Subversion Repositories SmartDukaan

Rev

Rev 1790 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1790 Rev 3125
Line 1... Line 1...
1
package in.shop2020.support.controllers;
1
package in.shop2020.support.controllers;
2
 
2
 
3
import in.shop2020.model.v1.order.TransactionServiceException;
-
 
4
import in.shop2020.model.v1.user.User;
3
import in.shop2020.model.v1.user.User;
5
import in.shop2020.model.v1.user.UserCommunication;
4
import in.shop2020.model.v1.user.UserCommunication;
6
import in.shop2020.model.v1.user.UserContextException;
5
import in.shop2020.model.v1.user.UserContextException;
7
import in.shop2020.model.v1.user.UserContextService.Client;
6
import in.shop2020.model.v1.user.UserContextService.Client;
8
import in.shop2020.thrift.clients.UserContextServiceClient;
7
import in.shop2020.thrift.clients.UserClient;
9
 
8
 
10
import java.io.ByteArrayOutputStream;
9
import java.io.ByteArrayOutputStream;
11
import java.io.IOException;
10
import java.io.IOException;
12
import java.text.ParseException;
-
 
13
import java.util.Date;
11
import java.util.Date;
14
import java.util.List;
12
import java.util.List;
15
 
13
 
16
import javax.servlet.ServletOutputStream;
14
import javax.servlet.ServletOutputStream;
17
import javax.servlet.http.HttpServletResponse;
15
import javax.servlet.http.HttpServletResponse;
Line 39... Line 37...
39
		this.response = res;
37
		this.response = res;
40
	}
38
	}
41
	
39
	
42
	public String index()	{
40
	public String index()	{
43
	    try   {
41
	    try   {
44
            UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
42
	    	UserClient userContextServiceClient = new UserClient();
45
            Client userClient = userContextServiceClient.getClient();
43
            Client userClient = userContextServiceClient.getClient();
46
 
44
 
47
            //Retrieving all user communications
45
            //Retrieving all user communications
48
            List<UserCommunication> allCommunications = userClient.getAllUserCommunications();
46
            List<UserCommunication> allCommunications = userClient.getAllUserCommunications();
49
            
47
            
Line 61... Line 59...
61
            } catch (IOException e) {
59
            } catch (IOException e) {
62
                errorMsg = "Failed to write to response.";
60
                errorMsg = "Failed to write to response.";
63
                e.printStackTrace();
61
                e.printStackTrace();
64
            }
62
            }
65
 
63
 
66
        } catch (ParseException e)  {
-
 
67
            errorMsg = e.getMessage();
-
 
68
            e.printStackTrace();
-
 
69
        } catch (TransactionServiceException e) {
-
 
70
            errorMsg = e.getMessage();
-
 
71
            e.printStackTrace();
-
 
72
        } catch (Exception e)   {
64
        } catch (Exception e)   {
73
            errorMsg = e.getMessage();
65
            errorMsg = e.getMessage();
74
            e.printStackTrace();
66
            e.printStackTrace();
75
        }
67
        }
76
        return null;
68
        return null;