1    package com.instantbank.lettertemplate.control.ejb;
2    
3    import java.util.Collection;
4    import java.util.List;
5    import java.rmi.RemoteException;
6    import javax.ejb.EJBObject;
7    import javax.ejb.FinderException;
8    import com.instantbank.component.lettertemplate.ejb.LetterTemplate;
9    import com.instantbank.component.job.ejb.Job;
10   import com.instantbank.lettertemplate.control.LetterTemplateEventException;
11   import com.instantbank.lettertemplate.control.event.LetterTemplateEvent;
12   
13   /**
14    *  This is the EJB-tier controller of the MVC. It is implemented as a session
15    *  EJB. It controls all the activities that happen in a client session
16    *  (managing update events through handleEvent() method) It also provides
17    *  mechanisms to access other session EJBs and variables: get services for
18    *  obtaining session variables and for contacting EJBs (entity or session)
19    *  which are instanced for the user.
20    *
21    * @author Instant-bank (Consuelo Franky)
22    * @created September 2002
23    */
24   public interface LetterTemplateController extends EJBObject {
25   
26     /**
27      *  Principal service: Feeds the specified event to the state machine of the
28      *  business logic.
29      *
30      * @param ese event associated to a user request
31      * @return a list of models (EJBs names)
32      *      that got updated because of the processing of this event. In
33      *      addition, the first element of the list contains the service answer
34      *      (or the "" string when this answer is not required)
35      * @exception LetterTemplateEventException
36      * @throws RemoteException Description of the Exception
37      */
38     public Collection handleEvent(LetterTemplateEvent ese)
39        throws RemoteException, LetterTemplateEventException;
40   
41   
42     /**
43      * Sets null to job attribute:
44      *
45      * @throws RemoteException Description of the Exception
46      */
47     public void setJobNull()
48        throws RemoteException;
49   
50   
51     /**
52      * Get reference to LetterTemplate EJB
53      *
54      * @param companyId current company
55      * @param userId current user
56      * @return the LetterTemplate session bean for this session
57      * @exception RemoteException
58      */
59     public LetterTemplate getLetterTemplate(String companyId, Long userId)
60        throws RemoteException;
61   
62   
63     /**
64      *Get reference to an existent Job EJB
65      *
66      * @param jobId primary key of the Job
67      * @return the Job entity EJB associated.
68      * @exception RemoteException
69      */
70     public Job getOldJob(Long jobId)
71        throws RemoteException;
72   
73   
74     /**
75      *Get reference to a new Job EJB
76      *
77      * @param companyId current company
78      * @param userId current user
79      * @param name name of Job
80      * @param ftpPrimaryId primary ftp associated to the Job
81      * @param ftpAlternateId alternate ftp associated to the Job
82      * @return a new Job entity EJB associated
83      *          with this session.
84      * @throws RemoteException Description of the Exception
85      */
86     public Job getNewJob(String companyId, Long userId, String name,
87                          long ftpPrimaryId, long ftpAlternateId)
88        throws RemoteException;
89   
90   
91     /**
92      * @return the w variable for this session
93      * @exception RemoteException
94      */
95     public String getW() throws RemoteException;
96   
97   }
98   
99