public class GroupAdapter extends Object implements GroupModel.Streams, JpaModel<GroupEntity>
GroupModel.GroupRemovedEvent, GroupModel.SearchableFields, GroupModel.Streams| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
em |
protected GroupEntity |
group |
protected RealmModel |
realm |
COMPARE_BY_NAME| Constructor and Description |
|---|
GroupAdapter(RealmModel realm,
javax.persistence.EntityManager em,
GroupEntity group) |
| 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.
|
GroupEntity |
getEntity() |
String |
getFirstAttribute(String name) |
protected javax.persistence.TypedQuery<GroupRoleMappingEntity> |
getGroupRoleMappingEntityTypedQuery(RoleModel role) |
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 |
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 parent)
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.
|
static GroupEntity |
toEntity(GroupModel model,
javax.persistence.EntityManager em) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetAttribute, getSubGroupsgetClientRoleMappings, getRealmRoleMappings, getRoleMappingsprotected GroupEntity group
protected javax.persistence.EntityManager em
protected RealmModel realm
public GroupAdapter(RealmModel realm, javax.persistence.EntityManager em, GroupEntity group)
public GroupEntity getEntity()
getEntity in interface JpaModel<GroupEntity>public String getId()
getId in interface GroupModelpublic String getName()
getName in interface GroupModelpublic void setName(String name)
setName in interface GroupModelpublic GroupModel getParent()
getParent in interface GroupModelpublic String getParentId()
getParentId in interface GroupModelpublic static GroupEntity toEntity(GroupModel model, javax.persistence.EntityManager em)
public void setParent(GroupModel parent)
GroupModelsetParent in interface GroupModelpublic void addChild(GroupModel subGroup)
GroupModeladdChild in interface GroupModelpublic void removeChild(GroupModel subGroup)
GroupModelremoveChild in interface GroupModelpublic Stream<GroupModel> getSubGroupsStream()
GroupModelgetSubGroupsStream in interface GroupModelgetSubGroupsStream in interface GroupModel.StreamsGroupModel. Never returns null.public void setSingleAttribute(String name, String value)
GroupModelsetSingleAttribute in interface GroupModelpublic void setAttribute(String name, List<String> values)
setAttribute in interface GroupModelpublic void removeAttribute(String name)
removeAttribute in interface GroupModelpublic String getFirstAttribute(String name)
getFirstAttribute in interface GroupModelpublic Stream<String> getAttributeStream(String name)
GroupModelgetAttributeStream in interface GroupModelgetAttributeStream in interface GroupModel.Streamsname - String Name of the attribute to be used as a filter.null.public Map<String,List<String>> getAttributes()
getAttributes in interface GroupModelpublic boolean hasRole(RoleModel role)
RoleMapperModeltrue 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 RoleMapperModelprotected javax.persistence.TypedQuery<GroupRoleMappingEntity> getGroupRoleMappingEntityTypedQuery(RoleModel role)
public void grantRole(RoleModel role)
RoleMapperModelgrantRole in interface RoleMapperModelpublic Stream<RoleModel> getRealmRoleMappingsStream()
RoleMapperModelgetRealmRoleMappingsStream in interface RoleMapperModelgetRealmRoleMappingsStream in interface RoleMapperModel.StreamsRoleModel. Never returns null.public Stream<RoleModel> getRoleMappingsStream()
RoleMapperModelgetRoleMappingsStream in interface RoleMapperModelgetRoleMappingsStream in interface RoleMapperModel.StreamsRoleModel. Never returns null.public void deleteRoleMapping(RoleModel role)
RoleMapperModeldeleteRoleMapping in interface RoleMapperModelrole - Role to removepublic Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
RoleMapperModelgetClientRoleMappingsStream in interface RoleMapperModelgetClientRoleMappingsStream in interface RoleMapperModel.Streamsapp - ClientModel Client to get the roles for.RoleModel. Never returns null.Copyright © 2021 JBoss by Red Hat. All rights reserved.