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