1 package com.instantbank.servicing.control.ejb.handlers;
2
3 import java.util.ArrayList;
4 import java.rmi.RemoteException;
5 import javax.naming.InitialContext;
6 import javax.naming.NamingException;
7 import javax.ejb.CreateException;
8 import javax.ejb.DuplicateKeyException;
9 import javax.ejb.FinderException;
10
11 import com.instantbank.common.utilcomponents.CodeDescription;
12 import com.instantbank.servicing.control.event.ParmRestrictionsEvent;
13 import com.instantbank.common.utilcomponents.Debug;
14 import com.instantbank.component.parameter.ejb.Parameter;
15 import com.instantbank.servicing.control.ServicingEventException;
16 import com.instantbank.servicing.control.event.ServicingEvent;
17
18
24 public class ParmRestrictionsHandler extends StateHandlerSupport {
25
26 private Debug debug = null;
27
28
29
36 public Object perform(ServicingEvent event)
37 throws ServicingEventException {
38 debug = new Debug();
39 debug.setDebugginOn(true);
40 debug.setPreMessage("** ParmRestrictionsHandler-services tier: ");
41 Object answer = "";
42 ParmRestrictionsEvent ce = (ParmRestrictionsEvent)event;
43
44 switch (ce.getActionType()) {
45
46 case ParmRestrictionsEvent.LIST_PARM_RESTRICTIONS:
47 {
48 debug.println("LIST_PARM_RESTRICTIONS event");
49 try {
50
51 Parameter parameter = machine.getServicingControllerEJB()
52 .getParameter(ce.getCompanyId(), ce.getUserId());
53
54
55
56 answer = parameter.listParamRestrictions();
57 }
58 catch(Exception e) {
59
60
61 throw new ServicingEventException(e.getMessage());
62 }
63 }
64 break;
65 case ParmRestrictionsEvent.UPDATE_PARM_RESTRICTIONS:
66 {
67 debug.println("UPDATE_PARM_RESTRICTIONS event");
68 try {
69 Parameter parameter = machine.getServicingControllerEJB()
70 .getParameter(ce.getCompanyId(), ce.getUserId());
71
72 answer = parameter.updateParamRestrictions(ce.getItemsUpdate());
73 }
74 catch(Exception e) {
75 throw new ServicingEventException(e.getMessage());
76 }
77 }
78 break;
79 default:
80 debug.println("Error: not implemented yet");
81 break;
82 }
83 return answer;
84 }
85 }
86
87