Package org.forgerock.openig.tools.am
Class AmService.Builder
- java.lang.Object
-
- org.forgerock.openig.tools.am.AmService.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AmService.Builder
authenticationService(AuthenticationService authenticationService)
Bind aAuthenticationService
instance to this builder.AmService
build()
Returns a newAmService
instance.AmService.Builder
cookieName(String cookieName)
Set the cookie/header name and returns this builder.AmService.Builder
enableNotifications(boolean enabled)
Enable or disable the notifications.AmService.Builder
notificationClientProvider(WebSocketClientProvider notificationClientProvider)
Specifies theWebSocketClientProvider
to use to manage notifications.AmService.Builder
notificationService(NotificationService notificationService)
Bind aNotificationService
instance to this builder.AmService.Builder
notificationServiceConnectionAttempts(Integer initialConnectionAttempts)
Specifies the number of Websocket connection attempts to try before failing the AmService creation.AmService.Builder
notificationServiceReconnectDelay(Duration delay)
Specifies the delay to wait between connection re-establishments when web-socket connection is lost (or cannot be acquired at startup).AmService.Builder
notificationServiceTls(ClientTlsOptions tlsOptions)
Specifies the TLS options to use for establishing a connection to the Web-socket endpoint.AmService.Builder
realm(String realm)
Set the realm and returns this builder.AmService.Builder
realm(Realm realm)
Set the realm and returns this builder.AmService.Builder
sessionCache(com.github.benmanes.caffeine.cache.Caffeine<Object,Object> caffeine, Duration maximumTimeout, DisconnectionStrategy disconnectionStrategy)
Specifies theCaffeine
cache for theCacheSessionService
.AmService.Builder
sessionIdleRefresh(boolean enabled, Duration interval)
Enable or disable the session idle refresh service and set the refresh interval.AmService.Builder
sessionProperties(Set<String> sessionProperties)
Set the session properties and return this builder.AmService.Builder
sessionService(SessionService sessionService)
Bind aSessionService
instance to this builder.AmService.Builder
uriService(UriService uriService)
Bind aUriService
instance to this builder.AmService.Builder
version(String version)
Set the version and returns this builder.AmService.Builder
version(Version version)
Set the version and returns this builder.
-
-
-
Method Detail
-
realm
public AmService.Builder realm(String realm)
Set the realm and returns this builder.- Parameters:
realm
- The realm to use, such as finances. Default is 'root' (or '/') if this parameter is set tonull
.- Returns:
- this builder
-
realm
public AmService.Builder realm(Realm realm)
Set the realm and returns this builder.- Parameters:
realm
- The realm to use, such as finances. Default is root realm (named '/') if this parameter is set tonull
.- Returns:
- this builder
-
cookieName
public AmService.Builder cookieName(String cookieName)
Set the cookie/header name and returns this builder.- Parameters:
cookieName
- The cookie/header name to use with this server. Default is to query AM if this parameter is set tonull
.- Returns:
- this builder
-
enableNotifications
public AmService.Builder enableNotifications(boolean enabled)
Enable or disable the notifications.- Parameters:
enabled
-true
if the notifications should be enabled orfalse
otherwise.- Returns:
- this builder.
-
sessionIdleRefresh
public AmService.Builder sessionIdleRefresh(boolean enabled, Duration interval)
Enable or disable the session idle refresh service and set the refresh interval.- Parameters:
enabled
-true
if the session idle refresh should be enabled orfalse
otherwise.interval
- The interval between session idle refresh requests, when session idle refresh is enabled.- Returns:
- this builder.
-
version
public AmService.Builder version(String version)
Set the version and returns this builder.- Parameters:
version
- The version of OpenAM that this instance represents. Default isAmService.DEFAULT_AM_VERSION
if this parameter is set tonull
.- Returns:
- this builder
-
version
public AmService.Builder version(Version version)
Set the version and returns this builder.- Parameters:
version
- The version of OpenAM/AM that this instance represents. Default isAmService.DEFAULT_AM_VERSION
if this parameter is set tonull
.- Returns:
- this builder
-
sessionCache
public AmService.Builder sessionCache(com.github.benmanes.caffeine.cache.Caffeine<Object,Object> caffeine, Duration maximumTimeout, DisconnectionStrategy disconnectionStrategy)
Specifies theCaffeine
cache for theCacheSessionService
. If the cache is set tonull
, no cache will be used.- Parameters:
caffeine
- TheCaffeine
cache. If thecache
isnull
, 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
public AmService.Builder sessionService(SessionService sessionService)
Bind aSessionService
instance to this builder.- Parameters:
sessionService
- service to be bound- Returns:
- this Builder
-
sessionProperties
public AmService.Builder sessionProperties(Set<String> 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.
-
authenticationService
public AmService.Builder authenticationService(AuthenticationService authenticationService)
Bind aAuthenticationService
instance to this builder.- Parameters:
authenticationService
- service to be bound- Returns:
- this Builder
-
uriService
public AmService.Builder uriService(UriService uriService)
Bind aUriService
instance to this builder.- Parameters:
uriService
- service to be bound- Returns:
- this Builder
-
notificationServiceReconnectDelay
public AmService.Builder notificationServiceReconnectDelay(Duration delay)
Specifies the delay to wait between connection re-establishments when web-socket connection is lost (or cannot be acquired at startup).- Parameters:
delay
- reconnection delay used when notification service is disconnected- Returns:
- this builder.
-
notificationServiceConnectionAttempts
public AmService.Builder notificationServiceConnectionAttempts(Integer initialConnectionAttempts)
Specifies the number of Websocket connection attempts to try before failing the AmService creation.- Parameters:
initialConnectionAttempts
- number of retries allowed to set up the first connection to the notification service- Returns:
- this builder.
-
notificationServiceTls
public AmService.Builder notificationServiceTls(ClientTlsOptions tlsOptions)
Specifies the TLS options to use for establishing a connection to the Web-socket endpoint.- Parameters:
tlsOptions
- options to use when establishing secure connection to the WS endpoint- Returns:
- this builder.
-
notificationClientProvider
public AmService.Builder notificationClientProvider(WebSocketClientProvider notificationClientProvider)
Specifies theWebSocketClientProvider
to use to manage notifications.- Parameters:
notificationClientProvider
- service provider for service to be bound- Returns:
- this builder.
-
notificationService
public AmService.Builder notificationService(NotificationService notificationService)
Bind aNotificationService
instance to this builder.- Parameters:
notificationService
- service to be bound- Returns:
- this Builder
-
-