org.apache.jetspeed.security.spi
Interface SecurityMappingHandler

All Known Implementing Classes:
DefaultSecurityMappingHandler, LdapSecurityMappingHandler

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 removeRolePrincipal(String username, String roleFullPathName)
           Removes the role principal on a given user.
 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 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 setRolePrincipal(String username, String roleFullPathName)
           Sets the role principal on a given user.
 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.
 

Method Detail

getRoleHierarchyResolver

public HierarchyResolver getRoleHierarchyResolver()

Gets the HierarchyResolver to be used for resolving role hierarchy.

Returns:
The role HierarchyResolver.

setRoleHierarchyResolver

public void setRoleHierarchyResolver(HierarchyResolver roleHierarchyResolver)

Sets the HierarchyResolver to be used for resolving role hierachy.

Parameters:
roleHierarchyResolver - The role HierarchyResolver.

getGroupHierarchyResolver

public HierarchyResolver getGroupHierarchyResolver()

Gets the HierarchyResolver to be used for resolving group hierarchy.

Returns:
The role HierarchyResolver.

setGroupHierarchyResolver

public void setGroupHierarchyResolver(HierarchyResolver groupHierarchyResolver)

Sets the HierarchyResolver used for resolving group hierarchy.

Parameters:
groupHierarchyResolver - The group HierarchyResolver.

getRolePrincipals

public 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


setRolePrincipal

public void setRolePrincipal(String username,
                             String roleFullPathName)
                      throws org.apache.jetspeed.security.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:
org.apache.jetspeed.security.SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.

removeRolePrincipal

public void removeRolePrincipal(String username,
                                String roleFullPathName)
                         throws org.apache.jetspeed.security.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:
org.apache.jetspeed.security.SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.

getRolePrincipalsInGroup

public 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

public void setRolePrincipalInGroup(String groupFullPathName,
                                    String roleFullPathName)
                             throws org.apache.jetspeed.security.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:
org.apache.jetspeed.security.SecurityException - Throws a SecurityException. An exeption needs to be thrown if the group does not exist.

removeRolePrincipalInGroup

public void removeRolePrincipalInGroup(String groupFullPathName,
                                       String roleFullPathName)
                                throws org.apache.jetspeed.security.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:
org.apache.jetspeed.security.SecurityException - Throws a SecurityException. An exeption needs to be thrown if the group does not exist.

getGroupPrincipals

public 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

public 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

public 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

public 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

public void setUserPrincipalInGroup(String username,
                                    String groupFullPathName)
                             throws org.apache.jetspeed.security.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:
org.apache.jetspeed.security.SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.

removeUserPrincipalInGroup

public void removeUserPrincipalInGroup(String username,
                                       String groupFullPathName)
                                throws org.apache.jetspeed.security.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:
org.apache.jetspeed.security.SecurityException - Throws a SecurityException. An exeption needs to be thrown if the user does not exist.


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