public abstract class MapGroupAdapter<K> extends AbstractGroupModel<MapGroupEntity<K>>
GroupModel.GroupRemovedEvent, GroupModel.SearchableFields, GroupModel.Streams
entity, realm, session
COMPARE_BY_NAME
Constructor and Description |
---|
MapGroupAdapter(KeycloakSession session,
RealmModel realm,
MapGroupEntity<K> entity) |
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.
|
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.
|
String |
getFirstAttribute(String name) |
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.
|
boolean |
hasRole(RoleModel role)
Returns
true if this object is directly or indirectly assigned the given role, false otherwise. |
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.
|
equals, hashCode
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getAttribute, getSubGroups
getId
getClientRoleMappings, getRealmRoleMappings, getRoleMappings
public MapGroupAdapter(KeycloakSession session, RealmModel realm, MapGroupEntity<K> entity)
public String getName()
public void setName(String name)
public void setSingleAttribute(String name, String value)
GroupModel
public void removeAttribute(String name)
public String getFirstAttribute(String name)
public Stream<String> getAttributeStream(String name)
GroupModel
name
- String
Name of the attribute to be used as a filter.null
.public GroupModel getParent()
public String getParentId()
public Stream<GroupModel> getSubGroupsStream()
GroupModel
GroupModel
. Never returns null
.public void setParent(GroupModel group)
GroupModel
public void addChild(GroupModel subGroup)
GroupModel
public void removeChild(GroupModel subGroup)
GroupModel
public Stream<RoleModel> getRealmRoleMappingsStream()
RoleMapperModel
RoleModel
. Never returns null
.public Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
RoleMapperModel
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:
public void grantRole(RoleModel role)
RoleMapperModel
public Stream<RoleModel> getRoleMappingsStream()
RoleMapperModel
RoleModel
. Never returns null
.public void deleteRoleMapping(RoleModel role)
RoleMapperModel
role
- Role to removeCopyright © 2021 JBoss by Red Hat. All rights reserved.