Novell exteNd
Director 5.2 API

com.sssw.fw.task.api
Interface EbiTask

All Superinterfaces:
EbiElement, Serializable
All Known Subinterfaces:
EbiDocExpireTask, EbiDocJanitorTask, EbiDocPublishTask, EbiPeriodicTask, EbiScheduledTask, EbiSynchTask, EbiTask

public interface EbiTask
extends EbiElement, Serializable

Generic interface that defines the behavior for a task. A task is a background job.


Field Summary
static String TASK_OBJECT_ID
          The object ID for a task.
 
Method Summary
 void doTask()
          Runs the actual task.
 void enable(boolean enable)
          Enables the task.
 void execute(EbiTaskManager tm)
          Executes the task.
 void fromXML(Node node)
          Populates the task object from XML.
 EbiContext getContext()
          Gets the context.
 String getDescription()
          Gets the description of this task.
 Timestamp getLaunchTime()
          Gets the time the task was fired off.
 String getName()
          Gets the name of the task.
 boolean getSinceLast()
          Determines whether the task is expected to only deal with conditions that have changed or occurred since the time the task was last run.
 EbiTaskType getTaskType()
          Gets the task type.
 int getTimesRan()
          Gets the number of times the task has run.
 Object getUserObject()
          Gets the object set into the Task by the user of the Task.
 boolean isEnabled()
          Checks to see if the task is enabled or disabled.
 boolean isOfType(EbiTaskType taskType)
          Checks to see if the task belongs to the specified type.
 boolean isStarted()
          Tells whether the task has been started.
 void setContext(EbiContext context)
          Sets the context.
 void setDescription(String description)
          Sets the description of this task.
 void setLaunchTime(Timestamp launchTime)
          Sets the time the task was fired off.
 void setName(String name)
          Sets the name of the task.
 void setSinceLast(boolean sinceLast)
          Determines whether the task is expected to only deal with conditions that have changed or occurred since the time the task was last run.
 void setTaskType(EbiTaskType taskType)
          Sets the task type.
 void setTimesRan(int timesRan)
          Sets the number of times the task has run.
 void setUserObject(Object obj)
          Sets an object defined by the Task user into the Task.
 void start()
          Starts the task (can only start if it's not disabled).
 void stop()
          Stops the task.
 
Methods implemented from interface com.sssw.fw.api.EbiElement
getType
 

Field Detail

TASK_OBJECT_ID

public static final String TASK_OBJECT_ID
The object ID for a task.
Method Detail

setName

public void setName(String name)
Sets the name of the task.
Parameters:
name - The name.

setTaskType

public void setTaskType(EbiTaskType taskType)
Sets the task type.
Parameters:
taskType - The type.

setDescription

public void setDescription(String description)
Sets the description of this task.
Parameters:
description - The description.

setSinceLast

public void setSinceLast(boolean sinceLast)
Determines whether the task is expected to only deal with conditions that have changed or occurred since the time the task was last run.
Parameters:
sinceLast - If true, the task is to only deal with conditions that have changed or occurred since the time the task was last run.

setLaunchTime

public void setLaunchTime(Timestamp launchTime)
Sets the time the task was fired off.
Parameters:
schedTime - The time the task was fired off.

setTimesRan

public void setTimesRan(int timesRan)
Sets the number of times the task has run.
Parameters:
timesRan - The times the task has run.

setUserObject

public void setUserObject(Object obj)
Sets an object defined by the Task user into the Task.
Parameters:
obj - The object.

setContext

public void setContext(EbiContext context)
Sets the context.
Parameters:
context - Context.

getName

public String getName()
Gets the name of the task.
Returns:
The task name.

getTaskType

public EbiTaskType getTaskType()
Gets the task type.
Returns:
The task type.

getDescription

public String getDescription()
Gets the description of this task.
Returns:
The task description.

getSinceLast

public boolean getSinceLast()
Determines whether the task is expected to only deal with conditions that have changed or occurred since the time the task was last run.
Returns:
True if the task is to only deal with conditions that have changed or occurred since the time the task last run.

getLaunchTime

public Timestamp getLaunchTime()
Gets the time the task was fired off.
Returns:
The time the task was fired off.

getTimesRan

public int getTimesRan()
Gets the number of times the task has run.
Returns:
The number of times the task has run so far.

getUserObject

public Object getUserObject()
Gets the object set into the Task by the user of the Task.
Returns:
The object or null if none set.

getContext

public EbiContext getContext()
Gets the context.
Returns:
The context.

fromXML

public void fromXML(Node node)
Populates the task object from XML.
Parameters:
node - The node to populate from.

enable

public void enable(boolean enable)
Enables the task.
Parameters:
enable - If true, enable the task, otherwise disable it.

isEnabled

public boolean isEnabled()
Checks to see if the task is enabled or disabled.
Returns:
True if the task is enabled, false if disabled.

start

public void start()
Starts the task (can only start if it's not disabled).

stop

public void stop()
Stops the task.

isStarted

public boolean isStarted()
Tells whether the task has been started.

isOfType

public boolean isOfType(EbiTaskType taskType)
Checks to see if the task belongs to the specified type.
Parameters:
taskType - The type.
Returns:
True if the task belongs to the type, false otherwise.

execute

public void execute(EbiTaskManager tm)
Executes the task.
Parameters:
tm - the Task Manager

doTask

public void doTask()
            throws com.sssw.fw.task.api.EboTaskException
Runs the actual task.

Novell exteNd
Director 5.2 API