Class SimpleRoleGroup
- java.lang.Object
-
- org.jboss.security.identity.plugins.SimpleRole
-
- org.jboss.security.identity.plugins.SimpleRoleGroup
-
- All Implemented Interfaces:
Serializable,Cloneable,Role,RoleGroup
public class SimpleRoleGroup extends SimpleRole implements RoleGroup
Simple Role Group- Since:
- Nov 16, 2007
- Version:
- $Revision$
- Author:
- Anil.Saldhana@redhat.com
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jboss.security.identity.plugins.SimpleRole
ANYBODY, ANYBODY_ROLE
-
-
Constructor Summary
Constructors Constructor Description SimpleRoleGroup(String roleName)SimpleRoleGroup(String roleName, Collection<Role> roles)SimpleRoleGroup(Group rolesGroup)SimpleRoleGroup(Set<Principal> rolesAsPrincipals)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(Collection<Role> roles)Adds all specified roles to the role group.voidaddRole(Role role)Add a rolevoidclearRoles()Clear all the rolesObjectclone()booleancontainsAll(Role anotherRole)Indicate whether the argument role is equal or contained depending on the role-typebooleancontainsAtleastOneRole(RoleGroup anotherRole)Validates whether there is at least one matching role in "anotherRoleGroup"booleancontainsRole(Role role)Validates whether a simple role is availableCollection<Role>getRoles()Get the roles contained in theRoleGroup.RoleTypegetType()Get type of rolevoidremoveRole(Role role)Remove a roleStringtoString()-
Methods inherited from class org.jboss.security.identity.plugins.SimpleRole
equals, getParent, getRoleName, hashCode
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jboss.security.identity.Role
getParent, getRoleName
-
-
-
-
Method Detail
-
getType
public RoleType getType()
Description copied from interface:RoleGet type of role- Specified by:
getTypein interfaceRole- Overrides:
getTypein classSimpleRole- Returns:
- simple,group
-
addAll
public void addAll(Collection<Role> roles)
Description copied from interface:RoleGroupAdds all specified roles to the role group.
-
removeRole
public void removeRole(Role role)
Description copied from interface:RoleGroupRemove a role- Specified by:
removeRolein interfaceRoleGroup
-
clearRoles
public void clearRoles()
Description copied from interface:RoleGroupClear all the roles- Specified by:
clearRolesin interfaceRoleGroup
-
getRoles
public Collection<Role> getRoles()
Description copied from interface:RoleGroupGet the roles contained in the
RoleGroup. The returnedListshould be unmodifiable as theRoleGroupinterface provides methods to add and remove roles.
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classSimpleRole- Throws:
CloneNotSupportedException
-
containsAll
public boolean containsAll(Role anotherRole)
Description copied from interface:RoleIndicate whether the argument role is equal or contained depending on the role-type- Specified by:
containsAllin interfaceRole- Overrides:
containsAllin classSimpleRole- Returns:
- true or false
- See Also:
Role#contains(Role)
-
containsAtleastOneRole
public boolean containsAtleastOneRole(RoleGroup anotherRole)
Description copied from interface:RoleGroupValidates whether there is at least one matching role in "anotherRoleGroup"- Specified by:
containsAtleastOneRolein interfaceRoleGroup- Parameters:
anotherRole- another role group- Returns:
-
containsRole
public boolean containsRole(Role role)
Description copied from interface:RoleGroupValidates whether a simple role is available- Specified by:
containsRolein interfaceRoleGroup- Parameters:
role- simple role- Returns:
-
toString
public String toString()
- Overrides:
toStringin classSimpleRole
-
-