org.keycloak.models.map.client

## Class AbstractClientModel<E extends AbstractEntity>

- java.lang.Object
- - org.keycloak.models.map.client.AbstractClientModel<E>

- All Implemented Interfaces:
    ClientModel, ClientScopeModel, OrderedModel, ProtocolMapperContainerModel, RoleContainerModel, ScopeContainerModel
  Direct Known Subclasses:
    MapClientAdapter

      public abstract class AbstractClientModel<E extends AbstractEntity>
      extends Object
      implements ClientModel

  Author:
    hmlnarik

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.ClientModel

      `ClientModel.ClientCreationEvent, ClientModel.ClientRemovedEvent, ClientModel.ClientUpdatedEvent`

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.OrderedModel

      `OrderedModel.OrderedModelComparator<OM extends OrderedModel>`

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.RoleContainerModel

      `RoleContainerModel.RoleRemovedEvent`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected E` | `entity`
    `protected RealmModel` | `realm`
    `protected KeycloakSession` | `session`

    - ### Fields inherited from interface org.keycloak.models.ClientModel

      `PRIVATE_KEY, PUBLIC_KEY, X509CERTIFICATE`

    - ### 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
    `AbstractClientModel(KeycloakSession session, RealmModel realm, E entity)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addClientScopes(Set<ClientScopeModel> clientScopes, boolean defaultScope)` Add clientScopes with this client.
    `RoleModel` | `addRole(String name)`
    `RoleModel` | `addRole(String id, String name)`
    `boolean` | `equals(Object o)`
    `Stream<RoleModel>` | `getRealmScopeMappingsStream()` From the scope mappings returned by `ScopeContainerModel.getScopeMappingsStream()` ()} returns only those that belong to the realm that owns this scope container.
    `RoleModel` | `getRole(String name)`
    `Stream<RoleModel>` | `getRolesStream()`
    `Stream<RoleModel>` | `getRolesStream(Integer firstResult, Integer maxResults)`
    `int` | `hashCode()`
    `boolean` | `removeRole(RoleModel role)`
    `Stream<RoleModel>` | `searchForRolesStream(String search, Integer first, Integer max)`

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

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

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

      `addClientScope, addRedirectUri, addWebOrigin, getAttribute, getAttributes, getAuthenticationFlowBindingOverride, getAuthenticationFlowBindingOverrides, getBaseUrl, getClientAuthenticatorType, getClientId, getClientScopes, getConsentScreenText, getDescription, getDynamicClientScope, getId, getManagementUrl, getName, getNodeReRegistrationTimeout, getNotBefore, getProtocol, getRealm, getRedirectUris, getRegisteredNodes, getRegistrationToken, getRootUrl, getSecret, getWebOrigins, isAlwaysDisplayInConsole, isBearerOnly, isConsentRequired, isDirectAccessGrantsEnabled, isDisplayOnConsentScreen, isEnabled, isFrontchannelLogout, isFullScopeAllowed, isImplicitFlowEnabled, isPublicClient, isServiceAccountsEnabled, isStandardFlowEnabled, isSurrogateAuthRequired, registerNode, removeAttribute, removeAuthenticationFlowBindingOverride, removeClientScope, removeRedirectUri, removeWebOrigin, setAlwaysDisplayInConsole, setAttribute, setAuthenticationFlowBindingOverride, setBaseUrl, setBearerOnly, setClientAuthenticatorType, setClientId, setConsentRequired, setDescription, setDirectAccessGrantsEnabled, setEnabled, setFrontchannelLogout, setFullScopeAllowed, setImplicitFlowEnabled, setManagementUrl, setName, setNodeReRegistrationTimeout, setNotBefore, setProtocol, setPublicClient, setRedirectUris, setRegistrationToken, setRootUrl, setSecret, setServiceAccountsEnabled, setStandardFlowEnabled, setSurrogateAuthRequired, setWebOrigins, unregisterNode, updateClient, validateSecret`

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

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

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

      `addProtocolMapper, getProtocolMapperById, getProtocolMapperByName, getProtocolMappers, getProtocolMappersStream, removeProtocolMapper, updateProtocolMapper`

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

      `addScopeMapping, deleteScopeMapping, getRealmScopeMappings, getScopeMappings, getScopeMappingsStream, hasScope`

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

      `addDefaultRole, getDefaultRoles, getDefaultRolesStream, getRoles, getRoles, removeDefaultRoles, searchForRoles, updateDefaultRoles`

- - ### Field Detail

    - #### session

          protected final KeycloakSession session

    - #### realm

          protected final RealmModel realm

    - #### entity

          protected final E extends AbstractEntity entity

  - ### Constructor Detail

    - #### AbstractClientModel

          public AbstractClientModel(KeycloakSession session,
                                     RealmModel realm,
                                     E entity)

  - ### Method Detail

    - #### addClientScopes

          public void addClientScopes(Set<ClientScopeModel> clientScopes,
                                      boolean defaultScope)

      Description copied from interface: `ClientModel`
      Add clientScopes with this client. Add as default scopes (if parameter 'defaultScope' is true) or optional scopes (if parameter 'defaultScope' is false)
      Specified by:
        `addClientScopes` in interface `ClientModel`

    - #### 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`

    - #### getRole

          public RoleModel getRole(String name)

      Specified by:
        `getRole` in interface `RoleContainerModel`

    - #### addRole

          public RoleModel addRole(String name)

      Specified by:
        `addRole` in interface `RoleContainerModel`

    - #### addRole

          public RoleModel addRole(String id,
                                   String name)

      Specified by:
        `addRole` in interface `RoleContainerModel`

    - #### removeRole

          public boolean removeRole(RoleModel role)

      Specified by:
        `removeRole` in interface `RoleContainerModel`

    - #### getRolesStream

          public Stream<RoleModel> getRolesStream()

      Specified by:
        `getRolesStream` in interface `RoleContainerModel`

    - #### getRolesStream

          public Stream<RoleModel> getRolesStream(Integer firstResult,
                                                  Integer maxResults)

      Specified by:
        `getRolesStream` in interface `RoleContainerModel`

    - #### searchForRolesStream

          public Stream<RoleModel> searchForRolesStream(String search,
                                                        Integer first,
                                                        Integer max)

      Specified by:
        `searchForRolesStream` in interface `RoleContainerModel`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

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