1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.security.spi;
18
19 import java.util.List;
20
21 import org.apache.jetspeed.security.RolePrincipal;
22 import org.apache.jetspeed.security.SecurityException;
23
24 /***
25 * <p>
26 * This interface encapsulates the persistence of security roles.
27 * </p>
28 * <p>
29 * This provides a central placeholder for changing the persistence of roles
30 * security information.
31 * </p>
32 * <p>
33 * A security implementation wanting to store role security implementation in
34 * LDAP for instance would need to provide an LDAP implementation of this
35 * interface.
36 * </p>
37 *
38 * @author <a href="mailto:dlestrat@apache.org">David Le Strat </a>
39 */
40 public interface RoleSecurityHandler
41 {
42
43 /***
44 * <p>
45 * Gets the role principal for the role full path name {principal}.{subprincipal}.
46 * </p>
47 *
48 * @param roleFullPathName The role full path name.
49 * @return The <code>Principal</p>
50 */
51 RolePrincipal getRolePrincipal(String roleFullPathName);
52
53 /***
54 * <p>
55 * Sets the role principal in the backing store.
56 * </p>
57 *
58 * @param rolePrincipal The <code>RolePrincipal</code>.
59 * @throws SecurityException Throws a {@link SecurityException}.
60 */
61 void setRolePrincipal(RolePrincipal rolePrincipal) throws SecurityException;
62
63 /***
64 * <p>
65 * Removes the role principal.
66 * </p>
67 *
68 * @param rolePrincipal The <code>RolePrincipal</code>.
69 * @throws SecurityException Throws a {@link SecurityException}.
70 */
71 void removeRolePrincipal(RolePrincipal rolePrincipal) throws SecurityException;
72
73 /***
74 * <p>
75 * Gets the an iterator of role principals for a given filter.
76 * </p>
77 *
78 * @param filter The filter.
79 * @return The list of <code>Principal</code>
80 */
81 List getRolePrincipals(String filter);
82
83 }