org.keycloak.models.sessions.infinispan

## Class InfinispanStickySessionEncoderProvider

- java.lang.Object
- - org.keycloak.models.sessions.infinispan.InfinispanStickySessionEncoderProvider

- All Implemented Interfaces:
    Provider, StickySessionEncoderProvider

      public class InfinispanStickySessionEncoderProvider
      extends Object
      implements StickySessionEncoderProvider

  Author:
    Marek Posolda

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InfinispanStickySessionEncoderProvider(KeycloakSession session, boolean shouldAttachRoute)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `String` | `decodeSessionId(String encodedSessionId)`
    `String` | `encodeSessionId(String sessionId)`
    `boolean` | `shouldAttachRoute()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InfinispanStickySessionEncoderProvider

          public InfinispanStickySessionEncoderProvider(KeycloakSession session,
                                                        boolean shouldAttachRoute)

  - ### Method Detail

    - #### encodeSessionId

          public String encodeSessionId(String sessionId)

      Specified by:
        `encodeSessionId` in interface `StickySessionEncoderProvider`
      Returns:
        Encoded value to be used as the value of sticky session cookie (AUTH_SESSION_ID cookie)

    - #### decodeSessionId

          public String decodeSessionId(String encodedSessionId)

      Specified by:
        `decodeSessionId` in interface `StickySessionEncoderProvider`
      Parameters:
        `encodedSessionId` - value of the sticky session cookie
      Returns:
        decoded value, which represents the actual ID of the `AuthenticationSessionModel`

    - #### shouldAttachRoute

          public boolean shouldAttachRoute()

      Specified by:
        `shouldAttachRoute` in interface `StickySessionEncoderProvider`
      Returns:
        true if information about route should be attached to the sticky session cookie by Keycloak. Otherwise it may be attached by loadbalancer.

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

Copyright © 2020 JBoss by Red Hat. All rights reserved.