com.tivoli.twg.engine
Class TWGConfigPanelBeans

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

public class TWGConfigPanelBeans
extends TWGPersistentObject
implements TWGShadowedObject

Persistent engine object used to hold definitions of sets of configuration panels to be made available in the configuration notebook on the Director WorkGroup console. Each instance consists of an ordered set of one or more panels, each of which contains a tab label and the class name for a Java Bean to be used to define the given panel.


Field Summary
static int DISCOVERY_CFG_BEAN
          High order bit we set in the sorting weight to indicate which preference dialog to add the bean to.
 
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
TWGConfigPanelBeans()
          Default constructor : used during restore
TWGConfigPanelBeans(java.lang.String inst_id, int sort_wt, java.lang.String nls_bndl, java.lang.String[] tab_lbls, java.lang.String[] panel_beans)
          Constructor for new ConfigPanelBeans instance
TWGConfigPanelBeans(java.lang.String inst_id, int sort_wt, java.lang.String nls_bndl, java.lang.String[] tab_lbls, java.lang.String[] panel_beans, boolean disc_pref)
          Constructor for new ConfigPanelBeans instance
 
Method Summary
 void Delete()
          Delete method : remove from our list
static TWGConfigPanelBeans getConfigPanelBeans(java.lang.String inst_id)
          Find existing instance by instance ID
 java.lang.String GetConShadowClass()
          Get name of console shadow class.
 java.lang.String getPanelBean(int index)
          Get bean classname
 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 getTabCount()
          Get number of tabs and panels
 java.lang.String getTabLabel(int index, java.util.Locale loc)
          Get tab label (using given locale)
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 setDiscoveryPanelPreferred(boolean disc_pref)
          Set Discovery panel preference
 void setNLSBundle(java.lang.String bndl)
          Set NLS bundle
 void setTabsAndBeans(java.lang.String[] tab_lbls, java.lang.String[] bean_names)
          Replace tab labels and bean names with new values
 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
 

Field Detail

DISCOVERY_CFG_BEAN

public static final int DISCOVERY_CFG_BEAN
High order bit we set in the sorting weight to indicate which preference dialog to add the bean to.

See Also:
Constant Field Values
Constructor Detail

TWGConfigPanelBeans

public TWGConfigPanelBeans(java.lang.String inst_id,
                           int sort_wt,
                           java.lang.String nls_bndl,
                           java.lang.String[] tab_lbls,
                           java.lang.String[] panel_beans)
                    throws TWGPersistentObjectSaveException
Constructor for new ConfigPanelBeans instance

Parameters:
inst_id - - unique instance ID
sort_wt - - ordering weight for this bean versus others : panels are ordered from lowest to highest sort weight
nls_bndl - - base classname for NLS bundle (null if none)
tab_lbls - - list of tab labels (or resource IDs for tab labels, if nls_bndl is non-null)
panel_beans - - list of bean classes for each panel
Throws:
TWGPersistentObjectSaveException - if error creating

TWGConfigPanelBeans

public TWGConfigPanelBeans(java.lang.String inst_id,
                           int sort_wt,
                           java.lang.String nls_bndl,
                           java.lang.String[] tab_lbls,
                           java.lang.String[] panel_beans,
                           boolean disc_pref)
                    throws TWGPersistentObjectSaveException
Constructor for new ConfigPanelBeans instance

Parameters:
inst_id - - unique instance ID
sort_wt - - ordering weight for this bean versus others : panels are ordered from lowest to highest sort weight
nls_bndl - - base classname for NLS bundle (null if none)
tab_lbls - - list of tab labels (or resource IDs for tab labels, if nls_bndl is non-null)
panel_beans - - list of bean classes for each panel
disc_pref - - if true, show panel(s) in discovery preference dialog, otherwise panel(s) are shown in server preference dialog.
Throws:
TWGPersistentObjectSaveException - if error creating

TWGConfigPanelBeans

public TWGConfigPanelBeans()
Default constructor : used during restore

Method Detail

Delete

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

Overrides:
Delete in class TWGObject

getConfigPanelBeans

public static TWGConfigPanelBeans getConfigPanelBeans(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.

getTabLabel

public java.lang.String getTabLabel(int index,
                                    java.util.Locale loc)
Get tab label (using given locale)

Parameters:
index - - index of request
loc - - locale of request
Returns:
label

setTabsAndBeans

public void setTabsAndBeans(java.lang.String[] tab_lbls,
                            java.lang.String[] bean_names)
Replace tab labels and bean names with new values

Parameters:
tab_lbls - - new tab labels (or string IDs, if nls bundle defined)
bean_names - - new bean names

setNLSBundle

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

Parameters:
bndl - - bundle name

setDiscoveryPanelPreferred

public void setDiscoveryPanelPreferred(boolean disc_pref)
Set Discovery panel preference

Parameters:
disc_pref - - true if should be in discovery panel, false if not

getTabCount

public int getTabCount()
Get number of tabs and panels

Returns:
number of tabs and panels

getPanelBean

public java.lang.String getPanelBean(int index)
Get bean classname

Parameters:
index - - index of bean to request
Returns:
name of bean class