public abstract class RoleBasedObject extends Object
| Constructor and Description |
|---|
RoleBasedObject()
Constructor.
|
RoleBasedObject(Role... roles)
Constructor.
|
RoleBasedObject(String... roleNames)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRole(Role... roles)
Associates given roles to this object
|
void |
addRole(String... roleNames)
Associates given roles to this object
|
void |
clearRoles()
Removes all role associations.
|
Set<Role> |
getRoles() |
void |
removeRole(Role... roles)
Removes the association of a role with this instance.
|
void |
removeRole(String... roleNames)
Removes the association of a role with this instance.
|
public RoleBasedObject()
public RoleBasedObject(Role... roles) throws IllegalArgumentException, DuplicateException
roles - default roles associated to this objectIllegalArgumentException - if any of given roles is nullDuplicateException - if there is an attempt to register the same role more than once (either directly of as a child of any associated role).public RoleBasedObject(String... roleNames) throws IllegalArgumentException, DuplicateException, RoleNotFoundException
roleNames - default role names associated to this object. Role instances will be obtained through RoleRepositoryIllegalArgumentException - if any of given role names is null/emptyDuplicateException - if there is an attempt to register the same role more than once (either directly of as a child of any associated role).RoleNotFoundException - if any of given roleNames is not registered in RoleRepositorypublic void addRole(Role... roles) throws DuplicateException, IllegalArgumentException
roles - to be associatedIllegalArgumentException - if roles.length == 0 or any given role is nullDuplicateException - if given role was already associated to this object (either directly or as child of any associated role)public void addRole(String... roleNames) throws DuplicateException, IllegalArgumentException, RoleNotFoundException
roleNames - roles to be added. Role instances will be obtained through RoleRepositoryIllegalArgumentException - if roleNames.length == 0 or any of given roleNames is null/emptyDuplicateException - if given role was already associated to this object (either directly or as child of any associated role)RoleNotFoundException - if any of given roleNames is not registered in RoleRepositorypublic void removeRole(Role... roles) throws IllegalArgumentException
roles - role to be removed from association set. If given role is not associated to this instance, nothing happens.IllegalArgumentException - if roles.length == 0 or any of given roles is nullpublic void removeRole(String... roleNames) throws IllegalArgumentException, RoleNotFoundException
roleNames - role to be removed from association set. If given role is not associated to this instance, nothing happens. Role instances will be obtained through RoleRepositoryIllegalArgumentException - if roleNames.length == 0 or any given role is null/emptyRoleNotFoundException - if any given role is not registered in RoleRepositorypublic void clearRoles()
Copyright © 2015 Agapsys Tecnologia Ltda-ME. All rights reserved.