Package org.forgerock.openig.tools.am
Class NotificationsConfig.Builder
- java.lang.Object
-
- org.forgerock.openig.tools.am.NotificationsConfig.Builder
-
- Enclosing class:
- NotificationsConfig
public static final class NotificationsConfig.Builder extends Object
Builder to ease the creation of aNotificationsConfig.
-
-
Constructor Summary
Constructors Constructor Description Builder(WebSocketClientProvider clientProvider)Create aNotificationsConfigbuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NotificationsConfigbuild()Build theNotificationsConfig.NotificationsConfig.BuilderconnectionTimeout(Duration timeout)Set the connection timeout of the websocket.NotificationsConfig.Builderheartbeat(Duration interval, ScheduledExecutorService executorService)Set the interval and executorService which will be used to send Websocket heartbeats.NotificationsConfig.BuilderidleTimeout(Duration timeout)Set the idle timeout of the Websocket connection.NotificationsConfig.BuilderinitialConnectionAttempts(int attemptCount)Set the number of retries allowed to set up the first connection to the notification service.NotificationsConfig.BuilderproxyOptions(ProxyOptions proxyOptions)Set the theProxyOptionsto use for the websocket connection.NotificationsConfig.BuilderreconnectDelay(Duration reconnectDelay)Set the reconnection delay used when notification service is disconnected.NotificationsConfig.BuilderrenewalDelay(Duration renewalDelay)Set the renewal delay of the websocket connection.NotificationsConfig.BuildertlsOptions(ClientTlsOptions tlsOptions)Set the options to use when establishing secure connection to the WS endpoint.NotificationsConfig.BuildervertxConfig(JsonValue vertxConfig)Set the vertx configuration to pass to the underlying WebSocket provider.
-
-
-
Constructor Detail
-
Builder
public Builder(WebSocketClientProvider clientProvider)
Create aNotificationsConfigbuilder.- Parameters:
clientProvider- service provider for service to be bound
-
-
Method Detail
-
heartbeat
public NotificationsConfig.Builder heartbeat(Duration interval, ScheduledExecutorService executorService)
Set the interval and executorService which will be used to send Websocket heartbeats.- Parameters:
interval- the duration between heartbeats.Duration.UNLIMITEDorDuration.ZEROdisable the feature.executorService- theScheduledExecutorServiceto use to schedule heartbeat tasks- Returns:
- this builder
-
reconnectDelay
public NotificationsConfig.Builder reconnectDelay(Duration reconnectDelay)
Set the reconnection delay used when notification service is disconnected.- Parameters:
reconnectDelay- reconnection delay used when notification service is disconnected- Returns:
- this builder
-
initialConnectionAttempts
public NotificationsConfig.Builder initialConnectionAttempts(int attemptCount)
Set the number of retries allowed to set up the first connection to the notification service.- Parameters:
attemptCount- number of retries allowed to set up the first connection to the notification service- Returns:
- this builder
-
proxyOptions
public NotificationsConfig.Builder proxyOptions(ProxyOptions proxyOptions)
Set the theProxyOptionsto use for the websocket connection.- Parameters:
proxyOptions- theProxyOptionsto use for the websocket connection.- Returns:
- this builder
-
tlsOptions
public NotificationsConfig.Builder tlsOptions(ClientTlsOptions tlsOptions)
Set the options to use when establishing secure connection to the WS endpoint.- Parameters:
tlsOptions- options to use when establishing secure connection to the WS endpoint- Returns:
- this builder
-
renewalDelay
public NotificationsConfig.Builder renewalDelay(Duration renewalDelay)
Set the renewal delay of the websocket connection.- Parameters:
renewalDelay- renewal delay of the websocket connection.- Returns:
- this builder
-
connectionTimeout
public NotificationsConfig.Builder connectionTimeout(Duration timeout)
Set the connection timeout of the websocket.- Parameters:
timeout- The time to wait for before failing the connection.- Returns:
- this builder
-
idleTimeout
public NotificationsConfig.Builder idleTimeout(Duration timeout)
Set the idle timeout of the Websocket connection.- Parameters:
timeout- The time to wait for without any activity before closing the connection.- Returns:
- this builder
-
vertxConfig
public NotificationsConfig.Builder vertxConfig(JsonValue vertxConfig)
Set the vertx configuration to pass to the underlying WebSocket provider.- Parameters:
vertxConfig- The vertx configuration.- Returns:
- this builder
-
build
public NotificationsConfig build()
Build theNotificationsConfig.- Returns:
- the notifications configurations
-
-