Package org.keycloak.models.jpa
Class RoleAdapter
java.lang.Object
org.keycloak.models.jpa.RoleAdapter
- All Implemented Interfaces:
JpaModel<RoleEntity>,RoleModel
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.RoleModel
RoleModel.RoleEvent, RoleModel.RoleGrantedEvent, RoleModel.RoleNameChangeEvent, RoleModel.RoleRevokedEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManagerprotected RealmModelprotected RoleEntityprotected KeycloakSession -
Constructor Summary
ConstructorsConstructorDescriptionRoleAdapter(KeycloakSession session, RealmModel realm, jakarta.persistence.EntityManager em, RoleEntity role) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompositeRole(RoleModel role) booleangetAttributeStream(String name) Returns all role's attributes that match the given name as a stream.Returns all composite roles as a stream.getCompositesStream(String search, Integer first, Integer max) Returns a paginated stream of composite roles ofthisrole that contain given string in its name.getId()getName()inthashCode()booleanbooleanbooleanvoidremoveAttribute(String name) voidremoveCompositeRole(RoleModel role) voidsetAttribute(String name, List<String> values) voidsetDescription(String description) voidvoidsetRole(RoleEntity role) voidsetSingleAttribute(String name, String value) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.RoleModel
getFirstAttribute
-
Field Details
-
role
-
em
protected jakarta.persistence.EntityManager em -
realm
-
session
-
-
Constructor Details
-
RoleAdapter
public RoleAdapter(KeycloakSession session, RealmModel realm, jakarta.persistence.EntityManager em, RoleEntity role)
-
-
Method Details
-
getEntity
- Specified by:
getEntityin interfaceJpaModel<RoleEntity>
-
setRole
-
getName
-
getDescription
- Specified by:
getDescriptionin interfaceRoleModel
-
setDescription
- Specified by:
setDescriptionin interfaceRoleModel
-
getId
-
setName
-
isComposite
public boolean isComposite()- Specified by:
isCompositein interfaceRoleModel
-
addCompositeRole
- Specified by:
addCompositeRolein interfaceRoleModel
-
removeCompositeRole
- Specified by:
removeCompositeRolein interfaceRoleModel
-
getCompositesStream
Description copied from interface:RoleModelReturns all composite roles as a stream.- Specified by:
getCompositesStreamin interfaceRoleModel- Returns:
- Stream of
RoleModel. Never returnsnull.
-
getCompositesStream
Description copied from interface:RoleModelReturns a paginated stream of composite roles ofthisrole that contain given string in its name.- Specified by:
getCompositesStreamin interfaceRoleModel- Parameters:
search- Case-insensitive search stringfirst- Index of the first result to return. Ignored if negative ornull.max- Maximum number of results to return. Ignored if negative ornull.- Returns:
- A stream of requested roles ordered by the role name
-
hasRole
-
setSingleAttribute
- Specified by:
setSingleAttributein interfaceRoleModel
-
setAttribute
- Specified by:
setAttributein interfaceRoleModel
-
removeAttribute
- Specified by:
removeAttributein interfaceRoleModel
-
getAttributeStream
Description copied from interface:RoleModelReturns all role's attributes that match the given name as a stream.- Specified by:
getAttributeStreamin interfaceRoleModel- Parameters:
name-StringName of an attribute to be used as a filter.- Returns:
- Stream of
String. Never returnsnull.
-
getAttributes
- Specified by:
getAttributesin interfaceRoleModel
-
isClientRole
public boolean isClientRole()- Specified by:
isClientRolein interfaceRoleModel
-
getContainerId
- Specified by:
getContainerIdin interfaceRoleModel
-
getContainer
- Specified by:
getContainerin interfaceRoleModel
-
equals
-
hashCode
public int hashCode()
-