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 void
addAll(Collection<Role> roles)
Adds all specified roles to the role group.void
addRole(Role role)
Add a rolevoid
clearRoles()
Clear all the rolesObject
clone()
boolean
containsAll(Role anotherRole)
Indicate whether the argument role is equal or contained depending on the role-typeboolean
containsAtleastOneRole(RoleGroup anotherRole)
Validates whether there is at least one matching role in "anotherRoleGroup"boolean
containsRole(Role role)
Validates whether a simple role is availableCollection<Role>
getRoles()
Get the roles contained in theRoleGroup
.RoleType
getType()
Get type of rolevoid
removeRole(Role role)
Remove a roleString
toString()
-
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:Role
Get type of role- Specified by:
getType
in interfaceRole
- Overrides:
getType
in classSimpleRole
- Returns:
- simple,group
-
addAll
public void addAll(Collection<Role> roles)
Description copied from interface:RoleGroup
Adds all specified roles to the role group.
-
removeRole
public void removeRole(Role role)
Description copied from interface:RoleGroup
Remove a role- Specified by:
removeRole
in interfaceRoleGroup
-
clearRoles
public void clearRoles()
Description copied from interface:RoleGroup
Clear all the roles- Specified by:
clearRoles
in interfaceRoleGroup
-
getRoles
public Collection<Role> getRoles()
Description copied from interface:RoleGroup
Get the roles contained in the
RoleGroup
. The returnedList
should be unmodifiable as theRoleGroup
interface provides methods to add and remove roles.
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classSimpleRole
- Throws:
CloneNotSupportedException
-
containsAll
public boolean containsAll(Role anotherRole)
Description copied from interface:Role
Indicate whether the argument role is equal or contained depending on the role-type- Specified by:
containsAll
in interfaceRole
- Overrides:
containsAll
in classSimpleRole
- Returns:
- true or false
- See Also:
Role#contains(Role)
-
containsAtleastOneRole
public boolean containsAtleastOneRole(RoleGroup anotherRole)
Description copied from interface:RoleGroup
Validates whether there is at least one matching role in "anotherRoleGroup"- Specified by:
containsAtleastOneRole
in interfaceRoleGroup
- Parameters:
anotherRole
- another role group- Returns:
-
containsRole
public boolean containsRole(Role role)
Description copied from interface:RoleGroup
Validates whether a simple role is available- Specified by:
containsRole
in interfaceRoleGroup
- Parameters:
role
- simple role- Returns:
-
toString
public String toString()
- Overrides:
toString
in classSimpleRole
-
-