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.

ParameterDescription
typethe connection type identifier

onConnected(String function)

Returns: SseMappingBuilder

Sets the name of the function invoked when a client connects to this SSE type.

ParameterDescription
functionthe 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.

ParameterDescription
functionthe name of the function to invoke on disconnect

adminOnly(boolean adminOnly)

Returns: SseMappingBuilder

Sets whether this connection is available to admin domains only.

ParameterDescription
adminOnlytrue 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.

ParameterDescription
isPublictrue 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.

ParameterDescription
roleNamesthe 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.

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