com.tivoli.twg.engine
Class TWGManagedObjectSet

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGManagedObjectSet
All Implemented Interfaces:
TWGBaseShadowedObject, TWGConsoleSpecShadowedObject, TWGDeltaShadow

public class TWGManagedObjectSet
extends TWGObject
implements TWGConsoleSpecShadowedObject, TWGDeltaShadow

Container class for collecting and maintaining lists of TWGManagedObject IDs. This class is used by the TWGFilter classes to maintain the set of managed objects matching a filter's criteria, and as input to the TWGAssociation classes. Each instance is shadowed to the Director Workgroup console on a console-specific bases (depending upon whether the filter is associated with a given console).


Constructor Summary
TWGManagedObjectSet()
          Construct empty set
TWGManagedObjectSet(int[] vallist, int start, int len)
          Construct set with initial list of values
TWGManagedObjectSet(long[] vallist, int start, int len)
          Construct set with initial list of values
 
Method Summary
 void AttachObjectToConsole(TWGActiveConsole act_con)
          Associate the object with the given TWGActiveConsole instance.
 void Delete()
          Object delete method : clean up references
 void DetachObjectFromAllConsoles()
          Disassociate the object from all TWGActiveConsoles.
 void DetachObjectFromConsole(TWGActiveConsole act_con)
          Disassociate the object from the given TWGActiveConsole instance.
 void emptySet()
          Empty managed object set
 java.lang.String GetConShadowClass()
          Get name of console shadow class.
 byte[] GetDeltaShadowRecord(java.util.Locale locale, long since_ver)
          Get buffer containing value delta since requested version stamp of the shadowed attributes to be delivered to the console shadow class.
 int[] getMoids()
          Get array containing MOIDs in managed object set
 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.
 void InsertManagedObjectID(long oid)
          Insert single object ID into set
 void InsertManagedObjectIDArray(int[] oidlist, int start, int len)
          Insert array of object IDs into set
 void InsertManagedObjectIDSet(IntValueSet oidset)
          Insert set of object IDs into set
static void removeManagedObjectFromAllSets(TWGManagedObject mo)
          Remove all references in all managed object sets to given managed object
 void RemoveManagedObjectID(long oid)
          Remove single object ID into set
 void RemoveManagedObjectIDArray(int[] oidlist, int start, int len)
          Remove array of object IDs from set
 void RemoveManagedObjectIDSet(IntValueSet oidset)
          Remove set of object IDs from set
static void removeManagedObjectsFromAllSets(IntValueSet mo_ids)
          Remove all references in all managed object sets to given set of managed object IDs
 java.lang.String toString()
          Get string representation
 void UpdateShadowVersion()
          Update object state version.
 
Methods inherited from class com.tivoli.twg.engine.TWGObject
AllObjects, AllObjects, Destroy, 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, wait, wait, wait
 

Constructor Detail

TWGManagedObjectSet

public TWGManagedObjectSet()
Construct empty set


TWGManagedObjectSet

public TWGManagedObjectSet(long[] vallist,
                           int start,
                           int len)
Construct set with initial list of values

Parameters:
vallist - - array containing list of TWGManagedObject IDs
start - - index of start of range in list
len - - length of range in list

TWGManagedObjectSet

public TWGManagedObjectSet(int[] vallist,
                           int start,
                           int len)
Construct set with initial list of values

Parameters:
vallist - - array containing list of TWGManagedObject persistent IDs
start - - index of start of range in list
len - - length of range in list
Method Detail

Delete

public void Delete()
Object delete method : clean up references

Overrides:
Delete in class TWGObject

InsertManagedObjectID

public void InsertManagedObjectID(long oid)
Insert single object ID into set

Parameters:
oid - - new object ID

RemoveManagedObjectID

public void RemoveManagedObjectID(long oid)
Remove single object ID into set

Parameters:
oid - - new object ID

InsertManagedObjectIDArray

public void InsertManagedObjectIDArray(int[] oidlist,
                                       int start,
                                       int len)
Insert array of object IDs into set

Parameters:
oidlist - - new managed object persistent ID array
start - - starting index in array
len - - length of range in array

RemoveManagedObjectIDArray

public void RemoveManagedObjectIDArray(int[] oidlist,
                                       int start,
                                       int len)
Remove array of object IDs from set

Parameters:
oidlist - - list of managed object persistent ID to remove
start - - starting index in array
len - - length of range in array

InsertManagedObjectIDSet

public void InsertManagedObjectIDSet(IntValueSet oidset)
Insert set of object IDs into set

Parameters:
oidset - - set of new managed object persistent IDs

RemoveManagedObjectIDSet

public void RemoveManagedObjectIDSet(IntValueSet oidset)
Remove set of object IDs from set

Parameters:
oidset - - set of managed object persistent IDs to remove

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.

GetDeltaShadowRecord

public byte[] GetDeltaShadowRecord(java.util.Locale locale,
                                   long since_ver)
Get buffer containing value delta since requested version stamp 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). If this interface is implemented, the GetShadowRecord() method implemented for the TWGBaseShadowedObject interface must be modified to call the GetDeltaShadowRecord() method with a since_ver setting of 0.

Specified by:
GetDeltaShadowRecord in interface TWGDeltaShadow
Parameters:
locale - - Locale requested (for any locale-specific content)
since_ver - - Version to be used as basis for delta (the version currently possessed by the caller).
Returns:
byte array containing opaque data representation of attribute values to be delivered to the console shadow class.

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

removeManagedObjectFromAllSets

public static void removeManagedObjectFromAllSets(TWGManagedObject mo)
Remove all references in all managed object sets to given managed object

Parameters:
mo - - managed object to be removed

removeManagedObjectsFromAllSets

public static void removeManagedObjectsFromAllSets(IntValueSet mo_ids)
Remove all references in all managed object sets to given set of managed object IDs

Parameters:
mo_ids - - managed object IDs to be removed

getMoids

public int[] getMoids()
Get array containing MOIDs in managed object set

Returns:
int[] of MOIDs

toString

public java.lang.String toString()
Get string representation

Returns:
string representation

emptySet

public void emptySet()
Empty managed object set