com.tivoli.twg.engine
Class TWGRemoteTaskManager

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

public class TWGRemoteTaskManager
extends java.lang.Object

This class manages all task related communications with the core engine for a task server running in a different JVM. Note: Many of the methods have two versions, one with a ServiceNode parameter and one without. If setServiceNode() has been called, then the version without the ServiceNode parameter can be used. Calling the version without the ServiceNode parameter before setServiceNode() has been called will result in a NullPointerException.


Field Summary
static long COMMAND_CLEAR_LOG_FILE_CONTENTS
           
static long COMMAND_GET_LOG_FILE_CONTENTS
           
static long COMMAND_GET_LOG_FILE_DEFINITIONS
           
static long RETURN_DELETE_PENDING
           
static long RETURN_GENERAL_FAILURE
           
static long RETURN_NO_LOG_FILE_DEF
           
static long RETURN_OK
           
static long RETURN_UNKNOWN_SUBTASK_ID
           
static long RETURN_UNKNOWN_TASK_ACT_ID
           
static long RETURN_UNKNOWN_TASK_ID
           
static long RETURN_UNKNOWN_USER_ID
           
 
Constructor Summary
TWGRemoteTaskManager()
           
 
Method Summary
static void activateSubtask(long localID, long toid, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener)
          Ask the server engine to activate a subtask
static void activateSubtask(long localID, long toid, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener, byte[] taskActData)
          Ask the server engine to activate a subtask
static void activateSubtask(long localID, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener)
          Ask the server engine to activate a subtask
static void activateSubtask(long localID, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener, byte[] taskActData)
          Ask the server engine to activate a subtask
static void activateSubtask(ServiceNode sn, long localID, long toid, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener)
          Ask the server engine to activate a subtask
static void activateSubtask(ServiceNode sn, long localID, long toid, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener, byte[] taskActData)
          Ask the server engine to activate a subtask
static void activateSubtask(ServiceNode sn, long localID, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener)
          Ask the server engine to activate a subtask
static void activateSubtask(ServiceNode sn, long localID, java.lang.String taskID, java.lang.String subtaskID, LongValueSet moid, LongValueSet foid, RemoteTaskActivatorListener listener, byte[] taskActData)
          Ask the server engine to activate a subtask
static void addActivationListener(ServiceNode sn, long cmdCode, RemoteTaskActivationListener listener)
          Register a RemoteTaskActivationListener which may run inside or outside the engine's JVM
static void addActivatorListener(ServiceNode sn, long cmdCode)
           
static void addRemoteMOLifeCycleListener(RemoteMOLifeCycleListener listener)
          Add a RemoteMOLifeCycleListener to the list of listeners that will be called when a managed object life cycle notification is received.
static boolean addRemoteMOServiceChangeListener(boolean deletes, ServiceNode sn, long cmdcode, com.tivoli.twg.engine.RemoteMOServiceChangeListener listener, java.lang.String svcname)
          Add a RemoteMOServiceChangeListener to the list of listeners that will be called when a managed object service change notification is received for the specified service name.
static void addRemoteMOStateChangeListener(RemoteMOStateChangeListener listener)
          Add a RemoteMOStateChangeListener to the list of listeners that will be called when a managed object life cycle notification is received.
static void addSubtask(long toid, java.lang.String subtaskID, java.lang.String menu, java.lang.String menuLocation, java.lang.String contextList, java.lang.String actionsList)
          Ask the server engine to add a subtask to the specified task
static void addSubtask(ServiceNode sn, long toid, java.lang.String subtaskID, java.lang.String menu, java.lang.String menuLocation, java.lang.String contextList, java.lang.String actionsList)
          Ask the server engine to add a subtask to the specified task
static long createDefaultTask(java.util.Properties props, java.lang.String extensionClassName)
          Ask the server engine to construct a TWGDefault task object by sending it a Properties object.
static long createDefaultTask(ServiceNode sn, java.util.Properties props, java.lang.String extensionClassName)
          Ask the server engine to construct a TWGDefault task object by sending it a Properties object.
static void deactivateSubtask(long remoteID)
          Ask the server to deactivate a subtask
static void deactivateSubtask(ServiceNode sn, long remoteID)
          Ask the server to deactivate a subtask
static int deleteTask(ServiceNode sn, java.lang.String taskID)
          Ask the server engine to delete a task
static int deleteTask(java.lang.String taskID)
          Ask the server engine to delete a task
static LongKeyTable getAllAddressShadowClassNames()
          Get a LongKeyTable of all the address entry shadow class names defined on the server engine.
static LongKeyTable getAllAddressShadowClassNames(ServiceNode sn)
          Get a LongKeyTable of all the address entry shadow class names defined on the server engine.
static LongKeyTable getAllManagedObjectClassNames()
          Get a LongKeyTable of all the managed object class names defined on the server engine.
static LongKeyTable getAllManagedObjectClassNames(ServiceNode sn)
          Get a LongKeyTable of all the managed object class names defined on the server engine.
static LongKeyTable getConTasks(java.util.Locale locale)
          Get a LongKeyTable of TWGConTask objects for all defined tasks.
static LongKeyTable getConTasks(java.util.Locale locale, long uid)
          Get a LongKeyTable of TWGConTask objects for all defined tasks.
static LongKeyTable getConTasks(ServiceNode sn, java.util.Locale locale)
          Get a LongKeyTable of TWGConTask objects for all defined tasks.
static LongKeyTable getConTasks(ServiceNode sn, java.util.Locale locale, long uid)
          Get a LongKeyTable of TWGConTask objects for all defined tasks.
static int getCurrentActivationCount()
          Returns the current count of subtask activations.
static TWGRemoteManagedObject getRemoteManagedObject(long moid)
          Retrieve a TWGRemoteManagedObject representing the managed object specified by the ID.
static TWGRemoteManagedObject getRemoteManagedObject(ServiceNode sn, long moid)
          Retrieve a TWGRemoteManagedObject representing the managed object specified by the ID.
static byte[] getSubtaskData(long toid, java.lang.String subtaskID)
          Get the user settable byte array from the specified subtask.
static byte[] getSubtaskData(ServiceNode sn, long toid, java.lang.String subtaskID)
          Get the user settable byte array from the specified subtask.
static java.lang.String[] getSubtaskIDs(long toid)
          Get the list of subtaskIDs for a specified task.
static java.lang.String[] getSubtaskIDs(ServiceNode sn, long toid)
          Get the list of subtaskIDs for a specified task.
static byte[] getTaskData(long toid)
          Get the user settable byte array from the specified task.
static byte[] getTaskData(ServiceNode sn, long toid)
          Get the user settable byte array from the specified task.
static LongKeyTable getTasks()
          Get a list of all tasks.
static LongKeyTable getTasks(ServiceNode sn)
          Get a list of all tasks.
static LongKeyTable getTasks(ServiceNode sn, java.lang.String extensionClassName)
          Get a list of all tasks associated for a specified extension.
static LongKeyTable getTasks(java.lang.String extensionClassName)
          Get a list of all tasks associated for a specified extension.
static java.lang.String getTaskTitle(long toid)
          Get the key used to retrieve the specified task's icon title from its resource bundle.
static java.lang.String getTaskTitle(ServiceNode sn, long toid)
          Get the key used to retrieve the specified task's icon title from its resource bundle.
static long getToid(ServiceNode sn, java.lang.String taskID)
          Get a task's object ID (toid) based on it's String identifier
static long getToid(java.lang.String taskID)
          Get a task's object ID (toid) based on it's String identifier Note: to use this version of the method, setServiceNode() must have been called first.
static void removeActivationListener(java.lang.String name)
           
static void removeActivatorListener(java.lang.String name)
           
static boolean removeRemoteMOLifeCycleListener(RemoteMOLifeCycleListener listener)
          Remove a RemoteMOLifeCycleListener from the list of listeners
static boolean removeRemoteMOStateChangeListener(RemoteMOStateChangeListener listener)
          Remove a RemoteMOStateChangeListener from the list of listeners Note: before any notifications can be received, setServiceNode() must have been called first.
static boolean removeSubtask(long toid, java.lang.String subtaskID)
          Ask the server engine to remove a subtask from a task.
static boolean removeSubtask(ServiceNode sn, long toid, java.lang.String subtaskID)
          Ask the server engine to remove a subtask from a task.
static boolean sendAsynchCommand(Command cmd)
          Send an asynchronous command to the service node previously specified by setServiceNode().
static boolean sendAsynchCommand(ServiceNode sn, Command cmd)
          Send an asynchronous command to the specified service node.
static boolean sendCommand(Command cmd)
          Send a command to the service node previously specified by setServiceNode().
static boolean sendCommand(ServiceNode sn, Command cmd)
          Send a command to the specified service node.
static void setServiceNode(ServiceNode SN, long cmdCode)
          Set the service node to use for task communications.
static void setServiceNode(ServiceNode SN, long cmdCode, RemoteTaskActivationListener listener)
          Set the service node to use for task communications.
static boolean setSubtaskData(long toid, java.lang.String subtaskID, byte[] data)
          Set the user settable byte array in the specified subtask.
static boolean setSubtaskData(ServiceNode sn, long toid, java.lang.String subtaskID, byte[] data)
          Set the user settable byte array in the specified subtask.
static boolean setTaskData(long toid, byte[] data)
          Set the user settable byte array in the specified task.
static boolean setTaskData(ServiceNode sn, long toid, byte[] data)
          Set the user settable byte array in the specified task.
static boolean setTaskTitle(long toid, java.lang.String titleKey)
          Set the key used to retrieve the specified task's icon title from its resource bundle.
static boolean setTaskTitle(ServiceNode sn, long toid, java.lang.String titleKey)
          Set the key used to retrieve the specified task's icon title from its resource bundle.
static void taskServerDeactivated(ServiceNode sn, java.lang.String taskID)
          Notify the server engine that a task server is exiting.
static void taskServerDeactivated(java.lang.String taskID)
          Notify the server engine that a task server is exiting.
static void taskServerReady(ServiceNode sn, java.lang.String taskID)
          Notify the server engine that a task server is ready for business.
static void taskServerReady(java.lang.String taskID)
          Notify the server engine that a task server is ready for business.
static void taskServerReadyForActivations(ServiceNode sn, long cmdcode)
           
static void unsetServiceNode()
          Unhook this class from the service node so that it will no longer intercept and process incoming task commands.
static boolean verifyTaskForUser(long toid, long uid)
          Verify that a task can is accessable to a user
static boolean verifyTaskForUser(ServiceNode sn, long toid, long uid)
          Verify that a task can is accessable to a user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND_GET_LOG_FILE_CONTENTS

public static final long COMMAND_GET_LOG_FILE_CONTENTS
See Also:
Constant Field Values

COMMAND_GET_LOG_FILE_DEFINITIONS

public static final long COMMAND_GET_LOG_FILE_DEFINITIONS
See Also:
Constant Field Values

COMMAND_CLEAR_LOG_FILE_CONTENTS

public static final long COMMAND_CLEAR_LOG_FILE_CONTENTS
See Also:
Constant Field Values

RETURN_OK

public static final long RETURN_OK
See Also:
Constant Field Values

RETURN_GENERAL_FAILURE

public static final long RETURN_GENERAL_FAILURE
See Also:
Constant Field Values

RETURN_UNKNOWN_TASK_ID

public static final long RETURN_UNKNOWN_TASK_ID
See Also:
Constant Field Values

RETURN_UNKNOWN_SUBTASK_ID

public static final long RETURN_UNKNOWN_SUBTASK_ID
See Also:
Constant Field Values

RETURN_UNKNOWN_TASK_ACT_ID

public static final long RETURN_UNKNOWN_TASK_ACT_ID
See Also:
Constant Field Values

RETURN_UNKNOWN_USER_ID

public static final long RETURN_UNKNOWN_USER_ID
See Also:
Constant Field Values

RETURN_DELETE_PENDING

public static final long RETURN_DELETE_PENDING
See Also:
Constant Field Values

RETURN_NO_LOG_FILE_DEF

public static final long RETURN_NO_LOG_FILE_DEF
See Also:
Constant Field Values
Constructor Detail

TWGRemoteTaskManager

public TWGRemoteTaskManager()
Method Detail

taskServerReady

public static final void taskServerReady(java.lang.String taskID)
Notify the server engine that a task server is ready for business.

Parameters:
taskID - a String containing the identifier of the task that is ready

taskServerReady

public static final void taskServerReady(ServiceNode sn,
                                         java.lang.String taskID)
Notify the server engine that a task server is ready for business.

Parameters:
sn - the service node to use to communicate with the server
taskID - a String containing the identifier of the task that is ready

taskServerDeactivated

public static final void taskServerDeactivated(java.lang.String taskID)
Notify the server engine that a task server is exiting.

Parameters:
taskID - a String containing the identifier of the task that is exiting

taskServerReadyForActivations

public static final void taskServerReadyForActivations(ServiceNode sn,
                                                       long cmdcode)

taskServerDeactivated

public static final void taskServerDeactivated(ServiceNode sn,
                                               java.lang.String taskID)
Notify the server engine that a task server is exiting.

Parameters:
sn - the service node to use to communicate with the server
taskID - a String containing the identifier of the task that is exiting

setServiceNode

public static void setServiceNode(ServiceNode SN,
                                  long cmdCode,
                                  RemoteTaskActivationListener listener)
Set the service node to use for task communications. This causes a command listener to be registered with the service node to receive commands with the specified command code. Processing of the received commands is handled on a new thread so that the service node's receive thread will not be tied up.

Parameters:
SN - an active ServiceNode that can be used for server communication.
cmdCode - the command code to register a listener for to receive task commands from the server engine
listener - a RemoteTaskActivationListener that will be called when task activation commands are received.

addActivationListener

public static void addActivationListener(ServiceNode sn,
                                         long cmdCode,
                                         RemoteTaskActivationListener listener)
Register a RemoteTaskActivationListener which may run inside or outside the engine's JVM


removeActivationListener

public static void removeActivationListener(java.lang.String name)

addActivatorListener

public static void addActivatorListener(ServiceNode sn,
                                        long cmdCode)

removeActivatorListener

public static void removeActivatorListener(java.lang.String name)

setServiceNode

public static void setServiceNode(ServiceNode SN,
                                  long cmdCode)
Set the service node to use for task communications. This causes a command listener to be registered with the service node to receive commands with the specified command code. Processing of the received commands is handled on a new thread so that the service node's receive thread will not be tied up. Use this version of the method only if this JVM will never receive and task activation commands.

Parameters:
SN - an active ServiceNode that can be used for server communication.
cmdCode - the command code to register a listener for to receive task commands from the server engine

unsetServiceNode

public static void unsetServiceNode()
Unhook this class from the service node so that it will no longer intercept and process incoming task commands.


addRemoteMOLifeCycleListener

public static void addRemoteMOLifeCycleListener(RemoteMOLifeCycleListener listener)
Add a RemoteMOLifeCycleListener to the list of listeners that will be called when a managed object life cycle notification is received.

Parameters:
listener - a RemoteMOLifeCycleListener

removeRemoteMOLifeCycleListener

public static boolean removeRemoteMOLifeCycleListener(RemoteMOLifeCycleListener listener)
Remove a RemoteMOLifeCycleListener from the list of listeners

Parameters:
listener - a RemoteMOLifeCycleListener
Returns:
boolean true, if listener was found and removed false, if listener was not in the list

addRemoteMOStateChangeListener

public static void addRemoteMOStateChangeListener(RemoteMOStateChangeListener listener)
Add a RemoteMOStateChangeListener to the list of listeners that will be called when a managed object life cycle notification is received. Note: before any notifications can be received, setServiceNode() must have been called first.

Parameters:
listener - a RemoteMOStateChangeListener

removeRemoteMOStateChangeListener

public static boolean removeRemoteMOStateChangeListener(RemoteMOStateChangeListener listener)
Remove a RemoteMOStateChangeListener from the list of listeners Note: before any notifications can be received, setServiceNode() must have been called first.

Parameters:
listener - a RemoteMOStateChangeListener
Returns:
boolean true, if listener was found and removed false, if listener was not in the list

addRemoteMOServiceChangeListener

public static boolean addRemoteMOServiceChangeListener(boolean deletes,
                                                       ServiceNode sn,
                                                       long cmdcode,
                                                       com.tivoli.twg.engine.RemoteMOServiceChangeListener listener,
                                                       java.lang.String svcname)
Add a RemoteMOServiceChangeListener to the list of listeners that will be called when a managed object service change notification is received for the specified service name. Note: before any notifications can be received, setServiceNode() must have been called first.

Parameters:
deletes - true to listen for adds and deletes, false to listen only for adds.
sn - service node to send notification commands to
cmdcode - command code set for RemoteTaskManager use on the service node
listener - a RemoteMOServiceChangeListener
svcname - service name to listen for
Returns:
true, if listener was added false, if listener was already added

getAllManagedObjectClassNames

public static final LongKeyTable getAllManagedObjectClassNames()
Get a LongKeyTable of all the managed object class names defined on the server engine. The keys are actually the oid of the ManagedObjectFactory that represents the class, and the value is a string containing the fully qualified class name. Note: to use this version of the method, setServiceNode() must have been called first.

Returns:
LongKeyTable

getAllManagedObjectClassNames

public static LongKeyTable getAllManagedObjectClassNames(ServiceNode sn)
Get a LongKeyTable of all the managed object class names defined on the server engine. The keys are actually the oid of the ManagedObjectFactory that represents the class, and the value is a string containing the fully qualified class name.

Parameters:
sn - the service node to use to communicate with the server
Returns:
LongKeyTable

getAllAddressShadowClassNames

public static final LongKeyTable getAllAddressShadowClassNames()
Get a LongKeyTable of all the address entry shadow class names defined on the server engine. The keys are actually the oid of the ManagedObjectFactory that represents the class, and the value is a string containing the fully qualified class name for the address entry shadow class. Note: to use this version of the method, setServiceNode() must have been called first.

Returns:
LongKeyTable

getAllAddressShadowClassNames

public static final LongKeyTable getAllAddressShadowClassNames(ServiceNode sn)
Get a LongKeyTable of all the address entry shadow class names defined on the server engine. The keys are actually the oid of the ManagedObjectFactory that represents the class, and the value is a string containing the fully qualified class name for the address entry shadow class.

Parameters:
sn - the service node to use to communicate with the server
Returns:
LongKeyTable

getRemoteManagedObject

public static final TWGRemoteManagedObject getRemoteManagedObject(long moid)
Retrieve a TWGRemoteManagedObject representing the managed object specified by the ID. All fields should be valid except for the clientStatus field (which will always be -1) since the returned object is not part of a TWGClientSet contained by a TWGRemoteTaskActivation. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
moid - the ID of the managed object to retrieve data from
Returns:
a TWGRemoteManagedObject

getRemoteManagedObject

public static TWGRemoteManagedObject getRemoteManagedObject(ServiceNode sn,
                                                            long moid)
Retrieve a TWGRemoteManagedObject representing the managed object specified by the ID. All fields should be valid except for the clientStatus field (which will always be -1) since the returned object is not part of a TWGClientSet contained by a TWGRemoteTaskActivation.

Parameters:
sn - the service node to use to communicate with the server
moid - the ID of the managed object to retrieve data from
Returns:
a TWGRemoteManagedObject

getSubtaskIDs

public static final java.lang.String[] getSubtaskIDs(long toid)
Get the list of subtaskIDs for a specified task. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
toid - the object ID of the task to retrieve the data from.
Returns:
string[] containing the list of subtaskIDs

getSubtaskIDs

public static java.lang.String[] getSubtaskIDs(ServiceNode sn,
                                               long toid)
Get the list of subtaskIDs for a specified task.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task to retrieve the data from.
Returns:
string[] containing the list of subtaskIDs

getTaskTitle

public static final java.lang.String getTaskTitle(long toid)
Get the key used to retrieve the specified task's icon title from its resource bundle. Note that if the task does not have a resource bundle, or if the key is not found in the task's resource bundle, then this key is the actual value dispayed as the task's title. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
toid - the object ID of the task to retrieve the data from.
Returns:
String containing the task's title key

getTaskTitle

public static final java.lang.String getTaskTitle(ServiceNode sn,
                                                  long toid)
Get the key used to retrieve the specified task's icon title from its resource bundle. Note that if the task does not have a resource bundle, or if the key is not found in the task's resource bundle, then this key is the actual value dispayed as the task's title.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task to retrieve the data from.
Returns:
String containing the task's title key

setTaskTitle

public static final boolean setTaskTitle(long toid,
                                         java.lang.String titleKey)
Set the key used to retrieve the specified task's icon title from its resource bundle. Note that if the task does not have a resource bundle, or if the key is not found in the task's resource bundle, then this key is the actual value dispayed as the task's title. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
toid - the object ID of the task to retrieve the data from.
titleKey - the value to set as the task's new title key

setTaskTitle

public static final boolean setTaskTitle(ServiceNode sn,
                                         long toid,
                                         java.lang.String titleKey)
Set the key used to retrieve the specified task's icon title from its resource bundle. Note that if the task does not have a resource bundle, or if the key is not found in the task's resource bundle, then this key is the actual value dispayed as the task's title.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task to retrieve the data from.
titleKey - the value to set as the task's new title key

getTaskData

public static final byte[] getTaskData(long toid)
Get the user settable byte array from the specified task. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
toid - the object ID of the task to retrieve the data from.
Returns:
byte[] containing the task data or null if it has not been set.

getTaskData

public static byte[] getTaskData(ServiceNode sn,
                                 long toid)
Get the user settable byte array from the specified task.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task to retrieve the data from.
Returns:
byte[] containing the task data or null if it has not been set.

setTaskData

public static final boolean setTaskData(long toid,
                                        byte[] data)
Set the user settable byte array in the specified task. This will cause the task object on the server to update both its persistant storage and the data being shadowed to active consoles. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
toid - the object ID of the task to set the data of
data - a byte[] containing the new data to be set, this can also be null.
Returns:
boolean true, if set operation was successful, otherwise false

setTaskData

public static boolean setTaskData(ServiceNode sn,
                                  long toid,
                                  byte[] data)
Set the user settable byte array in the specified task. This will cause the task object on the server to update both its persistant storage and the data being shadowed to active consoles.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task to set the data of
data - a byte[] containing the new data to be set, this can also be null.
Returns:
boolean true, if set operation was successful, otherwise false

getSubtaskData

public static final byte[] getSubtaskData(long toid,
                                          java.lang.String subtaskID)
Get the user settable byte array from the specified subtask. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
toid - the object ID of the task owning the subtask
subtaskID - a string containing the identifier of the subtask to retrieve the data from
Returns:
byte[] containing the subtask data or null if it has not been set

getSubtaskData

public static byte[] getSubtaskData(ServiceNode sn,
                                    long toid,
                                    java.lang.String subtaskID)
Get the user settable byte array from the specified subtask.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task owning the subtask
subtaskID - a string containing the identifier of the subtask to retrieve the data from
Returns:
byte[] containing the subtask data or null if it has not been set

setSubtaskData

public static boolean setSubtaskData(long toid,
                                     java.lang.String subtaskID,
                                     byte[] data)
Set the user settable byte array in the specified subtask. This will cause the task object on the server to update both its persistant storage and the data being shadowed to active consoles. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
toid - the object ID of the task owning the subtask
subtaskID - a string containing the identifier of the subtask to set the data of
data - a byte[] containing the new data to be set, this can also be null.
Returns:
boolean true, if set operation was successful, otherwise false

setSubtaskData

public static boolean setSubtaskData(ServiceNode sn,
                                     long toid,
                                     java.lang.String subtaskID,
                                     byte[] data)
Set the user settable byte array in the specified subtask. This will cause the task object on the server to update both its persistant storage and the data being shadowed to active consoles.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task owning the subtask
subtaskID - a string containing the identifier of the subtask to set the data of
data - a byte[] containing the new data to be set, this can also be null.
Returns:
boolean true, if set operation was successful, otherwise false

getToid

public static final long getToid(java.lang.String taskID)
Get a task's object ID (toid) based on it's String identifier Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
taskID - the String identifier of the task to retrieve the toid of
Returns:
long the toid of the specified task, or -1 if the identifier is not recognized or the command send fails/

getToid

public static final long getToid(ServiceNode sn,
                                 java.lang.String taskID)
Get a task's object ID (toid) based on it's String identifier

Parameters:
sn - the service node to use to communicate with the server
taskID - the String identifier of the task to retrieve the toid of
Returns:
long the toid of the specified task, or -1 if the identifier is not recognized or the command send fails.

getTasks

public static final LongKeyTable getTasks()
Get a list of all tasks. The keys are the toids and the objects in the table are strings containing the taskIDs. Note: to use this version of the method, setServiceNode() must have been called first.

Returns:
a LongKeyTable

getTasks

public static LongKeyTable getTasks(ServiceNode sn)
Get a list of all tasks. The keys are the toids and the objects in the table are strings containing the taskIDs.

Parameters:
sn - the service node to use to communicate with the server
Returns:
a LongKeyTable

getTasks

public static LongKeyTable getTasks(java.lang.String extensionClassName)
Get a list of all tasks associated for a specified extension. The keys are the toids and the objects in the table are strings containing the taskIDs. If no tasks are associated with the specified extension, an empty LongKeyTable will be returned. Note: to use this version of the method, setServiceNode() must have been called first.

Returns:
a LongKeyTable

getTasks

public static LongKeyTable getTasks(ServiceNode sn,
                                    java.lang.String extensionClassName)
Get a list of all tasks associated for a specified extension. The keys are the toids and the objects in the table are strings containing the taskIDs.

Parameters:
sn - the service node to use to communicate with the server
extensionClassName - the name of the extension class to find the tasks for
Returns:
a LongKeyTable

getConTasks

public static LongKeyTable getConTasks(java.util.Locale locale)
Get a LongKeyTable of TWGConTask objects for all defined tasks. Note, this is provided simply as a way to get the data from tasks and their subtasks. These TWGConTask objects are not a true shadowed objects like they are when they live on the console.

Parameters:
locale - the locale to use for translating NLS strings
Returns:
a LongKeyTable where the key is the task's object ID and the object is a TWGConTask.

getConTasks

public static LongKeyTable getConTasks(ServiceNode sn,
                                       java.util.Locale locale)
Get a LongKeyTable of TWGConTask objects for all defined tasks. Note, this is provided simply as a way to get the data from tasks and their subtasks. These TWGConTask objects are not a true shadowed objects like they are when they live on the console.

Parameters:
sn - the service node to use to communicate with the server
locale - the locale to use for translating NLS strings
Returns:
a LongKeyTable where the key is the task's object ID and the object is a TWGConTask.

getConTasks

public static LongKeyTable getConTasks(java.util.Locale locale,
                                       long uid)
Get a LongKeyTable of TWGConTask objects for all defined tasks. Note, this is provided simply as a way to get the data from tasks and their subtasks. These TWGConTask objects are not a true shadowed objects like they are when they live on the console.

Parameters:
locale - the locale to use for translating NLS strings
uid - ID of the user to use as a filter for which tasks to shadow
Returns:
a LongKeyTable where the key is the task's object ID and the object is a TWGConTask.

getConTasks

public static LongKeyTable getConTasks(ServiceNode sn,
                                       java.util.Locale locale,
                                       long uid)
Get a LongKeyTable of TWGConTask objects for all defined tasks. Note, this is provided simply as a way to get the data from tasks and their subtasks. These TWGConTask objects are not a true shadowed objects like they are when they live on the console.

Parameters:
sn - the service node to use to communicate with the server
locale - the locale to use for translating NLS strings
uid - ID of the user to use as a filter for which tasks to shadow
Returns:
a LongKeyTable where the key is the task's object ID and the object is a TWGConTask.

createDefaultTask

public static final long createDefaultTask(java.util.Properties props,
                                           java.lang.String extensionClassName)
                                    throws com.tivoli.twg.engine.TWGTaskCreationException
Ask the server engine to construct a TWGDefault task object by sending it a Properties object. Note: to use this version of the method, setServiceNode() must have been called first.

Parameters:
props - Properties object to send to the server for use in constructing a TWGDefaultTask object.
extensionClassName - String name of the extension class creating the task
Returns:
toid the object ID of the newly created task
Throws:
TWGTaskCreationException - if an exception was encountered on the server engine while processing the Properties object.

createDefaultTask

public static long createDefaultTask(ServiceNode sn,
                                     java.util.Properties props,
                                     java.lang.String extensionClassName)
                              throws com.tivoli.twg.engine.TWGTaskCreationException
Ask the server engine to construct a TWGDefault task object by sending it a Properties object.

Parameters:
sn - the service node to use to communicate with the server
props - Properties object to send to the server for use in constructing a TWGDefaultTask object.
extensionClassName - String name of the extension class creating the task
Returns:
toid the object ID of the newly created task
Throws:
TWGTaskCreationException - if an exception was encountered on the server engine while processing the Properties object.

deleteTask

public static int deleteTask(java.lang.String taskID)
Ask the server engine to delete a task

Parameters:
taskID - the task ID string of the task to be deleted.

deleteTask

public static int deleteTask(ServiceNode sn,
                             java.lang.String taskID)
Ask the server engine to delete a task

Parameters:
sn - the service node to use to communicate with the server
taskID - the task ID string of the task to be deleted.

addSubtask

public static final void addSubtask(long toid,
                                    java.lang.String subtaskID,
                                    java.lang.String menu,
                                    java.lang.String menuLocation,
                                    java.lang.String contextList,
                                    java.lang.String actionsList)
                             throws com.tivoli.twg.engine.TWGTaskCreationException
Ask the server engine to add a subtask to the specified task

Parameters:
toid - the object ID of the task to which the subtask should be added
subtaskID - String containing the subtask's ID.
menu - String containing the TWGTaskMenuList elements defining this subtask's label for menus.
menuLocation - String specifying the console locations where this subtasks menu should be displayed.
contextList - String specifying the tasks context attributes (i.e. interactive, client, server, targeted).
Throws:
TWGTaskCreationException - When syntax errors are discovered in the String parameters or if a subtask with the specified subtaskID already exists for this task.

addSubtask

public static final void addSubtask(ServiceNode sn,
                                    long toid,
                                    java.lang.String subtaskID,
                                    java.lang.String menu,
                                    java.lang.String menuLocation,
                                    java.lang.String contextList,
                                    java.lang.String actionsList)
                             throws com.tivoli.twg.engine.TWGTaskCreationException
Ask the server engine to add a subtask to the specified task

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task to which the subtask should be added
subtaskID - String containing the subtask's ID.
menu - String containing the TWGTaskMenuList elements defining this subtask's label for menus.
menuLocation - String specifying the console locations where this subtasks menu should be displayed.
contextList - String specifying the tasks context attributes (i.e. interactive, client, server, targeted).
Throws:
TWGTaskCreationException - When syntax errors are discovered in the String parameters or if a subtask with the specified subtaskID already exists for this task.

removeSubtask

public static boolean removeSubtask(long toid,
                                    java.lang.String subtaskID)
Ask the server engine to remove a subtask from a task.

Parameters:
toid - the object ID of the task from which the subtask should be removed
subtaskID - String containing the subtask's ID.
Returns:
boolean true if the command was successfully sent to the server, false otherwise. This only indicates if the request made it to the server. If the subtask exists, it will be deleted. If it does not, then this method will have no effect.

removeSubtask

public static boolean removeSubtask(ServiceNode sn,
                                    long toid,
                                    java.lang.String subtaskID)
Ask the server engine to remove a subtask from a task.

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task from which the subtask should be removed
subtaskID - String containing the subtask's ID.
Returns:
boolean true if the command was successfully sent to the server, false otherwise. This only indicates if the request made it to the server. If the subtask exists, it will be deleted. If it does not, then this method will have no effect.

activateSubtask

public static void activateSubtask(long localID,
                                   long toid,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener)
Ask the server engine to activate a subtask

Parameters:
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
toid - the object ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.

activateSubtask

public static void activateSubtask(long localID,
                                   long toid,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener,
                                   byte[] taskActData)
Ask the server engine to activate a subtask

Parameters:
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
toid - the object ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.
taskActData - byte[] of data to be associated with the activation

activateSubtask

public static void activateSubtask(ServiceNode sn,
                                   long localID,
                                   long toid,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener)
Ask the server engine to activate a subtask

Parameters:
sn - the service node to use to communicate with the server
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
toid - the object ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.

activateSubtask

public static void activateSubtask(ServiceNode sn,
                                   long localID,
                                   long toid,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener,
                                   byte[] taskActData)
Ask the server engine to activate a subtask

Parameters:
sn - the service node to use to communicate with the server
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
toid - the object ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.
taskActData - byte[] of data to be associated with the activation

activateSubtask

public static void activateSubtask(long localID,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener)
Ask the server engine to activate a subtask

Parameters:
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
taskID - the string task ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.

activateSubtask

public static void activateSubtask(long localID,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener,
                                   byte[] taskActData)
Ask the server engine to activate a subtask

Parameters:
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
taskID - the string task ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.
taskActData - byte[] of data to be associated with the activation

activateSubtask

public static void activateSubtask(ServiceNode sn,
                                   long localID,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener)
Ask the server engine to activate a subtask

Parameters:
sn - the service node to use to communicate with the server
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
taskID - the string task ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.

activateSubtask

public static void activateSubtask(ServiceNode sn,
                                   long localID,
                                   java.lang.String taskID,
                                   java.lang.String subtaskID,
                                   LongValueSet moid,
                                   LongValueSet foid,
                                   RemoteTaskActivatorListener listener,
                                   byte[] taskActData)
Ask the server engine to activate a subtask

Parameters:
sn - the service node to use to communicate with the server
localID - a "correlator" for use by the caller to identify the subtask activation when the listener is called back
taskID - the string task ID of the task to activate
subtaskID - the string subtask ID of the subtask to activate
moid - a LongValueSet containing the object ID's of the managed objects that are targets of the activation or null if none.
foid - a LongValueSet containing the object ID's of the filter(s) that are targets of the activation or null if none.
listener - a RemoteTaskActivator that will be called when the subtask activation has completed.
taskActData - byte[] of data to be associated with the activation

deactivateSubtask

public static void deactivateSubtask(long remoteID)
Ask the server to deactivate a subtask

Parameters:
remoteID - the remoteID received via the RemoteTaskActivatorListener when the subtask activation completed.

deactivateSubtask

public static void deactivateSubtask(ServiceNode sn,
                                     long remoteID)
Ask the server to deactivate a subtask

Parameters:
sn - the service node to use to communicate with the server
remoteID - the remoteID received via the RemoteTaskActivatorListener when the subtask activation completed.

verifyTaskForUser

public static boolean verifyTaskForUser(long toid,
                                        long uid)
Verify that a task can is accessable to a user

Parameters:
toid - the object ID of the task to verify
uid - the object ID of tue user to verify
Returns:
boolean true means that the specified task is accessable by the specified user.

verifyTaskForUser

public static boolean verifyTaskForUser(ServiceNode sn,
                                        long toid,
                                        long uid)
Verify that a task can is accessable to a user

Parameters:
sn - the service node to use to communicate with the server
toid - the object ID of the task to verify
uid - the object ID of tue user to verify
Returns:
boolean true means that the specified task is accessable by the specified user.

getCurrentActivationCount

public static int getCurrentActivationCount()
Returns the current count of subtask activations. return int the number of activations.


sendCommand

public static final boolean sendCommand(Command cmd)
Send a command to the service node previously specified by setServiceNode().

Parameters:
cmd - the Command to send.
Returns:
boolean true if the command was sent without error.

sendCommand

public static final boolean sendCommand(ServiceNode sn,
                                        Command cmd)
Send a command to the specified service node.

Parameters:
cmd - the Command to send.
Returns:
boolean true if the command was sent without error.

sendAsynchCommand

public static final boolean sendAsynchCommand(Command cmd)
Send an asynchronous command to the service node previously specified by setServiceNode().

Parameters:
cmd - the Command to send.
Returns:
boolean true if the command was sent without error.

sendAsynchCommand

public static final boolean sendAsynchCommand(ServiceNode sn,
                                              Command cmd)
Send an asynchronous command to the specified service node.

Parameters:
cmd - the Command to send.
Returns:
boolean true if the command was sent without error.