Package org.keycloak.models.jpa
Class GroupAdapter
- java.lang.Object
-
- org.keycloak.models.jpa.GroupAdapter
-
- All Implemented Interfaces:
GroupModel
,JpaModel<GroupEntity>
,RoleMapperModel
public class GroupAdapter extends Object implements GroupModel, JpaModel<GroupEntity>
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.GroupModel
GroupModel.GroupPathChangeEvent, GroupModel.GroupRemovedEvent, GroupModel.SearchableFields, GroupModel.Streams
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.persistence.EntityManager
em
protected GroupEntity
group
protected RealmModel
realm
-
Fields inherited from interface org.keycloak.models.GroupModel
COMPARE_BY_NAME
-
-
Constructor Summary
Constructors Constructor Description GroupAdapter(RealmModel realm, javax.persistence.EntityManager em, GroupEntity group)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.RoleMapperModel
hasDirectRole
-
-
-
-
Field Detail
-
group
protected GroupEntity group
-
em
protected javax.persistence.EntityManager em
-
realm
protected RealmModel realm
-
-
Constructor Detail
-
GroupAdapter
public GroupAdapter(RealmModel realm, javax.persistence.EntityManager em, GroupEntity group)
-
-
Method Detail
-
getEntity
public GroupEntity getEntity()
- Specified by:
getEntity
in interfaceJpaModel<GroupEntity>
-
getId
public String getId()
- Specified by:
getId
in interfaceGroupModel
-
getName
public String getName()
- Specified by:
getName
in interfaceGroupModel
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceGroupModel
-
getParent
public GroupModel getParent()
- Specified by:
getParent
in interfaceGroupModel
-
getParentId
public String getParentId()
- Specified by:
getParentId
in interfaceGroupModel
-
toEntity
public static GroupEntity toEntity(GroupModel model, javax.persistence.EntityManager em)
-
setParent
public void setParent(GroupModel parent)
- Specified by:
setParent
in interfaceGroupModel
-
addChild
public void addChild(GroupModel subGroup)
- Specified by:
addChild
in interfaceGroupModel
-
removeChild
public void removeChild(GroupModel subGroup)
- Specified by:
removeChild
in interfaceGroupModel
-
getSubGroupsStream
public Stream<GroupModel> getSubGroupsStream()
- Specified by:
getSubGroupsStream
in interfaceGroupModel
-
setSingleAttribute
public void setSingleAttribute(String name, String value)
- Specified by:
setSingleAttribute
in interfaceGroupModel
-
setAttribute
public void setAttribute(String name, List<String> values)
- Specified by:
setAttribute
in interfaceGroupModel
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttribute
in interfaceGroupModel
-
getFirstAttribute
public String getFirstAttribute(String name)
- Specified by:
getFirstAttribute
in interfaceGroupModel
-
getAttributeStream
public Stream<String> getAttributeStream(String name)
- Specified by:
getAttributeStream
in interfaceGroupModel
-
getAttributes
public Map<String,List<String>> getAttributes()
- Specified by:
getAttributes
in interfaceGroupModel
-
hasRole
public boolean hasRole(RoleModel role)
- Specified by:
hasRole
in interfaceRoleMapperModel
-
getGroupRoleMappingEntityTypedQuery
protected javax.persistence.TypedQuery<GroupRoleMappingEntity> getGroupRoleMappingEntityTypedQuery(RoleModel role)
-
grantRole
public void grantRole(RoleModel role)
- Specified by:
grantRole
in interfaceRoleMapperModel
-
getRealmRoleMappingsStream
public Stream<RoleModel> getRealmRoleMappingsStream()
- Specified by:
getRealmRoleMappingsStream
in interfaceRoleMapperModel
-
getRoleMappingsStream
public Stream<RoleModel> getRoleMappingsStream()
- Specified by:
getRoleMappingsStream
in interfaceRoleMapperModel
-
deleteRoleMapping
public void deleteRoleMapping(RoleModel role)
- Specified by:
deleteRoleMapping
in interfaceRoleMapperModel
-
getClientRoleMappingsStream
public Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
- Specified by:
getClientRoleMappingsStream
in interfaceRoleMapperModel
-
-