com.tivoli.twg.engine
Class TWGImageSet

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

public class TWGImageSet
extends TWGPersistentObject
implements TWGShadowedObject

Image set is a class for easily collecting a set of related images resource identifiers. Each record in an image set has a specific index value and provides a value representing an image resource (in System Resource format, as used with ClassLoader.getSystemResource()). Once defined, a given image set is read-only and persistent.


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
TWGImageSet()
          Default constructor for TWGImageSet
 
Method Summary
static java.lang.String ComputeHashString(java.lang.String[] v)
          Compute hash key string (concatenation of strings, followed by "|")
 void Delete()
          Destructor for TWGImageSet: remove object from table
static TWGImageSet FindImageSet(java.lang.String[] image_names)
          Find or make TWGImageSet for a given set of image names
 java.lang.String GetConShadowClass()
          Get name of console shadow class.
 java.lang.String getImageName(int index)
          Get image resource string at given index
 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 ImageNameCount()
          Number of image strings defined in set
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 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

TWGImageSet

public TWGImageSet()
Default constructor for TWGImageSet

Method Detail

Delete

public void Delete()
Destructor for TWGImageSet: remove object from table

Overrides:
Delete in class TWGObject

FindImageSet

public static TWGImageSet FindImageSet(java.lang.String[] image_names)
                                throws TWGPersistentObjectSaveException
Find or make TWGImageSet for a given set of image names

Parameters:
image_names - - array of attribute string values
Returns:
TWGImageSet matching required image names
Throws:
TWGPersistentObjectSaveException - if error creating new object

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.

ComputeHashString

public static java.lang.String ComputeHashString(java.lang.String[] v)
Compute hash key string (concatenation of strings, followed by "|")

Parameters:
v - - array of image strings
Returns:
hash string

getImageName

public java.lang.String getImageName(int index)
Get image resource string at given index

Parameters:
index - - index of resource string in set (base 0)
Returns:
resource string, or null if not defined or found

ImageNameCount

public int ImageNameCount()
Number of image strings defined in set

Returns:
number of image strings

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.