org.keycloak.models.cache

## Class ApplicationAdapter

- java.lang.Object
- - org.keycloak.models.cache.ClientAdapter
  - - org.keycloak.models.cache.ApplicationAdapter

- All Implemented Interfaces:
    ApplicationModel, ClientModel, RoleContainerModel

      public class ApplicationAdapter
      extends ClientAdapter
      implements ApplicationModel

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CachedApplication` | `cached`
    `protected ApplicationModel` | `updated`

    - ### Fields inherited from class org.keycloak.models.cache.ClientAdapter

      `cache, cachedClient, cachedRealm, cacheSession, updatedClient`

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

      `PRIVATE_KEY, PUBLIC_KEY, X509CERTIFICATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationAdapter(RealmModel cachedRealm, CachedApplication cached, CacheRealmProvider cacheSession, RealmCache cache)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDefaultRole(String name)`
    `RoleModel` | `addRole(String name)`
    `RoleModel` | `addRole(String id, String name)`
    `boolean` | `equals(Object o)`
    `Set<RoleModel>` | `getApplicationScopeMappings(ClientModel client)`
    `String` | `getBaseUrl()`
    `String` | `getClientId()` String exposed to outside world
    `List<String>` | `getDefaultRoles()`
    `protected void` | `getDelegateForUpdate()`
    `String` | `getManagementUrl()`
    `String` | `getName()`
    `int` | `getNodeReRegistrationTimeout()`
    `Map<String,Integer>` | `getRegisteredNodes()`
    `RoleModel` | `getRole(String name)`
    `Set<RoleModel>` | `getRoles()`
    `int` | `hashCode()`
    `boolean` | `hasScope(RoleModel role)`
    `boolean` | `isBearerOnly()`
    `boolean` | `isSurrogateAuthRequired()`
    `void` | `registerNode(String nodeHost, int registrationTime)` Register node or just update the 'lastReRegistration' time if this node is already registered
    `boolean` | `removeRole(RoleModel role)`
    `void` | `setBaseUrl(String url)`
    `void` | `setBearerOnly(boolean only)`
    `void` | `setManagementUrl(String url)`
    `void` | `setName(String name)`
    `void` | `setNodeReRegistrationTimeout(int timeout)`
    `void` | `setSurrogateAuthRequired(boolean surrogateAuthRequired)`
    `void` | `unregisterNode(String nodeHost)`
    `void` | `updateApplication()`
    `void` | `updateDefaultRoles(String[] defaultRoles)`

    - ### Methods inherited from class org.keycloak.models.cache.ClientAdapter

      `addRedirectUri, addScopeMapping, addWebOrigin, deleteScopeMapping, getAllowedClaimsMask, getAttribute, getAttributes, getId, getNotBefore, getProtocol, getRealm, getRealmScopeMappings, getRedirectUris, getScopeMappings, getSecret, getWebOrigins, isDirectGrantsOnly, isEnabled, isFullScopeAllowed, isPublicClient, removeAttribute, removeRedirectUri, removeWebOrigin, setAllowedClaimsMask, setAttribute, setDirectGrantsOnly, setEnabled, setFullScopeAllowed, setNotBefore, setProtocol, setPublicClient, setRedirectUris, setSecret, setWebOrigins, validateSecret`

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

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

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

      `addRedirectUri, addScopeMapping, addWebOrigin, deleteScopeMapping, getAllowedClaimsMask, getAttribute, getAttributes, getId, getNotBefore, getProtocol, getRealm, getRealmScopeMappings, getRedirectUris, getScopeMappings, getSecret, getWebOrigins, isDirectGrantsOnly, isEnabled, isFullScopeAllowed, isPublicClient, removeAttribute, removeRedirectUri, removeWebOrigin, setAllowedClaimsMask, setAttribute, setDirectGrantsOnly, setEnabled, setFullScopeAllowed, setNotBefore, setProtocol, setPublicClient, setRedirectUris, setSecret, setWebOrigins, validateSecret`

- - ### Field Detail

    - #### updated

          protected ApplicationModel updated

    - #### cached

          protected CachedApplication cached

  - ### Constructor Detail

    - #### ApplicationAdapter

          public ApplicationAdapter(RealmModel cachedRealm,
                            CachedApplication cached,
                            CacheRealmProvider cacheSession,
                            RealmCache cache)

  - ### Method Detail

    - #### getDelegateForUpdate

          protected void getDelegateForUpdate()

      Specified by:
        `getDelegateForUpdate` in class `ClientAdapter`

    - #### updateApplication

          public void updateApplication()

      Specified by:
        `updateApplication` in interface `ApplicationModel`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `ApplicationModel`

    - #### getClientId

          public String getClientId()

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

    - #### setName

          public void setName(String name)

      Specified by:
        `setName` in interface `ApplicationModel`

    - #### isSurrogateAuthRequired

          public boolean isSurrogateAuthRequired()

      Specified by:
        `isSurrogateAuthRequired` in interface `ApplicationModel`

    - #### setSurrogateAuthRequired

          public void setSurrogateAuthRequired(boolean surrogateAuthRequired)

      Specified by:
        `setSurrogateAuthRequired` in interface `ApplicationModel`

    - #### getManagementUrl

          public String getManagementUrl()

      Specified by:
        `getManagementUrl` in interface `ApplicationModel`

    - #### setManagementUrl

          public void setManagementUrl(String url)

      Specified by:
        `setManagementUrl` in interface `ApplicationModel`

    - #### getBaseUrl

          public String getBaseUrl()

      Specified by:
        `getBaseUrl` in interface `ApplicationModel`

    - #### setBaseUrl

          public void setBaseUrl(String url)

      Specified by:
        `setBaseUrl` in interface `ApplicationModel`

    - #### getDefaultRoles

          public List<String> getDefaultRoles()

      Specified by:
        `getDefaultRoles` in interface `ApplicationModel`

    - #### addDefaultRole

          public void addDefaultRole(String name)

      Specified by:
        `addDefaultRole` in interface `ApplicationModel`

    - #### updateDefaultRoles

          public void updateDefaultRoles(String[] defaultRoles)

      Specified by:
        `updateDefaultRoles` in interface `ApplicationModel`

    - #### getApplicationScopeMappings

          public Set<RoleModel> getApplicationScopeMappings(ClientModel client)

      Specified by:
        `getApplicationScopeMappings` in interface `ApplicationModel`

    - #### isBearerOnly

          public boolean isBearerOnly()

      Specified by:
        `isBearerOnly` in interface `ApplicationModel`

    - #### setBearerOnly

          public void setBearerOnly(boolean only)

      Specified by:
        `setBearerOnly` in interface `ApplicationModel`

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

    - #### getRoles

          public Set<RoleModel> getRoles()

      Specified by:
        `getRoles` in interface `RoleContainerModel`

    - #### getNodeReRegistrationTimeout

          public int getNodeReRegistrationTimeout()

      Specified by:
        `getNodeReRegistrationTimeout` in interface `ApplicationModel`

    - #### setNodeReRegistrationTimeout

          public void setNodeReRegistrationTimeout(int timeout)

      Specified by:
        `setNodeReRegistrationTimeout` in interface `ApplicationModel`

    - #### getRegisteredNodes

          public Map<String,Integer> getRegisteredNodes()

      Specified by:
        `getRegisteredNodes` in interface `ApplicationModel`

    - #### registerNode

          public void registerNode(String nodeHost,
                          int registrationTime)

      Description copied from interface: `ApplicationModel`
      Register node or just update the 'lastReRegistration' time if this node is already registered
      Specified by:
        `registerNode` in interface `ApplicationModel`

    - #### unregisterNode

          public void unregisterNode(String nodeHost)

      Specified by:
        `unregisterNode` in interface `ApplicationModel`

    - #### hasScope

          public boolean hasScope(RoleModel role)

      Specified by:
        `hasScope` in interface `ClientModel`
      Overrides:
        `hasScope` in class `ClientAdapter`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2015. All Rights Reserved.