public class GroupAdapter extends Object implements GroupModel.Streams
GroupModel.GroupRemovedEvent, GroupModel.SearchableFields, GroupModel.Streams
Modifier and Type | Field and Description |
---|---|
protected CachedGroup |
cached |
protected RealmCacheSession |
cacheSession |
protected boolean |
invalidated |
protected KeycloakSession |
keycloakSession |
protected RealmModel |
realm |
protected GroupModel |
updated |
COMPARE_BY_NAME
Constructor and Description |
---|
GroupAdapter(CachedGroup cached,
RealmCacheSession cacheSession,
KeycloakSession keycloakSession,
RealmModel realm) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(GroupModel subGroup)
Automatically calls setParent() on the subGroup
|
void |
deleteRoleMapping(RoleModel role)
Removes the given role mapping from this object.
|
boolean |
equals(Object o) |
Map<String,List<String>> |
getAttributes() |
Stream<String> |
getAttributeStream(String name)
Returns group attributes that match the given name as a stream.
|
Stream<RoleModel> |
getClientRoleMappingsStream(ClientModel app)
Returns stream of client roles that are directly set to this object for the given client.
|
protected void |
getDelegateForUpdate() |
String |
getFirstAttribute(String name) |
String |
getId() |
String |
getName() |
GroupModel |
getParent() |
String |
getParentId() |
Stream<RoleModel> |
getRealmRoleMappingsStream()
Returns stream of realm roles that are directly set to this object.
|
Stream<RoleModel> |
getRoleMappingsStream()
Returns stream of all role (both realm all client) that are directly set to this object.
|
Stream<GroupModel> |
getSubGroupsStream()
Returns all sub groups for the parent group as a stream.
|
void |
grantRole(RoleModel role)
Grants the given role to this object.
|
int |
hashCode() |
boolean |
hasRole(RoleModel role)
Returns
true if this object is directly or indirectly assigned the given role, false otherwise. |
void |
invalidate() |
protected boolean |
isUpdated() |
void |
removeAttribute(String name) |
void |
removeChild(GroupModel subGroup)
Automatically calls setParent() on the subGroup
|
void |
setAttribute(String name,
List<String> values) |
void |
setName(String name) |
void |
setParent(GroupModel group)
You must also call addChild on the parent group, addChild on RealmModel if there is no parent group
|
void |
setSingleAttribute(String name,
String value)
Set single value of specified attribute.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getAttribute, getSubGroups
getClientRoleMappings, getRealmRoleMappings, getRoleMappings
protected final CachedGroup cached
protected final RealmCacheSession cacheSession
protected final KeycloakSession keycloakSession
protected final RealmModel realm
protected volatile GroupModel updated
protected volatile boolean invalidated
public GroupAdapter(CachedGroup cached, RealmCacheSession cacheSession, KeycloakSession keycloakSession, RealmModel realm)
protected void getDelegateForUpdate()
public void invalidate()
protected boolean isUpdated()
public String getId()
getId
in interface GroupModel
public String getName()
getName
in interface GroupModel
public void setName(String name)
setName
in interface GroupModel
public void setSingleAttribute(String name, String value)
GroupModel
setSingleAttribute
in interface GroupModel
public void setAttribute(String name, List<String> values)
setAttribute
in interface GroupModel
public void removeAttribute(String name)
removeAttribute
in interface GroupModel
public String getFirstAttribute(String name)
getFirstAttribute
in interface GroupModel
public Stream<String> getAttributeStream(String name)
GroupModel
getAttributeStream
in interface GroupModel
getAttributeStream
in interface GroupModel.Streams
name
- String
Name of the attribute to be used as a filter.null
.public Map<String,List<String>> getAttributes()
getAttributes
in interface GroupModel
public Stream<RoleModel> getRealmRoleMappingsStream()
RoleMapperModel
getRealmRoleMappingsStream
in interface RoleMapperModel
getRealmRoleMappingsStream
in interface RoleMapperModel.Streams
RoleModel
. Never returns null
.public Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
RoleMapperModel
getClientRoleMappingsStream
in interface RoleMapperModel
getClientRoleMappingsStream
in interface RoleMapperModel.Streams
app
- ClientModel
Client to get the roles for.RoleModel
. Never returns null
.public boolean hasRole(RoleModel role)
RoleMapperModel
true
if this object is directly or indirectly assigned the given role, false
otherwise.
For example, true
is returned for hasRole(R) if:
hasRole
in interface RoleMapperModel
public void grantRole(RoleModel role)
RoleMapperModel
grantRole
in interface RoleMapperModel
public Stream<RoleModel> getRoleMappingsStream()
RoleMapperModel
getRoleMappingsStream
in interface RoleMapperModel
getRoleMappingsStream
in interface RoleMapperModel.Streams
RoleModel
. Never returns null
.public void deleteRoleMapping(RoleModel role)
RoleMapperModel
deleteRoleMapping
in interface RoleMapperModel
role
- Role to removepublic GroupModel getParent()
getParent
in interface GroupModel
public String getParentId()
getParentId
in interface GroupModel
public Stream<GroupModel> getSubGroupsStream()
GroupModel
getSubGroupsStream
in interface GroupModel
getSubGroupsStream
in interface GroupModel.Streams
GroupModel
. Never returns null
.public void setParent(GroupModel group)
GroupModel
setParent
in interface GroupModel
public void addChild(GroupModel subGroup)
GroupModel
addChild
in interface GroupModel
public void removeChild(GroupModel subGroup)
GroupModel
removeChild
in interface GroupModel
Copyright © 2021 JBoss by Red Hat. All rights reserved.