001: package bank;
002:
003: import javax.ejb.EJBObject;
004: import java.rmi.RemoteException;
005: import java.util.List;
006:
007: /**
008: * @author S.Chassande-Barrioz
009: */
010: public interface BankApplication extends EJBObject {
011:
012: // Agencies management
013: //--------------------
014:
015: /**
016: * Create a new Bank in the bank
017: * @param name is the name of the agency
018: */
019: void createAgency(String name) throws RemoteException;
020:
021: /**
022: * Retrieves a list of agency names.
023: * @return list of String
024: */
025: List getAgencies() throws RemoteException;
026:
027: /**
028: * Removes an agency only if this agency does not have any client
029: * @param name is the name of the agency to remove
030: * @return true if the agency was removed
031: */
032: boolean removeAgency(String name) throws RemoteException;
033:
034: // Clients management
035: //--------------------
036:
037: /**
038: * Create a Client in an agency
039: * @param cid is a client identifier (last name, first name and address)
040: * @param agencyName the the name of the agency of the new client
041: */
042: void createClient(ClientId cid, String agencyName)
043: throws RemoteException;
044:
045: /**
046: * Retrieves a list of ClientId instance corresponding to the clients of
047: * an agency.
048: * @param agencyName is the name of the agency
049: * @return list of ClientId
050: */
051: List getClients(String agencyName) throws RemoteException;
052:
053: /**
054: * Removes a client from an agency only if the client does not have any Account
055: * @param agencyName is the name of the agency hosting the client
056: * @param cid is a client identifier
057: * @return true if the client was removed
058: */
059: boolean removeClient(String agencyName, ClientId cid)
060: throws RemoteException;
061:
062: // Accounts management
063: //--------------------
064:
065: /**
066: * Create a new Account for a client of an agency
067: * @param cid is a client identifier (last name, first name and address),
068: * the owner of the new account.
069: * @param agencyName the name of the agency of the client
070: * @return the account number
071: */
072: String createAccount(ClientId cid, String agencyName)
073: throws RemoteException;
074:
075: /**
076: * Retrieves information about an account of a client in an agency
077: * @param number is the account number
078: * @param cid is the client identifier
079: * @param agencyName is the name of the agency
080: */
081: AccountInfo getAccountInfo(String number, ClientId cid,
082: String agencyName) throws RemoteException;
083:
084: /**
085: * Retrieves a list of account for client.
086: * @param agencyName is the name of the agency
087: * @param cid is the client identifier
088: * @return list of AccountInfo instance
089: */
090: List getAccounts(String agencyName, ClientId cid)
091: throws RemoteException;
092:
093: /**
094: * Closes a account of a client.
095: * @param agencyName is the agency name
096: * @param cid is a client identifier
097: * @param accountNumber is the number of account to close
098: * @return a AccountInfo if the account was removed. The accountInfo
099: * instance contains the value of the account. If the account does not exist
100: * a null value is returned
101: */
102: AccountInfo closeAccount(String agencyName, ClientId cid,
103: String accountNumber) throws RemoteException;
104: }
|