Class OAuth2ThingsConfig

java.lang.Object
org.forgerock.am.iot.OAuth2ThingsConfig

@Singleton public class OAuth2ThingsConfig extends Object
This class provides the configuration for OAuth2 Things. It listens for changes in the IoT Service configuration and notifies listeners when the configuration changes.
  • Constructor Details

    • OAuth2ThingsConfig

      @Inject public OAuth2ThingsConfig(org.forgerock.openam.oauth2.OAuth2ProviderConfig oauth2ProviderConfig, com.iplanet.am.util.SystemPropertiesWrapper systemProperties)
  • Method Details

    • addStateChangeListener

      public void addStateChangeListener(BiConsumer<OAuth2ThingsConfig.ConfigState,OAuth2ThingsConfig.ConfigState> consumer)
      Adds a listener that will be notified when the configuration for the given realm changes.
      Parameters:
      consumer - the consumer of the old and new config state
    • removeStateChangeListener

      public void removeStateChangeListener(BiConsumer<OAuth2ThingsConfig.ConfigState,OAuth2ThingsConfig.ConfigState> consumer)
      Removes a listener that was previously added.
      Parameters:
      consumer - the consumer to be removed
    • isOAuth2ThingsEnabled

      public boolean isOAuth2ThingsEnabled()
      Returns whether OAuth2 Machines is enabled for the given realm.
      Returns:
      true if OAuth2 Machines is enabled, false otherwise
    • getOAuth2ThingsDataStore

      public Optional<String> getOAuth2ThingsDataStore(Realm realm)
      Returns the data store for OAuth2 Machines for the given realm.
      Parameters:
      realm - the realm to check
      Returns:
      the data store for OAuth2 Machines, or Optional.empty() if not set
    • getOAuth2ThingsDn

      public Optional<String> getOAuth2ThingsDn(Realm realm)
      Returns the DN for OAuth2 Machines for the given realm.
      Parameters:
      realm - the realm to check
      Returns:
      the DN for OAuth2 Machines, or Optional.empty() if not set
    • getOAuth2ThingsNamingAttribute

      public Optional<String> getOAuth2ThingsNamingAttribute(Realm realm)
      Returns the naming attribute for OAuth2 Machines for the given realm.
      Parameters:
      realm - the realm to check
      Returns:
      the naming attribute for OAuth2 Machines, or Optional.empty() if not set
    • getOAuth2ThingsIdentityObjectName

      public Optional<String> getOAuth2ThingsIdentityObjectName(Realm realm)
      Returns the identity object name for OAuth2 Machines for the given realm.
      Parameters:
      realm - the realm to check
      Returns:
      the identity object name for OAuth2 Machines, or Optional.empty() if not set