Represents one live Server-Sent Events connection from a browser client, scoped to a single SSE type and host. Created for every incoming SSE upgrade request accepted by the listener, and holds the request attributes (query string, headers, remote IP, profile ID) captured at connect time. This is the object passed into an app's registered onConnected and onDisconnected JavaScript functions, so its getters are the API surface available to those handlers.

Extends: GrizzlySseConnection


Properties

PropertyReturnsDescription
attributesMap<String,Object>Request attributes captured when the connection was opened: the underlying request attributes plus queryString, queryParameters, headers, remoteIP, profileId, isSecure and port.
contentIdStringContent identifier taken from the third path segment of the SSE upgrade URL (/sse/{TypeName}/{ContentID}), used by handlers to filter which connections a broadcast message is sent to.
hostStringHostname the SSE connection was made to, with any port number stripped.
profileIdLongID of the profile that was authenticated when this connection was opened.
typeStringName of the SSE type this connection was opened for, taken from the second path segment of the SSE upgrade URL (/sse/{TypeName}/{ContentID}).

Methods

getType()

Returns: String

Name of the SSE type this connection was opened for, taken from the second path segment of the SSE upgrade URL (/sse/{TypeName}/{ContentID}).

getContentId()

Returns: String

Content identifier taken from the third path segment of the SSE upgrade URL (/sse/{TypeName}/{ContentID}), used by handlers to filter which connections a broadcast message is sent to.

getHost()

Returns: String

Hostname the SSE connection was made to, with any port number stripped.

getAttributes()

Returns: Map<String,Object>

Request attributes captured when the connection was opened: the underlying request attributes plus queryString, queryParameters, headers, remoteIP, profileId, isSecure and port.

getProfileId()

Returns: Long

ID of the profile that was authenticated when this connection was opened.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.