KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ebank > ejb > account > AccountController


1 /*
2  * Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. U.S.
3  * Government Rights - Commercial software. Government users are subject
4  * to the Sun Microsystems, Inc. standard license agreement and
5  * applicable provisions of the FAR and its supplements. Use is subject
6  * to license terms.
7  *
8  * This distribution may include materials developed by third parties.
9  * Sun, Sun Microsystems, the Sun logo, Java and J2EE are trademarks
10  * or registered trademarks of Sun Microsystems, Inc. in the U.S. and
11  * other countries.
12  *
13  * Copyright (c) 2004 Sun Microsystems, Inc. Tous droits reserves.
14  *
15  * Droits du gouvernement americain, utilisateurs gouvernementaux - logiciel
16  * commercial. Les utilisateurs gouvernementaux sont soumis au contrat de
17  * licence standard de Sun Microsystems, Inc., ainsi qu'aux dispositions
18  * en vigueur de la FAR (Federal Acquisition Regulations) et des
19  * supplements a celles-ci. Distribue par des licences qui en
20  * restreignent l'utilisation.
21  *
22  * Cette distribution peut comprendre des composants developpes par des
23  * tierces parties. Sun, Sun Microsystems, le logo Sun, Java et J2EE
24  * sont des marques de fabrique ou des marques deposees de Sun
25  * Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
26  */

27
28
29 package com.sun.ebank.ejb.account;
30
31 import java.util.ArrayList JavaDoc;
32 import java.util.Date JavaDoc;
33 import java.math.BigDecimal JavaDoc;
34 import javax.ejb.EJBObject JavaDoc;
35 import java.rmi.RemoteException JavaDoc;
36 import com.sun.ebank.util.AccountDetails;
37 import com.sun.ebank.ejb.exception.*;
38
39
40 public interface AccountController extends EJBObject JavaDoc {
41     // account creation and removal methods
42
public String JavaDoc createAccount(String JavaDoc customerId, String JavaDoc type,
43         String JavaDoc description, BigDecimal JavaDoc balance, BigDecimal JavaDoc creditLine,
44         BigDecimal JavaDoc beginBalance, Date JavaDoc beginBalanceTimeStamp)
45         throws RemoteException JavaDoc, IllegalAccountTypeException,
46             CustomerNotFoundException, InvalidParameterException;
47
48     // makes a new account and enters it into db,
49
// customer for customerId must exist 1st,
50
// returns accountId
51
public void removeAccount(String JavaDoc accountId)
52         throws RemoteException JavaDoc, AccountNotFoundException,
53             InvalidParameterException;
54
55     // removes account from db
56
// customer-account relationship methods
57
public void addCustomerToAccount(String JavaDoc customerId, String JavaDoc accountId)
58         throws RemoteException JavaDoc, AccountNotFoundException,
59             CustomerNotFoundException, CustomerInAccountException,
60             InvalidParameterException;
61
62     // adds another customer to the account
63
// throws CustomerInAccountException
64
// if the customer is already in the account
65
// throws CustomerNotFoundException
66
// if the customer does not exist
67
public void removeCustomerFromAccount(String JavaDoc customerId, String JavaDoc accountId)
68         throws RemoteException JavaDoc, AccountNotFoundException,
69             CustomerRequiredException, CustomerNotInAccountException,
70             InvalidParameterException;
71
72     // removes a customer from the account, but
73
// the customer is not removed from the db
74
// throws CustomerRequiredException
75
// if there is only one customer in the account
76
// (an account must have a least one customer)
77
// throws CustomerNotInAccountException
78
// if the customer to be removed is not in the account
79
// getters
80
public ArrayList JavaDoc getAccountsOfCustomer(String JavaDoc customerId)
81         throws RemoteException JavaDoc, AccountNotFoundException,
82             InvalidParameterException;
83
84     // returns an ArrayList of AccountDetails objects
85
// that correspond to the accounts for the specified
86
// customer
87
public AccountDetails getDetails(String JavaDoc accountId)
88         throws RemoteException JavaDoc, AccountNotFoundException,
89             InvalidParameterException;
90
91     // returns the AccountDetails for the specified account
92
// setters
93
public void setType(String JavaDoc type, String JavaDoc accountId)
94         throws RemoteException JavaDoc, AccountNotFoundException,
95             IllegalAccountTypeException, InvalidParameterException;
96
97     public void setDescription(String JavaDoc description, String JavaDoc accountId)
98         throws RemoteException JavaDoc, AccountNotFoundException,
99             InvalidParameterException;
100
101     public void setBalance(BigDecimal JavaDoc balance, String JavaDoc accountId)
102         throws RemoteException JavaDoc, AccountNotFoundException,
103             InvalidParameterException;
104
105     public void setCreditLine(BigDecimal JavaDoc creditLine, String JavaDoc accountId)
106         throws RemoteException JavaDoc, AccountNotFoundException,
107             InvalidParameterException;
108
109     public void setBeginBalance(BigDecimal JavaDoc beginBalance, String JavaDoc accountId)
110         throws RemoteException JavaDoc, AccountNotFoundException,
111             InvalidParameterException;
112
113     public void setBeginBalanceTimeStamp(Date JavaDoc beginBalanceTimeStamp,
114         String JavaDoc accountId)
115         throws RemoteException JavaDoc, AccountNotFoundException,
116             InvalidParameterException;
117 }
118  // AccountController
119
Popular Tags