clientmanager
Last updated
Was this helpful?
Last updated
Was this helpful?
(plugins.clientmanager)
The clientmanager
plugin facilitates communication and management of connected clients in Servoy. It supports broadcasting messages using createBroadcaster
and retrieving connected clients with getConnectedClients
. Administrators can send messages to clients via sendMessageToClient
or sendMessageToAllClients
and shut down clients using shutDownClient
or shutDownAllClients
.
Record locks can be managed with getLocks
and releaseLocks
, while isInMaintenanceMode
checks server maintenance status. The plugin also enables advanced messaging through channels with getOrCreateBroadcaster
, making it a powerful tool for client-server management.
,,
Create a broadcast object giving it a (nick)name and on a specific channel, the callback is used for getting messages of other clients on that channel The function gets 3 arguments (nickName, message, channelName)
Returns the current client JSClientInformation object.
Returns an array of JSClientInformation elements describing the clients connected to the server.
Returns an array of JSClientInformation elements describing the clients connected to the server filtered by the a client info string.
Get client that locked the record from a specific datasource or null if record is not locked.
Get a dataset will all locks on the server.
Get a broadcast object giving it a (nick)name and on a specific channel var broadcaster = plugins.
Get a broadcast object giving it a (nick)name and on a specific channel, the callback is used for getting messages of other clients on that channel The function gets 3 arguments (nickName, message, channelName)
Returns true if the server is in maintenance mode, false otherwise.
void
Release all locks acquired by a client WARNING: use with care
void
Sends a message to all connected clients.
void
Sends a message to a specific client, identified by its clientId.
void
Shuts down all connected clients.
void
Shuts down a specific client, identified by its clientId.
void
Shuts down a specific client, identified by its clientId.
Create a broadcast object giving it a (nick)name and on a specific channel, the callback is used for getting messages of other clients on that channel The function gets 3 arguments (nickName, message, channelName)
Parameters
Sample
Returns the current client JSClientInformation object. Note this is snapshot information, client information will not get updated.
Returns an array of JSClientInformation elements describing the clients connected to the server. Note this is snapshot information on connected clients, client information will not get updated.
Sample
Returns an array of JSClientInformation elements describing the clients connected to the server filtered by the a client info string. This way you can ask for a specific set of clients that have a specific information added to there client information. Note this is snapshot information on connected clients, client information will not get updated.
Parameters
Sample
Get client that locked the record from a specific datasource or null if record is not locked.
Parameters
Sample
Get a dataset will all locks on the server. The dataset will have four columns: datasource, acquireDate, clientId, pkHash. Each row in the dataset will be a lock.
Sample
Get a broadcast object giving it a (nick)name and on a specific channel var broadcaster = plugins.clientmanager.getBroadcaster("nickname", "mychatchannel"); broadcaster.broadcastMessage("Hallo");
Parameters
Get a broadcast object giving it a (nick)name and on a specific channel, the callback is used for getting messages of other clients on that channel The function gets 3 arguments (nickName, message, channelName)
Parameters
Sample
Returns true if the server is in maintenance mode, false otherwise.
Sample
Release all locks acquired by a client
WARNING: use with care
Parameters
Returns: void
Sends a message to all connected clients.
Parameters
Returns: void
Sample
Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method.
Parameters
Returns: void
Sample
Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down.
Returns: void
Sample
Shuts down a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. This method returns immediately, it does not wait until the client shuts down.
Parameters
Returns: void
Sample
Shuts down a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. This method returns immediately, it does not wait until the client shuts down. If forceUnregister is true, the client will unregister itself from server. Beware this should be used only if you are sure client is already closed (cannot connect anymore)
Parameters
Returns: void
Sample
name The nickname for this user on this channel
channelName The channel name where should be listened to (and send messages to)
callback The callback when for incomming messages
Returns: BroadCaster
Returns: A JSClientInformation object containing snapshot information about the current client, or null if the information cannot be retrieved.
Returns: JSClientInformation[]
clientInfoFilter The filter string
Returns: JSClientInformation[]
datasource ;
pks ;
Returns: Client information
Returns: A dataset containing all locks on the server, with columns for datasource, acquireDate, clientId, and pkHash.
name The nickname for this user on this channel
channelName The channel name where should be listened to (and send messages to)
Returns: BroadCaster
name The nickname for this user on this channel
channelName The channel name where should be listened to (and send messages to)
callback The callback when for incomming messages
Returns: BroadCaster
Returns: The server build date as a Date object, or null if the information cannot be retrieved.
Returns: true if the server is in maintenance mode, false otherwise.
clientId ;
message ;
clientId ;
message ;
clientId ;
clientId ;
forceUnregister client is forced to unregister from server