1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.astrogrid.community.common.policy.manager ;
19
20 import java.rmi.Remote ;
21 import java.rmi.RemoteException ;
22
23 import org.astrogrid.community.common.policy.data.AccountData ;
24 import org.astrogrid.community.common.service.CommunityService ;
25
26 import org.astrogrid.community.common.exception.CommunityPolicyException ;
27 import org.astrogrid.community.common.exception.CommunityServiceException ;
28 import org.astrogrid.community.common.exception.CommunityIdentifierException ;
29
30 /***
31 * Public interface for the AccountManager services.
32 *
33 */
34 public interface AccountManager
35 extends Remote, CommunityService
36 {
37 /***
38 * Add a new Account, given the Account ident.
39 * @param ident The Account identifier.
40 * @return An AccountData for the Account.
41 * @throws CommunityIdentifierException If the identifier is not valid.
42 * @throws CommunityPolicyException If the identifier is already in the database.
43 * @throws CommunityServiceException If there is an internal error in the service.
44 * @throws RemoteException If the WebService call fails.
45 *
46 */
47 public AccountData addAccount(String ident)
48 throws RemoteException, CommunityServiceException, CommunityIdentifierException, CommunityPolicyException ;
49
50 /***
51 * Add a new Account, given the Account data.
52 * @param account The AccountData to add.
53 * @return A new AccountData for the Account.
54 * @throws CommunityIdentifierException If the identifier is not valid.
55 * @throws CommunityPolicyException If the identifier is already in the database.
56 * @throws CommunityServiceException If there is an internal error in the service.
57 * @throws RemoteException If the WebService call fails.
58 *
59 */
60 public AccountData addAccount(AccountData account)
61 throws RemoteException, CommunityServiceException, CommunityIdentifierException, CommunityPolicyException ;
62
63 /***
64 * Request an Account details, given the Account ident.
65 * @param ident The Account identifier.
66 * @return An AccountData for the Account.
67 * @throws CommunityIdentifierException If the identifier is not valid.
68 * @throws CommunityPolicyException If the identifier is not in the database.
69 * @throws CommunityServiceException If there is an internal error in the service.
70 * @throws RemoteException If the WebService call fails.
71 *
72 */
73 public AccountData getAccount(String ident)
74 throws RemoteException, CommunityServiceException, CommunityIdentifierException, CommunityPolicyException ;
75
76 /***
77 * Update an Account.
78 * @param account The new AccountData to update.
79 * @return A new AccountData for the Account.
80 * @throws CommunityIdentifierException If the identifier is not valid.
81 * @throws CommunityPolicyException If the identifier is not in the database.
82 * @throws CommunityServiceException If there is an internal error in the service.
83 * @throws RemoteException If the WebService call fails.
84 *
85 */
86 public AccountData setAccount(AccountData account)
87 throws RemoteException, CommunityServiceException, CommunityIdentifierException, CommunityPolicyException ;
88
89 /***
90 * Delete an Account.
91 * @param ident The Account identifier.
92 * @return The AccountData for the old Account.
93 * @throws CommunityIdentifierException If the identifier is not valid.
94 * @throws CommunityPolicyException If the identifier is not in the database.
95 * @throws CommunityServiceException If there is an internal error in the service.
96 * @throws RemoteException If the WebService call fails.
97 * @todo Need to have a mechanism for tidying up references to a remote Account
98 * @todo Need to have a mechanism for tidying up references to an old Account
99 *
100 */
101 public AccountData delAccount(String ident)
102 throws RemoteException, CommunityServiceException, CommunityIdentifierException, CommunityPolicyException ;
103
104 /***
105 * Request a list of local Accounts.
106 * @return An array of AccountData objects.
107 * @throws CommunityServiceException If there is an internal error in the service.
108 * @throws RemoteException If the WebService call fails.
109 *
110 */
111 public Object[] getLocalAccounts()
112 throws RemoteException, CommunityServiceException ;
113
114 }