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.OrderedModel

      `OrderedModel.OrderedModelComparator<OM extends OrderedModel>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and 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, GUI_ORDER, INCLUDE_IN_TOKEN_SCOPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientScopeAdapter(RealmModel realm, javax.persistence.EntityManager em, KeycloakSession session, ClientScopeEntity entity)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ProtocolMapperModel` | `addProtocolMapper(ProtocolMapperModel model)`
    `void` | `addScopeMapping(RoleModel role)`
    `void` | `deleteScopeMapping(RoleModel role)`
    `protected ProtocolMapperModel` | `entityToModel(ProtocolMapperEntity entity)`
    `boolean` | `equals(Object o)`
    `String` | `getAttribute(String name)`
    `Map<String,String>` | `getAttributes()`
    `String` | `getDescription()`
    `ClientScopeEntity` | `getEntity()`
    `String` | `getId()`
    `String` | `getName()`
    `String` | `getProtocol()`
    `ProtocolMapperModel` | `getProtocolMapperById(String id)`
    `ProtocolMapperModel` | `getProtocolMapperByName(String protocol, String name)`
    `protected ProtocolMapperEntity` | `getProtocolMapperEntity(String id)`
    `protected ProtocolMapperEntity` | `getProtocolMapperEntityByName(String protocol, String name)`
    `Stream<ProtocolMapperModel>` | `getProtocolMappersStream()` Returns protocol mappers as a stream.
    `RealmModel` | `getRealm()`
    `Stream<RoleModel>` | `getRealmScopeMappingsStream()` From the scope mappings returned by `ScopeContainerModel.getScopeMappingsStream()` ()} returns only those that belong to the realm that owns this scope container.
    `Stream<RoleModel>` | `getScopeMappingsStream()`
    `int` | `hashCode()`
    `boolean` | `hasScope(RoleModel role)`
    `void` | `removeAttribute(String name)`
    `void` | `removeProtocolMapper(ProtocolMapperModel mapping)`
    `void` | `setAttribute(String name, String value)`
    `void` | `setDescription(String description)`
    `void` | `setName(String name)`
    `void` | `setProtocol(String protocol)`
    `static ClientScopeEntity` | `toClientScopeEntity(ClientScopeModel model, javax.persistence.EntityManager em)`
    `void` | `updateProtocolMapper(ProtocolMapperModel mapping)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.models.ClientScopeModel

      `getConsentScreenText, getGuiOrder, isDisplayOnConsentScreen, isIncludeInTokenScope, setConsentScreenText, setDisplayOnConsentScreen, setGuiOrder, setIncludeInTokenScope`

    - ### Methods inherited from interface org.keycloak.models.ProtocolMapperContainerModel

      `getProtocolMappers`

    - ### Methods inherited from interface org.keycloak.models.ScopeContainerModel

      `getRealmScopeMappings, getScopeMappings`

- - ### 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 interface `JpaModel<ClientScopeEntity>`

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `ClientScopeModel`

    - #### getRealm

          public RealmModel getRealm()

      Specified by:
        `getRealm` in interface `ClientScopeModel`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `ClientScopeModel`

    - #### setName

          public void setName(String name)

      Specified by:
        `setName` in interface `ClientScopeModel`

    - #### getDescription

          public String getDescription()

      Specified by:
        `getDescription` in interface `ClientScopeModel`

    - #### setDescription

          public void setDescription(String description)

      Specified by:
        `setDescription` in interface `ClientScopeModel`

    - #### getProtocol

          public String getProtocol()

      Specified by:
        `getProtocol` in interface `ClientScopeModel`

    - #### setProtocol

          public void setProtocol(String protocol)

      Specified by:
        `setProtocol` in interface `ClientScopeModel`

    - #### getProtocolMappersStream

          public Stream<ProtocolMapperModel> getProtocolMappersStream()

      Description copied from interface: `ProtocolMapperContainerModel`
      Returns protocol mappers as a stream.
      Specified by:
        `getProtocolMappersStream` in interface `ProtocolMapperContainerModel`
      Returns:
        Stream of protocol mapper.

    - #### addProtocolMapper

          public ProtocolMapperModel addProtocolMapper(ProtocolMapperModel model)

      Specified by:
        `addProtocolMapper` in interface `ProtocolMapperContainerModel`

    - #### getProtocolMapperEntity

          protected ProtocolMapperEntity getProtocolMapperEntity(String id)

    - #### getProtocolMapperEntityByName

          protected ProtocolMapperEntity getProtocolMapperEntityByName(String protocol,
                                                                       String name)

    - #### removeProtocolMapper

          public void removeProtocolMapper(ProtocolMapperModel mapping)

      Specified by:
        `removeProtocolMapper` in interface `ProtocolMapperContainerModel`

    - #### updateProtocolMapper

          public void updateProtocolMapper(ProtocolMapperModel mapping)

      Specified by:
        `updateProtocolMapper` in interface `ProtocolMapperContainerModel`

    - #### getProtocolMapperById

          public ProtocolMapperModel getProtocolMapperById(String id)

      Specified by:
        `getProtocolMapperById` in interface `ProtocolMapperContainerModel`

    - #### getProtocolMapperByName

          public ProtocolMapperModel getProtocolMapperByName(String protocol,
                                                             String name)

      Specified by:
        `getProtocolMapperByName` in interface `ProtocolMapperContainerModel`

    - #### entityToModel

          protected ProtocolMapperModel entityToModel(ProtocolMapperEntity entity)

    - #### getRealmScopeMappingsStream

          public Stream<RoleModel> getRealmScopeMappingsStream()

      Description copied from interface: `ScopeContainerModel`
      From the scope mappings returned by `ScopeContainerModel.getScopeMappingsStream()` ()} returns only those that belong to the realm that owns this scope container.
      Specified by:
        `getRealmScopeMappingsStream` in interface `ScopeContainerModel`
      Returns:
        stream of `RoleModel`

    - #### getScopeMappingsStream

          public Stream<RoleModel> getScopeMappingsStream()

      Specified by:
        `getScopeMappingsStream` in interface `ScopeContainerModel`

    - #### addScopeMapping

          public void addScopeMapping(RoleModel role)

      Specified by:
        `addScopeMapping` in interface `ScopeContainerModel`

    - #### deleteScopeMapping

          public void deleteScopeMapping(RoleModel role)

      Specified by:
        `deleteScopeMapping` in interface `ScopeContainerModel`

    - #### hasScope

          public boolean hasScope(RoleModel role)

      Specified by:
        `hasScope` in interface `ScopeContainerModel`

    - #### setAttribute

          public void setAttribute(String name,
                                   String value)

      Specified by:
        `setAttribute` in interface `ClientScopeModel`

    - #### removeAttribute

          public void removeAttribute(String name)

      Specified by:
        `removeAttribute` in interface `ClientScopeModel`

    - #### getAttribute

          public String getAttribute(String name)

      Specified by:
        `getAttribute` in interface `ClientScopeModel`

    - #### toClientScopeEntity

          public static ClientScopeEntity toClientScopeEntity(ClientScopeModel model,
                                                              javax.persistence.EntityManager em)

    - #### getAttributes

          public Map<String,String> getAttributes()

      Specified by:
        `getAttributes` in interface `ClientScopeModel`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2021 JBoss by Red Hat. All rights reserved.