Return Types
{column:padding=0px|width=80px}{column}{column}{column}
Method Summary
getConnectedClients()
Returns an array of JSClientInformation elements describing the clients connected to the server.
String[]
getDataModelClonesFrom(name)
Retrieves a list with names of all database servers that have property DataModelCloneFrom equal to the parameter.
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:padding=0px|width=100%}{column}
Method Details
getConnectedClients
()
Returns an array of JSClientInformation elements describing the clients connected to the server.
Since
Replace with version info
Parameters
Returns
Also see
External links
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() + "'.");
String[]
getDataModelClonesFrom
(name)
Retrieves a list with names of all database servers that have property DataModelCloneFrom equal to the parameter.
Since
Replace with version info
Parameters
{String} name
Also see
External links
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 names of all database servers that have property DataModelCloneFrom equal to the parameter. var serverNames = plugins.maintenance.getDataModelClonesFrom('my_server'); for (var i=0; i<serverNames.length; i++) application.output("Process server " + i + ": " + serverNames[i]);
getServer
(serverName)
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.
Since
Replace with version info
Parameters
{String} serverName
Also see
External links
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)
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.
Since
Replace with version info
Also see
External links
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)
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.
Since
Replace with version info
Also see
External links
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
()
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.
Since
Replace with version info
Parameters
Also see
External links
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)
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.
Since
Replace with version info
Parameters
{Boolean} mustBeEnabled
Also see
External links
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)
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.
Since
Replace with version info
Also see
External links
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)
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.
Since
Replace with version info
Also see
External links
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)
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.
Since
Replace with version info
Also see
External links
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
()
Returns true if the server is in maintenance mode, false otherwise.
Since
Replace with version info
Parameters
Also see
External links
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)
Sends a message to all connected clients.
Since
Replace with version info
Parameters
{String} message
Returns
void
Also see
External links
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)
Sends a message to a specific client, identified by its clientId. The clientIds are retrieved by calling the getConnectedClients method.
Since
Replace with version info
Returns
void
Also see
External links
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)
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).
Since
Replace with version info
Parameters
{Boolean} maintenanceMode
Returns
void
Also see
External links
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
()
Shuts down all connected clients. This method returns immediately, it does not wait until the client shuts down.
Since
Replace with version info
Parameters
Returns
void
Also see
External links
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)
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.
Since
Replace with version info
Parameters
{String} clientId
Returns
void
Also see
External links
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());