Package org.forgerock.am.iot
Class OAuth2ThingsConfig
java.lang.Object
org.forgerock.am.iot.OAuth2ThingsConfig
This class provides the configuration for OAuth2 Things. It listens for changes in the IoT Service configuration and
notifies listeners when the configuration changes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents the OAuth2Things configuration state for a realm. -
Constructor Summary
ConstructorsConstructorDescriptionOAuth2ThingsConfig
(org.forgerock.openam.oauth2.OAuth2ProviderConfig oauth2ProviderConfig, com.iplanet.am.util.SystemPropertiesWrapper systemProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStateChangeListener
(BiConsumer<OAuth2ThingsConfig.ConfigState, OAuth2ThingsConfig.ConfigState> consumer) Adds a listener that will be notified when the configuration for the given realm changes.getOAuth2ThingsDataStore
(Realm realm) Returns the data store for OAuth2 Machines for the given realm.getOAuth2ThingsDn
(Realm realm) Returns the DN for OAuth2 Machines for the given realm.Returns the identity object name for OAuth2 Machines for the given realm.Returns the naming attribute for OAuth2 Machines for the given realm.boolean
Returns whether OAuth2 Machines is enabled for the given realm.void
removeStateChangeListener
(BiConsumer<OAuth2ThingsConfig.ConfigState, OAuth2ThingsConfig.ConfigState> consumer) Removes a listener that was previously added.
-
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
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
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
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
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
-