1    package com.instantbank.servicing.control.event;
2    
3    import java.io.Serializable;
4    import java.util.ArrayList;
5    import java.util.Hashtable;
6    import com.instantbank.component.parameter.util.*;
7    
8    /**
9     *  Set Parameter X Value usecase: This event is sent from the web tier to the EJB
10    *  Controller to notify the EJB Controller that an action needs to be made in
11    *  the Set Parameter X Value model data.
12    *
13    * @author Instant-bank (Jorge Cardenas)
14    * @created October 2002
15    */
16   public class SetParameterXValueEvent extends ServicingEventSupport {
17   
18     // possible actions on Set Parameter X Value model data:
19     /**
20      * action constant of setting the parameter restrictions
21      *  of the current company
22      */
23   
24     public static final int LIST_PARAM_XVALUE = 0;
25   
26     public static final int UPDATE_PARAM_XVALUE = 1;
27   
28     public static final int VERIFY_PARAM_XVALUE = 2;
29   
30     // attributes: necesary data for executing the operations
31     /**
32      * action requested by the user
33      */
34     private int actionType;
35     /**
36      * current company
37      */
38     private String companyId;
39     /**
40      * current user
41      */
42     private Long userId;
43     /**
44      * current code parameter
45      */
46     private String codeParameter;
47     /**
48      * items for changing the parameter restrictions
49      *  of the current company
50      */
51     private ParameterModel items;
52     /**
53      * items for changing the parameter restrictions
54      *  of the current company
55      */
56     private ParameterValue itemsUpdate;
57   
58   
59     /**
60      * constructor: initializes attributes
61      *
62      * @param actionType action requested by the user
63      * @param codeParameter current code
64      * @param userId current user
65      * @param items for changing the parameter values of the current parameter
66      * @param companyId Description of the Parameter
67      * @param itemsUpdate Description of the Parameter
68      */
69     public SetParameterXValueEvent(int actionType, String companyId, Long userId,
70                                    String codeParameter, ParameterModel items, ParameterValue itemsUpdate) {
71       this.actionType = actionType;
72       this.companyId = companyId;
73       this.userId = userId;
74       this.codeParameter = codeParameter;
75       this.items = items;
76       this.itemsUpdate = itemsUpdate;
77     }
78   
79   
80     /**
81      * get method for actionType
82      *
83      * @return The actionType value
84      */
85     public int getActionType() {
86       return actionType;
87     }
88   
89   
90     /**
91      * get method for companyId
92      *
93      * @return The companyId value
94      */
95     public String getCompanyId() {
96       return companyId;
97     }
98   
99   
100    /**
101     * get method for userId
102     *
103     * @return The userId value
104     */
105    public Long getUserId() {
106      return userId;
107    }
108  
109  
110    /**
111     * get method for codeParameter
112     *
113     * @return The codeParameter value
114     */
115    public String getCodeParameter() {
116      return codeParameter;
117    }
118  
119  
120    /**
121     * get method for items
122     *
123     * @return The items value
124     */
125    public ParameterModel getItems() {
126      return items;
127    }
128  
129  
130    /**
131     * get method for items
132     *
133     * @return The itemsUpdate value
134     */
135    public ParameterValue getItemsUpdate() {
136      return itemsUpdate;
137    }
138  
139  
140    /**
141     * String representation of the event
142     *
143     * @return Description of the Return Value
144     */
145    public String toString() {
146      return "SetParameterXValuesEvent("
147        + String.valueOf(actionType) + ", "
148        + companyId + ", "
149        + codeParameter + ", "
150        + userId.toString() +
151        ")";
152    }
153  
154  
155    /**
156     * JNDI name for the event: Controller EJB registers this env variable
157     *
158     * @return The eventName value
159     */
160    public String getEventName() {
161      return "java:comp/env/setParameterXValueEvent";
162    }
163  }
164  
165