Registers a Server-Sent Events (SSE) connection type for a repository app, so browsers can open a persistent event stream of that type and have the app be notified when clients connect and disconnect. Started from ControllerMappingList.sseController(). Call build() to construct the resulting RepoAppSseMapping and, unless the app's engine initialisation has already completed, register it under the given type so it can later be looked up by RepositoryApp.getSseType(String).
Group: Builders
Methods
type(String type)
Returns: SseMappingBuilder
Sets the connection type identifier for this SSE mapping, used to look it up when a client connects.
| Parameter | Description |
|---|---|
type | the connection type identifier |
onConnected(String function)
Returns: SseMappingBuilder
Sets the name of the function invoked when a client connects to this SSE type.
| Parameter | Description |
|---|---|
function | the name of the function to invoke on connect |
onDisconnected(String function)
Returns: SseMappingBuilder
Sets the name of the function invoked when a client disconnects from this SSE type.
| Parameter | Description |
|---|---|
function | the name of the function to invoke on disconnect |
adminOnly(boolean adminOnly)
Returns: SseMappingBuilder
Sets whether this connection is available to admin domains only.
| Parameter | Description |
|---|---|
adminOnly | true to restrict connections to admin domains only, false to also allow public/website domains |
isPublic(boolean isPublic)
Returns: SseMappingBuilder
Sets whether this connection type is open to unauthenticated clients.
| Parameter | Description |
|---|---|
isPublic | true if any client may connect without authenticating, false if a signed in profile is required |
addRole(String roleNames)
Returns: SseMappingBuilder
Adds one or more role names required to connect to this SSE type.
| Parameter | Description |
|---|---|
roleNames | the role names to add; ignored if null or empty |
build()
Returns: RepoAppSseMapping
Finishes this builder, constructing a RepoAppSseMapping from the configured values and, unless the app's engine initialisation has already completed, registering it under the configured type.