1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.astrogrid.community.common.security.service ;
19
20 import java.rmi.Remote ;
21 import java.rmi.RemoteException ;
22
23 import org.astrogrid.community.common.security.data.SecurityToken ;
24
25 import org.astrogrid.community.common.service.CommunityService ;
26
27 import org.astrogrid.community.common.exception.CommunityServiceException ;
28 import org.astrogrid.community.common.exception.CommunitySecurityException ;
29 import org.astrogrid.community.common.exception.CommunityIdentifierException ;
30
31 /***
32 * Public interface for our SecurityService.
33 *
34 */
35 public interface SecurityService
36 extends Remote, CommunityService
37 {
38
39 /***
40 * Check an Account password.
41 * @param account The account ident.
42 * @param password The account password.
43 * @return A valid SecurityToken if the ident and password are valid.
44 * @throws CommunitySecurityException If the security check fails.
45 * @throws CommunityServiceException If there is an internal error in service.
46 * @throws CommunityIdentifierException If the account identifier is invalid.
47 * @throws RemoteException If the WebService call fails.
48 *
49 */
50 public SecurityToken checkPassword(String account, String pass)
51 throws RemoteException, CommunityServiceException, CommunitySecurityException, CommunityIdentifierException ;
52
53 /***
54 * Validate a SecurityToken.
55 * Validates a token, and creates a new tokens issued to the same account.
56 * @param token The token to validate.
57 * @return A new SecurityToken if the original was valid.
58 * @throws CommunitySecurityException If the security check fails.
59 * @throws CommunityServiceException If there is an internal error in service.
60 * @throws CommunityIdentifierException If the token is invalid.
61 * @throws RemoteException If the WebService call fails.
62 *
63 */
64 public SecurityToken checkToken(SecurityToken token)
65 throws RemoteException, CommunityServiceException, CommunitySecurityException, CommunityIdentifierException ;
66
67 /***
68 * Split a SecurityToken.
69 * Validates a token, and then creates a new set of tokens issued to the same account.
70 * @param token The token to validate.
71 * @param count The number of new tokens required.
72 * @return An array of new SecurityToken(s).
73 * @throws CommunitySecurityException If the security check fails.
74 * @throws CommunityServiceException If there is an internal error in service.
75 * @throws CommunityIdentifierException If the token is invalid.
76 * @throws RemoteException If the WebService call fails.
77 *
78 */
79 public Object[] splitToken(SecurityToken token, int count)
80 throws RemoteException, CommunityServiceException, CommunitySecurityException, CommunityIdentifierException ;
81
82 }