com.tivoli.twg.engine
Class TWGTaskActivation

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGTaskActivation
All Implemented Interfaces:
TWGActiveConsoleListener

public class TWGTaskActivation
extends TWGObject
implements TWGActiveConsoleListener

This class maintains all the pertinent information within the server for a task activation. It is also the focal point for controlling the task activation.


Constructor Summary
TWGTaskActivation(TWGTask task, TWGSubtask subtask)
          Constructor accepting only the task/subtask to activate.
TWGTaskActivation(TWGTask task, TWGSubtask subtask, Command cmd)
          Constructor accepting only the task/subtask to activate.
TWGTaskActivation(TWGTask task, TWGSubtask subtask, LongValueSet moid, LongValueSet foid, java.lang.String logName, TWGTaskActivationListener listener, byte[] taskActData)
          Full blown constructor
 
Method Summary
 void activeConsoleChanged(TWGActiveConsole console, int conState)
          Notification of an active console state change.
 void deactivateClient(long id, int status)
          Deactivate a client's tasks if it is in this activation's list
 void deactivateClients(boolean force)
          Deactivate clients.
 void Destroy()
          Destroy this activation.
 TWGLocalTaskClients getClients()
          Get the collection of TWGLocalManagedObjects that represent the clients that are the targets of this activation.
 Command getCommand()
          Get the task activation command that caused this activation to be created.
 long getConsoleActID()
          Get the activation ID assigned by the console for this activation.
 LongValueSet getFoid()
          Get the filter(s) that were resolved to obtain the target set.
 TWGLog getLog()
          Get the TWGLog object to use to log status messages for this activation.
 java.lang.String getLogName()
          Get log name
 LongValueSet getMoid()
          Get the set of managed objects that are the target(s) for this activation
 long getServerActID()
          Get the activation ID for this activation.
 int getStatus()
          Get the status of this task activation.
 TWGSubtask getSubtask()
          Get the TWGSubtask object being activated
 TWGTask getTask()
          Get the TWGTask object being activated
 byte[] getTaskActData()
          Get the taskActData from this activation
 java.lang.String getTitle()
           
 TWGUser getUser()
          Get user associated with activation
 void logMessage(java.lang.String message, int level)
          Log a non-translatable message to the log associeated with this activation.
 void logMessage(java.lang.String message, int level, int correlator)
          Log a non-translatable message to the log associeated with this activation.
 void logMessage(java.lang.String message, int level, TWGManagedObject mo)
          Log a non-translatable message to the log associeated with this activation.
 void logMessage(java.lang.String bundleName, java.lang.String messageKey, int level)
          Log a message to the log associated with this activation.
 void logMessage(java.lang.String bundleName, java.lang.String messageKey, int level, int correlator)
          Log a message to the log associated with this activation.
 void logMessage(java.lang.String bundleName, java.lang.String messageKey, int level, TWGManagedObject mo)
          Log a message to the log associated with this activation.
 void setClientTaskStatus(long id, int status)
          Set the client task status for the specified client.
 void setLogName(java.lang.String logname)
          Set log name
 void setStatus(int status)
          Set the status of this task activation.
 void setTaskActData(byte[] taskActData)
          Set the taskActData for this activation
 
Methods inherited from class com.tivoli.twg.engine.TWGObject
AllObjects, AllObjects, Delete, DumpTWGObjects, FindObject, isDeleted, isNewObject, isPersistent, isPersistent, isValid, isValid, ObjectID, setDistinctObjectID, SetObjectID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TWGTaskActivation

public TWGTaskActivation(TWGTask task,
                         TWGSubtask subtask)
Constructor accepting only the task/subtask to activate.

Parameters:
task - TWGTask to activate.
subtask - TWGSubtask to activate.

TWGTaskActivation

public TWGTaskActivation(TWGTask task,
                         TWGSubtask subtask,
                         LongValueSet moid,
                         LongValueSet foid,
                         java.lang.String logName,
                         TWGTaskActivationListener listener,
                         byte[] taskActData)
Full blown constructor

Parameters:
task - TWGTask to activate.
subtask - TWGSubtask to activate.
moid - LongValueSet containing the clients to activate
foid - LongValueSet containing the filters that were resolved
logName - name of the log to write status messages to
listener - TWGTaskActivationListener to notify with status changes

TWGTaskActivation

public TWGTaskActivation(TWGTask task,
                         TWGSubtask subtask,
                         Command cmd)
Constructor accepting only the task/subtask to activate.

Parameters:
task - TWGTask to activate.
subtask - TWGSubtask to activate.
cmd - task activation Command received that caused this activation to happen
Method Detail

getTitle

public java.lang.String getTitle()

getCommand

public Command getCommand()
Get the task activation command that caused this activation to be created.

Returns:
Command

getTask

public TWGTask getTask()
Get the TWGTask object being activated

Returns:
TWGTask

getSubtask

public TWGSubtask getSubtask()
Get the TWGSubtask object being activated

Returns:
TWGSubtask

getMoid

public LongValueSet getMoid()
Get the set of managed objects that are the target(s) for this activation

Returns:
LongValueSet

getFoid

public LongValueSet getFoid()
Get the filter(s) that were resolved to obtain the target set.

Returns:
LongValueSet

getClients

public TWGLocalTaskClients getClients()
Get the collection of TWGLocalManagedObjects that represent the clients that are the targets of this activation.

Returns:
TWGLocalTaskClients

getTaskActData

public byte[] getTaskActData()
Get the taskActData from this activation

Returns:
byte[]

setTaskActData

public void setTaskActData(byte[] taskActData)
Set the taskActData for this activation

Parameters:
taskActData - byte[] for new taskActData value

getServerActID

public long getServerActID()
Get the activation ID for this activation.

Returns:
the ID for this activation.

getConsoleActID

public long getConsoleActID()
Get the activation ID assigned by the console for this activation. This method should only be called by the core engine.


getUser

public TWGUser getUser()
Get user associated with activation

Returns:
user object, or null if none

getLog

public TWGLog getLog()
Get the TWGLog object to use to log status messages for this activation.

Returns:
TWGLog

getStatus

public int getStatus()
Get the status of this task activation. See TWGTaskConstants for constants starting with ACT_STATUS_

Returns:
int the status of this activation.

setStatus

public void setStatus(int status)
Set the status of this task activation. See TWGTaskConstants for constants starting with ACT_STATUS_

Parameters:
status - the new status of this activation.

Destroy

public void Destroy()
             throws TWGObjectDestroyException
Destroy this activation. This method should only be called by the core engine. It is public only because it is inherited.

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

activeConsoleChanged

public void activeConsoleChanged(TWGActiveConsole console,
                                 int conState)
Notification of an active console state change.

Specified by:
activeConsoleChanged in interface TWGActiveConsoleListener
Parameters:
console - TWGActiveConsole object that changed.
conState - new state of the console

deactivateClients

public void deactivateClients(boolean force)
Deactivate clients.

Parameters:
force - true if clients' statuses should be force to a final state false if clients' statuses should be left in pending or active

deactivateClient

public void deactivateClient(long id,
                             int status)
Deactivate a client's tasks if it is in this activation's list


setClientTaskStatus

public void setClientTaskStatus(long id,
                                int status)
Set the client task status for the specified client.

Parameters:
id - the managed object id of the client to set
status - the status of the client task. See TWGTaskConstants for constants starting with CLIENT_TASK_

logMessage

public void logMessage(java.lang.String bundleName,
                       java.lang.String messageKey,
                       int level,
                       int correlator)
Log a message to the log associated with this activation. If there is no log, this method call is basically a no-op.

Parameters:
bundleName - the fully qualified name of the bundle to retrieve the locale specific version of the message text.
messageKey - the key to use to retrieve the message from the bundle Note: If your message has string substitutions (i.e. {0}, {1}, etc. that you need to use with MessageFormat, then the substitution values should be appended to the message key using the vertical bar ("|") as a delimiter.
level - the level of detail of the message for selective display; currently, 0-99=low, 100-199=medium, >200=high
correlator - If the message being logged pertains to a specific managed object, then this value should be the object's ID (moid) cast to an int; otherwise, this value should be 0.

logMessage

public void logMessage(java.lang.String bundleName,
                       java.lang.String messageKey,
                       int level,
                       TWGManagedObject mo)
Log a message to the log associated with this activation. If there is no log, this method call is basically a no-op.

Parameters:
bundleName - the fully qualified name of the bundle to retrieve the locale specific version of the message text.
messageKey - the key to use to retrieve the message from the bundle Note: If your message has string substitutions (i.e. {0}, {1}, etc. that you need to use with MessageFormat, then the substitution values should be appended to the message key using the vertical bar ("|") as a delimiter.
level - the level of detail of the message for selective display; currently, 0-99=low, 100-199=medium, >200=high
mo - The managed object to which this message pertains

logMessage

public void logMessage(java.lang.String bundleName,
                       java.lang.String messageKey,
                       int level)
Log a message to the log associated with this activation. If there is no log, this method call is basically a no-op.

Parameters:
bundleName - the fully qualified name of the bundle to retrieve the locale specific version of the message text.
messageKey - the key to use to retrieve the message from the bundle Note: If your message has string substitutions (i.e. {0}, {1}, etc. that you need to use with MessageFormat, then the substitution values should be appended to the message key using the vertical bar ("|") as a delimiter.
level - the level of detail of the message for selective display; currently, 0-99=low, 100-199=medium, >200=high

logMessage

public void logMessage(java.lang.String message,
                       int level)
Log a non-translatable message to the log associeated with this activation. If there is no log, this method call is basically a no-op.

Parameters:
message - the non-translatable message text to log
level - the level of detail of the message for selective display; currently, 0-99=low, 100-199=medium, >200=high

logMessage

public void logMessage(java.lang.String message,
                       int level,
                       TWGManagedObject mo)
Log a non-translatable message to the log associeated with this activation. If there is no log, this method call is basically a no-op.

Parameters:
message - the non-translatable message text to log
level - the level of detail of the message for selective display; currently, 0-99=low, 100-199=medium, >200=high
mo - The managed object to which this message pertains

logMessage

public void logMessage(java.lang.String message,
                       int level,
                       int correlator)
Log a non-translatable message to the log associeated with this activation. If there is no log, this method call is basically a no-op.

Parameters:
message - the non-translatable message text to log
level - the level of detail of the message for selective display; currently, 0-99=low, 100-199=medium, >200=high
correlator - If the message being logged pertains to a specific managed object, then this value should be the object's ID (moid) cast to an int; otherwise, this value should be 0.

setLogName

public void setLogName(java.lang.String logname)
Set log name


getLogName

public java.lang.String getLogName()
Get log name

Returns:
log name (or null if no log set)