Page History
...
Function
...
isInMaintenanceMode
...
Description
...
Returns true if the server is in maintenance mode, false otherwise.
...
Example
...
No Format | ||
---|---|---|
| ||
if (plugins.maintenance.isInMaintenanceMode())
application.output("Server is in maintenance mode.");
else
application.output("Server is not in maintenance mode.");
|
...
Function
...
setMaintenanceMode
...
Description
...
Example
...
No Format | ||
---|---|---|
| ||
plugins.maintenance.setMaintenanceMode(!plugins.maintenance.isInMaintenanceMode());
|
...
Function
...
getConnectedClients
...
Description
...
Returns an array of IClientInformation elements describing the clients connected to the server.
...
Example
...
No Format | ||
---|---|---|
| ||
var clients = plugins.maintenance.getConnectedClients();
application.output("There are " + clients.length + " connected clients.");
for (var i = 0; i < clients.length; i++)
application.output("Client has clientId '" + clients[i].getClientId() + "' and has connected from host '" + clients[i].getHostAddress() + "'.");
|
...
Function
...
sendMessageToAllClients
...
Description
...
Example
...
No Format | ||
---|---|---|
| ||
plugins.maintenance.sendMessageToAllClients("Hello, all clients!");
|
...
Function
...
sendMessageToClient
...
Description
...
Example
...
No Format | ||
---|---|---|
| ||
var clients = plugins.maintenance.getConnectedClients();
for (var i=0; i<clients.length; i++)
plugins.maintenance.sendMessageToClient(clients[i].getClientId(), "Hello, client " + clients[i].getClientId() + "!");
|
...
Function
...
shutDownAllClients
...
Description
...
Shuts down all connected clients.
...
Example
...
No Format | ||
---|---|---|
| ||
plugins.maintenance.shutDownAllClients();
|
...
Function
...
shutDownClient
...
Description
...
Example
...
No Format | ||
---|---|---|
| ||
var clients = plugins.maintenance.getConnectedClients();
for (var i=0; i<clients.length; i++)
plugins.maintenance.shutDownClient(clients[i].getClientId());
|
...
Function
...
getServer
...
Description
...
Example
...
No Format | ||
---|---|---|
| ||
var server = plugins.maintenance.getServer("example_data");
if (server) {
var tableNames = server.getTableNames();
application.output("There are " + tableNames.length + " tables.");
for (var i=0; i<tableNames.length; i++)
application.output("Table " + i + ": " + tableNames[i]);
}
else {
plugins.dialogs.showInfoDialog("Attention","Server 'example_data' cannot be found.","OK");
}
|
...
Function
...
getServerNames
...
Description
...
Example
...
nopanel | true |
---|
...
The Servoy Application Server can be set into the so-called 'Maintenance mode'. When in maintenance mode, no new clients can connect to the Servoy Application Server.
The Servoy Application Server can be put into maintenance mode manually through the 'Enter Maintenance Mode' button on the Servoy Server Home page of the Servoy Admin page or programatically using the maintenance plugin inside an solution import hook.
Maintenance mode can be used when performing maintenance on the Servoy Application Server, like importing new solutions. While solutions can be imported and activated without going into maintenance mode first, when the nature of the changes would mean that existing and/or new clients might go into error, for example due to removing tables, the maintenance mode can prevent new clients connecting.
After the Servoy Application Server has been put in maintenance mode, existing clients can be disconnected, either through the Servoy Admin page or programatically through the Maintenance plugin.
See the Maintenance plugin for more information.