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 aNotificationsConfig
builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NotificationsConfig
build()
Build theNotificationsConfig
.NotificationsConfig.Builder
connectionTimeout(Duration timeout)
Set the connection timeout of the websocket.NotificationsConfig.Builder
heartbeat(Duration interval, ScheduledExecutorService executorService)
Set the interval and executorService which will be used to send Websocket heartbeats.NotificationsConfig.Builder
idleTimeout(Duration timeout)
Set the idle timeout of the Websocket connection.NotificationsConfig.Builder
initialConnectionAttempts(int attemptCount)
Set the number of retries allowed to set up the first connection to the notification service.NotificationsConfig.Builder
proxyOptions(ProxyOptions proxyOptions)
Set the theProxyOptions
to use for the websocket connection.NotificationsConfig.Builder
reconnectDelay(Duration reconnectDelay)
Set the reconnection delay used when notification service is disconnected.NotificationsConfig.Builder
renewalDelay(Duration renewalDelay)
Set the renewal delay of the websocket connection.NotificationsConfig.Builder
tlsOptions(ClientTlsOptions tlsOptions)
Set the options to use when establishing secure connection to the WS endpoint.NotificationsConfig.Builder
vertxConfig(JsonValue vertxConfig)
Set the vertx configuration to pass to the underlying WebSocket provider.
-
-
-
Constructor Detail
-
Builder
public Builder(WebSocketClientProvider clientProvider)
Create aNotificationsConfig
builder.- 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.UNLIMITED
orDuration.ZERO
disable the feature.executorService
- theScheduledExecutorService
to 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 theProxyOptions
to use for the websocket connection.- Parameters:
proxyOptions
- theProxyOptions
to 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
-
-