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.ParmSearchOrderEvent;
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 ParmSearchOrderHandler 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("** ParmSearchOrderHandler-services tier: ");
41 Object answer = "";
42 ParmSearchOrderEvent ce = (ParmSearchOrderEvent)event;
43
44 switch (ce.getActionType()) {
45
46 case ParmSearchOrderEvent.LIST_PARM_SEARCH_ORDER:
47 {
48 debug.println("LIST_PARM_SEARCH_ORDER event");
49 try {
50
51 Parameter parameter = machine.getServicingControllerEJB()
52 .getParameter(ce.getCompanyId(), ce.getUserId());
53
54
55 ArrayList parmSearchValues = new ArrayList(2);
56 parmSearchValues = parameter.loadParamSearchValues();
57 answer = parmSearchValues;
58 }
59 catch(Exception e) {
60
61
62 throw new ServicingEventException(e.getMessage());
63 }
64 }
65 break;
66 case ParmSearchOrderEvent.UPDATE_PARM_SEARCH_ORDER:
67 {
68 debug.println("UPDATE_PARM_SEARCH_ORDER event");
69 try {
70 Parameter parameter = machine.getServicingControllerEJB()
71 .getParameter(ce.getCompanyId(), ce.getUserId());
72
73 answer = parameter.updateParamSearchValues(ce.getItems());
74 }
75 catch(Exception e) {
76 throw new ServicingEventException(e.getMessage());
77 }
78 }
79 break;
80 default:
81 debug.println("Error: not implemented yet");
82 break;
83 }
84 return answer;
85 }
86 }
87
88