public class RoleMap extends java.lang.Object implements java.util.Map, XMLable, java.io.Serializable
N.B. The ComplexForeignKey.requiredByIxSpec()
for groups is set true in
RoleBinder.getRefMd(Role, ReferenceContext, boolean)
in order to
prevent the import of objects referencing missing security groups.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AGGREGATE_SECURITY_KEY |
static java.lang.String |
SECURITY_KEY |
static java.lang.String |
TYPE_AGGREGATE_GROUP |
static java.lang.String |
TYPE_AGGREGATE_USER |
static java.lang.String |
TYPE_GROUP |
static java.lang.String |
TYPE_GROUP_UUIDS |
static java.lang.String |
TYPE_USER |
static java.lang.String |
TYPE_USER_UUIDS |
DEFAULT_BUFFER_SIZE
Constructor and Description |
---|
RoleMap() |
Modifier and Type | Method and Description |
---|---|
void |
addActorsToRole(java.lang.String role_,
java.lang.String type_,
java.lang.Long[] id_)
Adds groups to the specified role.
|
void |
addActorsToRole(java.lang.String role_,
java.lang.String type_,
java.lang.String[] id_)
Adds users to the specified role.
|
void |
clear()
Removes all roles and actors.
|
boolean |
containsActors()
Returns true if there are actors in any role of the role map.
|
boolean |
containsKey(java.lang.Object key_)
Returns whether this role map contains the role specified.
|
boolean |
containsValue(java.lang.Object value_)
Not implemented.
|
java.util.Set |
entrySet()
Returns all of the entries in the role map.
|
boolean |
equals(java.lang.Object obj)
Compares this role map with another, and returns whether this role map
contains exactly the same data as the other.
|
java.lang.Object |
get(java.lang.Object key_)
Returns the actors at the particular role.
|
java.lang.Object[] |
getActorsInRole(java.lang.String role_,
java.lang.String type_)
Returns all of the actors at the given role and of the given type.
|
java.lang.Integer |
getAggregateSecurity()
Gets the aggregate security bitmap for the object.
|
java.util.Set<java.lang.Long> |
getAllGroupIds()
Returns all the group ids in this role map.
|
java.util.Set<java.lang.String> |
getAllUsernames()
Returns all the usernames in this role map.
|
protected Role |
getRole(java.lang.String roleName) |
protected java.lang.String[] |
getRoleNames() |
Role[] |
getRoles()
Returns an array of Role objects for all the roles stored in this role map.
|
java.lang.Integer |
getSecurity()
Gets the security bitmap for the object.
|
int |
hashCode()
Returns a hash code for the role map.
|
protected void |
init(RoleMap rm) |
boolean |
isEmpty()
Returns whether this role map contains no roles.
|
java.util.Set |
keySet()
Returns all of the roles in the role map.
|
void |
mergeWith(RoleMap newRM)
Merges this role map with the given new role map.
|
java.lang.Object |
put(java.lang.Object key_,
java.lang.Object value_)
Returns the users and groups in the given role.
|
void |
putAll(java.util.Map t_)
Not supported.
|
java.lang.Object |
remove(java.lang.Object key_)
Remove all users and groups at the role.
|
void |
removeActorsFromRole(java.lang.String role_,
java.lang.String type_,
java.lang.Long[] id_)
Removes groups from the specified role.
|
void |
removeActorsFromRole(java.lang.String role_,
java.lang.String type_,
java.lang.String[] id_)
Removes users from the specified role.
|
protected void |
removeAllRoles() |
void |
setActorsInRole(java.lang.String role_,
java.lang.String type_,
java.lang.Long[] id_)
Sets the actors in the given role at the given type.
|
void |
setActorsInRole(java.lang.String role_,
java.lang.String type_,
java.lang.String[] id_)
Sets the actors in the specified role.
|
void |
setAggregateSecurity(java.lang.Integer aggregateSecurity_)
Sets the aggregate security bitmap for the object.
|
protected void |
setRole(Role role) |
void |
setRoles(java.util.Collection<? extends Role> rolesSet)
Removes any roles that are currently set and sets the roles to the given data.
|
void |
setRoles(Role[] roles)
Removes any roles that are currently set and sets the roles to the given data.
|
void |
setSecurity(java.lang.Integer security_)
Sets the security bitmap for the object.
|
int |
size()
Returns the number of roles in the role map.
|
java.lang.String |
toString() |
java.lang.String |
toXML()
Converts this role map to xml and returns it as a string.
|
void |
toXML(java.lang.StringBuilder buffer_)
Converts this role map node to XML and stores it in a
StringBuilder . |
java.util.Collection |
values()
Returns all of the users and groups at any roles.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static final java.lang.String TYPE_USER
public static final java.lang.String TYPE_USER_UUIDS
public static final java.lang.String TYPE_AGGREGATE_USER
public static final java.lang.String TYPE_GROUP
public static final java.lang.String TYPE_GROUP_UUIDS
public static final java.lang.String TYPE_AGGREGATE_GROUP
public static final java.lang.String SECURITY_KEY
public static final java.lang.String AGGREGATE_SECURITY_KEY
protected void init(RoleMap rm)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXML()
public void toXML(java.lang.StringBuilder buffer_)
StringBuilder
.public int size()
size
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
true
if the map contains no roles; false
otherwisepublic boolean containsKey(java.lang.Object key_)
containsKey
in interface java.util.Map
key_
- the role to check fortrue
if the map contains the specified role;
false
otherwisepublic boolean containsValue(java.lang.Object value_)
containsValue
in interface java.util.Map
value_
- The object to look for.false
public java.lang.Object get(java.lang.Object key_)
get
in interface java.util.Map
key_
- the role to get the actors atMap
containing the users and groups,
where the keys are the types TYPE_USER
or
TYPE_GROUP
and the values are Array
objects of
usernames (String
s) and group IDs (Long
s)
respectively.public java.lang.Object put(java.lang.Object key_, java.lang.Object value_)
put
in interface java.util.Map
key_
- the rolevalue_
- a Map
containing the users and groups,
where the keys are the types TYPE_USER
or
TYPE_GROUP
and the values are Array
objects of
usernames (String
s) and group IDs (Long
s)
respectively.public java.lang.Object remove(java.lang.Object key_)
remove
in interface java.util.Map
key_
- The key of the object to remove from the role map.Map
with the previous users and groups in the role,
where the keys are the types (TYPE_USER
or
TYPE_GROUP
) and the values are Array
objects of
usernames (String
s) and group IDs (Long
s)
respectively.public void putAll(java.util.Map t_)
putAll
in interface java.util.Map
t_
- value does not matterUnsupportedOperatorException
- alwayspublic void clear()
clear
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
Set
containing the rolespublic java.util.Collection values()
values
in interface java.util.Map
Collection
containing all of the user and group
Map
objects, where for each Map
, the keys are
the types TYPE_USER
or TYPE_GROUP
and the
values are Array
objects of usernames (String
s)
and group IDs (Long
s) respectively.public java.util.Set entrySet()
entrySet
in interface java.util.Map
Set
containing Map.Entry
objects,
where the keys in the entries are the roles, and the values are the
Map
objectsvalues()
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Map
equals
in class java.lang.Object
obj
- the other role maptrue
, if this rolemap equals o_
; else
false
public int hashCode()
hashCode
in interface java.util.Map
hashCode
in class java.lang.Object
public java.lang.Object[] getActorsInRole(java.lang.String role_, java.lang.String type_)
role_
- the role to get users fortype_
- TYPE_USER
or TYPE_GROUP
Array
of the actor IDs (String
for
users, Long
for groups)setActorsInRole(String, String, String[])
public boolean containsActors()
public void setActorsInRole(java.lang.String role_, java.lang.String type_, java.lang.Long[] id_)
role_
- the role. This parameter is required.type_
- should always be TYPE_GROUP
id_
- the group idsjava.lang.NullPointerException
- if the role is not specified.getActorsInRole(String, String)
public void setActorsInRole(java.lang.String role_, java.lang.String type_, java.lang.String[] id_)
role_
- the role. This parameter is required.type_
- should always be TYPE_USER
id_
- the usernames of the usersjava.lang.NullPointerException
- if the role is not specified.getActorsInRole(String, String)
public void addActorsToRole(java.lang.String role_, java.lang.String type_, java.lang.Long[] id_) throws java.lang.NullPointerException
role_
- the role. This parameter is required. Example: ContentRoleMap.AUTHOR, ContentRoleMap.VIEWER...type_
- should always be RoleMap.TYPE_GROUP
id_
- the group idsjava.lang.NullPointerException
- if the role is not specified.public void addActorsToRole(java.lang.String role_, java.lang.String type_, java.lang.String[] id_) throws java.lang.NullPointerException
role_
- the role. This parameter is required. Example: ContentRoleMap.AUTHOR, ContentRoleMap.VIEWER...type_
- should always be RoleMap.TYPE_USER
id_
- the usernames of the users to addjava.lang.NullPointerException
- if the role is not specified.public void removeActorsFromRole(java.lang.String role_, java.lang.String type_, java.lang.Long[] id_)
role_
- the roletype_
- should always be TYPE_GROUP
id_
- the group ids to removepublic void removeActorsFromRole(java.lang.String role_, java.lang.String type_, java.lang.String[] id_)
role_
- the roletype_
- should always be TYPE_USER
id_
- the usernames to removepublic void setSecurity(java.lang.Integer security_)
null
security_
- the security mapgetSecurity()
public java.lang.Integer getSecurity()
null
setSecurity(Integer)
public void setAggregateSecurity(java.lang.Integer aggregateSecurity_)
null
aggregateSecurity_
- the aggregate security mapgetAggregateSecurity()
public java.lang.Integer getAggregateSecurity()
null
setAggregateSecurity(Integer)
public void mergeWith(RoleMap newRM)
TYPE_USER
and
TYPE_GROUP
are merged. All other fields are left unchanged.
The following rules are used to merge the users and groups:
newRM
- The new role map to merge with this (existing/old) role map.public java.util.Set<java.lang.Long> getAllGroupIds()
public java.util.Set<java.lang.String> getAllUsernames()
public Role[] getRoles()
public void setRoles(Role[] roles)
SECURITY_KEY
) is not affected by this call.roles
- The roles data to set in the role map.public void setRoles(java.util.Collection<? extends Role> rolesSet)
SECURITY_KEY
) is not affected by this call.rolesSet
- The set of roles data to set in the role map.protected java.lang.String[] getRoleNames()
protected void removeAllRoles()
protected Role getRole(java.lang.String roleName)
protected void setRole(Role role)
Copyright © 2003-2024 Appian Corporation. All Rights Reserved.