i-net Clear Reports

com.inet.report.schedule
Class Scheduler

java.lang.Object
  extended by com.inet.report.schedule.Scheduler
All Implemented Interfaces:
ConfigurationChangeListener

public class Scheduler
extends java.lang.Object
implements ConfigurationChangeListener

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:

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().

Since:
6.0

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

PROPERTY_MAX_WORKER

public static final java.lang.String PROPERTY_MAX_WORKER
With this property you can specify how many task can be executed simultaneously. The default value for this property is 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.

To get the current value for max worker you should call

getSchedulerRuntimeProperty(PROPERTY_MAX_WORKER)

and to set the current value you should call

setSchedulerRuntimeProperty(PROPERTY_MAX_WORKER,"6")

See Also:
Constant Field Values

PROPERTY_SMTP_PORT

public static final java.lang.String PROPERTY_SMTP_PORT
Property used to define the SMTP server port to connect when EmailAction is used. The default port used is 25.

Since:
7.3
See Also:
setScheduleRuntimeProperty(String, String), getScheduleRuntimeProperty(String), Constant Field Values

PROPERTY_POP3_PORT

public static final java.lang.String PROPERTY_POP3_PORT
Property used to define the POP3 server port to connect when EmailAction is used. The default port used is 110.

Since:
7.3
See Also:
setScheduleRuntimeProperty(String, String), getScheduleRuntimeProperty(String), Constant Field Values

LOG_LEVEL_FATAL

public static final int LOG_LEVEL_FATAL
This constant defines the log level FATAL.

See Also:
Constant Field Values

LOG_LEVEL_ERROR

public static final int LOG_LEVEL_ERROR
This constant defines the log level ERROR.

See Also:
Constant Field Values

LOG_LEVEL_WARN

public static final int LOG_LEVEL_WARN
This constant defines the log level WARN.

See Also:
Constant Field Values

LOG_LEVEL_INFO

public static final int LOG_LEVEL_INFO
This constant defines the log level INFO.

See Also:
Constant Field Values

LOG_LEVEL_DEBUG

public static final int LOG_LEVEL_DEBUG
This constant defines the log level DEBUG.

See Also:
Constant Field Values

LOG_LEVEL_PARANOID

public static final int LOG_LEVEL_PARANOID
This constant defines the log level PARANOID.

Since:
6.1
See Also:
Constant Field Values

PROPERTY_SMTP_HOST

public static final java.lang.String PROPERTY_SMTP_HOST
The key for the property "smtphost" to use with setScheduleRuntimeProperty(String, String) or getScheduleRuntimeProperty(String)

See Also:
Constant Field Values

PROPERTY_POP3_HOST

public static final java.lang.String PROPERTY_POP3_HOST
The key for the property "pop3host" to use with setScheduleRuntimeProperty(String, String) or getScheduleRuntimeProperty(String)

See Also:
Constant Field Values

PROPERTY_USER

public static final java.lang.String PROPERTY_USER
The key for the property "user" to use with setScheduleRuntimeProperty(String, String) or getScheduleRuntimeProperty(String)

See Also:
Constant Field Values

PROPERTY_PASSWORD

public static final java.lang.String PROPERTY_PASSWORD
The key for the property "password" to use with setScheduleRuntimeProperty(String, String) or getScheduleRuntimeProperty(String)

See Also:
Constant Field Values

PROPERTY_SENDER

public static final java.lang.String PROPERTY_SENDER
The key for the property "sender" to use with setScheduleRuntimeProperty(String, String) or getScheduleRuntimeProperty(String)

See Also:
Constant Field Values

PROPERTY_PROPERTIES_CHECKER

public static final 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).

Since:
6.1
See Also:
Constant Field Values

PROPERTY_EMAIL_AUTHENTICATION

public static final 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).
This property describes which authentication should be used to connect to the email account used for sending emails with the EmailAction. There are four possible values for the authentication mode:

Since:
6.1
See Also:
setScheduleRuntimeProperty(String, String), getScheduleRuntimeProperty(String), Constant Field Values
Method Detail

addTask

public ScheduleTask addTask(java.lang.String taskName)
                     throws ScheduleException
This method allows you to create a new task. All you have to supply is a unique name for the task. This will automatically create a "dummy" OneDayExecution time object with the start date being the current date.

Parameters:
taskName - The name of the task. (The name has to be unique.)
Returns:
A ScheduleTask object which was directly added to the scheduler.
Throws:
ScheduleException -
  • If the task name taskName passed was null or empty. (SE0001)
  • If a task with name taskName already exists. (SE0002)
See Also:
ScheduleExecution, ScheduleTask

removeTask

public void removeTask(java.lang.Integer taskID)
                throws ScheduleException
Removes the specified task from the scheduler. This also means that current rendering actions for this task will be canceled and possible rendered instances in the cache will be deleted.

Parameters:
taskID - The id of the task, that should be removed from the scheduler.
Throws:
ScheduleException -
  • If the task id taskID passed was null or negative. (SE0003)
  • If a task with the specified id taskID does not exist. (SE0004)
in the scheduler.
Since:
11.0

removeTask

@Deprecated
public void removeTask(java.lang.String taskName)
                throws ScheduleException
Deprecated. As of i-net Clear Reports 12.0 the task's ID will be the primary key, use removeTask(Integer) instead.

Removes the specified task from the scheduler. This also means that current rendering actions for this task will be canceled and possible rendered instances in the cache will be deleted.

Parameters:
taskName - The name of the task, that should be removed from the scheduler.
Throws:
ScheduleException -
  • If the task name taskName passed was null or empty. (SE0003)
  • If a task with the specified name taskName does not exist. (SE0004)
in the scheduler.
See Also:
removeTask(Integer)

list

public ScheduleTask[] list()
This method returns an array of all ScheduleTask registered in this scheduler.

Returns:
An array with the ScheduleTask instances or an empty array if no tasks have been found.

getTask

public ScheduleTask getTask(java.lang.String taskName)
This method will return a ScheduleTask instance.
See list() for details.

Parameters:
taskName - The name of the ScheduleTask which should be returned.
Returns:
The ScheduleTask instance with the given name. Or null if a task with the given name does not exist.

getTask

public ScheduleTask getTask(java.lang.Integer id)
This method will return a ScheduleTask instance.
See list() for details.

Parameters:
id - the primary key for the task to get
Returns:
The ScheduleTask instance with the given id. Or null if a task with the given id does not exist.
Since:
11.0

loadXML

public void loadXML()
This method will read the schedule configuration from an XML file and create the schedule tasks. These tasks will be added to the waiting tasks if it is enabled.
Since i-net Clear reports 12.0 this method behaves different: It will use the system-preferences to save and load information to/from.
For backward compatibility, the information of an existing "scheduler.xml"-file will be imported, renaming the file to "scheduler.xml.migrated".
From that point only system-preferences will be used.

See Also:
saveXML()

isActionEnabled

public boolean isActionEnabled(java.lang.String className)
Returns whether the action is enabled. true if the action is enabled, otherwise false

Parameters:
className - The given class name to check activation-state
Returns:
true if the action is enabled, otherwise false
Since:
11.0

saveXML

public 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".
You should call this method if you changed something in the i-net Scheduler and you want to get sure that these settings are still there after a restart of the i-net Scheduler.
Since i-net Clear Reports 12.0 this method will behave different: it will store the contents in the system-preferences instaed of the "scheduler.xml"-file.

Returns:
Returns true if saving was successful.

setPassword

public void setPassword(java.lang.String newPassword)
Sets a new password for the web interface. You have to call 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.

Parameters:
newPassword - new password to use

addDynamicPropertiesClass

public void addDynamicPropertiesClass(java.lang.String className,
                                      java.lang.String path)
                               throws ScheduleException
This will register an DynamicProperties class to the i-net Scheduler and the path where this class can be found. You have to register such a DynamicProperties class before you can use it for a ScheduleReport. This is needed because you will pass the path of the jar file also where the class should be found and this path has to be added to the class path. So this method will also check if the given class can be found in the resulting class path.
You do not have to specify a path in every case. If the class is already in class path when the i-net Scheduler is loaded then the class will be found without specifying a path. But it is strongly recommended to do so nevertheless.

Parameters:
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.
Throws:
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.
See Also:
getDynamicPropertiesClassCount(), getDynamicPropertiesClass(int), removeDynamicPropertiesClass(String)

addDynamicPropertiesClass

public void addDynamicPropertiesClass(java.lang.String className)
                               throws ScheduleException
This will register an DynamicProperties class to the i-net Scheduler and the path where this class can be found. You have to register such a DynamicProperties class before you can use it for a ScheduleReport. This is needed because you will pass the path of the jar file also where the class should be found and this path has to be added to the class path. So this method will also check if the given class can be found in the resulting class path.
You do not have to specify a path in every case. If the class is already in class path when the i-net Scheduler is loaded then the class will be found without specifying a path. But it is strongly recommended to do so nevertheless.

Parameters:
className - The name of the DynamicProperties class.
Throws:
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.
Since:
11.1
See Also:
getDynamicPropertiesClassCount(), getDynamicPropertiesClass(int), removeDynamicPropertiesClass(String)

getDynamicPropertiesClassCount

public int getDynamicPropertiesClassCount()
Returns the number of DynamicProperties classes registered to the i-net Scheduler.

Returns:
The number of registered DynamicProperties classes.
See Also:
addDynamicPropertiesClass(String), getDynamicPropertiesClass(String), getDynamicPropertiesClass(int), removeDynamicPropertiesClass(String)

getDynamicPropertiesClass

public Scheduler.DynamicPropertiesDefinition getDynamicPropertiesClass(int index)
This will return the DynamicProperties definition from the list at the given index.

Parameters:
index - A value between 0 and getDynamicPropertiesClassCount() specifying the definition to return.
Returns:
A definition specifying a valid DynamicProperties class and their path where it can be found.
See Also:
addDynamicPropertiesClass(String), getDynamicPropertiesClassCount(), getDynamicPropertiesClass(String), removeDynamicPropertiesClass(String)

getDynamicPropertiesClass

public Scheduler.DynamicPropertiesDefinition getDynamicPropertiesClass(java.lang.String className)
This will return the DynamicPropertiesDefinition of the given DynamicProperties class. There can be only one definition per class so if the given class is defined in the i-net Scheduler the relating definition will be returned.

Parameters:
className - The name of the DynamicProperties class which definition should be returned.
Returns:
The definition for the given class or null if no definition exists for this class.
See Also:
addDynamicPropertiesClass(String), getDynamicPropertiesClassCount(), getDynamicPropertiesClass(int), removeDynamicPropertiesClass(String)

removeDynamicPropertiesClass

public void removeDynamicPropertiesClass(java.lang.String className)
                                  throws ScheduleException
Removes the definition for the given DynamicProperty class. This can only be done if there is a definition for this class in the i-net Scheduler and if there is no report which uses this DynamicProperty class.

Parameters:
className - The name of the DynamicProperties class which definition should be removed from the i-net Scheduler.
Throws:
ScheduleException -
  • If there is no DynamicProperties class defined with this name. (SE0005)
  • If there is at least one report using this DynamicProperties class. (SE0006)
See Also:
addDynamicPropertiesClass(String), getDynamicPropertiesClass(String), getDynamicPropertiesClassCount(), getDynamicPropertiesClass(int)

addCustomAction

public void addCustomAction(java.lang.String name,
                            java.lang.String className,
                            java.lang.String path)
                     throws ScheduleException
Adds a custom action to the list of custom actions of the i-net Scheduler. A custom action has to extend 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.
The custom action will be registered to the whole scheduler not to one single task. This is because the web front-end of the i-net Scheduler can then offer the usage of a custom action to all tasks.

Parameters:
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.CustomAction
path - The path to the jar file containing the custom action. This can be a path name or an URL.
Throws:
ScheduleException -
  • If the name for the custom action class was null or empty. (SE0008)
  • If there is already a custom action defined with this name. (SE0009)
  • If the class name of the custom action class was null or empty. (SE0014)
  • If the custom action class could not be found in classpath. (SE0015)
  • If the found custom action class is no sub class of ScheduleAction. (SE0016)
  • If the found custom action class is abstract. (SE0017)
See Also:
getCustomActionCount(), getCustomAction(String), getCustomAction(int), removeCustomAction(String)

getCustomActionCount

public int getCustomActionCount()
This method will return the number of custom action registered to the i-net Scheduler.

Returns:
The number of custom actions of this scheduler.
See Also:
getCustomAction(int), getCustomAction(String), addCustomAction(String, String, String), removeCustomAction(String)

getCustomAction

public Scheduler.CustomActionDefinition getCustomAction(int index)
Returns the custom action definition from the list of definitions at the given index.

Parameters:
index - A value between 0 and getCustomActionCount()
Returns:
A custom action definition describing one single custom action registered to the i-net Scheduler.
See Also:
getCustomActionCount(), getCustomAction(String), addCustomAction(String, String, String), removeCustomAction(String)

start

public void start()
           throws ScheduleException
This will start the i-net Scheduler. All the tasks currently defined will be scheduled with their next execution time. If the i-net Scheduler was running already nothing will happen.

Throws:
ScheduleException - If you try to start the i-net Clear Reports Scheduler with no valid i-net Clear Reports Plus license. (SE0013)

isStarted

public boolean isStarted()
This will return whether the i-net Scheduler is currently running or not. Please note that if you check this method immediately after you called start() that it will not return the real status. Because some threads are started you should wait some time before checking this return value.

Returns:
True if the i-net Scheduler is running, false otherwise.

stop

public void stop()
This will stop the i-net Scheduler. All execution tasks will be canceled and all threads of the i-net Scheduler will be stopped.


getInstance

public static Scheduler getInstance()
This will return an instance of the i-net Scheduler. If it is the first call of this method then the configuration will be loaded from the configuration xml file "scheduler.xml". This will also start the i-net Scheduler if the last status of the i-net Scheduler was running at system or JavaVM shutdown.
All further requests will return the same instance of the i-net Scheduler within the same Java Virtual Machine.

Returns:
An instance of the i-net Scheduler.

resetPassword

public void resetPassword()
This will reset the password of the i-net Scheduler.
With the i-net Scheduler - web interface you can set a new password. Also, it is possible to call setPassword(String) to set a new password.
You have to call 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.

See Also:
setPassword(String)

setScheduleRuntimeProperty

public void setScheduleRuntimeProperty(java.lang.String name,
                                       java.lang.String value)
Sets a runtime property for the i-net Scheduler. You should not use this method one of the following constants for the name of the property. 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.

Parameters:
name - The name of the runtime property to set.
value - The new value for this runtime property.

setScheduleRuntimeProperties

public void setScheduleRuntimeProperties(java.util.Properties p)
With this method you can set multiple runtime properties at the same time. As key in the passed Properties object you have to use the name of the property and for the value the property value. You have to call saveXML() to save this setting to the configuration file.

Parameters:
p - The Properties object containing all runtime properties which should be set.

getScheduleRuntimeProperty

public 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. You simply pass the name of the property and you will get its value as a string representation.

Parameters:
name - The name of the property which value should be returned.
Returns:
The value of the property or null if this property is not defined.

getScheduleRuntimeProperties

public java.util.Properties getScheduleRuntimeProperties()
This will return all i-net Scheduler runtime properties currently set.

Returns:
The runtime properties of the i-net Scheduler.

isLogEnabled

public static boolean isLogEnabled()
Returns whether the logging of the i-net Scheduler is enabled or not.

Returns:
True if the logging is enabled false if not.
See Also:
setLogEnabled(boolean), getLogLevel(), getLogFile()

getLogFile

@Deprecated
public 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.

Returns the name of the file where the log output should be written if

Returns:
The name of the file where the log messages will be saved or an empty String if no file should be used.
See Also:
setLogFile(String), isLogEnabled(), getLogLevel()

setLogFile

@Deprecated
public 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.

Sets the name of the file where the log messages of the i-net Scheduler should be saved if 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.
Please note that if you change this setting this will only have effect if the i-net Scheduler is restarted.

Parameters:
logFile - The name of the file for the log messages of the i-net Scheduler or an empty string or null.
See Also:
getLogFile(), isLogEnabled(), getLogLevel()

getLogLevel

@Deprecated
public 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.

Returns the level of the log that should be written. A higher level will produce more log messages but also will give you more information about the executions.

Returns:
One of these values: LOG_LEVEL_FATAL, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG

setLogLevel

@Deprecated
public 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.

Sets the value for the log level of the i-net Scheduler. If you want to get more information you can increase the log level. Please note that this it produce a lot of messages if you set it to LOG_LEVEL_DEBUG. If you try to set an invalid value this will be ignored.
Please note that if you change this setting this will only have effect if the i-net Scheduler is restarted.

Parameters:
logLevel - One of these values: LOG_LEVEL_FATAL, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG
See Also:
getLogLevel(), isLogEnabled(), getLogFile()

setLogEnabled

public static void setLogEnabled(boolean logEnabled)
Sets whether the log of the i-net Scheduler should be enabled or not.
Please note that if you change this setting this will only have effect if the i-net Scheduler is restarted.

Parameters:
logEnabled - True for enabling the log and false for disabling the log.

resetScheduler

public void resetScheduler()
This will reset the i-net Scheduler. That means that if the i-net Scheduler is currently running then it will be stopped. All currently defined tasks will be removed with their reports and actions. Also the configurations for the custom actions and the DynamicProperties classes will be deleted.
The result will be an empty i-net Scheduler which has no tasks, no custom actions, no DynamicProperties classes and which is then not running.


getCustomAction

public Scheduler.CustomActionDefinition getCustomAction(java.lang.String name)
Returns the custom action definition registered with the given name. Each custom action registered to the i-net Scheduler has a unique name. This name can here be used to get the complete description of this custom action.

Parameters:
name - The name with which the custom action is registered to the i-net Scheduler.
Returns:
The custom action definition which is registered with this name or null if there is no custom action defined with this name.
See Also:
addCustomAction(String, String, String), getCustomActionCount(), getCustomAction(int), removeCustomAction(String)

removeCustomAction

public void removeCustomAction(java.lang.String name)
                        throws ScheduleException
Removes the registered custom action from the i-net Scheduler if it exists.

Parameters:
name - The name of the custom action. (This is not the class name)
Throws:
ScheduleException -
  • If the name for the custom action class was null or empty. (SE0010)
  • If there is no custom action defined with this name. (SE0011)
  • If there is at least one task defined which uses the custom action to be removed. (SE0012)

setPropertiesChecker

public 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. With the PropertiesChecker you can filter/add/remove properties before rendering or make changes to the Engine object before rendering e.g. setting an own connection or sql statement.
You can check if there is a PropertiesChecker set by calling getPropertiesChecker().

Parameters:
propertiesChecker - The instance of the PropertiesChecker class which should be used or null if you do not want to use a PropertiesChecker class.
Since:
6.0

getPropertiesChecker

public PropertiesChecker getPropertiesChecker()
Returns the PropertiesChecker currently set for rendering report with the cache interface of i-net Clear Reports. With the PropertiesChecker you can filter/add/remove properties before rendering or make changes to the Engine object before rendering e.g. setting an own connection or sql statement.
Please note that there are two ways to specify a PropertiesChecker class and that this method will return a PropertiesChecker class not considering which method was used.

The methods are the following:

Important: The second method will always have a higher priority. So when you set the runtime property after specifing a concrete instance of a PropertiesChecker then this call will have no effect.

Returns:
The currently set instance of a PropertiesChecker or null if none has been set.
Since:
6.0

getEnabledActionClassNames

public java.util.List getEnabledActionClassNames()
Get a list of all action which are currently enabled/activated.

Returns:
a list containing the classNames iof all actions which are currently enabled (normal actions plus custom actions)
Since:
i-net Clear Reports 12

getCustomActionByClassName

public Scheduler.CustomActionDefinition getCustomActionByClassName(java.lang.String className)
Returns the custom action definition registered with the given class name. This is similar to getCustomAction(String), but will return the CustomAction which has the given classname.

Parameters:
className - the name of the class which realized the desired customAction
Returns:
The custom action definition which is registered with this name or null if there is no custom action defined with this className.
Since:
i-net Clear Reports 12

setEnabledActions

public void setEnabledActions(java.util.List enabledActions)
Sets all enabled actions.
This will overwrite any previously saved list of enabled actions, so each action listed will be enabled and any other will be disabled.

Parameters:
enabledActions - the list with classnames of the actions to be enabled

configurationChanged

public void configurationChanged(ConfigurationChangeEvent e)
For scheduler, this will check whether still a plus-license is used.
If not then it will stop itself when it's running.
When configuration changed to a plus-license and the settings say the scheduler is started, will start the scheduler when its not running.
This event is fired, if:

Specified by:
configurationChanged in interface ConfigurationChangeListener
Parameters:
e - ConfigurationChangeEvent
See Also:
ConfigurationChangeEvent

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH