com.tivoli.twg.engine
Class TWGContentInfoBeans

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGContentInfoBeans
All Implemented Interfaces:
TWGActiveConsoleListener, TWGBaseShadowedObject, TWGShadowedObject

public class TWGContentInfoBeans
extends TWGPersistentObject
implements TWGShadowedObject, TWGActiveConsoleListener

Persistent engine object used to hold definitions of a new type of information to be made available in the contents pane under a managed object in the Director console. Each instance consists of the name of type of information (to be used in the menu for selection) passed as a key into a resource bundle (also specified), and two class names which serve as the handlers for the content info. One is the event handler for dealing with user interaction with the content info objects, the other is the handler used for providing the content info objects that appear on the console. Interaction between the content info bean, the console and the object handler is via commands.

See Also:
TWGContentInfoEventHandler, TWGContentInfoObjectHandler, ActDeactContentInfoCmd, GetContentInfoCmd, UpdateContentInfoCmd

Field Summary
 
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
TWGContentInfoBeans()
          Default constructor : used during restore
TWGContentInfoBeans(java.lang.String inst_id, int sort_wt, java.lang.String nls_bndl, java.lang.String menu_lbl, java.lang.String obj_hndlr_name, java.lang.String evt_hndlr_name)
          Constructor for new ContentInfoBeans instance
 
Method Summary
 void activeConsoleChanged(TWGActiveConsole console, int state)
          Called by the active console when the console is logged off.
 void addConsoleToViewList(long act_con)
          Add the console specific to this bean's list of consoles using this view.
 void Delete()
          Delete method : remove from our list
 java.lang.String GetConShadowClass()
          Get name of console shadow class.
static TWGContentInfoBeans getContentInfoBeans(java.lang.String inst_id)
          Find existing instance by instance ID
 java.lang.String getContentInfoEventHandler()
          Get the classname of the content info event handler.
 java.lang.String getContentInfoObjectHandler()
          Get the classname of the content info object handler.
 java.lang.String getMenuLabel(java.util.Locale loc)
          Get menu label (using given locale)
 byte[] GetShadowRecord(java.util.Locale locale)
          Get buffer containing current values of the shadowed attributes to be delivered to the console shadow class.
 long GetShadowVersion()
          Get object state version.
 int getSortingWeight()
          Get the menu weighting factor of the content info bean.
static void handleActDeactContentInfoCmd(Command cmd)
          Command handler for activate/deactivate content info command
static void handleGetContentInfoCmd(Command cmd)
          Command handler for get content info command
static void handleUpdateContentInfoCmd(Command cmd)
          Command handler for update content info command
 boolean isViewActive()
          Check if this bean's task association view is active.
 void removeConsoleFromViewList(long act_con)
          Remove the specific console from this bean's list of consoles using this view.
protected  void restoreData(TWGPersistentObjectDictionary dictionary, boolean resolveObjectReferences)
          Method for restoring persistent object data.
protected  void saveData(TWGPersistentObjectDictionary dictionary)
          Method for saving persistent object data.
 void setContentHandlers(java.lang.String obj_hndlr, java.lang.String evt_hndlr)
          Replace object handler class and event handler class with new classes
 void setMenuLabel(java.lang.String menu_lbl)
          Replace menu label with new value
 void setNLSBundle(java.lang.String bndl)
          Set NLS bundle
 void UpdateShadowVersion()
          Update object state version.
 
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject
Destroy, enableAsyncWrites, fromPersistID, initialize, isNewPersistentStore, isSaveRequired, PersistID, restore, restoreAll, save, save, setSaveRequired, terminate, toPersistID
 
Methods inherited from class com.tivoli.twg.engine.TWGObject
AllObjects, AllObjects, 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

TWGContentInfoBeans

public TWGContentInfoBeans(java.lang.String inst_id,
                           int sort_wt,
                           java.lang.String nls_bndl,
                           java.lang.String menu_lbl,
                           java.lang.String obj_hndlr_name,
                           java.lang.String evt_hndlr_name)
                    throws TWGPersistentObjectSaveException
Constructor for new ContentInfoBeans instance

Parameters:
inst_id - - unique instance ID
sort_wt - - ordering weight for this bean versus others : menu items are ordered from lowest to highest sort weight
nls_bndl - - base classname for NLS bundle (null if none)
menu_lbl - - menu text (or resource ID for menu text, if nls_bndl is non-null)
obj_hndlr_name - - handler class for providing content info objects
evt_hndlr_name - - handler class for interacting with content info user events
Throws:
TWGPersistentObjectSaveException - if error creating

TWGContentInfoBeans

public TWGContentInfoBeans()
Default constructor : used during restore

Method Detail

Delete

public void Delete()
Delete method : remove from our list

Overrides:
Delete in class TWGObject

getContentInfoBeans

public static TWGContentInfoBeans getContentInfoBeans(java.lang.String inst_id)
Find existing instance by instance ID

Parameters:
inst_id - - instance ID to find
Returns:
instance found, or null if not found

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.

UpdateShadowVersion

public void UpdateShadowVersion()
Update object state version. This method must call the TWGActiveConsole.nextShadowVersion() to update its internal state_version attribute (a 'long' instance variable). This method should be called by any methods of the object's class or subclasses which modify attributes which are send to the shadow objects on the console).

Specified by:
UpdateShadowVersion in interface TWGBaseShadowedObject

GetShadowVersion

public long GetShadowVersion()
Get object state version. This returns value of state_version.

Specified by:
GetShadowVersion in interface TWGBaseShadowedObject
Returns:
state_version attribute value

GetConShadowClass

public java.lang.String GetConShadowClass()
Get name of console shadow class. This returns the name of TWGConObject subclass which is used to hold the attributes shadowed to the console.

Specified by:
GetConShadowClass in interface TWGBaseShadowedObject
Returns:
com.tivoli.twg.engine.TWGConObject subclass which object shadows to

GetShadowRecord

public byte[] GetShadowRecord(java.util.Locale locale)
Get buffer containing current values of the shadowed attributes to be delivered to the console shadow class. This data is delivered along with the ObjectID (so the ObjectID shouldn't be included in the shadowed data record).

Specified by:
GetShadowRecord in interface TWGBaseShadowedObject
Parameters:
locale - - Locale of requested data
Returns:
byte array containing opaque data representation of attribute values to be delivered to the console shadow class.

getMenuLabel

public java.lang.String getMenuLabel(java.util.Locale loc)
Get menu label (using given locale)

Parameters:
loc - - locale of request
Returns:
label

setMenuLabel

public void setMenuLabel(java.lang.String menu_lbl)
Replace menu label with new value

Parameters:
menu_lbl - - new menu label (or string ID, if nls bundle defined)

setContentHandlers

public void setContentHandlers(java.lang.String obj_hndlr,
                               java.lang.String evt_hndlr)
Replace object handler class and event handler class with new classes

Parameters:
obj_hndlr - - new object handler class name
evt_hndlr - - new event handler class name

setNLSBundle

public void setNLSBundle(java.lang.String bndl)
Set NLS bundle

Parameters:
bndl - - bundle name

getContentInfoObjectHandler

public java.lang.String getContentInfoObjectHandler()
Get the classname of the content info object handler.

Returns:
name of object handler class for this content info bean.

getContentInfoEventHandler

public java.lang.String getContentInfoEventHandler()
Get the classname of the content info event handler.

Returns:
name of event handler class for this content info bean.

getSortingWeight

public int getSortingWeight()
Get the menu weighting factor of the content info bean.

Returns:
weight assigned to this bean

addConsoleToViewList

public void addConsoleToViewList(long act_con)
Add the console specific to this bean's list of consoles using this view.

Parameters:
act_con - The active console id for the console using the task association view for this bean.

removeConsoleFromViewList

public void removeConsoleFromViewList(long act_con)
Remove the specific console from this bean's list of consoles using this view.

Parameters:
act_con - The active console id for the console that no longer displays the task association view for this bean.

isViewActive

public boolean isViewActive()
Check if this bean's task association view is active.

Returns:
true if any console is using the task association view for this bean.

activeConsoleChanged

public void activeConsoleChanged(TWGActiveConsole console,
                                 int state)
Called by the active console when the console is logged off. This will remove this console from the view list so that the view will know if it is still in use yet or not.

Specified by:
activeConsoleChanged in interface TWGActiveConsoleListener
Parameters:
console - Instance of the TWGActiveConsole that is being closed.
state - Flag indicating is the console was opened or closed.

handleActDeactContentInfoCmd

public static void handleActDeactContentInfoCmd(Command cmd)
Command handler for activate/deactivate content info command

Parameters:
cmd - - command requested

handleGetContentInfoCmd

public static void handleGetContentInfoCmd(Command cmd)
Command handler for get content info command

Parameters:
cmd - - command requested

handleUpdateContentInfoCmd

public static void handleUpdateContentInfoCmd(Command cmd)
Command handler for update content info command

Parameters:
cmd - - command requested