Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SessionEvent

The interface for an event delivered by a SessionEventStream.

Hierarchy

  • SessionEvent

Index

Properties

changedProperties

changedProperties: SessionProperties

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 SessionEvent.type is PROPERTIES or SessionEvent.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 SessionEvent.properties.

returns

the changed session properties

Optional closeReason

closeReason: ClientCloseReason

Provides the reason a session was closed.

If SessionEvent.state is CLOSED this contains the reason the session was closed.

returns

the reason for session closure or null if SessionEvent.state is not CLOSED.

properties

properties: SessionProperties

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 SessionEvent.state is CLOSED the map will be empty.

returns

the map of session properties

sessionId

sessionId: SessionId

Provides the session identifier of the client session that the event relates to.

returns

the client session id

state

Provides the current state of the session.

returns

the session state

type

Provides the event type.

returns

the event type

Methods

isOpenEvent

  • isOpenEvent(): boolean
  • 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 boolean

    true if the type is STATE and the state is ACTIVE, otherwise false