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.ClientScopeRemovedEvent, ClientScopeModel.SearchableFields
-
Nested classes/interfaces inherited from interface org.keycloak.models.OrderedModel
OrderedModel.OrderedModelComparator<OM extends OrderedModel>
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.persistence.EntityManager
em
protected ClientScopeEntity
entity
protected RealmModel
realm
protected KeycloakSession
session
-
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
Constructors Constructor Description ClientScopeAdapter(RealmModel realm, javax.persistence.EntityManager em, KeycloakSession session, ClientScopeEntity entity)
-
Method Summary
-
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 Detail
-
session
protected KeycloakSession session
-
realm
protected RealmModel realm
-
em
protected javax.persistence.EntityManager em
-
entity
protected ClientScopeEntity entity
-
-
Constructor Detail
-
ClientScopeAdapter
public ClientScopeAdapter(RealmModel realm, javax.persistence.EntityManager em, KeycloakSession session, ClientScopeEntity entity)
-
-
Method Detail
-
getEntity
public ClientScopeEntity getEntity()
- Specified by:
getEntity
in interfaceJpaModel<ClientScopeEntity>
-
getId
public String getId()
- Specified by:
getId
in interfaceClientScopeModel
-
getRealm
public RealmModel getRealm()
- Specified by:
getRealm
in interfaceClientScopeModel
-
getName
public String getName()
- Specified by:
getName
in interfaceClientScopeModel
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceClientScopeModel
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceClientScopeModel
-
setDescription
public void setDescription(String description)
- Specified by:
setDescription
in interfaceClientScopeModel
-
getProtocol
public String getProtocol()
- Specified by:
getProtocol
in interfaceClientScopeModel
-
setProtocol
public void setProtocol(String protocol)
- Specified by:
setProtocol
in interfaceClientScopeModel
-
getProtocolMappersStream
public Stream<ProtocolMapperModel> 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
public ProtocolMapperModel addProtocolMapper(ProtocolMapperModel model)
- Specified by:
addProtocolMapper
in interfaceProtocolMapperContainerModel
-
getProtocolMapperEntity
protected ProtocolMapperEntity getProtocolMapperEntity(String id)
-
getProtocolMapperEntityByName
protected ProtocolMapperEntity getProtocolMapperEntityByName(String protocol, String name)
-
removeProtocolMapper
public void removeProtocolMapper(ProtocolMapperModel mapping)
- Specified by:
removeProtocolMapper
in interfaceProtocolMapperContainerModel
-
updateProtocolMapper
public void updateProtocolMapper(ProtocolMapperModel mapping)
- Specified by:
updateProtocolMapper
in interfaceProtocolMapperContainerModel
-
getProtocolMapperById
public ProtocolMapperModel getProtocolMapperById(String id)
- Specified by:
getProtocolMapperById
in interfaceProtocolMapperContainerModel
-
getProtocolMapperByName
public ProtocolMapperModel getProtocolMapperByName(String protocol, String name)
- Specified by:
getProtocolMapperByName
in interfaceProtocolMapperContainerModel
-
entityToModel
protected ProtocolMapperModel entityToModel(ProtocolMapperEntity entity)
-
getRealmScopeMappingsStream
public Stream<RoleModel> 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
public Stream<RoleModel> 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
public void addScopeMapping(RoleModel role)
- Specified by:
addScopeMapping
in interfaceScopeContainerModel
-
deleteScopeMapping
public void deleteScopeMapping(RoleModel role)
- Specified by:
deleteScopeMapping
in interfaceScopeContainerModel
-
hasScope
public boolean hasScope(RoleModel role)
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:
if you want to check if this object has the given role directly in its scope
-
setAttribute
public void setAttribute(String name, String value)
- Specified by:
setAttribute
in interfaceClientScopeModel
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttribute
in interfaceClientScopeModel
-
getAttribute
public String getAttribute(String name)
- Specified by:
getAttribute
in interfaceClientScopeModel
-
toClientScopeEntity
public static ClientScopeEntity toClientScopeEntity(ClientScopeModel model, javax.persistence.EntityManager em)
-
getAttributes
public Map<String,String> getAttributes()
- Specified by:
getAttributes
in interfaceClientScopeModel
-
-