i-net Clear Reports

com.inet.report.schedule
Class ScheduleAction

java.lang.Object
  extended by com.inet.report.schedule.ScheduleAction
Direct Known Subclasses:
CacheAction, EmailAction, ErrorAction, FileAction, PrintAction

public abstract class ScheduleAction
extends java.lang.Object

This class represents an action which will be done when a task has been executed. There are five actions coming with the i-net Scheduler which will render the reports, send these as e-mail, print on a printer or save in a certain directory on the file system or to a FTP server.
You can also overwrite this class to implement an own action. The only necessary method which needs to be overwritten is action(ExecutedTask). This method will be called when the task is executed. You could then render the reports of this task. The five pre-defined actions you can find here:


Since:
i-net Crystal-Clear 6.0
See Also:
action(ExecutedTask)

Field Summary
static int TYPE_CACHE
          This constant identifies that a ScheduleAction is an instance of CacheAction.
static int TYPE_CUSTOM
          This constant identifies that a ScheduleAction is an CustomAction.
static int TYPE_EMAIL
          This constant identifies that a ScheduleAction is an instance of EmailAction.
static int TYPE_FILE
          This constant identifies that a ScheduleAction is an instance of FileAction.
static int TYPE_FTP
          This constant identifies that a ScheduleAction is an instance of FtpAction.
static int TYPE_PRINT
          This constant identifies that a ScheduleAction is an instance of PrintAction.
 
Constructor Summary
protected ScheduleAction()
          Constructor which has to be called by sub classes.
 
Method Summary
abstract  void action(ExecutedTask task)
          Will be invoked when an action is executed.
 java.lang.String[] getErrorMessages()
          Has to be overridden to provide error information and to determine the behavior of isValid().
 int getType()
          Returns the type of this ScheduleAction.
 boolean isValid()
          Every ScheduleAction can be checked whether it is valid.
 java.lang.String toString()
          Returns a string representation of this ScheduleAction.
 

Field Detail

TYPE_EMAIL

public static final int TYPE_EMAIL
This constant identifies that a ScheduleAction is an instance of EmailAction.

See Also:
EmailAction, getType(), Constant Field Values

TYPE_FILE

public static final int TYPE_FILE
This constant identifies that a ScheduleAction is an instance of FileAction.

See Also:
FileAction, getType(), Constant Field Values

TYPE_PRINT

public static final int TYPE_PRINT
This constant identifies that a ScheduleAction is an instance of PrintAction.

See Also:
PrintAction, getType(), Constant Field Values

TYPE_CUSTOM

public static final int TYPE_CUSTOM
This constant identifies that a ScheduleAction is an CustomAction.

See Also:
getType(), Constant Field Values

TYPE_CACHE

public static final int TYPE_CACHE
This constant identifies that a ScheduleAction is an instance of CacheAction.

See Also:
CacheAction, getType(), Constant Field Values

TYPE_FTP

public static final int TYPE_FTP
This constant identifies that a ScheduleAction is an instance of FtpAction.

Since:
7.0
See Also:
FtpAction, getType(), Constant Field Values
Constructor Detail

ScheduleAction

protected ScheduleAction()
Constructor which has to be called by sub classes.

Method Detail

action

public abstract void action(ExecutedTask task)
Will be invoked when an action is executed. Has to be implemented by a child class to provide functionality.

Parameters:
task - The executed task including all reports which can be executed.

isValid

public final boolean isValid()
Every ScheduleAction can be checked whether it is valid. An action is valid if all essential properties are set to values that allow this action to be executed in a meaningful way. This method is final and cannot be overridden. To implement the functionality provided by this method you have to override getErrorMessages(). If the String[] returned by that method has a length of zero the ScheduleAction is considered to be valid. If it is not valid you can rest assured that there are error messages that explain what is going wrong.

Returns:
true, if getErrorMessages() returns an array of length zero

getErrorMessages

public java.lang.String[] getErrorMessages()
Has to be overridden to provide error information and to determine the behavior of isValid(). The returned array should have a length of zero when there are no errors to report and it should not contain any null values.

Returns:
an array containing error messages

getType

public final int getType()
Returns the type of this ScheduleAction.

Returns:
Can only be one of the following values. e-mail, file, print, cache, ftp or custom.
See Also:
TYPE_CACHE, TYPE_CUSTOM, TYPE_EMAIL, TYPE_FILE, TYPE_FTP, TYPE_PRINT

toString

public java.lang.String toString()
Returns a string representation of this ScheduleAction. If not overwritten the returned string will contain any error message returned by getErrorMessages().

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this ScheduleAction.
Since:
6.1

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH