com.tivoli.twg.engine
Class TWGTask

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGTask
All Implemented Interfaces:
TWGBaseShadowedObject, TWGClientServiceListener, TWGConsoleSpecShadowedObject, TWGGetSetInterface, TWGPersistentObjectSubclassRestorable
Direct Known Subclasses:
TWGDefaultTask

public abstract class TWGTask
extends TWGPersistentObject
implements TWGConsoleSpecShadowedObject, TWGGetSetInterface, TWGClientServiceListener, TWGPersistentObjectSubclassRestorable

This class is an abstract base class for tasks. It is primarily a container to hold all the information about a specific task, like the Java class to invoke for its GUI, its icon, the labels used for various places on the console, and which Java class or native program to run for the server portion of the task.


Field Summary
static java.lang.String CLASSNAME
          Our classname
protected  TWGClientTaskList clientTasks
           
protected  int dataStoreVersion
           
protected  StringValueSet privileges
           
protected  java.lang.String propertiesFileName
           
protected  java.util.Properties props
           
static int SUBTASK_ACT_COMPLETE
           
static int SUBTASK_ACT_FAILED
           
static int SUBTASK_ACT_PENDING
           
protected  java.util.Hashtable subtasks
           
static int TASK_BIND_INSTANCE
           
static int TASK_DELETED
           
static int TASK_SERVER_AUTOLOAD
           
static int TASK_SERVER_ENABLE_JIT
           
static int TASK_SERVER_NO_RUN_THREAD
           
static int TASK_SERVER_SAME_JVM
           
static int TASK_SERVER_SAME_JVM_CONFIGURABLE
           
static int TASK_SERVER_SYNCHRONOUS
           
static int TASK_SERVER_TYPE_JAVA
           
static int TASK_SERVER_TYPE_NATIVE
           
static int TASK_SERVER_TYPE_NONE
           
static int TASK_STATE_FAILED
           
static int TASK_STATE_STARTED
           
static int TASK_STATE_STARTING
           
static int TASK_STATE_STOPPED
           
static int TASK_STATE_STOPPING
           
protected static java.util.Hashtable tasks
           
protected static LongKeyTable tasksByToid
           
 
Fields inherited from class com.tivoli.twg.engine.TWGPersistentObject
CLASS_NAME, SIZEOF_BYTE, SIZEOF_CHAR, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_SHORT
 
Constructor Summary
TWGTask()
          Default constructor to allow for persistant object restore
 
Method Summary
 boolean addClient(java.lang.String clientClass, java.lang.String clientTaskList)
          Adds a client and the client tasks used by this task to its client list.
 boolean addClient(java.lang.String clientClass, java.lang.String clientTaskList, boolean single)
          Adds a client and the client tasks used by this task to its client list.
 void addSubtask(java.lang.String subtaskID, java.lang.String menu, java.lang.String menuLocation, java.lang.String contextList, java.lang.String actionsList)
          Add a subtask to this task's list.
 void addSubtask(java.lang.String subtaskID, java.lang.String menu, java.lang.String menuLocation, java.lang.String contextList, java.lang.String actionsList, java.lang.String privilegeList)
          Add a subtask to this task's list.
static void attachAllAllowedTasks(TWGActiveConsole con)
          Attach all allowed tasks to console
 void AttachObjectToConsole(TWGActiveConsole act_con)
          Associate the object with the given TWGActiveConsole instance.
protected  void checkPersistentStoreLevel()
          Check to see if persistent store needs to be updated for any reason
 boolean checkPrivileges(StringValueSet checkSet)
          Check to see if the specified set of privileges is adequate for using this TWGTask.
 void clientServiceAdded(java.lang.String svcname, TWGManagedObject mo)
          Service add notification : indicates that the given client service has been added to the given managed object
 void clientServiceRemoved(java.lang.String svcname, TWGManagedObject mo)
          Service remove notification : indicates that the given client service has been remove from the given managed object
 void Delete()
          Override of TWGObject's Delete to do some necessary cleanup when a task is deleted.
static int deleteTask(java.lang.String taskID)
          Delete the specified task.
static int deleteTask(TWGTask task)
          Delete the specified task.
 void Destroy()
          Destroy method : used to process cleanup for object destroy
 void destroyActivation(TWGTaskActivation act, int status)
           
static void detachAllDisallowedTasks(TWGActiveConsole con)
          Detach all disallowed tasks from console
 void DetachObjectFromAllConsoles()
          Disassociate the object from all TWGActiveConsoles.
 void DetachObjectFromConsole(TWGActiveConsole act_con)
          Disassociate the object from the given TWGActiveConsole instance.
protected  void dumpProperties()
           
 java.util.Enumeration getAllSubtasks()
          Get an enumeration of all the subtasks contain in this task.
static long[] getAllTaskIdentifiers()
          Get all task identifiers
 java.lang.String[] getAttributeIDList()
          Attribute ID enumeration : this method is expected to return a list of strings containing the String names of the attributes supported for a given object.
 int getAttributeType(java.lang.String id)
          Get type of attribute value for given attribute
 DataValue getAttributeValue(java.lang.String id, java.util.Locale loc)
          Get value of attribute with given ID
 int getClientTaskCount(TWGManagedObject mo)
          Get the number of client tasks that would be started for a specific TWGManagedObject based on its MOF.
 TWGClientTaskList getClientTasks()
           
 java.lang.String GetConShadowClass()
          Get the name of the console class that shadow's task.
 java.lang.String getExtensionClassName()
          Get the name of the extension class that defined this task.
 java.lang.String getGuiClass()
          Get the name of the GUI class for this task.
 java.lang.String getGuiParms()
          Get the parameters for the GUI class for this task.
 java.lang.String getHelpTopicsMapping()
          Get the help topics mapping file name.
 java.lang.String getID()
          Get the this task's ID
 long getImageSet()
          Get the image set id for this task.
 TWGTask getParent()
          Get this task's parent.
 long getParentID()
          Get this task's parent OID.
 java.lang.String[] getPrivileges()
          Get the list of privileges required for a user to be able to use this task.
 java.lang.String getPropertiesFileName()
          Get the name of the properties file used to create this task.
 java.lang.String getProperty(java.lang.String key)
          Get a property from the task's properties file.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Get a property from the task's properties file.
 java.lang.String getResourceBundle()
          Get the name of the resource bundle for this task's labels.
 java.lang.String getServerMaxHeapParm()
          Get the server's maximum heap size parameter.
 java.lang.String getServerMinHeapParm()
          Get the server's minimum heap size parameter.
 java.lang.String getServerName()
          Get the name of the server Java class or native executable for this task.
 java.lang.String getServerParms()
          Get the parameters for the server class/native executable.
 int getServerType()
          Get the type of the server portion of this task.
 java.lang.String getServiceNode()
          Get the name of the Service Node for this task.
 byte[] GetShadowRecord(java.util.Locale locale)
          Get the data to shadow this task.
 long GetShadowVersion()
          Get the shadow version of this task.
 int getState()
           
 TWGSubtask getSubtask(java.lang.String subtaskID)
          Get a subtask based on the task ID string.
 int getSubtaskCount()
          Get the number of subtasks defined for this task
static TWGTask getTask(long toid)
          Get a task based on its object identifier.
static TWGTask getTask(java.lang.String taskID)
          Get a task based on its task ID.
 byte[] getTaskData()
          Get the data for this task.
 java.lang.String getTitle(java.util.Locale loc)
          Get the title for the task
 java.lang.String getTitleKey()
          Get the key used to retrieve the icon title from the resource file.
 boolean hasServerRunThread()
          Determine if this Java server task in engine JVM is to have run method called
 boolean hasSubtask(java.lang.String subtaskID)
          Determine if a subtask is defined for this task.
static void initialize()
          Activate any tasks that are flagged to be started during server initialization
 boolean isBoundInstance()
          See if this task is bound to managed object on an instance basis.
 boolean isDisabled()
          Test to see if task is disabled
 boolean isDisabledSubtask(java.lang.String subid)
          Test to see if subtask is disabled
 boolean isLiteralTitle()
          Indicate if this task's title is a literal or a resource bundle key.
static boolean isSchedulerReady()
          Check if the scheduler has been initialized.
 boolean isServerAutoLoad()
          Indicate if this task's server portion will be loaded during initialization
 boolean isServerJIT()
          Indicate if this task's Java server task runs with the JIT enabled.
 boolean isServerSameJVM()
          Determine if this task's Java server task will be run in the server's JVM.
 boolean isServerSameJVMConfigurable()
          Determine if this task's Java server task will be run in or out of the engine's JVM based on the engine's configuration.
 boolean isServerSynchronous()
          Indicate if this task's server portion will be loaded during initialization and will cause the server engine's initialization to wait for this task's server to indicate that it is ready.
 boolean isTaskDeleted()
           
 boolean isTaskIconHidden()
          Indicate if this task's icon will be displayed in the console's task pane.
static boolean isTaskID(java.lang.String taskID)
          Determine if a task has already been defined based on its task ID.
 boolean isUnrestricted()
          See if this task is unrestricted with respect to user permissions.
static void putTask(TWGTask task)
          Add a task to the hash table.
 boolean removeSubtask(java.lang.String subtaskID)
           
protected  void restoreData(TWGPersistentObjectDictionary dictionary, boolean resolveObjectReferences)
          Method for restoring persistent object data.
protected  void saveData(TWGPersistentObjectDictionary dictionary)
          Method for saving persistent object data.
abstract  boolean serverActivate()
          This abstract method is called by the server when it is activating the this task in preparation for activating a subtask.
 void serverActivationFailed()
          This method is called by the server task if it has experienced some sort of error that is causing it to terminate.
abstract  boolean serverDeactivate()
          This method is called by the server when it needs to deactivate a task.
 void serverDeactivationComplete()
          This method is called by the server task to indicate that server task deactivation is complete after previously returning false to the serverDeactivate() call.
abstract  boolean serverTaskThread()
          This method is called by the server to offer the server task a chance to own the thread that is being used to invoke serverActivate().
 boolean setAttributeValue(java.lang.String id, DataValue val)
          Set value of attribute with given ID
 void setBoundInstance(boolean flag)
          Specify that this task is to be bound to managed objects on an instance basis.
 void setExtensionClassName(java.lang.String extensionClassName)
          Set the name of the extension class that defined this task.
 void setGuiClass(java.lang.String guiClass)
          Set the name of the GUI class for this task.
 void setGuiParms(java.lang.String guiParms)
          Set the name of the GUI class for this task.
 void setHelpTopicsMapping(java.lang.String helpTopicsMapping)
          Set the name of the help topics mapping file.
protected  void setID(java.lang.String taskID)
          Set the this task's ID
 void setImageSet(long imageSetID)
          Set the image set for this task.
 void setImageSet(java.lang.String[] iconNames)
          Set the image set for this task.
 void setLiteralTitle(boolean flag)
          Set whether or not the task's title is a literal or a resource bundle key.
 void SetObjectID(long oid)
          Set object ID.
 void setParent(TWGTask parent)
          Set this task's parent.
 void setPrivileges(java.lang.String[] privNames, boolean reset)
          Set the list of privilege token names required to be able to use this subtask.
 void setPropertiesFileName(java.lang.String propertiesFileName)
          Set the name of the properties file used to create this task.
 void setResourceBundle(java.lang.String resourceBundle)
          Set the resource bundle for the task's labels.
 void setServerAutoLoad(boolean flag)
           
protected  void setServerJIT(boolean flag)
          Set this task's Java server to run with the JIT enabled.
 void setServerMaxHeapParm(java.lang.String val)
          Set the maximum heap size parm for the Java server for this task.
 void setServerMinHeapParm(java.lang.String val)
          Set the minimum heap size parm for the Java server for this task.
 void setServerName(java.lang.String serverName)
          Set the name of the server Java class or native executable for this task.
 void setServerParms(java.lang.String serverParms)
          Set the parameter string for the server class/native executable.
 void setServerRunThread(boolean flag)
          Set whether this Java server task in engine JVM is to have run method called
 void setServerSameJVM(boolean flag)
          Set this task's server portion to run in the same or different JVM
 void setServerSameJVMConfigurable(boolean flag)
          Set this task's server portion to run in the same or different JVM based on the engine's configuration.
 void setServerSynchronous(boolean flag)
          Set this task's server portion so that it will be loaded during initialization and will cause the server engine's initialization to wait for this task's server to indicate that it is ready.
 void setServerType(int serverType)
          Set the type of the server portion of this task.
 void setServiceNode(java.lang.String serviceNode)
          Set the name of the Service Node for this task.
 void setTaskData(byte[] taskData)
          Set the data for this task.
 void setTaskIconHidden(boolean flag)
          Set whether or not the task's icon will be displayed in the console's task pane.
 void setTempDisabled(boolean do_disable)
          Set task disabled temporarily (non-persistently)
 void setTitleKey(java.lang.String titleKey)
          Set the key used to retrieve the icon title from the resource file.
 void setUnrestricted(boolean flag)
          Specify that this task is unrestricted with respect to user permissions.
abstract  int subtaskActivate(TWGTaskActivation act)
          This method is called by the server when it receives a console command to activate a subtask.
 void subtaskActivationComplete(TWGTaskActivation act, boolean success)
          This method is called by the server task when subtask activation has completed after previously returning SUBTASK_ACT_PENDING from the subtaskActivate() call.
abstract  void subtaskDeactivate(TWGTaskActivation act)
          This method is called by the server when it receives a console command to deactivate a subtask or if the active console that has started the subtask goes away.
static void terminate()
          Deactivate all active tasks
 java.lang.String toString()
          Obtain a string representation of this TWGTask.
 void unsetParent()
          Unset this task's parent
 void UpdateShadowVersion()
          Update the shadow version of this task.
 
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject
enableAsyncWrites, fromPersistID, isNewPersistentStore, isSaveRequired, PersistID, restore, restoreAll, save, save, setSaveRequired, toPersistID
 
Methods inherited from class com.tivoli.twg.engine.TWGObject
AllObjects, AllObjects, DumpTWGObjects, FindObject, isDeleted, isNewObject, isPersistent, isPersistent, isValid, isValid, ObjectID, setDistinctObjectID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
Our classname

See Also:
Constant Field Values

TASK_STATE_STOPPED

public static final int TASK_STATE_STOPPED
See Also:
Constant Field Values

TASK_STATE_STARTING

public static final int TASK_STATE_STARTING
See Also:
Constant Field Values

TASK_STATE_STARTED

public static final int TASK_STATE_STARTED
See Also:
Constant Field Values

TASK_STATE_STOPPING

public static final int TASK_STATE_STOPPING
See Also:
Constant Field Values

TASK_STATE_FAILED

public static final int TASK_STATE_FAILED
See Also:
Constant Field Values

SUBTASK_ACT_COMPLETE

public static final int SUBTASK_ACT_COMPLETE
See Also:
Constant Field Values

SUBTASK_ACT_FAILED

public static final int SUBTASK_ACT_FAILED
See Also:
Constant Field Values

SUBTASK_ACT_PENDING

public static final int SUBTASK_ACT_PENDING
See Also:
Constant Field Values

TASK_SERVER_AUTOLOAD

public static final int TASK_SERVER_AUTOLOAD
See Also:
Constant Field Values

TASK_SERVER_SYNCHRONOUS

public static final int TASK_SERVER_SYNCHRONOUS
See Also:
Constant Field Values

TASK_SERVER_SAME_JVM

public static final int TASK_SERVER_SAME_JVM
See Also:
Constant Field Values

TASK_DELETED

public static final int TASK_DELETED
See Also:
Constant Field Values

TASK_BIND_INSTANCE

public static final int TASK_BIND_INSTANCE
See Also:
Constant Field Values

TASK_SERVER_NO_RUN_THREAD

public static final int TASK_SERVER_NO_RUN_THREAD
See Also:
Constant Field Values

TASK_SERVER_SAME_JVM_CONFIGURABLE

public static final int TASK_SERVER_SAME_JVM_CONFIGURABLE
See Also:
Constant Field Values

TASK_SERVER_ENABLE_JIT

public static final int TASK_SERVER_ENABLE_JIT
See Also:
Constant Field Values

TASK_SERVER_TYPE_NONE

public static final int TASK_SERVER_TYPE_NONE
See Also:
Constant Field Values

TASK_SERVER_TYPE_JAVA

public static final int TASK_SERVER_TYPE_JAVA
See Also:
Constant Field Values

TASK_SERVER_TYPE_NATIVE

public static final int TASK_SERVER_TYPE_NATIVE
See Also:
Constant Field Values

tasks

protected static java.util.Hashtable tasks

tasksByToid

protected static LongKeyTable tasksByToid

dataStoreVersion

protected int dataStoreVersion

clientTasks

protected TWGClientTaskList clientTasks

subtasks

protected java.util.Hashtable subtasks

privileges

protected StringValueSet privileges

propertiesFileName

protected java.lang.String propertiesFileName

props

protected java.util.Properties props
Constructor Detail

TWGTask

public TWGTask()
Default constructor to allow for persistant object restore

Method Detail

isTaskID

public static boolean isTaskID(java.lang.String taskID)
Determine if a task has already been defined based on its task ID.

Parameters:
taskID - string containing the task ID to check for.
Returns:
true if a task with this task ID exists, false if not.

putTask

public static void putTask(TWGTask task)
                    throws TWGTaskException
Add a task to the hash table.

Throws:
TWGTaskException - Thrown if the task's taskID is already in the table.

deleteTask

public static int deleteTask(java.lang.String taskID)
Delete the specified task. If the task has active subtasks, it will be flagged for deletion when all subtasks have completed.

Parameters:
taskID - a string containing the ID of the task to destroy
Returns:
int
  • -1 if the taskID is not recognized
  • 0 if the task has been deleted
  • 1 if the delete failed
  • 2 if the task has active subtasks and has been flagged for deletion

deleteTask

public static int deleteTask(TWGTask task)
Delete the specified task. If the task has active subtasks, it will be flagged for deletion when all subtasks have completed.

Parameters:
task - the task to destroy.
Returns:
int
  • -1 if the taskID is not recognized
  • 0 if the task has been deleted
  • 1 if the delete failed
  • 2 if the task has active subtasks and has been flagged for deletion

Delete

public void Delete()
Override of TWGObject's Delete to do some necessary cleanup when a task is deleted. This method is public only because it is inherited; it should only be called by the core engine.

Overrides:
Delete in class TWGObject

Destroy

public void Destroy()
             throws TWGObjectDestroyException
Destroy method : used to process cleanup for object destroy

Overrides:
Destroy in class TWGPersistentObject
Throws:
TWGObjectDestroyException - if error during destroy

getTask

public static TWGTask getTask(java.lang.String taskID)
Get a task based on its task ID.

Parameters:
taskID - string containing the ID of the task to retrieve.
Returns:
the TWGTask object with the specified task ID, or null if one does not exist.

getTask

public static TWGTask getTask(long toid)
Get a task based on its object identifier.

Parameters:
toid - object identifier the ID of the task to retrieve.
Returns:
the TWGTask object with the specified task ID, or null if one does not exist.

isSchedulerReady

public static boolean isSchedulerReady()
Check if the scheduler has been initialized.

Returns:
true if the scheduler is ready, otherwise false

getAllTaskIdentifiers

public static long[] getAllTaskIdentifiers()
Get all task identifiers

Returns:
long array of task identifiers

checkPersistentStoreLevel

protected void checkPersistentStoreLevel()
Check to see if persistent store needs to be updated for any reason


initialize

public static void initialize()
Activate any tasks that are flagged to be started during server initialization


terminate

public static void terminate()
Deactivate all active tasks


destroyActivation

public void destroyActivation(TWGTaskActivation act,
                              int status)

serverActivate

public abstract boolean serverActivate()
This abstract method is called by the server when it is activating the this task in preparation for activating a subtask. This method is called once to start the task. The thread making this call was started specifically to perform the task activation process. Control should not be returned until the activation has completed and the task is ready to accept subtaskActivate() calls, or a failure has occurred. If the task is configured to be automatically started by the server, this call will only be made once during server initialization; otherwise, this call will be made followed by any number of subtask activations. Once all of the subtasks have completed, serverDeactivate() will be called. After that, any subsequent subtasks will cause serverActivate() to be called again.

Returns:
true to indicate successful server task activation, or false to indicate a failure.

serverActivationFailed

public final void serverActivationFailed()
This method is called by the server task if it has experienced some sort of error that is causing it to terminate. The server's state will be set to indicate that it has failed, and all pending subtask activations will be returned to the console with a return code indicating that the server task has failed.


serverDeactivate

public abstract boolean serverDeactivate()
This method is called by the server when it needs to deactivate a task. This is done during server shutdown. It is also done if this task was not autostarted and all TWGTaskActivation objects for this task have completed.

Returns:
true to indicate that serverDeactivation is complete, or false to indicate that clean-up is still in progress and completion will be signaled by calling serverDeactivationComplete().

serverDeactivationComplete

public final void serverDeactivationComplete()
This method is called by the server task to indicate that server task deactivation is complete after previously returning false to the serverDeactivate() call.


serverTaskThread

public abstract boolean serverTaskThread()
This method is called by the server to offer the server task a chance to own the thread that is being used to invoke serverActivate(). If the task needs a thread, it may do it's main thread processing in this call.

Returns:
true if task doesn't need a thread, but the server task should still be considered to be in a started state, otherwise false indicating the server task has ended, and the server will do any necessary cleanup and notification.

subtaskActivate

public abstract int subtaskActivate(TWGTaskActivation act)
This method is called by the server when it receives a console command to activate a subtask. This method will only be called when the task is in the started state. The console will be notified of the subtask activation's success or failure.

Parameters:
act - the TWGTaskActivation object for this subtask activation.
Returns:
Use one of the following final values:
  • SUBTASK_ACT_COMPLETE - completed successfully
  • SUBTASK_ACT_FAILED - subtask activation failed
  • SUBTASK_ACT_PENDING - subtask activation will complete asynchronously and report results by calling subtaskActivateComplete()

subtaskActivationComplete

public final void subtaskActivationComplete(TWGTaskActivation act,
                                            boolean success)
This method is called by the server task when subtask activation has completed after previously returning SUBTASK_ACT_PENDING from the subtaskActivate() call.

Parameters:
act - the TWGTaskActivation object for this subtask activation.
success - true if activation successful, false if failed

subtaskDeactivate

public abstract void subtaskDeactivate(TWGTaskActivation act)
This method is called by the server when it receives a console command to deactivate a subtask or if the active console that has started the subtask goes away.


UpdateShadowVersion

public void UpdateShadowVersion()
Update the shadow version of this task. This method should be called by any method that modifies this task in a way that needs to be reflected up to the console. Update the shadow version for this task.

Specified by:
UpdateShadowVersion in interface TWGBaseShadowedObject
See Also:
TWGShadowedObject

GetShadowVersion

public long GetShadowVersion()
Get the shadow version of this task.

Specified by:
GetShadowVersion in interface TWGBaseShadowedObject
Returns:
the shadow version of this task.
See Also:
TWGShadowedObject

GetConShadowClass

public java.lang.String GetConShadowClass()
Get the name of the console class that shadow's task.

Specified by:
GetConShadowClass in interface TWGBaseShadowedObject
Returns:
the name of the console task shadow class.
See Also:
TWGShadowedObject

GetShadowRecord

public byte[] GetShadowRecord(java.util.Locale locale)
Get the data to shadow this task.

Specified by:
GetShadowRecord in interface TWGBaseShadowedObject
Parameters:
locale - - Locale to use for locale-specific data
Returns:
a byte array containing the instance information to shadow this object up to the console.
See Also:
TWGShadowedObject

getState

public final int getState()

getID

public final java.lang.String getID()
Get the this task's ID

Returns:
the string ID of this task

setID

protected final void setID(java.lang.String taskID)
Set the this task's ID

Parameters:
taskID - the string ID of this task

getParent

public final TWGTask getParent()
Get this task's parent.

Returns:
TWGTask that is the parent of this one or null if none.

getParentID

public final long getParentID()
Get this task's parent OID.

Returns:
object ID of parent, or 0 if none

setParent

public final void setParent(TWGTask parent)
Set this task's parent.

Parameters:
parent - TWGTask to be set as the parent of this task.

unsetParent

public final void unsetParent()
Unset this task's parent


getTitleKey

public final java.lang.String getTitleKey()
Get the key used to retrieve the icon title from the resource file.

Returns:
title key

getTitle

public final java.lang.String getTitle(java.util.Locale loc)
Get the title for the task

Parameters:
loc - - locale for request
Returns:
title

setTitleKey

public final void setTitleKey(java.lang.String titleKey)
Set the key used to retrieve the icon title from the resource file.


getPropertiesFileName

public final java.lang.String getPropertiesFileName()
Get the name of the properties file used to create this task.

Returns:
the name of this task's property file.

setPropertiesFileName

public final void setPropertiesFileName(java.lang.String propertiesFileName)
                                 throws TWGTaskException
Set the name of the properties file used to create this task.

Parameters:
propertiesFileName - the name of this task's property file.
Throws:
TWGTaskException

getExtensionClassName

public final java.lang.String getExtensionClassName()
Get the name of the extension class that defined this task.

Returns:
the name of the extension class that defined this task.

setExtensionClassName

public final void setExtensionClassName(java.lang.String extensionClassName)
Set the name of the extension class that defined this task.


getProperty

public final java.lang.String getProperty(java.lang.String key)
Get a property from the task's properties file.

Parameters:
key - the property key
Returns:
the value in this task's properties file with this key. This method returns null if the key is not found or if this task does not have a properties list.

getProperty

public final java.lang.String getProperty(java.lang.String key,
                                          java.lang.String defaultValue)
Get a property from the task's properties file.

Parameters:
key - the property key
defaultValue - a default value
Returns:
the value in this task's properties file with this key. This method returns defaultValue if the key is not found or if this task does not have a properties list.

getServiceNode

public final java.lang.String getServiceNode()
Get the name of the Service Node for this task.

Returns:
service node name

setServiceNode

public final void setServiceNode(java.lang.String serviceNode)
Set the name of the Service Node for this task.

Parameters:
serviceNode - service node name

getResourceBundle

public final java.lang.String getResourceBundle()
Get the name of the resource bundle for this task's labels.

Returns:
the name of the resource bundle for this task's labels.

setResourceBundle

public final void setResourceBundle(java.lang.String resourceBundle)
                             throws java.util.MissingResourceException
Set the resource bundle for the task's labels.

Parameters:
resourceBundle - name of the resource bundle for the task
Throws:
ResourceNotFound - If the specified resource bundle is not found.
java.util.MissingResourceException

getTaskData

public final byte[] getTaskData()
Get the data for this task. This field is for task implementors to have a place to stash task related data that will be held persistently. TWGTask does absolutely nothing with this data except for providing accessor methods, handling saving and restoring the data to make it persistent and shadowing it up to the console.

Returns:
a byte array containing the task's data or null if it's never been set

setTaskData

public final void setTaskData(byte[] taskData)
Set the data for this task. This field is for task implementors to have a place to stash task related data that will be held persistently. TWGTask does absolutely nothing with this data except for providing accessor methods, handling saving and restoring the data to make it persistent and shadowing it up to the console.

NOTE: save() must be called in order for the task's data to actually be placed into persistent storage.

Parameters:
taskData - a byte array to save as this task's data

getServerName

public final java.lang.String getServerName()
Get the name of the server Java class or native executable for this task.

Returns:
the name of the server Java class or native executable for this task.

setServerName

public final void setServerName(java.lang.String serverName)
Set the name of the server Java class or native executable for this task.

Parameters:
serverName - the name of the server Java class or native executable for this task.

getServerMinHeapParm

public final java.lang.String getServerMinHeapParm()
Get the server's minimum heap size parameter.

Returns:
server's minimum heap size parameter.

setServerMinHeapParm

public final void setServerMinHeapParm(java.lang.String val)
Set the minimum heap size parm for the Java server for this task.

Parameters:
val - the minimum heap size parm (e.g., "4M" (megabytes) or "4096" (kilobytes))

getServerMaxHeapParm

public final java.lang.String getServerMaxHeapParm()
Get the server's maximum heap size parameter.

Returns:
server's maximum heap size parameter.

setServerMaxHeapParm

public final void setServerMaxHeapParm(java.lang.String val)
Set the maximum heap size parm for the Java server for this task.

Parameters:
val - the maximum heap size parm (e.g., "128M" (megabytes) or "131072" (kilobytes))

isServerJIT

public final boolean isServerJIT()
Indicate if this task's Java server task runs with the JIT enabled.

Returns:
true if the JIT is enabled for this Java task

setServerJIT

protected final void setServerJIT(boolean flag)
Set this task's Java server to run with the JIT enabled.

Parameters:
flag - true to enable the JIT for this Java task, false to disable the JIT for this Java task

getServerParms

public final java.lang.String getServerParms()
Get the parameters for the server class/native executable.

Returns:
the parameter string for the server class/native executable.

setServerParms

public final void setServerParms(java.lang.String serverParms)
Set the parameter string for the server class/native executable.

Parameters:
serverParms - the parameter string for the server class/native executable.

getServerType

public final int getServerType()
Get the type of the server portion of this task.

Returns:
the type of the server portion of this task.

setServerType

public final void setServerType(int serverType)
Set the type of the server portion of this task.

Parameters:
serverType - the type of the server portion of this task.

getGuiClass

public final java.lang.String getGuiClass()
Get the name of the GUI class for this task.

Returns:
the name of the GUI class for this task.

setGuiClass

public final void setGuiClass(java.lang.String guiClass)
Set the name of the GUI class for this task.

Parameters:
guiClass - the name of the GUI class for this task.

getGuiParms

public final java.lang.String getGuiParms()
Get the parameters for the GUI class for this task.

Returns:
the parameters for the GUI class for this task.

setGuiParms

public final void setGuiParms(java.lang.String guiParms)
Set the name of the GUI class for this task.

Parameters:
guiParms - the name of the GUI class for this task.

getHelpTopicsMapping

public final java.lang.String getHelpTopicsMapping()
Get the help topics mapping file name.


setHelpTopicsMapping

public final void setHelpTopicsMapping(java.lang.String helpTopicsMapping)
Set the name of the help topics mapping file.

Parameters:
helpTopicsMapping - the name of the help topics mapping file

getImageSet

public final long getImageSet()
Get the image set id for this task.


setImageSet

public final void setImageSet(java.lang.String[] iconNames)
                       throws TWGTaskException
Set the image set for this task.

Parameters:
iconNames - an array of strings that are the names of the icons for this task.
Throws:
TWGTaskException

setImageSet

public final void setImageSet(long imageSetID)
Set the image set for this task.

Parameters:
imageSetID - image set id for this task.

addClient

public final boolean addClient(java.lang.String clientClass,
                               java.lang.String clientTaskList)
Adds a client and the client tasks used by this task to its client list.

Parameters:
clientClass - The name of the client task class being added to the list of clients supported by this task.
Returns:
boolean true, if the client was successfully added, false if the specified client class is not registered with the engine.

addClient

public final boolean addClient(java.lang.String clientClass,
                               java.lang.String clientTaskList,
                               boolean single)
Adds a client and the client tasks used by this task to its client list.

Parameters:
clientClass - The name of the client task class being added to the list of clients supported by this task.
single - true, if clientTasks is actually a single client task instead of a list concatenated with the '|' character
Returns:
boolean true, if the client was successfully added, false if the specified client class is not registered with the engine.

getClientTasks

public TWGClientTaskList getClientTasks()

getClientTaskCount

public int getClientTaskCount(TWGManagedObject mo)
Get the number of client tasks that would be started for a specific TWGManagedObject based on its MOF.

Parameters:
mo - the TWGManagedObject to report
Returns:
the number of client tasks that would be started during task activation

addSubtask

public final void addSubtask(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
Add a subtask to this task's list.

Parameters:
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 final void addSubtask(java.lang.String subtaskID,
                             java.lang.String menu,
                             java.lang.String menuLocation,
                             java.lang.String contextList,
                             java.lang.String actionsList,
                             java.lang.String privilegeList)
                      throws com.tivoli.twg.engine.TWGTaskCreationException
Add a subtask to this task's list.

Parameters:
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).
privilegeList - list of privileges required for user to be able to use this subtask
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 final boolean removeSubtask(java.lang.String subtaskID)

getSubtaskCount

public final int getSubtaskCount()
Get the number of subtasks defined for this task

Returns:
the number of subtasks defined for this task

getSubtask

public final TWGSubtask getSubtask(java.lang.String subtaskID)
Get a subtask based on the task ID string.

Parameters:
subtaskID - Subtaks ID string.
Returns:
TWGSubtask or null if a subtask with the specified ID has not been defined for this task.

getAllSubtasks

public java.util.Enumeration getAllSubtasks()
Get an enumeration of all the subtasks contain in this task.

Returns:
An enumeration of TWGSubtasks or null if task does not contain any subtasks.

hasSubtask

public final boolean hasSubtask(java.lang.String subtaskID)
Determine if a subtask is defined for this task.

Returns:
true if the subtask is defined.

isTaskDeleted

public final boolean isTaskDeleted()

isBoundInstance

public final boolean isBoundInstance()
See if this task is bound to managed object on an instance basis.

Returns:
boolean

setBoundInstance

public final void setBoundInstance(boolean flag)
Specify that this task is to be bound to managed objects on an instance basis.

Parameters:
flag - a boolean

isUnrestricted

public final boolean isUnrestricted()
See if this task is unrestricted with respect to user permissions.

Returns:
a boolean

setUnrestricted

public final void setUnrestricted(boolean flag)
Specify that this task is unrestricted with respect to user permissions.

Parameters:
flag - a boolean

isTaskIconHidden

public final boolean isTaskIconHidden()
Indicate if this task's icon will be displayed in the console's task pane.


setTaskIconHidden

public final void setTaskIconHidden(boolean flag)
Set whether or not the task's icon will be displayed in the console's task pane.

Parameters:
flag - true to make hidden, false to make visible

isLiteralTitle

public final boolean isLiteralTitle()
Indicate if this task's title is a literal or a resource bundle key.

Returns:
flag true if title is a literal, false if title is a key

setLiteralTitle

public final void setLiteralTitle(boolean flag)
Set whether or not the task's title is a literal or a resource bundle key.

Parameters:
flag - true if title is a literal, false if title is a key

isServerAutoLoad

public final boolean isServerAutoLoad()
Indicate if this task's server portion will be loaded during initialization

Returns:
true if this task's server portion is set to load on demand

setServerAutoLoad

public final void setServerAutoLoad(boolean flag)

isServerSynchronous

public final boolean isServerSynchronous()
Indicate if this task's server portion will be loaded during initialization and will cause the server engine's initialization to wait for this task's server to indicate that it is ready.


setServerSynchronous

public final void setServerSynchronous(boolean flag)
Set this task's server portion so that it will be loaded during initialization and will cause the server engine's initialization to wait for this task's server to indicate that it is ready.


isServerSameJVM

public final boolean isServerSameJVM()
Determine if this task's Java server task will be run in the server's JVM.

Returns:
true if this Java task will be run in the same JVM as the server

setServerSameJVM

public final void setServerSameJVM(boolean flag)
Set this task's server portion to run in the same or different JVM

Parameters:
flag - true to load this Java task in the same JVM as the server, false to create a new JVM for this Java task

isServerSameJVMConfigurable

public final boolean isServerSameJVMConfigurable()
Determine if this task's Java server task will be run in or out of the engine's JVM based on the engine's configuration.

Returns:
true if this Java task will be run in/out of the engine's JVM based on the engine's configuration false if the decision is based instead on isServerSameJVM()

setServerSameJVMConfigurable

public final void setServerSameJVMConfigurable(boolean flag)
Set this task's server portion to run in the same or different JVM based on the engine's configuration.

Parameters:
flag - true to base this task on the engine's configuration false to base this task on the value returned by isServerSameJVM()

hasServerRunThread

public final boolean hasServerRunThread()
Determine if this Java server task in engine JVM is to have run method called

Returns:
true if Java server task in engine JVM is to have run method called

setServerRunThread

public final void setServerRunThread(boolean flag)
Set whether this Java server task in engine JVM is to have run method called

Parameters:
flag - true for Java server task in engine JVM to have its run method called

toString

public java.lang.String toString()
Obtain a string representation of this TWGTask.

Returns:
A string representation of this TWGTask.

saveData

protected void saveData(TWGPersistentObjectDictionary dictionary)
                 throws TWGPersistentObjectSaveException
Method for saving persistent object data.

Overrides:
saveData in class TWGPersistentObject
Throws:
TWGPersistentObjectSaveException - thrown to abort save procedure.

restoreData

protected void restoreData(TWGPersistentObjectDictionary dictionary,
                           boolean resolveObjectReferences)
                    throws TWGPersistentObjectRestoreException
Method for restoring persistent object data.

Overrides:
restoreData in class TWGPersistentObject
Parameters:
resolveObjectReferences - used to indicate if object references should be resolved during restore.
Throws:
TWGPersistentObjectRestoreException - thrown to abort restore procedure.

getAttributeIDList

public java.lang.String[] getAttributeIDList()
Attribute ID enumeration : this method is expected to return a list of strings containing the String names of the attributes supported for a given object. Subclasses of base classes implementing the interface should report additional attributes by adding them to the list returned by the base class.

Specified by:
getAttributeIDList in interface TWGGetSetInterface

getAttributeValue

public DataValue getAttributeValue(java.lang.String id,
                                   java.util.Locale loc)
Get value of attribute with given ID

Specified by:
getAttributeValue in interface TWGGetSetInterface
Parameters:
id - - attribute ID requested
loc - - locale to use for value, if applicable
Returns:
value object, or null if no value

setAttributeValue

public boolean setAttributeValue(java.lang.String id,
                                 DataValue val)
Set value of attribute with given ID

Specified by:
setAttributeValue in interface TWGGetSetInterface
Parameters:
id - - attribute ID to be set
val - - attribute value to be set
Returns:
true if set successful, false if not successful

getAttributeType

public int getAttributeType(java.lang.String id)
Get type of attribute value for given attribute

Specified by:
getAttributeType in interface TWGGetSetInterface
Parameters:
id - - attribute ID
Returns:
DataValue type of attribute, or DataValue.NONE_TYPE if undefined

SetObjectID

public void SetObjectID(long oid)
                 throws DuplicateObjectIDException
Set object ID. This method subclasses the TWGObject class's SetObjectID.

Overrides:
SetObjectID in class TWGObject
Parameters:
oid - - new object ID, or INVALID_OBJECT_ID if none
Throws:
DuplicateObjectIDException - if ID is duplicate

AttachObjectToConsole

public void AttachObjectToConsole(TWGActiveConsole act_con)
Associate the object with the given TWGActiveConsole instance. This method should simply call the TWGActiveConsole.objectAddToConsole() method.

Specified by:
AttachObjectToConsole in interface TWGConsoleSpecShadowedObject
Parameters:
act_con - - Active console instance to be associated with

DetachObjectFromConsole

public void DetachObjectFromConsole(TWGActiveConsole act_con)
Disassociate the object from the given TWGActiveConsole instance. This method should simply call the TWGActiveConsole.objectRemoveFromConsole() method.

Specified by:
DetachObjectFromConsole in interface TWGConsoleSpecShadowedObject
Parameters:
act_con - - Active console instance to be disassociated from

DetachObjectFromAllConsoles

public void DetachObjectFromAllConsoles()
Disassociate the object from all TWGActiveConsoles. This method should simply call the TWGActiveConsole.objectRemoveFromAllConsoles() method.

Specified by:
DetachObjectFromAllConsoles in interface TWGConsoleSpecShadowedObject

attachAllAllowedTasks

public static void attachAllAllowedTasks(TWGActiveConsole con)
Attach all allowed tasks to console

Parameters:
con - - console instance

detachAllDisallowedTasks

public static void detachAllDisallowedTasks(TWGActiveConsole con)
Detach all disallowed tasks from console

Parameters:
con - - console instance

clientServiceAdded

public void clientServiceAdded(java.lang.String svcname,
                               TWGManagedObject mo)
Service add notification : indicates that the given client service has been added to the given managed object

Specified by:
clientServiceAdded in interface TWGClientServiceListener
Parameters:
svcname - - client service name
mo - - managed object

clientServiceRemoved

public void clientServiceRemoved(java.lang.String svcname,
                                 TWGManagedObject mo)
Service remove notification : indicates that the given client service has been remove from the given managed object

Specified by:
clientServiceRemoved in interface TWGClientServiceListener
Parameters:
svcname - - client service name
mo - - managed object

dumpProperties

protected void dumpProperties()

isDisabled

public final boolean isDisabled()
Test to see if task is disabled


setTempDisabled

public void setTempDisabled(boolean do_disable)
Set task disabled temporarily (non-persistently)

Parameters:
do_disable - - true if disable, false if enable
Since:
V2.11

isDisabledSubtask

public final boolean isDisabledSubtask(java.lang.String subid)
Test to see if subtask is disabled

Parameters:
subid - - subtask ID

setPrivileges

public void setPrivileges(java.lang.String[] privNames,
                          boolean reset)
Set the list of privilege token names required to be able to use this subtask.

Parameters:
reset - true if existing list should be reset before adding false if new list should simple be added to existing list

getPrivileges

public java.lang.String[] getPrivileges()
Get the list of privileges required for a user to be able to use this task.

Returns:
String[] of privilege names

checkPrivileges

public boolean checkPrivileges(StringValueSet checkSet)
Check to see if the specified set of privileges is adequate for using this TWGTask.

Returns:
true if the privilege set is adequate for using this task false if the privilege set does not contain all the privilege tokens required for using this subtask.