org.keycloak.models.mongo.keycloak.adapters

## Class ClientAdapter<T extends MongoIdentifiableEntity>

- java.lang.Object
- - org.keycloak.models.mongo.keycloak.adapters.AbstractMongoAdapter<T>
  - - org.keycloak.models.mongo.keycloak.adapters.ClientAdapter<T>

- All Implemented Interfaces:
    ClientModel
  Direct Known Subclasses:
    ApplicationAdapter, OAuthClientAdapter

      public abstract class ClientAdapter<T extends MongoIdentifiableEntity>
      extends AbstractMongoAdapter<T>
      implements ClientModel

  Author:
    Marek Posolda

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected T` | `clientEntity`
    `protected KeycloakSession` | `session`

    - ### Fields inherited from class org.keycloak.models.mongo.keycloak.adapters.AbstractMongoAdapter

      `invocationContext`

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

      `PRIVATE_KEY, PUBLIC_KEY, X509CERTIFICATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientAdapter(KeycloakSession session, RealmModel realm, T clientEntity, MongoStoreInvocationContext invContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRedirectUri(String redirectUri)`
    `void` | `addScopeMapping(RoleModel role)`
    `void` | `addWebOrigin(String webOrigin)`
    `void` | `deleteScopeMapping(RoleModel role)`
    `long` | `getAllowedClaimsMask()`
    `String` | `getAttribute(String name)`
    `Map<String,String>` | `getAttributes()`
    `String` | `getClientId()` String exposed to outside world
    `String` | `getId()` Internal database key
    `T` | `getMongoEntity()`
    `ClientEntity` | `getMongoEntityAsClient()`
    `int` | `getNotBefore()` Time in seconds since epoc
    `String` | `getProtocol()`
    `RealmModel` | `getRealm()`
    `Set<RoleModel>` | `getRealmScopeMappings()`
    `Set<String>` | `getRedirectUris()`
    `Set<RoleModel>` | `getScopeMappings()`
    `String` | `getSecret()`
    `Set<String>` | `getWebOrigins()`
    `boolean` | `hasScope(RoleModel role)`
    `boolean` | `isEnabled()`
    `boolean` | `isFullScopeAllowed()`
    `boolean` | `isPublicClient()`
    `void` | `removeAttribute(String name)`
    `void` | `removeRedirectUri(String redirectUri)`
    `void` | `removeWebOrigin(String webOrigin)`
    `void` | `setAllowedClaimsMask(long mask)`
    `void` | `setAttribute(String name, String value)`
    `void` | `setEnabled(boolean enabled)`
    `void` | `setFullScopeAllowed(boolean value)`
    `void` | `setNotBefore(int notBefore)`
    `void` | `setProtocol(String protocol)`
    `void` | `setPublicClient(boolean flag)`
    `void` | `setRedirectUris(Set<String> redirectUris)`
    `void` | `setSecret(String secret)`
    `void` | `setWebOrigins(Set<String> webOrigins)`
    `boolean` | `validateSecret(String secret)`

    - ### Methods inherited from class org.keycloak.models.mongo.keycloak.adapters.AbstractMongoAdapter

      `equals, getMongoStore, hashCode, updateMongoEntity`

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

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

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

      `isDirectGrantsOnly, setDirectGrantsOnly`

- - ### Field Detail

    - #### clientEntity

          protected final T extends MongoIdentifiableEntity clientEntity

    - #### session

          protected KeycloakSession session

  - ### Constructor Detail

    - #### ClientAdapter

          public ClientAdapter(KeycloakSession session,
                       RealmModel realm,
                       T clientEntity,
                       MongoStoreInvocationContext invContext)

  - ### Method Detail

    - #### getMongoEntity

          public T getMongoEntity()

      Specified by:
        `getMongoEntity` in class `AbstractMongoAdapter<T extends MongoIdentifiableEntity>`

    - #### getMongoEntityAsClient

          public ClientEntity getMongoEntityAsClient()

    - #### getId

          public String getId()

      Description copied from interface: `ClientModel`
      Internal database key
      Specified by:
        `getId` in interface `ClientModel`
      Returns:

    - #### getClientId

          public String getClientId()

      Description copied from interface: `ClientModel`
      String exposed to outside world
      Specified by:
        `getClientId` in interface `ClientModel`
      Returns:

    - #### getAllowedClaimsMask

          public long getAllowedClaimsMask()

      Specified by:
        `getAllowedClaimsMask` in interface `ClientModel`

    - #### setAllowedClaimsMask

          public void setAllowedClaimsMask(long mask)

      Specified by:
        `setAllowedClaimsMask` in interface `ClientModel`

    - #### getWebOrigins

          public Set<String> getWebOrigins()

      Specified by:
        `getWebOrigins` in interface `ClientModel`

    - #### setWebOrigins

          public void setWebOrigins(Set<String> webOrigins)

      Specified by:
        `setWebOrigins` in interface `ClientModel`

    - #### addWebOrigin

          public void addWebOrigin(String webOrigin)

      Specified by:
        `addWebOrigin` in interface `ClientModel`

    - #### removeWebOrigin

          public void removeWebOrigin(String webOrigin)

      Specified by:
        `removeWebOrigin` in interface `ClientModel`

    - #### getRedirectUris

          public Set<String> getRedirectUris()

      Specified by:
        `getRedirectUris` in interface `ClientModel`

    - #### setRedirectUris

          public void setRedirectUris(Set<String> redirectUris)

      Specified by:
        `setRedirectUris` in interface `ClientModel`

    - #### addRedirectUri

          public void addRedirectUri(String redirectUri)

      Specified by:
        `addRedirectUri` in interface `ClientModel`

    - #### removeRedirectUri

          public void removeRedirectUri(String redirectUri)

      Specified by:
        `removeRedirectUri` in interface `ClientModel`

    - #### isEnabled

          public boolean isEnabled()

      Specified by:
        `isEnabled` in interface `ClientModel`

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Specified by:
        `setEnabled` in interface `ClientModel`

    - #### validateSecret

          public boolean validateSecret(String secret)

      Specified by:
        `validateSecret` in interface `ClientModel`

    - #### getSecret

          public String getSecret()

      Specified by:
        `getSecret` in interface `ClientModel`

    - #### setSecret

          public void setSecret(String secret)

      Specified by:
        `setSecret` in interface `ClientModel`

    - #### isPublicClient

          public boolean isPublicClient()

      Specified by:
        `isPublicClient` in interface `ClientModel`

    - #### setPublicClient

          public void setPublicClient(boolean flag)

      Specified by:
        `setPublicClient` in interface `ClientModel`

    - #### isFullScopeAllowed

          public boolean isFullScopeAllowed()

      Specified by:
        `isFullScopeAllowed` in interface `ClientModel`

    - #### setFullScopeAllowed

          public void setFullScopeAllowed(boolean value)

      Specified by:
        `setFullScopeAllowed` in interface `ClientModel`

    - #### getRealm

          public RealmModel getRealm()

      Specified by:
        `getRealm` in interface `ClientModel`

    - #### getNotBefore

          public int getNotBefore()

      Description copied from interface: `ClientModel`
      Time in seconds since epoc
      Specified by:
        `getNotBefore` in interface `ClientModel`
      Returns:

    - #### setNotBefore

          public void setNotBefore(int notBefore)

      Specified by:
        `setNotBefore` in interface `ClientModel`

    - #### getScopeMappings

          public Set<RoleModel> getScopeMappings()

      Specified by:
        `getScopeMappings` in interface `ClientModel`

    - #### getRealmScopeMappings

          public Set<RoleModel> getRealmScopeMappings()

      Specified by:
        `getRealmScopeMappings` in interface `ClientModel`

    - #### hasScope

          public boolean hasScope(RoleModel role)

      Specified by:
        `hasScope` in interface `ClientModel`

    - #### addScopeMapping

          public void addScopeMapping(RoleModel role)

      Specified by:
        `addScopeMapping` in interface `ClientModel`

    - #### deleteScopeMapping

          public void deleteScopeMapping(RoleModel role)

      Specified by:
        `deleteScopeMapping` in interface `ClientModel`

    - #### getProtocol

          public String getProtocol()

      Specified by:
        `getProtocol` in interface `ClientModel`

    - #### setProtocol

          public void setProtocol(String protocol)

      Specified by:
        `setProtocol` in interface `ClientModel`

    - #### setAttribute

          public void setAttribute(String name,
                          String value)

      Specified by:
        `setAttribute` in interface `ClientModel`

    - #### removeAttribute

          public void removeAttribute(String name)

      Specified by:
        `removeAttribute` in interface `ClientModel`

    - #### getAttribute

          public String getAttribute(String name)

      Specified by:
        `getAttribute` in interface `ClientModel`

    - #### getAttributes

          public Map<String,String> getAttributes()

      Specified by:
        `getAttributes` in interface `ClientModel`

Copyright © 2015. All Rights Reserved.