Class DefaultingPurpose<S extends Secret>

java.lang.Object
org.forgerock.openam.secrets.DefaultingPurpose<S>
Type Parameters:
S - The type of the secret.

@EvolvingAll public final class DefaultingPurpose<S extends Secret> extends Object
A purpose that can fallback to a default secret ID if the first - more specific - secret ID could not be found in the secrets provider.
Since:
AM 6.5.0
  • Constructor Details

    • DefaultingPurpose

      public DefaultingPurpose(Purpose<S> defaultPurpose, String customSecretId)
      Creates a new defaulting purpose.
      Parameters:
      defaultPurpose - The default purpose to use if the custom purpose is not available in the secrets provider.
      customSecretId - The instance specific secret ID to use if available. The ID must contain %s.
  • Method Details

    • getCustomPurpose

      public Purpose<S> getCustomPurpose(String instanceId)
      Returns the instance specific purpose.
      Parameters:
      instanceId - The instance ID to include in the secret ID.
      Returns:
      The instance specific purpose.
    • getDefaultPurpose

      public Purpose<S> getDefaultPurpose()
      Returns the default purpose.
      Returns:
      The default purpose.