KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > bank > BankApplication


1 package bank;
2
3 import javax.ejb.EJBObject JavaDoc;
4 import java.rmi.RemoteException JavaDoc;
5 import java.util.List JavaDoc;
6
7 /**
8  * @author S.Chassande-Barrioz
9  */

10 public interface BankApplication extends EJBObject JavaDoc {
11
12     // Agencies management
13
//--------------------
14

15     /**
16      * Create a new Bank in the bank
17      * @param name is the name of the agency
18      */

19     void createAgency(String JavaDoc name) throws RemoteException JavaDoc;
20
21     /**
22      * Retrieves a list of agency names.
23      * @return list of String
24      */

25     List JavaDoc getAgencies() throws RemoteException JavaDoc;
26
27     /**
28      * Removes an agency only if this agency does not have any client
29      * @param name is the name of the agency to remove
30      * @return true if the agency was removed
31      */

32     boolean removeAgency(String JavaDoc name) throws RemoteException JavaDoc;
33
34     
35     // Clients management
36
//--------------------
37

38     /**
39      * Create a Client in an agency
40      * @param cid is a client identifier (last name, first name and address)
41      * @param agencyName the the name of the agency of the new client
42      */

43     void createClient(ClientId cid, String JavaDoc agencyName) throws RemoteException JavaDoc;
44
45     /**
46      * Retrieves a list of ClientId instance corresponding to the clients of
47      * an agency.
48      * @param agencyName is the name of the agency
49      * @return list of ClientId
50      */

51     List JavaDoc getClients(String JavaDoc agencyName) throws RemoteException JavaDoc;
52
53     /**
54      * Removes a client from an agency only if the client does not have any Account
55      * @param agencyName is the name of the agency hosting the client
56      * @param cid is a client identifier
57      * @return true if the client was removed
58      */

59     boolean removeClient(String JavaDoc agencyName, ClientId cid) throws RemoteException JavaDoc;
60
61
62     // Accounts management
63
//--------------------
64

65     /**
66      * Create a new Account for a client of an agency
67      * @param cid is a client identifier (last name, first name and address),
68      * the owner of the new account.
69      * @param agencyName the name of the agency of the client
70      * @return the account number
71      */

72     String JavaDoc createAccount(ClientId cid, String JavaDoc agencyName) throws RemoteException JavaDoc;
73
74     /**
75      * Retrieves information about an account of a client in an agency
76      * @param number is the account number
77      * @param cid is the client identifier
78      * @param agencyName is the name of the agency
79      */

80     AccountInfo getAccountInfo(String JavaDoc number,
81                                ClientId cid,
82                                String JavaDoc agencyName) throws RemoteException JavaDoc;
83
84     /**
85      * Retrieves a list of account for client.
86      * @param agencyName is the name of the agency
87      * @param cid is the client identifier
88      * @return list of AccountInfo instance
89      */

90     List JavaDoc getAccounts(String JavaDoc agencyName, ClientId cid) throws RemoteException JavaDoc;
91
92     /**
93      * Closes a account of a client.
94      * @param agencyName is the agency name
95      * @param cid is a client identifier
96      * @param accountNumber is the number of account to close
97      * @return a AccountInfo if the account was removed. The accountInfo
98      * instance contains the value of the account. If the account does not exist
99      * a null value is returned
100      */

101     AccountInfo closeAccount(String JavaDoc agencyName,
102                              ClientId cid,
103                              String JavaDoc accountNumber) throws RemoteException JavaDoc;
104 }
105
Popular Tags