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.EntityManageremprotected GroupEntitygroupprotected RealmModelrealm-
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:
getEntityin interfaceJpaModel<GroupEntity>
-
getId
public String getId()
- Specified by:
getIdin interfaceGroupModel
-
getName
public String getName()
- Specified by:
getNamein interfaceGroupModel
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceGroupModel
-
getParent
public GroupModel getParent()
- Specified by:
getParentin interfaceGroupModel
-
getParentId
public String getParentId()
- Specified by:
getParentIdin interfaceGroupModel
-
toEntity
public static GroupEntity toEntity(GroupModel model, javax.persistence.EntityManager em)
-
setParent
public void setParent(GroupModel parent)
- Specified by:
setParentin interfaceGroupModel
-
addChild
public void addChild(GroupModel subGroup)
- Specified by:
addChildin interfaceGroupModel
-
removeChild
public void removeChild(GroupModel subGroup)
- Specified by:
removeChildin interfaceGroupModel
-
getSubGroupsStream
public Stream<GroupModel> getSubGroupsStream()
- Specified by:
getSubGroupsStreamin interfaceGroupModel
-
setSingleAttribute
public void setSingleAttribute(String name, String value)
- Specified by:
setSingleAttributein interfaceGroupModel
-
setAttribute
public void setAttribute(String name, List<String> values)
- Specified by:
setAttributein interfaceGroupModel
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfaceGroupModel
-
getFirstAttribute
public String getFirstAttribute(String name)
- Specified by:
getFirstAttributein interfaceGroupModel
-
getAttributeStream
public Stream<String> getAttributeStream(String name)
- Specified by:
getAttributeStreamin interfaceGroupModel
-
getAttributes
public Map<String,List<String>> getAttributes()
- Specified by:
getAttributesin interfaceGroupModel
-
hasRole
public boolean hasRole(RoleModel role)
- Specified by:
hasRolein interfaceRoleMapperModel
-
getGroupRoleMappingEntityTypedQuery
protected javax.persistence.TypedQuery<GroupRoleMappingEntity> getGroupRoleMappingEntityTypedQuery(RoleModel role)
-
grantRole
public void grantRole(RoleModel role)
- Specified by:
grantRolein interfaceRoleMapperModel
-
getRealmRoleMappingsStream
public Stream<RoleModel> getRealmRoleMappingsStream()
- Specified by:
getRealmRoleMappingsStreamin interfaceRoleMapperModel
-
getRoleMappingsStream
public Stream<RoleModel> getRoleMappingsStream()
- Specified by:
getRoleMappingsStreamin interfaceRoleMapperModel
-
deleteRoleMapping
public void deleteRoleMapping(RoleModel role)
- Specified by:
deleteRoleMappingin interfaceRoleMapperModel
-
getClientRoleMappingsStream
public Stream<RoleModel> getClientRoleMappingsStream(ClientModel app)
- Specified by:
getClientRoleMappingsStreamin interfaceRoleMapperModel
-
-