1
2
3
4
5 package com.hack23.cia.web.controller.admin;
6
7 import com.hack23.cia.model.application.impl.admin.AgencyActionEvent.Operation;
8 import com.hack23.cia.service.api.admin.AgencyRequest;
9 import com.hack23.cia.service.api.admin.AgencyResponse;
10 import com.hack23.cia.service.api.application.ApplicationManager;
11 import com.hack23.cia.web.action.admin.ConfigureAgencyAction;
12 import com.hack23.cia.web.viewfactory.api.admin.AgencyModelAndView;
13 import com.hack23.cia.web.viewfactory.api.admin.AgencyModelAndView.AgencyViewSpecification;
14 import com.hack23.cia.web.viewfactory.api.common.ModelAndView;
15 import com.hack23.cia.web.viewfactory.api.common.ViewFactoryService;
16
17 /***
18 * The Class ConfigureAgencyActionHandler.
19 */
20 public class ConfigureAgencyActionHandler
21 extends
22 AbstractAdminActionHandler<ConfigureAgencyAction, AgencyRequest, AgencyResponse> {
23
24 /***
25 * Instantiates a new configure agency action handler.
26 *
27 * @param viewFactoryService the view factory service
28 * @param applicationManager the application manager
29 */
30 public ConfigureAgencyActionHandler(
31 final ViewFactoryService viewFactoryService,
32 final ApplicationManager applicationManager) {
33 super(viewFactoryService, applicationManager);
34 }
35
36
37
38
39
40
41
42 @Override
43 public final AgencyRequest createServiceRequest(
44 final ConfigureAgencyAction action) {
45 return new AgencyRequest(getUserStateService().getUserSessionId(),
46 Operation.ConfigureAgency, null);
47 }
48
49
50
51
52
53
54 @SuppressWarnings("unchecked")
55 @Override
56 public final Class getSupportedAction() {
57 return ConfigureAgencyAction.class;
58 }
59
60
61
62
63
64
65
66
67 @Override
68 public final ModelAndView handleSuccessResponse(
69 final ConfigureAgencyAction action, final AgencyResponse response) {
70 return new AgencyModelAndView(response.getUserSessionDTO(), action,
71 AgencyViewSpecification.ConfigureAgencyView, response
72 .getAgency());
73 }
74
75 }