Holds the configuration for one app-defined websocket data type: its connect, disconnect and message JavaScript handler functions, and whether it is restricted to admin domains. Instances are built by WebsocketMappingBuilder and looked up by ControllerMappingList to dispatch incoming websocket events through RepoAppWebsocketType.


Properties

PropertyReturnsDescription
adminOnlybooleanWhether sockets of this type may only be established on admin domains.
onConnectedFunctionObjectThe JavaScript function called when a new socket of this type connects, or null if none was registered.
onDisconnectedFunctionObjectThe JavaScript function called when a socket of this type disconnects, or null if none was registered.
onMessageFunctionObjectThe JavaScript function called when a socket of this type receives a message from the client, or null if none was registered.
typeStringThe data type this mapping was registered under, used to group and look up sockets of this kind.

Methods

getType()

Returns: String

The data type this mapping was registered under, used to group and look up sockets of this kind.

getOnConnectedFunction()

Returns: Object

The JavaScript function called when a new socket of this type connects, or null if none was registered.

getOnDisconnectedFunction()

Returns: Object

The JavaScript function called when a socket of this type disconnects, or null if none was registered.

getOnMessageFunction()

Returns: Object

The JavaScript function called when a socket of this type receives a message from the client, or null if none was registered.

isAdminOnly()

Returns: boolean

Whether sockets of this type may only be established on admin domains.

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