org.keycloak.models.jpa

## Class ApplicationAdapter

- java.lang.Object
- - org.keycloak.models.jpa.ClientAdapter
  - - org.keycloak.models.jpa.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 ApplicationEntity` | `applicationEntity`
    `protected javax.persistence.EntityManager` | `em`
    `protected KeycloakSession` | `session`

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

      `entity, realm`

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

      `PRIVATE_KEY, PUBLIC_KEY, X509CERTIFICATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationAdapter(RealmModel realm, javax.persistence.EntityManager em, KeycloakSession session, ApplicationEntity applicationEntity)`

  - ### 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()`
    `List<String>` | `getDefaultRoles()`
    `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` | `isDirectGrantsOnly()`
    `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 roleModel)`
    `void` | `setBaseUrl(String url)`
    `void` | `setBearerOnly(boolean only)`
    `void` | `setDirectGrantsOnly(boolean flag)`
    `void` | `setManagementUrl(String url)`
    `void` | `setName(String name)`
    `void` | `setNodeReRegistrationTimeout(int timeout)`
    `void` | `setSurrogateAuthRequired(boolean surrogateAuthRequired)`
    `String` | `toString()`
    `void` | `unregisterNode(String nodeHost)`
    `void` | `updateApplication()`
    `void` | `updateDefaultRoles(String[] defaultRoles)`

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

      `addProtocolMapper, addRedirectUri, addScopeMapping, addWebOrigin, contains, deleteScopeMapping, entityToModel, getAttribute, getAttributes, getClientId, getEntity, getId, getIdentityProviders, getNotBefore, getProtocol, getProtocolMapperById, getProtocolMapperByName, getProtocolMapperEntity, getProtocolMapperEntityByName, getProtocolMappers, getRealm, getRealmScopeMappingQuery, getRealmScopeMappings, getRedirectUris, getScopeMappings, getSecret, getWebOrigins, isAllowedRetrieveTokenFromIdentityProvider, isEnabled, isFrontchannelLogout, isFullScopeAllowed, isPublicClient, removeAttribute, removeProtocolMapper, removeRedirectUri, removeWebOrigin, setAttribute, setEnabled, setFrontchannelLogout, setFullScopeAllowed, setNotBefore, setProtocol, setPublicClient, setRedirectUris, setSecret, setWebOrigins, updateIdentityProviders, updateProtocolMapper, validateSecret`

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

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

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

      `addProtocolMapper, addRedirectUri, addScopeMapping, addWebOrigin, deleteScopeMapping, getAttribute, getAttributes, getClientId, getId, getIdentityProviders, getNotBefore, getProtocol, getProtocolMapperById, getProtocolMapperByName, getProtocolMappers, getRealm, getRealmScopeMappings, getRedirectUris, getScopeMappings, getSecret, getWebOrigins, isAllowedRetrieveTokenFromIdentityProvider, isEnabled, isFrontchannelLogout, isFullScopeAllowed, isPublicClient, removeAttribute, removeProtocolMapper, removeRedirectUri, removeWebOrigin, setAttribute, setEnabled, setFrontchannelLogout, setFullScopeAllowed, setNotBefore, setProtocol, setPublicClient, setRedirectUris, setSecret, setWebOrigins, updateIdentityProviders, updateProtocolMapper, validateSecret`

- - ### Field Detail

    - #### em

          protected javax.persistence.EntityManager em

    - #### session

          protected KeycloakSession session

    - #### applicationEntity

          protected ApplicationEntity applicationEntity

  - ### Constructor Detail

    - #### ApplicationAdapter

          public ApplicationAdapter(RealmModel realm,
                            javax.persistence.EntityManager em,
                            KeycloakSession session,
                            ApplicationEntity applicationEntity)

  - ### Method Detail

    - #### updateApplication

          public void updateApplication()

      Specified by:
        `updateApplication` in interface `ApplicationModel`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `ApplicationModel`

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

    - #### isBearerOnly

          public boolean isBearerOnly()

      Specified by:
        `isBearerOnly` in interface `ApplicationModel`

    - #### setBearerOnly

          public void setBearerOnly(boolean only)

      Specified by:
        `setBearerOnly` in interface `ApplicationModel`

    - #### isDirectGrantsOnly

          public boolean isDirectGrantsOnly()

      Specified by:
        `isDirectGrantsOnly` in interface `ClientModel`

    - #### setDirectGrantsOnly

          public void setDirectGrantsOnly(boolean flag)

      Specified by:
        `setDirectGrantsOnly` in interface `ClientModel`

    - #### 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 roleModel)

      Specified by:
        `removeRole` in interface `RoleContainerModel`

    - #### getRoles

          public Set<RoleModel> getRoles()

      Specified by:
        `getRoles` in interface `RoleContainerModel`

    - #### hasScope

          public boolean hasScope(RoleModel role)

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

    - #### getApplicationScopeMappings

          public Set<RoleModel> getApplicationScopeMappings(ClientModel client)

      Specified by:
        `getApplicationScopeMappings` 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`

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

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `ClientAdapter`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `ClientAdapter`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2015. All rights reserved.