Class AmService.Builder

    • Method Detail

      • enableNotifications

        public AmService.Builder enableNotifications​(boolean enabled)
        Enable or disable the notifications.
        Parameters:
        enabled - true if the notifications should be enabled or false 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 or false otherwise.
        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 the Caffeine cache for the CacheSessionService. If the cache is set to null, no cache will be used.
        Parameters:
        caffeine - The Caffeine cache. If the cache is null, then the cache will be disabled.
        maximumTimeout - The maximum time to cache a session; can be null.
        disconnectionStrategy - The strategy to apply in case of notifications' disconnection.
        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.
      • 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.
      • notificationServiceProxyOptions

        public AmService.Builder notificationServiceProxyOptions​(ProxyOptions proxyOptions)
        Specifies the ProxyOptions to use for the websocket connection.
        Parameters:
        proxyOptions - the ProxyOptions to use for the websocket connection.
        Returns:
        this builder.