org.apache.jetspeed.security.spi
Interface SecurityMappingHandler


public interface SecurityMappingHandler

This interface encapsulates the mapping between principals.

This provides a central placeholder for changing the implementation of the mapping association between principals.

Author:
David Le Strat

Method Summary
 HierarchyResolver getGroupHierarchyResolver()
           Gets the HierarchyResolver to be used for resolving group hierarchy.
 Set getGroupPrincipals(String username)
           Gets the group principals for the given user according to the relevant hierarchy resolution rules.
 Set getGroupPrincipalsInRole(String roleFullPathName)
           Gets the group principals for the given role according to the relevant hierarchy resolution rules.
 HierarchyResolver getRoleHierarchyResolver()
           Gets the HierarchyResolver to be used for resolving role hierarchy.
 Set getRolePrincipals(String username)
           Gets the role principals for the given user according to the relevant hierarchy resolution rules.
 Set getRolePrincipalsInGroup(String groupFullPathName)
           Gets the role principals for the given group according to the relevant hierarchy resolution rules.
 Set getUserPrincipalsInGroup(String groupFullPathName)
           Gets the user principals for the given group according to the relevant hierarchy resolution rules.
 Set getUserPrincipalsInRole(String roleFullPathName)
           Gets the user principals for the given role according to the relevant hierarchy resolution rules.
 void removeRolePrincipalInGroup(String groupFullPathName, String roleFullPathName)
           Removes the role principal on a given user.
 void removeUserPrincipalInGroup(String username, String groupFullPathName)
           Removes the user principal from the given group.
 void removeUserPrincipalInRole(String username, String roleFullPathName)
           Removes the role principal on a given user.
 void setGroupHierarchyResolver(HierarchyResolver groupHierarchyResolver)
           Sets the HierarchyResolver used for resolving group hierarchy.
 void setRoleHierarchyResolver(HierarchyResolver roleHierarchyResolver)
           Sets the HierarchyResolver to be used for resolving role hierachy.
 void setRolePrincipalInGroup(String groupFullPathName, String roleFullPathName)
           Sets the role principal on a given user.
 void setUserPrincipalInGroup(String username, String groupFullPathName)
           Sets the user principal in the given group.
 void setUserPrincipalInRole(String username, String roleFullPathName)
           Sets the role principal on a given user.
 

Method Detail

getRoleHierarchyResolver

HierarchyResolver getRoleHierarchyResolver()

Gets the HierarchyResolver to be used for resolving role hierarchy.

Returns:
The role HierarchyResolver.

setRoleHierarchyResolver

void setRoleHierarchyResolver(HierarchyResolver roleHierarchyResolver)

Sets the HierarchyResolver to be used for resolving role hierachy.

Parameters:
roleHierarchyResolver - The role HierarchyResolver.

getGroupHierarchyResolver

HierarchyResolver getGroupHierarchyResolver()

Gets the HierarchyResolver to be used for resolving group hierarchy.

Returns:
The role HierarchyResolver.

setGroupHierarchyResolver

void setGroupHierarchyResolver(HierarchyResolver groupHierarchyResolver)

Sets the HierarchyResolver used for resolving group hierarchy.

Parameters:
groupHierarchyResolver - The group HierarchyResolver.

getRolePrincipals

Set getRolePrincipals(String username)

Gets the role principals for the given user according to the relevant hierarchy resolution rules.

Parameters:
username - The user name.
Returns:
A set of Principal


setUserPrincipalInRole

void setUserPrincipalInRole(String username,
                            String roleFullPathName)
                            throws SecurityException

Sets the role principal on a given user. Existence of the role or the user must be checked prior to invoking this method. If a principal does not exist in the security mapping store, it will be created for the purpose of security mapping only.

Parameters:
username - The user to add the role principal to.
roleFullPathName - The full path of the role principal to add.
Throws:
SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.

removeUserPrincipalInRole

void removeUserPrincipalInRole(String username,
                               String roleFullPathName)
                               throws SecurityException

Removes the role principal on a given user.

If a mapping only record does not have any mapping, this method will remove the record as well.

Parameters:
username - The user to remove the role principal from.
roleFullPathName - The full path of the role principal to remove.
Throws:
SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.

getRolePrincipalsInGroup

Set getRolePrincipalsInGroup(String groupFullPathName)

Gets the role principals for the given group according to the relevant hierarchy resolution rules.

Parameters:
groupFullPathName - The group full path name.
Returns:
A set of Principal


setRolePrincipalInGroup

void setRolePrincipalInGroup(String groupFullPathName,
                             String roleFullPathName)
                             throws SecurityException

Sets the role principal on a given user.

Parameters:
groupFullPathName - The group to add the role principal to.
roleFullPathName - The full path of the role principal to add.
Throws:
SecurityException - Throws a SecurityException. An exeption needs to be thrown if the group does not exist.

removeRolePrincipalInGroup

void removeRolePrincipalInGroup(String groupFullPathName,
                                String roleFullPathName)
                                throws SecurityException

Removes the role principal on a given user.

Parameters:
groupFullPathName - The group to remove the role principal from.
roleFullPathName - The full path of the role principal to remove.
Throws:
SecurityException - Throws a SecurityException. An exeption needs to be thrown if the group does not exist.

getGroupPrincipals

Set getGroupPrincipals(String username)

Gets the group principals for the given user according to the relevant hierarchy resolution rules.

Parameters:
username - The user name.
Returns:
A set of GroupPrincipal


getGroupPrincipalsInRole

Set getGroupPrincipalsInRole(String roleFullPathName)

Gets the group principals for the given role according to the relevant hierarchy resolution rules.

Parameters:
roleFullPathName - The role full path name.
Returns:
A set of Principal


getUserPrincipalsInRole

Set getUserPrincipalsInRole(String roleFullPathName)

Gets the user principals for the given role according to the relevant hierarchy resolution rules.

Parameters:
roleFullPathName - The role full path name.
Returns:
A set of Principal


getUserPrincipalsInGroup

Set getUserPrincipalsInGroup(String groupFullPathName)

Gets the user principals for the given group according to the relevant hierarchy resolution rules.

Parameters:
groupFullPathName - The group full path name.
Returns:
A set of Principal


setUserPrincipalInGroup

void setUserPrincipalInGroup(String username,
                             String groupFullPathName)
                             throws SecurityException

Sets the user principal in the given group.

Existence of the group or the user must be checked prior to invoking this method. If a principal does not exist in the security mapping store, it will be created for the purpose of security mapping only.

Parameters:
username - The user to add to the group principal.
groupFullPathName - The full path of the group principal.
Throws:
SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.

removeUserPrincipalInGroup

void removeUserPrincipalInGroup(String username,
                                String groupFullPathName)
                                throws SecurityException

Removes the user principal from the given group.

Parameters:
username - The user to remove from the group principal.
groupFullPathName - The full path of the group principal.
Throws:
SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.