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
| Property | Returns | Description |
|---|---|---|
| attributes | Map<String,Object> | Request attributes captured when the connection was opened: the underlying request attributes plus queryString, queryParameters, headers, remoteIP, profileId, isSecure and port. |
| contentId | 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. |
| host | String | Hostname the SSE connection was made to, with any port number stripped. |
| profileId | Long | ID of the profile that was authenticated when this connection was opened. |
| type | 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}). |
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.