1    package com.instantbank.lettertemplate.control.event;
2    
3    import java.io.Serializable;
4    import java.util.ArrayList;
5    import com.instantbank.component.lettertemplate.util.*;
6    
7    /**
8     *  Letter Batch Review usecase: This event is sent from the web tier to the
9     *  EJB Controller to notify the EJB Controller that an action needs to be made
10    *  in the letter batch review model data.
11    *
12    * @author Instant-bank (Jorge Cardenas)
13    * @created November 2002
14    */
15   public class BatchReviewEvent extends LetterTemplateEventSupport {
16   
17     // possible actions on BatchReview model data:
18     /**
19      *  action constant of getting the letters list of the current company
20      */
21     public static final int LIST_BATCH_REVIEW = 0;
22   
23     public static final int UPDATE_BATCH_REVIEW = 1;
24   
25     // attributes: necesary data for executing the operations
26     /**
27      *  action requested by the user
28      */
29     private int actionType;
30     /**
31      *  current company
32      */
33     private String companyId;
34     /**
35      *  current user
36      */
37     private Long userId;
38     /**
39      *  letter review
40      */
41     private LetterBatchReviewModel batchReview;
42   
43     /**
44      *  date
45      */
46     private String date;
47   
48   
49     /**
50      *  constructor: initializes attributes
51      *
52      * @param actionType action requested by the user
53      * @param companyId current company
54      * @param userId current user
55      * @param batchReview letter review
56      * @param date Description of the Parameter
57      */
58     public BatchReviewEvent(int actionType, String companyId, Long userId,
59                             LetterBatchReviewModel batchReview, String date) {
60   
61       this.actionType = actionType;
62       this.companyId = companyId;
63       this.userId = userId;
64       this.batchReview = batchReview;
65       this.date = date;
66     }
67   
68   
69     /**
70      *  get method for actionType
71      *
72      * @return The actionType value
73      */
74     public int getActionType() {
75       return actionType;
76     }
77   
78   
79     /**
80      *  get method for companyId
81      *
82      * @return The companyId value
83      */
84     public String getCompanyId() {
85       return companyId;
86     }
87   
88   
89     /**
90      *  get method for userId
91      *
92      * @return The userId value
93      */
94     public Long getUserId() {
95       return userId;
96     }
97   
98   
99     /**
100     *  get method for batchReview
101     *
102     * @return The batchReview value
103     */
104    public LetterBatchReviewModel getBatchReview() {
105      return batchReview;
106    }
107  
108  
109    /**
110     *  get method for date
111     *
112     * @return The date value
113     */
114    public String date() {
115      return date;
116    }
117  
118  
119    /**
120     *  String representation of the event
121     *
122     * @return text of event
123     */
124    public String toString() {
125      return "BatchReviewEvent("
126        + String.valueOf(actionType) + ", "
127        + companyId + ", "
128        + userId.toString() +
129        ")";
130    }
131  
132  
133    /**
134     *  JNDI name for the event: LetterTemplateController EJB registers this env variable
135     *
136     * @return The eventName value
137     */
138    public String getEventName() {
139      return "java:comp/env/batchReviewEvent";
140    }
141  }
142  
143