Package org.forgerock.openig.tools.am
Class AmService.Builder
java.lang.Object
org.forgerock.openig.tools.am.AmService.Builder
- Enclosing class:
- AmService
Builder of
AmService.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(Handler amHandler, Clock clock, String agentId, String cookieName, AmVersion version, UriService uriService, AsyncRefreshableSupplier<SsoToken, AuthenticationException> tokenProvider, org.forgerock.openig.tracing.TracingProvider tracingProvider) Create a Builder instance with every mandatory parameters. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newAmServiceinstance.notification(NotificationsConfig config) Specifies the notification configurations.notificationService(NotificationService notificationService) Bind aNotificationServiceinstance to this builder.sessionCache(com.github.benmanes.caffeine.cache.Caffeine<Object, Object> caffeine, Duration maximumTimeout, DisconnectionStrategy disconnectionStrategy) Specifies theCaffeinecache for theCacheSessionService.sessionIdleRefresh(boolean enabled, Duration interval) Enable or disable the session idle refresh service and set the refresh interval.sessionProperties(Set<String> sessionProperties) Set the session properties and return this builder.sessionService(SessionService sessionService) Bind aSessionServiceinstance to this builder.
-
Constructor Details
-
Builder
public Builder(Handler amHandler, Clock clock, String agentId, String cookieName, AmVersion version, UriService uriService, AsyncRefreshableSupplier<SsoToken, AuthenticationException> tokenProvider, org.forgerock.openig.tracing.TracingProvider tracingProvider) Create a Builder instance with every mandatory parameters.- Parameters:
amHandler- the Handler to use to query AMclock- the clock to useagentId- the ID identifying this AMService instance as an agentcookieName- the AM session cookie nameversion- the AM versionuriService- the URI service to usetokenProvider- an AM token providertracingProvider- theTracingProviderto use when working with AM.
-
-
Method Details
-
sessionIdleRefresh
Enable or disable the session idle refresh service and set the refresh interval.- Parameters:
enabled-trueif the session idle refresh should be enabled orfalseotherwise.interval- The interval between session idle refresh requests, when session idle refresh is enabled.- Returns:
- this builder.
-
sessionCache
public AmService.Builder sessionCache(com.github.benmanes.caffeine.cache.Caffeine<Object, Object> caffeine, Duration maximumTimeout, DisconnectionStrategy disconnectionStrategy) Specifies theCaffeinecache for theCacheSessionService. If the cache is set tonull, no cache will be used.- Parameters:
caffeine- TheCaffeinecache. If thecacheisnull, then the cache will be disabled.maximumTimeout- The maximum time to cache a session; can benull.disconnectionStrategy- The strategy to apply in case of notifications' disconnection.- Returns:
- this builder.
-
sessionService
Bind aSessionServiceinstance to this builder.- Parameters:
sessionService- service to be bound- Returns:
- this Builder
-
sessionProperties
Set the session properties and return this builder.- Parameters:
sessionProperties- The session properties that will be requested from the sessionInfo endpoint of the session service.- Returns:
- this builder.
-
notification
Specifies the notification configurations. If not used the notifications are considered disabled.- Parameters:
config- the notifications configurations- Returns:
- this builder.
-
notificationService
Bind aNotificationServiceinstance to this builder.- Parameters:
notificationService- service to be bound- Returns:
- this Builder
-
build
Returns a newAmServiceinstance.- Returns:
- a new
AmServiceinstance.
-