Building Your Event-Driven Architecture : Universal Messaging Administration Guide : Universal Messaging Administration API : Realm Server Management : Scheduling
Scheduling
Universal Messaging Realm servers provide the ability for scheduling tasks. Tasks can be scheduled to execute based on certain conditions being met.
These conditions can be either time based (scheduling) or event based (triggers).
Universal Messaging scheduling is achieved through the creation of numerous scheduling scripts. Each script can contain multiple definitions of triggers and tasks.
The Universal Messaging server parses these scripts and sets up the triggers and tasks accordingly. For more information on the script grammar, there is a section in the enterprise manager guide which deals with writing scheduling scripts.
nSchedulerManager
When you have connected to a realm, and have a reference to an nRealmNode object (see nRealmNode), you can access an object called nSchedulerManager, which provides you with the ability to add, modify, delete scheduling scripts. To get access to this object, you can call the following method from a realm node:
Java, C#:
nSchedulerManager sMgr = realm.getSchedulerManager();
C++:
nSchedulerManager* sMgr = realm->getSchedulerManager();
Using the nSchedulerManager object you can then obtain a list of scheduler objects for the realm:
Java:
Enumeration schedulers = sMgr.getNodes();
C#:
System.Collections.IEnumerator schedulers = sMgr.getNodes();
C++:
fSortedList nodes = pNode->getNodes();
This method returns an enumeration of nScheduler objects. The nScheduler objects each correspond to a particular scheduling script.
The following code shows you how to construct a new scheduler object using a sample script that will log a message to the realm server log every hour, signified by the 'every 60' condition: {Please Note: typically this script would be read from a script file or it could be entered directly into the realm enterprise manager GUI.}
Java, C##:
String source = "scheduler myScheduler {\n";
String logString = "Sample script : ";
source += "\n";
source += "\n";
source += " initialise{\n";
source += " Logger.setlevel(0);\n";
source += " }\n";
source += " every 60"{\n";
source += " Logger.report(\""+logString+"\");\n";
source += " }\n";
source += "}\n";
sMgr.add(source, "user@localhost", false);
C++:
stringstream s;
s<<"scheduler myScheduler {\n";
string logString = "Sample script : ";
s<<"\n";
s<<"\n";
s<<"initialise{\n";
s<<"Logger.setlevel(0);\n";
s<<"}\n";
s<<"every 60"{\n";
s<<"fLogger::report(\""+logString+"\");\n";
s<<"}\n";
s<<"}\n";
sMgr->add(source, "user@localhost", false);

For more information on Universal Messaging Administration, please see the API documentation, and the Enterprise Manager Guide.
Copyright © 2016 - 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback