Package org.keycloak.models.jpa
Class ClientScopeAdapter
java.lang.Object
org.keycloak.models.jpa.ClientScopeAdapter
- All Implemented Interfaces:
ClientScopeModel
,JpaModel<ClientScopeEntity>
,OrderedModel
,ProtocolMapperContainerModel
,ScopeContainerModel
public class ClientScopeAdapter
extends Object
implements ClientScopeModel, JpaModel<ClientScopeEntity>
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.ClientScopeModel
ClientScopeModel.ClientScopeCreatedEvent, ClientScopeModel.ClientScopeRemovedEvent
Nested classes/interfaces inherited from interface org.keycloak.models.OrderedModel
OrderedModel.OrderedModelComparator<OM extends OrderedModel>
-
Field Summary
Modifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManager
protected ClientScopeEntity
protected RealmModel
protected KeycloakSession
Fields inherited from interface org.keycloak.models.ClientScopeModel
CONSENT_SCREEN_TEXT, DISPLAY_ON_CONSENT_SCREEN, DYNAMIC_SCOPE_REGEXP, GUI_ORDER, INCLUDE_IN_TOKEN_SCOPE, IS_DYNAMIC_SCOPE
-
Constructor Summary
ConstructorDescriptionClientScopeAdapter
(RealmModel realm, jakarta.persistence.EntityManager em, KeycloakSession session, ClientScopeEntity entity) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addScopeMapping
(RoleModel role) void
deleteScopeMapping
(RoleModel role) protected ProtocolMapperModel
entityToModel
(ProtocolMapperEntity entity) boolean
getAttribute
(String name) getId()
getName()
getProtocolMapperByName
(String protocol, String name) protected ProtocolMapperEntity
protected ProtocolMapperEntity
getProtocolMapperEntityByName
(String protocol, String name) Returns protocol mappers as a stream.getRealm()
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.Returns scope mappings for this scope container as a stream.int
hashCode()
boolean
Returnstrue
, if this object has the given role directly or indirectly in its scope,false
otherwise.void
removeAttribute
(String name) void
removeProtocolMapper
(ProtocolMapperModel mapping) void
setAttribute
(String name, String value) void
setDescription
(String description) void
void
setProtocol
(String protocol) static ClientScopeEntity
toClientScopeEntity
(ClientScopeModel model, jakarta.persistence.EntityManager em) toString()
void
updateProtocolMapper
(ProtocolMapperModel mapping) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.keycloak.models.ClientScopeModel
getConsentScreenText, getDynamicScopeRegexp, getGuiOrder, isDisplayOnConsentScreen, isDynamicScope, isIncludeInTokenScope, setConsentScreenText, setDisplayOnConsentScreen, setGuiOrder, setIncludeInTokenScope, setIsDynamicScope
Methods inherited from interface org.keycloak.models.ScopeContainerModel
hasDirectScope
-
Field Details
-
session
-
realm
-
em
protected jakarta.persistence.EntityManager em -
entity
-
-
Constructor Details
-
ClientScopeAdapter
public ClientScopeAdapter(RealmModel realm, jakarta.persistence.EntityManager em, KeycloakSession session, ClientScopeEntity entity)
-
-
Method Details
-
getEntity
- Specified by:
getEntity
in interfaceJpaModel<ClientScopeEntity>
-
getId
- Specified by:
getId
in interfaceClientScopeModel
-
getRealm
- Specified by:
getRealm
in interfaceClientScopeModel
-
getName
- Specified by:
getName
in interfaceClientScopeModel
-
setName
- Specified by:
setName
in interfaceClientScopeModel
-
getDescription
- Specified by:
getDescription
in interfaceClientScopeModel
-
setDescription
- Specified by:
setDescription
in interfaceClientScopeModel
-
getProtocol
- Specified by:
getProtocol
in interfaceClientScopeModel
-
setProtocol
- Specified by:
setProtocol
in interfaceClientScopeModel
-
getProtocolMappersStream
Description copied from interface:ProtocolMapperContainerModel
Returns protocol mappers as a stream.- Specified by:
getProtocolMappersStream
in interfaceProtocolMapperContainerModel
- Returns:
- Stream of protocol mapper. Never returns
null
.
-
addProtocolMapper
- Specified by:
addProtocolMapper
in interfaceProtocolMapperContainerModel
-
getProtocolMapperEntity
-
getProtocolMapperEntityByName
-
removeProtocolMapper
- Specified by:
removeProtocolMapper
in interfaceProtocolMapperContainerModel
-
updateProtocolMapper
- Specified by:
updateProtocolMapper
in interfaceProtocolMapperContainerModel
-
getProtocolMapperById
- Specified by:
getProtocolMapperById
in interfaceProtocolMapperContainerModel
-
getProtocolMapperByName
- Specified by:
getProtocolMapperByName
in interfaceProtocolMapperContainerModel
-
entityToModel
-
getRealmScopeMappingsStream
Description copied from interface:ScopeContainerModel
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.- Specified by:
getRealmScopeMappingsStream
in interfaceScopeContainerModel
- Returns:
- stream of
RoleModel
. Never returnsnull
.
-
getScopeMappingsStream
Description copied from interface:ScopeContainerModel
Returns scope mappings for this scope container as a stream.- Specified by:
getScopeMappingsStream
in interfaceScopeContainerModel
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
addScopeMapping
- Specified by:
addScopeMapping
in interfaceScopeContainerModel
-
deleteScopeMapping
- Specified by:
deleteScopeMapping
in interfaceScopeContainerModel
-
hasScope
Description copied from interface:ScopeContainerModel
Returnstrue
, if this object has the given role directly or indirectly in its scope,false
otherwise.- Specified by:
hasScope
in interfaceScopeContainerModel
- Parameters:
role
- the role- Returns:
- see description
- See Also:
-
setAttribute
- Specified by:
setAttribute
in interfaceClientScopeModel
-
removeAttribute
- Specified by:
removeAttribute
in interfaceClientScopeModel
-
getAttribute
- Specified by:
getAttribute
in interfaceClientScopeModel
-
toClientScopeEntity
public static ClientScopeEntity toClientScopeEntity(ClientScopeModel model, jakarta.persistence.EntityManager em) -
getAttributes
- Specified by:
getAttributes
in interfaceClientScopeModel
-
equals
-
hashCode
public int hashCode() -
toString
-