org.keycloak.adapters

## Class AdapterDeploymentContext

- java.lang.Object
- - org.keycloak.adapters.AdapterDeploymentContext

-     public class AdapterDeploymentContext
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `AdapterDeploymentContext.DeploymentDelegate` This delegate is used to store temporary, per-request metadata like request resolved URLs.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected KeycloakConfigResolver` | `configResolver`
    `protected KeycloakDeployment` | `deployment`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdapterDeploymentContext()`
    `AdapterDeploymentContext(KeycloakConfigResolver configResolver)` For multi-tenant deployments, this constructor is to be used, as a KeycloakDeployment is not known at deployment time.
    `AdapterDeploymentContext(KeycloakDeployment deployment)` For single-tenant deployments, this constructor is to be used, as a full KeycloakDeployment is known at deployment time and won't change during the application deployment's life cycle.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `close(org.apache.http.HttpResponse response)`
    `protected KeycloakUriBuilder` | `getBaseBuilder(HttpFacade facade, String base)`
    `KeycloakDeployment` | `resolveDeployment(HttpFacade facade)` For single-tenant deployments, it complements KeycloakDeployment by resolving a relative Auth Server's URL based on the current request and, if needed, will lazily resolve the Realm's Public Key.
    `void` | `resolveRealmKey(KeycloakDeployment deployment)`
    `protected KeycloakDeployment` | `resolveUrls(KeycloakDeployment deployment, HttpFacade facade)`
    `void` | `updateDeployment(AdapterConfig config)`

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

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

- - ### Field Detail

    - #### deployment

          protected KeycloakDeployment deployment

    - #### configResolver

          protected KeycloakConfigResolver configResolver

  - ### Constructor Detail

    - #### AdapterDeploymentContext

          public AdapterDeploymentContext()

    - #### AdapterDeploymentContext

          public AdapterDeploymentContext(KeycloakDeployment deployment)

      For single-tenant deployments, this constructor is to be used, as a full KeycloakDeployment is known at deployment time and won't change during the application deployment's life cycle.
      Parameters:
        `deployment` - A KeycloakConfigResolver, possibly missing the Auth Server URL and/or Realm Public Key

    - #### AdapterDeploymentContext

          public AdapterDeploymentContext(KeycloakConfigResolver configResolver)

      For multi-tenant deployments, this constructor is to be used, as a KeycloakDeployment is not known at deployment time. It defers the resolution of a KeycloakDeployment to a KeycloakConfigResolver, to be implemented by the target application.
      Parameters:
        `configResolver` - A KeycloakConfigResolver that will be used to resolve a KeycloakDeployment

  - ### Method Detail

    - #### resolveDeployment

          public KeycloakDeployment resolveDeployment(HttpFacade facade)

      For single-tenant deployments, it complements KeycloakDeployment by resolving a relative Auth Server's URL based on the current request and, if needed, will lazily resolve the Realm's Public Key. For multi-tenant deployments, defers the resolution of KeycloakDeployment to the KeycloakConfigResolver .
      Parameters:
        `facade` - the Request/Response FaÃ§ade , used to either determine the Auth Server URL (single tenant) or pass thru to the KeycloakConfigResolver.
      Returns:

    - #### resolveUrls

          protected KeycloakDeployment resolveUrls(KeycloakDeployment deployment,
                                       HttpFacade facade)

    - #### resolveRealmKey

          public void resolveRealmKey(KeycloakDeployment deployment)

    - #### getBaseBuilder

          protected KeycloakUriBuilder getBaseBuilder(HttpFacade facade,
                                          String base)

    - #### close

          protected void close(org.apache.http.HttpResponse response)

    - #### updateDeployment

          public void updateDeployment(AdapterConfig config)

Copyright © 2014. All Rights Reserved.