Interface ClientControl.SessionEventStream.Event

Enclosing interface:
ClientControl.SessionEventStream

public static interface ClientControl.SessionEventStream.Event
The interface for an event delivered by the stream.
  • Method Details

    • sessionId

      SessionId sessionId()
      Provides the session identifier of the client session that the event relates to.
      Returns:
      the client session id
    • type

      Provides the event type.
      Returns:
      the event type
    • state

      Provides the current state of the session.
      Returns:
      the session state
    • isOpenEvent

      boolean isOpenEvent()
      Convenience method to determine whether the event notifies the opening of a new session.

      This is equivalent to:

      event.type() == Type.STATE && event.state() == State.ACTIVE

      Returns:
      true if the type is STATE and the state is ACTIVE, otherwise false
    • properties

      Map<String,String> properties()
      Provides the session's properties.

      Only those properties requested when registering the listener will be present in the map.

      If no properties were requested or state() is CLOSED the map will be empty.

      Returns:
      the map of session properties
    • changedProperties

      Map<String,String> changedProperties()
      Provides a map of the previous values of session properties that have changed.

      This map will be empty if no session properties were requested or the event did not result in a change of any properties.

      This map will only be populated if type() is PROPERTIES or state() is RECONNECTED, FAILED_OVER, or DISCONNECTED.

      This will only contain keys that have changed and not the whole required property set.

      When a new property is added the value in this map will be null.

      When a property is removed there will be a value in this map but not in properties().

      Returns:
      the map of changed session properties
    • closeReason

      Provides the reason a session was closed.

      If state() is CLOSED this returns the reason the session was closed.

      Returns:
      the reason for session closure or null if state() is not CLOSED.