Novell exteNd
Director 5.2 API

com.sssw.fw.task.api
Interface EbiTaskManager

All Superinterfaces:
EbiStateChangeProducer
All Known Subinterfaces:
EbiTaskManager

public interface EbiTaskManager
extends EbiStateChangeProducer

This is a generic interface for a Task Manager. See also EbiTask.


Field Summary
static String TASK_MGR
          The Task Manager identifier string.
 
Method Summary
 boolean addTask(EbiContext context, EbiTask task, boolean overwrite)
          Add a new task.
 boolean enableTask(EbiContext context, boolean enable, String taskName)
          Enable/disable a specific task.
 Collection getFailedTaskNames(EbiContext context)
          Enumerate names of failed to load tasks.
 String getQualifier()
          Get the qualifier string.
 EbiTask getTask(EbiContext context, String taskName)
          Get a specific task by name.
 Collection getTaskNames(EbiContext context)
          Enumerate tasks.
 Collection getTasks(EbiContext context)
          Enumerate tasks.
 Collection getTasks(EbiContext context, EbiTaskType type)
          Get all the Tasks that belong to a specific Task Type.
 Collection getTasks(EbiContext context, String[] names)
          Get specific tasks.
 EbiTaskType getTaskType(EbiContext context, String name, String kind)
          Get a Task Type given its name and kind
 Collection getTaskTypes(EbiContext context)
          Get all Task Types.
 Collection getTaskTypes(EbiContext context, String kind)
          Get all Task Types of the specified kind.
 boolean isTaskEnabled(EbiContext context, String taskName)
          Find out if a specific task is enabled.
 void loadTaskList(EbiContext context, InputStream is)
          Load the task list from the specified input stream.
 void loadTaskList(InputStream is)
          Deprecated. Instead use loadTaskList that has an additional EbiContext parameter
 void loadTaskTypeList(InputStream is)
          Load the task type list.
 void setLog(EbiLog log)
          Set the log for the Task Manager to write into.
 void setQualifier(String qualifier)
          Set the qualifier string.
 void startTasks(EbiContext context)
          Fire off all tasks.
 void startTasks(EbiContext context, String[] names)
          Fire off specific tasks.
 void stopTasks(EbiContext context)
          Stop all tasks.
 void stopTasks(EbiContext context, String[] names)
          Stop specific tasks.
 void taskCompleted(EbiTask task, Object details)
          Callback notification of the successful completion of a task.
 void taskFailed(EbiTask task, EboException ex)
          Callback notification of a task failure.
 
Methods implemented from interface com.sssw.fw.event.api.EbiStateChangeProducer
addStateChangeListener, addStateChangeListener, addVetoableStateChangeListener, addVetoableStateChangeListener, fireStateChange, fireVetoableStateChange, getListeners, getScpDescription, getScpLog, getVetoableListeners, hasListeners, hasVetoableListeners, removeStateChangeListener, removeVetoableStateChangeListener, setScpDescription, setScpLog
 

Field Detail

TASK_MGR

public static final String TASK_MGR
The Task Manager identifier string.
Method Detail

loadTaskTypeList

public void loadTaskTypeList(InputStream is)
                      throws EboUnrecoverableSystemException
Load the task type list.
Parameters:
is - the input stream

getTaskTypes

public Collection getTaskTypes(EbiContext context)
                        throws EboUnrecoverableSystemException,
                               EboSecurityException
Get all Task Types.
Parameters:
context - context
Returns:
Collection of EbiTaskType's

getTaskTypes

public Collection getTaskTypes(EbiContext context,
                               String kind)
                        throws EboUnrecoverableSystemException,
                               EboSecurityException
Get all Task Types of the specified kind.
Returns:
Collection of EbiTaskType's

getTaskType

public EbiTaskType getTaskType(EbiContext context,
                               String name,
                               String kind)
                        throws EboUnrecoverableSystemException,
                               EboSecurityException
Get a Task Type given its name and kind
Returns:
the Task Type, or null if not found

loadTaskList

public void loadTaskList(InputStream is)
                  throws EboUnrecoverableSystemException
Deprecated. Instead use loadTaskList that has an additional EbiContext parameter

Load the task list from the specified input stream.
Parameters:
is - the input stream

loadTaskList

public void loadTaskList(EbiContext context,
                         InputStream is)
                  throws EboUnrecoverableSystemException
Load the task list from the specified input stream.
Parameters:
context - request/session context
is - the input stream

startTasks

public void startTasks(EbiContext context)
                throws EboUnrecoverableSystemException,
                       EboSecurityException
Fire off all tasks.
Parameters:
context - context

startTasks

public void startTasks(EbiContext context,
                       String[] names)
                throws EboUnrecoverableSystemException,
                       EboSecurityException
Fire off specific tasks.
Parameters:
context - context
names - the list of task names for tasks to fire off

stopTasks

public void stopTasks(EbiContext context)
               throws EboUnrecoverableSystemException,
                      EboSecurityException
Stop all tasks.
Parameters:
context - context

stopTasks

public void stopTasks(EbiContext context,
                      String[] names)
               throws EboUnrecoverableSystemException,
                      EboSecurityException
Stop specific tasks.
Parameters:
context - context
names - the list of task names for tasks to fire off

getTaskNames

public Collection getTaskNames(EbiContext context)
                        throws EboUnrecoverableSystemException,
                               EboSecurityException
Enumerate tasks.
Parameters:
context - context
Returns:
a Collection of names (Strings)

getFailedTaskNames

public Collection getFailedTaskNames(EbiContext context)
                              throws EboUnrecoverableSystemException,
                                     EboSecurityException
Enumerate names of failed to load tasks.
Parameters:
context - context
Returns:
a Collection of String objects represent the names of the tasks failed to load (String's)

getTasks

public Collection getTasks(EbiContext context)
                    throws EboUnrecoverableSystemException,
                           EboSecurityException
Enumerate tasks.
Parameters:
context - context
Returns:
a Collection of Task objects (EbiTask's)

getTasks

public Collection getTasks(EbiContext context,
                           String[] names)
                    throws EboUnrecoverableSystemException,
                           EboSecurityException
Get specific tasks.
Parameters:
context - context
names - list of task names
Returns:
a Collection of Task objects (EbiTask's)

getTasks

public Collection getTasks(EbiContext context,
                           EbiTaskType type)
                    throws EboUnrecoverableSystemException,
                           EboSecurityException
Get all the Tasks that belong to a specific Task Type.
Parameters:
context - context
type - the Task Type
Returns:
a Collection of Task objects (EbiTask's)

getTask

public EbiTask getTask(EbiContext context,
                       String taskName)
                throws EboUnrecoverableSystemException,
                       EboSecurityException
Get a specific task by name.
Parameters:
context - context
taskName - task name
Returns:
the task or null if not found

getQualifier

public String getQualifier()
Get the qualifier string.
Returns:
the qualifier string

enableTask

public boolean enableTask(EbiContext context,
                          boolean enable,
                          String taskName)
                   throws EboUnrecoverableSystemException,
                          EboSecurityException
Enable/disable a specific task.
Parameters:
context - context
enable - if true, enable the task, if false, disable it
taskName - the name of the task to enable or disable
Returns:
true if the task was successfully enabled/disabled, false if it was not found

isTaskEnabled

public boolean isTaskEnabled(EbiContext context,
                             String taskName)
                      throws EboUnrecoverableSystemException,
                             EboSecurityException
Find out if a specific task is enabled.
Parameters:
context - context
taskName - the name of the task to check
Returns:
true if the task is enabled, false if disabled or not found

addTask

public boolean addTask(EbiContext context,
                       EbiTask task,
                       boolean overwrite)
                throws EboUnrecoverableSystemException,
                       EboSecurityException
Add a new task.
Parameters:
context - context
task - the new task
overwrite - if true, overwrite any task with the same name
Returns:
true if added the task successfully, false if a task with the same name exists and the value of 'overwrite' was false

taskCompleted

public void taskCompleted(EbiTask task,
                          Object details)
Callback notification of the successful completion of a task.
Parameters:
task - the task that completed
details - any details or stats

taskFailed

public void taskFailed(EbiTask task,
                       EboException ex)
Callback notification of a task failure.
Parameters:
task - the task that failed
ex - any exception

setLog

public void setLog(EbiLog log)
Set the log for the Task Manager to write into.
Parameters:
log - the log to write into

setQualifier

public void setQualifier(String qualifier)
Set the qualifier string.
Parameters:
qualifier -  

Novell exteNd
Director 5.2 API