|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.inet.report.schedule.Scheduler
public class Scheduler
The main class of the scheduler package. This class has only one instance, which can be retrieved by the method
getInstance().
The scheduler is in charge of executing any number of ScheduleTasks for report execution.
Each of these tasks contains:
ExecutionTimeProvider defining at what point(s) in time the task is to be executed.ScheduleReports defining which reports are to be executed and how.ScheduleActions defining what is to be done when the reports are generated.The scheduler has various settings which can be set using the "set" methods in this class. Note that if at
any point you would like to return the scheduler to its "original" state, that is, without any tasks, actions,
report configurations, or any other settings, you can use the method resetScheduler().
| Nested Class Summary | |
|---|---|
static class |
Scheduler.CustomActionDefinition
This class stores information about a custom action. |
class |
Scheduler.DynamicPropertiesDefinition
This class stores the information about your instances of DynamicProperties
classes which can be used in the i-net Scheduler. |
| Field Summary | |
|---|---|
static int |
LOG_LEVEL_DEBUG
This constant defines the log level DEBUG. |
static int |
LOG_LEVEL_ERROR
This constant defines the log level ERROR. |
static int |
LOG_LEVEL_FATAL
This constant defines the log level FATAL. |
static int |
LOG_LEVEL_INFO
This constant defines the log level INFO. |
static int |
LOG_LEVEL_PARANOID
This constant defines the log level PARANOID. |
static int |
LOG_LEVEL_WARN
This constant defines the log level WARN. |
static java.lang.String |
PROPERTY_EMAIL_AUTHENTICATION
With this constant you can get/set the runtime property "email authentication" with the methods setScheduleRuntimeProperty(String, String) and
getScheduleRuntimeProperty(String). |
static java.lang.String |
PROPERTY_MAX_WORKER
With this property you can specify how many task can be executed simultaneously. |
static java.lang.String |
PROPERTY_PASSWORD
The key for the property "password" to use with setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String) |
static java.lang.String |
PROPERTY_POP3_HOST
The key for the property "pop3host" to use with setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String) |
static java.lang.String |
PROPERTY_POP3_PORT
Property used to define the POP3 server port to connect when EmailAction is used. |
static java.lang.String |
PROPERTY_PROPERTIES_CHECKER
With this constant you can get/set the runtime property "propertieschecker" with the methods setScheduleRuntimeProperty(String, String) and
getScheduleRuntimeProperty(String). |
static java.lang.String |
PROPERTY_SENDER
The key for the property "sender" to use with setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String) |
static java.lang.String |
PROPERTY_SMTP_HOST
The key for the property "smtphost" to use with setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String) |
static java.lang.String |
PROPERTY_SMTP_PORT
Property used to define the SMTP server port to connect when EmailAction is used. |
static java.lang.String |
PROPERTY_USER
The key for the property "user" to use with setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String) |
| Method Summary | |
|---|---|
void |
addCustomAction(java.lang.String name,
java.lang.String className,
java.lang.String path)
Adds a custom action to the list of custom actions of the i-net Scheduler. |
void |
addDynamicPropertiesClass(java.lang.String className,
java.lang.String path)
This will register an DynamicProperties class to the i-net Scheduler and the path where this class can be found. |
void |
addDynamicPropertiesClass(java.lang.String className)
This will register an DynamicProperties class to the i-net Scheduler and the path where this class can be found. |
ScheduleTask |
addTask(java.lang.String taskName)
This method allows you to create a new task. |
void |
configurationChanged(ConfigurationChangeEvent e)
For scheduler, this will check whether still a plus-license is used. |
Scheduler.CustomActionDefinition |
getCustomAction(int index)
Returns the custom action definition from the list of definitions at the given index. |
Scheduler.CustomActionDefinition |
getCustomAction(java.lang.String name)
Returns the custom action definition registered with the given name. |
Scheduler.CustomActionDefinition |
getCustomActionByClassName(java.lang.String className)
Returns the custom action definition registered with the given class name. |
int |
getCustomActionCount()
This method will return the number of custom action registered to the i-net Scheduler. |
Scheduler.DynamicPropertiesDefinition |
getDynamicPropertiesClass(int index)
This will return the DynamicProperties definition from the list at the given index. |
Scheduler.DynamicPropertiesDefinition |
getDynamicPropertiesClass(java.lang.String className)
This will return the DynamicPropertiesDefinition of the given DynamicProperties class. |
int |
getDynamicPropertiesClassCount()
Returns the number of DynamicProperties classes registered to the i-net Scheduler. |
java.util.List |
getEnabledActionClassNames()
Get a list of all action which are currently enabled/activated. |
static Scheduler |
getInstance()
This will return an instance of the i-net Scheduler. |
static java.lang.String |
getLogFile()
Deprecated. As of i-net Clear Reports 12.0 the scheduler always uses the logger from i-net Clear Reports. The returned file does not represent the file where i-net Clear Reports logs to. |
static int |
getLogLevel()
Deprecated. As of i-net Clear Reports 12.0 the scheduler always uses the logger from i-net Clear Reports. The returned log-level does not represent the level from i-net Clear Reports logger. |
PropertiesChecker |
getPropertiesChecker()
Returns the PropertiesChecker currently set for rendering report with the cache interface of i-net Clear Reports. |
java.util.Properties |
getScheduleRuntimeProperties()
This will return all i-net Scheduler runtime properties currently set. |
java.lang.String |
getScheduleRuntimeProperty(java.lang.String name)
With this method you can get the value of one of the i-net Scheduler runtime properties. |
ScheduleTask |
getTask(java.lang.String taskName)
This method will return a ScheduleTask instance. |
ScheduleTask |
getTask(java.lang.Integer id)
This method will return a ScheduleTask instance. |
boolean |
isActionEnabled(java.lang.String className)
Returns whether the action is enabled. |
static boolean |
isLogEnabled()
Returns whether the logging of the i-net Scheduler is enabled or not. |
boolean |
isStarted()
This will return whether the i-net Scheduler is currently running or not. |
ScheduleTask[] |
list()
This method returns an array of all ScheduleTask registered in this scheduler. |
void |
loadXML()
This method will read the schedule configuration from an XML file and create the schedule tasks. |
void |
removeCustomAction(java.lang.String name)
Removes the registered custom action from the i-net Scheduler if it exists. |
void |
removeDynamicPropertiesClass(java.lang.String className)
Removes the definition for the given DynamicProperty class. |
void |
removeTask(java.lang.Integer taskID)
Removes the specified task from the scheduler. |
void |
removeTask(java.lang.String taskName)
Deprecated. As of i-net Clear Reports 12.0 the task's ID will be the primary key, use removeTask(Integer) instead. |
void |
resetPassword()
This will reset the password of the i-net Scheduler. |
void |
resetScheduler()
This will reset the i-net Scheduler. |
boolean |
saveXML()
This will save the current configuration, which means all tasks, all actions, all reports and all runtime properties to the i-net Scheduler configuration xml file "scheduler.xml". |
void |
setEnabledActions(java.util.List enabledActions)
Sets all enabled actions. |
static void |
setLogEnabled(boolean logEnabled)
Sets whether the log of the i-net Scheduler should be enabled or not. |
static void |
setLogFile(java.lang.String logFile)
Deprecated. As of i-net Clear Reports 12.0 the scheduler always uses the logger from i-net Clear Reports. Setting the log file here will not affect the logging of i-net Clear Reports and thus not the logging of the i-net Scheduler. |
static void |
setLogLevel(int logLevel)
Deprecated. As of i-net Clear Reports 12.0 the scheduler always uses the logger from i-net Clear Reports. Setting the log-level here will not affect the logging if i-net Clear Reports and thus not the logging of the i-net Scheduler. |
void |
setPassword(java.lang.String newPassword)
Sets a new password for the web interface. |
void |
setPropertiesChecker(PropertiesChecker propertiesChecker)
This will set a PropertiesChecker class which will be used for rendering the reports with the cache interface of i-net Clear Reports. |
void |
setScheduleRuntimeProperties(java.util.Properties p)
With this method you can set multiple runtime properties at the same time. |
void |
setScheduleRuntimeProperty(java.lang.String name,
java.lang.String value)
Sets a runtime property for the i-net Scheduler. |
void |
start()
This will start the i-net Scheduler. |
void |
stop()
This will stop the i-net Scheduler. |
| Field Detail |
|---|
public static final java.lang.String PROPERTY_MAX_WORKER
5. You can increment the value if you have small and fast
reports running. The effect of this property is that while the current number of executing tasks reaches this limit all tasks that should be executed will be queued so that the execution does
not start immediately.getSchedulerRuntimeProperty(PROPERTY_MAX_WORKER)setSchedulerRuntimeProperty(PROPERTY_MAX_WORKER,"6")
public static final java.lang.String PROPERTY_SMTP_PORT
setScheduleRuntimeProperty(String, String),
getScheduleRuntimeProperty(String),
Constant Field Valuespublic static final java.lang.String PROPERTY_POP3_PORT
setScheduleRuntimeProperty(String, String),
getScheduleRuntimeProperty(String),
Constant Field Valuespublic static final int LOG_LEVEL_FATAL
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_WARN
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_PARANOID
public static final java.lang.String PROPERTY_SMTP_HOST
setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String)
public static final java.lang.String PROPERTY_POP3_HOST
setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String)
public static final java.lang.String PROPERTY_USER
setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String)
public static final java.lang.String PROPERTY_PASSWORD
setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String)
public static final java.lang.String PROPERTY_SENDER
setScheduleRuntimeProperty(String, String) or
getScheduleRuntimeProperty(String)
public static final java.lang.String PROPERTY_PROPERTIES_CHECKER
setScheduleRuntimeProperty(String, String) and
getScheduleRuntimeProperty(String).
public static final java.lang.String PROPERTY_EMAIL_AUTHENTICATION
setScheduleRuntimeProperty(String, String) and
getScheduleRuntimeProperty(String).
setScheduleRuntimeProperty(String, String),
getScheduleRuntimeProperty(String),
Constant Field Values| Method Detail |
|---|
public ScheduleTask addTask(java.lang.String taskName)
throws ScheduleException
taskName - The name of the task. (The name has to be unique.)
ScheduleException - ScheduleExecution,
ScheduleTask
public void removeTask(java.lang.Integer taskID)
throws ScheduleException
taskID - The id of the task, that should be removed from the scheduler.
ScheduleException -
@Deprecated
public void removeTask(java.lang.String taskName)
throws ScheduleException
taskName - The name of the task, that should be removed from the scheduler.
ScheduleException - removeTask(Integer)public ScheduleTask[] list()
public ScheduleTask getTask(java.lang.String taskName)
list() for details.
taskName - The name of the ScheduleTask which should be
returned.
public ScheduleTask getTask(java.lang.Integer id)
list() for details.
id - the primary key for the task to get
public void loadXML()
saveXML()public boolean isActionEnabled(java.lang.String className)
true if the action is enabled, otherwise false
className - The given class name to check activation-state
true if the action is enabled, otherwise falsepublic boolean saveXML()
public void setPassword(java.lang.String newPassword)
saveXML() to save this setting to the configuration
file. Note: The password is only used by the web interface.
So if you do not use the web interface you do not need to set a
password. The given password will be encrypted.
newPassword - new password to use
public void addDynamicPropertiesClass(java.lang.String className,
java.lang.String path)
throws ScheduleException
className - The name of the DynamicProperties class.path - The path which will be added to the class path to find
the given class. Usually this should point to a jar file.
ScheduleException - If the class could not be found or the
given class does not implement DynamicProperties or it is an
abstract class or the class is already registered to the
i-net Scheduler.getDynamicPropertiesClassCount(),
getDynamicPropertiesClass(int),
removeDynamicPropertiesClass(String)
public void addDynamicPropertiesClass(java.lang.String className)
throws ScheduleException
className - The name of the DynamicProperties class.
ScheduleException - If the class could not be found or the
given class does not implement DynamicProperties or it is an
abstract class or the class is already registered to the
i-net Scheduler.getDynamicPropertiesClassCount(),
getDynamicPropertiesClass(int),
removeDynamicPropertiesClass(String)public int getDynamicPropertiesClassCount()
addDynamicPropertiesClass(String),
getDynamicPropertiesClass(String),
getDynamicPropertiesClass(int),
removeDynamicPropertiesClass(String)public Scheduler.DynamicPropertiesDefinition getDynamicPropertiesClass(int index)
index - A value between 0 and getDynamicPropertiesClassCount() specifying the definition to return.
addDynamicPropertiesClass(String),
getDynamicPropertiesClassCount(),
getDynamicPropertiesClass(String),
removeDynamicPropertiesClass(String)public Scheduler.DynamicPropertiesDefinition getDynamicPropertiesClass(java.lang.String className)
className - The name of the DynamicProperties class which definition should be returned.
null if no definition exists for this class.addDynamicPropertiesClass(String),
getDynamicPropertiesClassCount(),
getDynamicPropertiesClass(int),
removeDynamicPropertiesClass(String)
public void removeDynamicPropertiesClass(java.lang.String className)
throws ScheduleException
className - The name of the DynamicProperties class which definition should be removed from the i-net Scheduler.
ScheduleException - addDynamicPropertiesClass(String),
getDynamicPropertiesClass(String),
getDynamicPropertiesClassCount(),
getDynamicPropertiesClass(int)
public void addCustomAction(java.lang.String name,
java.lang.String className,
java.lang.String path)
throws ScheduleException
ScheduleAction. You have to give the action a name (not the class name) and
to specify the jar file where the class can be found. This jar file will be added to the class path of the i-net Scheduler so that it can be found at execution of a task which uses this
custom action.
name - A unique name for your custom action. (Does not have to be the class name. This can be a display name also).className - The package qualified class name of your custom action. e.g. com.mycompany.inet.report.CustomActionpath - The path to the jar file containing the custom action. This can be a path name or an URL.
ScheduleException - ScheduleAction. (SE0016)getCustomActionCount(),
getCustomAction(String),
getCustomAction(int),
removeCustomAction(String)public int getCustomActionCount()
getCustomAction(int),
getCustomAction(String),
addCustomAction(String, String, String),
removeCustomAction(String)public Scheduler.CustomActionDefinition getCustomAction(int index)
index - A value between 0 and getCustomActionCount()
getCustomActionCount(),
getCustomAction(String),
addCustomAction(String, String, String),
removeCustomAction(String)
public void start()
throws ScheduleException
ScheduleException - If you try to start the i-net Clear Reports Scheduler with no valid i-net Clear Reports Plus license. (SE0013)public boolean isStarted()
start() that it will not return the
real status. Because some threads are started you should wait some time before checking this return value.
True if the i-net Scheduler is running, false otherwise.public void stop()
public static Scheduler getInstance()
public void resetPassword()
setPassword(String) to set a new password.
saveXML()
to save this setting to the configuration file.
Note: The password is only used by the web interface. So
if you do not use the web interface you do not need to set a password.
setPassword(String)
public void setScheduleRuntimeProperty(java.lang.String name,
java.lang.String value)
PROPERTY_MAX_WORKER, PROPERTY_PASSWORD,
PROPERTY_POP3_HOST, PROPERTY_SENDER,
PROPERTY_SMTP_HOST, PROPERTY_USER
You have to call saveXML()
to save this setting to the configuration file.
name - The name of the runtime property to set.value - The new value for this runtime property.public void setScheduleRuntimeProperties(java.util.Properties p)
saveXML()
to save this setting to the configuration file.
p - The Properties object containing all runtime properties which
should be set.public java.lang.String getScheduleRuntimeProperty(java.lang.String name)
name - The name of the property which value should be returned.
null if this property
is not defined.public java.util.Properties getScheduleRuntimeProperties()
public static boolean isLogEnabled()
True if the logging is enabled false if not.setLogEnabled(boolean),
getLogLevel(),
getLogFile()@Deprecated public static java.lang.String getLogFile()
setLogFile(String),
isLogEnabled(),
getLogLevel()@Deprecated public static void setLogFile(java.lang.String logFile)
isLogEnabled() is true. You can also
set the name empty or null to indicate that no log file should be used.
In this case the log messages will be written to the log stream of i-net Clear Reports
defined in the i-net Clear Reports configuration.
logFile - The name of the file for the log messages of the i-net Scheduler or
an empty string or null.getLogFile(),
isLogEnabled(),
getLogLevel()@Deprecated public static int getLogLevel()
LOG_LEVEL_FATAL, LOG_LEVEL_ERROR,
LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG@Deprecated public static void setLogLevel(int logLevel)
LOG_LEVEL_DEBUG.
If you try to set an invalid value this will be ignored.
logLevel - One of these values: LOG_LEVEL_FATAL, LOG_LEVEL_ERROR,
LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUGgetLogLevel(),
isLogEnabled(),
getLogFile()public static void setLogEnabled(boolean logEnabled)
logEnabled - True for enabling the log and false
for disabling the log.public void resetScheduler()
public Scheduler.CustomActionDefinition getCustomAction(java.lang.String name)
name - The name with which the custom action is registered to the i-net Scheduler.
null if there is no custom action defined with this name.addCustomAction(String, String, String),
getCustomActionCount(),
getCustomAction(int),
removeCustomAction(String)
public void removeCustomAction(java.lang.String name)
throws ScheduleException
name - The name of the custom action. (This is not the class name)
ScheduleException - public void setPropertiesChecker(PropertiesChecker propertiesChecker)
getPropertiesChecker().
propertiesChecker - The instance of the PropertiesChecker class which should be used
or null if you do not want to use a PropertiesChecker class.public PropertiesChecker getPropertiesChecker()
PROPERTY_PROPERTIES_CHECKERsetPropertiesChecker(PropertiesChecker)
null if
none has been set.public java.util.List getEnabledActionClassNames()
public Scheduler.CustomActionDefinition getCustomActionByClassName(java.lang.String className)
getCustomAction(String), but will return the CustomAction which has the given classname.
className - the name of the class which realized the desired customAction
null if there is no custom action defined with this className.public void setEnabledActions(java.util.List enabledActions)
enabledActions - the list with classnames of the actions to be enabledpublic void configurationChanged(ConfigurationChangeEvent e)
Configuration has changed through Configuration.put(String, String) or Configuration.putAll(java.util.Map).ConfigurationManager.getCurrent())
configurationChanged in interface ConfigurationChangeListenere - ConfigurationChangeEventConfigurationChangeEvent
|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||