com.tivoli.twg.engine
Class TWGClientTaskList

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGClientTaskList

public class TWGClientTaskList
extends java.lang.Object

This class is used by TWGTask to maintain a list of client services to start on managed objects based on their managed object class. It basically keeps a hash tables where the key is the ID of the managed object factory and the value is a vector of client tasks for the specified MOF.


Constructor Summary
TWGClientTaskList()
          Default constructor
TWGClientTaskList(TWGByteArrayInputStream data)
          Constructor for creating a TWGClientTaskList from an input byte stream
 
Method Summary
 boolean addClientTasks(java.lang.String className, java.lang.String taskList)
          Add a client and it's list of tasks.
 boolean addClientTasks(java.lang.String className, java.lang.String taskList, boolean single)
          Add a client and it's list of tasks.
 void flatten(TWGByteArrayOutputStream data)
          Save the contents of this list to an output byte stream as follows:
 void flatten(TWGByteArrayOutputStream data, boolean forConsole)
          Save the contents of this list to an output byte stream as follows:
 long[] getMofoids()
          Get an array of MOFs that have a task list defined.
 int getNumMOFs()
          Get the number of MOFs that have a task list defined.
 Vect getTaskList(long mofoid)
          Get the client task list for the specified MOF.
 java.lang.String toString()
          Print out as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGClientTaskList

public TWGClientTaskList()
Default constructor


TWGClientTaskList

public TWGClientTaskList(TWGByteArrayInputStream data)
                  throws java.io.UTFDataFormatException
Constructor for creating a TWGClientTaskList from an input byte stream

Method Detail

flatten

public void flatten(TWGByteArrayOutputStream data)
Save the contents of this list to an output byte stream as follows:
    int count of classes
    for each class:
       long mofoid
       int  count of tasks for this class
       for each client task:
          string
 

Parameters:
data - the output byte stream where data should be written

flatten

public void flatten(TWGByteArrayOutputStream data,
                    boolean forConsole)
Save the contents of this list to an output byte stream as follows:
    int count of classes
    for each class:
       long mofoid
       int  count of tasks for this class
       for each client task:
          string
 

Parameters:
data - the output byte stream where data should be written
forConsole - true to save only count of client tasks, false to also include task names

addClientTasks

public boolean addClientTasks(java.lang.String className,
                              java.lang.String taskList)
Add a client and it's list of tasks. If the client has already been added to the list, then the tasks in the taskList parameter are added to the existing list for the client.

Parameters:
className - String containing the name of the client Java class.
taskList - String containing list of client tasks (separated by vertical bars "|")
Returns:
boolean true, if the client tasks were successfully added, false if the specified client class is not registered with the engine.

addClientTasks

public boolean addClientTasks(java.lang.String className,
                              java.lang.String taskList,
                              boolean single)
Add a client and it's list of tasks. If the client has already been added to the list, then the tasks in the taskList parameter are added to the existing list for the client.

Parameters:
className - String containing the name of the client Java class.
taskList - String containing list of client tasks (separated by vertical bars "|")
single - task list is a single class that should not be parsed using vertical bars "|" as delimiters
Returns:
boolean true, if the client tasks were successfully added, false if the specified client class is not registered with the engine.

getTaskList

public Vect getTaskList(long mofoid)
Get the client task list for the specified MOF.

Parameters:
mofoid - the ID of the Managed Object Factory to retrieve the defined client tasks for. This will return null if the specified MOF is not in this TWGClientTaskList.

getNumMOFs

public int getNumMOFs()
Get the number of MOFs that have a task list defined.

Returns:
int number of MOFs

getMofoids

public long[] getMofoids()
Get an array of MOFs that have a task list defined.

Returns:
long[] of mofoids

toString

public java.lang.String toString()
Print out as a string