| java.lang.Object org.josso.gateway.identity.service.BaseRoleImpl
BaseRoleImpl | public class BaseRoleImpl implements BaseRole(Code) | | An implementation of BaseRole that manages a collection of Principal
objects based on their hashCode() and equals() methods.
This class is not thread safe.
author: Sebastian Gonzalez Oyuela version: $Id: BaseRoleImpl.java 508 2008-02-18 13:32:29Z sgonzalez $ |
Method Summary | |
public boolean | addMember(Principal user) Adds the specified member to the group.
Parameters: user - the principal to add to this group. | public boolean | equals(Object another) | public String | getName() | public int | hashCode() | public boolean | isMember(Principal member) 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. | public Enumeration | members() Returns an enumeration of the members in the group. | public boolean | removeMember(Principal user) Removes the specified member from the group.
Parameters: user - the principal to remove from this group. | public void | setName(String name) | public String | toString() |
BaseRoleImpl | public BaseRoleImpl()(Code) | | |
addMember | public boolean addMember(Principal user)(Code) | | Adds the specified member to the group.
Parameters: user - the principal to add to this group. true if the member was successfully added,false if the principal was already a member. |
equals | public boolean equals(Object another)(Code) | | Compare this BaseRole's name against another BaseRole
true if name equals another.getName(); |
hashCode | public int hashCode()(Code) | | |
isMember | public boolean isMember(Principal member)(Code) | | 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. true if the principal is a member of this group,false otherwise. |
members | public Enumeration members()(Code) | | 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).
an enumeration of the group members. |
removeMember | public boolean removeMember(Principal user)(Code) | | Removes the specified member from the group.
Parameters: user - the principal to remove from this group. true if the principal was removed, orfalse if the principal was not a member. |
|
|