Package org.gatein.sso.saml.plugin
Class SimpleGroup
java.lang.Object
org.gatein.sso.saml.plugin.SimplePrincipal
org.gatein.sso.saml.plugin.SimpleGroup
- All Implemented Interfaces:
Serializable,Cloneable,Principal
Forked class because this plugin can be used on both JBoss or Tomcat and we want to be independent on AS.
An implementation of Group that manages a collection of Principal
objects based on their hashCode() and equals() methods. This class
is not thread safe.
- Version:
- $Revision$
- Author:
- Scott.Stark@jboss.org
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the specified member to the group.clone()booleanCompare this SimplePrincipal's name against another Principal.inthashCode()booleanReturns true if the passed principal is a member of the group.members()Returns an enumeration of the members in the group.booleanremoveMember(Principal user) Removes the specified member from the group.toString()Methods inherited from class org.gatein.sso.saml.plugin.SimplePrincipal
getName
-
Constructor Details
-
SimpleGroup
-
-
Method Details
-
addMember
Adds the specified member to the group.- Parameters:
user- the principal to add to this group.- Returns:
- true if the member was successfully added, false if the principal was already a member.
-
isMember
Returns true if the passed principal is a member of the group. This method does a recursive search, so if a principal belongs to a group which is a member of this group, true is returned. A special check is made to see if the member is an instance of org.jboss.security.AnybodyPrincipal or org.jboss.security.NobodyPrincipal since these classes do not hash to meaningful values.- Parameters:
member- the principal whose membership is to be checked.- Returns:
- true if the principal is a member of this group, false otherwise.
-
members
Returns an enumeration of the members in the group. The returned objects can be instances of either Principal or Group (which is a subinterface of Principal).- Returns:
- an enumeration of the group members.
-
removeMember
Removes the specified member from the group.- Parameters:
user- the principal to remove from this group.- Returns:
- true if the principal was removed, or false if the principal was not a member.
-
toString
- Specified by:
toStringin interfacePrincipal- Overrides:
toStringin classSimplePrincipal
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
equals
Description copied from class:SimplePrincipalCompare this SimplePrincipal's name against another Principal. If system property org.jboss.security.simpleprincipal.equals.override is set to true will only compare instances of SimplePrincipals.- Specified by:
equalsin interfacePrincipal- Overrides:
equalsin classSimplePrincipal- Returns:
- true if name equals another.getName();
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacePrincipal- Overrides:
hashCodein classSimplePrincipal
-