DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR
Return Types
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
getConnectedClients()
Returns an array of JSClientInformation elements describing the clients connected to the server.
String[]
getServerNames()
Retrieves a list with the names of all available database servers.
String[]
getServerNames(mustBeEnabled)
Retrieves a list with the names of all available database servers.
String[]
getServerNames(mustBeEnabled, mustBeValid)
Retrieves a list with the names of all available database servers.
String[]
getServerNames(mustBeEnabled, mustBeValid, sort)
Retrieves a list with the names of all available database servers.
String[]
getServerNames(mustBeEnabled, mustBeValid, sort, includeDuplicates)
Retrieves a list with the names of all available database servers.
isInMaintenanceMode()
Returns true if the server is in maintenance mode, false otherwise.
void
sendMessageToAllClients(message)
Sends a message to all connected clients.
void
sendMessageToClient(clientId, message)
Sends a message to a specific client, identified by its clientId.
void
setMaintenanceMode(maintenanceMode)
Puts the server into/out of maintenance mode, depending on the boolean parameter that is specified (if the parameter is true, then the server will be put into maintenance mode; if the parameter is false, then the server will be put out of maintenance mode).
void
shutDownAllClients()
Shuts down all connected clients.
void
shutDownClient(clientId)
Shuts down a specific client, identified by its clientId.
{column:width=100%|padding=0px}{column}
Method Details
getConnectedClients
()
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Returns an array of JSClientInformation elements describing the clients connected to the server. 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() + "'.");
getServer
(serverName)
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument. //If the optional argument "mustBeEnabled" is set to true, then the JSServer instance is returned only if the server is active. //Similarly, if the "mustBeValid" optional argument is set to true, then the JSServer instance is returned only if the server is valid. //If the specified server is not found, or if it does not meet the requirements imposed by the optional arguments, then null is returned. //By default both optional arguments have the value false. 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"); }
getServer
(serverName, mustBeEnabled)
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument. //If the optional argument "mustBeEnabled" is set to true, then the JSServer instance is returned only if the server is active. //Similarly, if the "mustBeValid" optional argument is set to true, then the JSServer instance is returned only if the server is valid. //If the specified server is not found, or if it does not meet the requirements imposed by the optional arguments, then null is returned. //By default both optional arguments have the value false. 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"); }
getServer
(serverName, mustBeEnabled, mustBeValid)
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves an instance of JSServer corresponding to the server with the name specified through the "serverName" argument. //If the optional argument "mustBeEnabled" is set to true, then the JSServer instance is returned only if the server is active. //Similarly, if the "mustBeValid" optional argument is set to true, then the JSServer instance is returned only if the server is valid. //If the specified server is not found, or if it does not meet the requirements imposed by the optional arguments, then null is returned. //By default both optional arguments have the value false. 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"); }
String[]
getServerNames
()
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves a list with the names of all available database servers. The returned list will contain only enabled servers if the "mustBeEnabled" //optional argument is set to true. The list will contain only valid servers if the "mustBeValid" argument is set to true. If the "sort" optional //argument is set to true, then the list will be sorted alphabetically. If the "includeDuplicates" optional argument is set to false, then duplicate //servers will appear only once in the list. By default, the "mustBeEnabled" and the "mustBeValid" arguments have the value false, while the "sort" //and "includeDuplicates" arguments have the value true. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]);
String[]
getServerNames
(mustBeEnabled)
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves a list with the names of all available database servers. The returned list will contain only enabled servers if the "mustBeEnabled" //optional argument is set to true. The list will contain only valid servers if the "mustBeValid" argument is set to true. If the "sort" optional //argument is set to true, then the list will be sorted alphabetically. If the "includeDuplicates" optional argument is set to false, then duplicate //servers will appear only once in the list. By default, the "mustBeEnabled" and the "mustBeValid" arguments have the value false, while the "sort" //and "includeDuplicates" arguments have the value true. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]);
String[]
getServerNames
(mustBeEnabled, mustBeValid)
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves a list with the names of all available database servers. The returned list will contain only enabled servers if the "mustBeEnabled" //optional argument is set to true. The list will contain only valid servers if the "mustBeValid" argument is set to true. If the "sort" optional //argument is set to true, then the list will be sorted alphabetically. If the "includeDuplicates" optional argument is set to false, then duplicate //servers will appear only once in the list. By default, the "mustBeEnabled" and the "mustBeValid" arguments have the value false, while the "sort" //and "includeDuplicates" arguments have the value true. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]);
String[]
getServerNames
(mustBeEnabled, mustBeValid, sort)
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves a list with the names of all available database servers. The returned list will contain only enabled servers if the "mustBeEnabled" //optional argument is set to true. The list will contain only valid servers if the "mustBeValid" argument is set to true. If the "sort" optional //argument is set to true, then the list will be sorted alphabetically. If the "includeDuplicates" optional argument is set to false, then duplicate //servers will appear only once in the list. By default, the "mustBeEnabled" and the "mustBeValid" arguments have the value false, while the "sort" //and "includeDuplicates" arguments have the value true. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]);
String[]
getServerNames
(mustBeEnabled, mustBeValid, sort, includeDuplicates)
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Retrieves a list with the names of all available database servers. The returned list will contain only enabled servers if the "mustBeEnabled" //optional argument is set to true. The list will contain only valid servers if the "mustBeValid" argument is set to true. If the "sort" optional //argument is set to true, then the list will be sorted alphabetically. If the "includeDuplicates" optional argument is set to false, then duplicate //servers will appear only once in the list. By default, the "mustBeEnabled" and the "mustBeValid" arguments have the value false, while the "sort" //and "includeDuplicates" arguments have the value true. var serverNames = plugins.maintenance.getServerNames(); application.output("There are " + serverNames.length + " servers."); for (var i=0; i<serverNames.length; i++) application.output("Server " + i + ": " + serverNames[i]);
isInMaintenanceMode
()
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Returns true if the server is in maintenance mode, false otherwise. if (plugins.maintenance.isInMaintenanceMode()) application.output("Server is in maintenance mode."); else application.output("Server is not in maintenance mode.");
void
sendMessageToAllClients
(message)
Returns
void
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Sends a message to all connected clients. plugins.maintenance.sendMessageToAllClients("Hello, all clients!");
void
sendMessageToClient
(clientId, message)
Returns
void
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method. var clients = plugins.maintenance.getConnectedClients(); for (var i=0; i<clients.length; i++) plugins.maintenance.sendMessageToClient(clients[i].getClientId(), "Hello, client " + clients[i].getClientId() + "!");
void
setMaintenanceMode
(maintenanceMode)
Returns
void
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Puts the server into/out of maintenance mode, depending on the boolean parameter that is specified (if the parameter is true, then the server will be put into maintenance mode; if the parameter is false, then the server will be put out of maintenance mode). plugins.maintenance.setMaintenanceMode(!plugins.maintenance.isInMaintenanceMode());
void
shutDownAllClients
()
Returns
void
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down. plugins.maintenance.shutDownAllClients();
void
shutDownClient
(clientId)
Returns
void
Sample
// WARNING: maintenance plugin is only meant to run during solution import using before or after import hook(so not from Smart/Web client) //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. var clients = plugins.maintenance.getConnectedClients(); for (var i=0; i<clients.length; i++) plugins.maintenance.shutDownClient(clients[i].getClientId());