Child pages
  • Maintenance Mode

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Function

...

isInMaintenanceMode

...

Description

...

The Servoy Application Server can be set into the so-called 'Maintenance mode'. When in maintenance mode,

...

Example

...

No Format
nopaneltrue

if (%%elementName%%.isInMaintenanceMode())
	application.output("Server is in maintenance mode.");
else
	application.output("Server is not in maintenance mode.");

...

Function

...

setMaintenanceMode

...

Description

...

Example

...

No Format
nopaneltrue

%%elementName%%.setMaintenanceMode(!%%elementName%%.isInMaintenanceMode());

...

Function

...

getConnectedClients

...

Description

...

Example

...

No Format
nopaneltrue

var clients = %%elementName%%.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
nopaneltrue

%%elementName%%.sendMessageToAllClients("Hello, all clients!");

...

Function

...

sendMessageToClient

...

Description

...

Example

...

No Format
nopaneltrue

var clients = %%elementName%%.getConnectedClients();
for (var i=0; i<clients.length; i++)
	%%elementName%%.sendMessageToClient(clients[i].getClientId(), "Hello, client " + clients[i].getClientId() + "!");

...

Function

...

shutDownAllClients

...

Description

...

Example

...

No Format
nopaneltrue

%%elementName%%.shutDownAllClients();

...

Function

...

shutDownClient

...

Description

...

Example

...

No Format
nopaneltrue

var clients = %%elementName%%.getConnectedClients();
for (var i=0; i<clients.length; i++)
	%%elementName%%.shutDownClient(clients[i].getClientId());

...

Function

...

getServer

...

Description

...

Example

...

No Format
nopaneltrue

var server = %%elementName%%.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

...

nopaneltrue

...

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.