com.tivoli.twg.engine
Class TWGRelationshipSet

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

public class TWGRelationshipSet
extends TWGObject
implements TWGConsoleSpecShadowedObject

Container class for collecting and maintaining lists of TWGRelationship IDs. This class is used by the TWGAssociation classes to maintain the set of TWGRelationship objects generated by matches to an association's relationship criteria. Each instance is shadowed to a specific Director console, and has its contents maintained by a specific TWGAssociation instance.

See Also:
TWGRelationship, TWGActiveConsole, TWGAssociation

Constructor Summary
TWGRelationshipSet(TWGActiveConsole con)
          Construct empty set owned by given console
 
Method Summary
 void AttachObjectToConsole(TWGActiveConsole act_con)
          Associate the object with the given TWGActiveConsole instance.
 void Delete()
          Delete method for relationship set
 void DetachObjectFromAllConsoles()
          Disassociate the object from all TWGActiveConsoles.
 void DetachObjectFromConsole(TWGActiveConsole act_con)
          Disassociate the object from the given TWGActiveConsole instance.
 TWGRelationship findRelationshipByID(java.lang.String rel_id)
          Find TWGRelationship instance by relationship ID
 java.lang.String GetConShadowClass()
          Get name of console shadow class.
 TWGActiveConsole getOwningActiveConsole()
          Get TWGActiveConsole which owns the TWGRelationshipSet
 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 InsertRelationship(TWGRelationship rel)
          Insert single TWGRelationship instance into set
 void removeAllLinksToManagedObject(TWGManagedObject mo)
          Remove all references to a given TWGManagedObject : used when object deleted
 void removeAllLinksToManagedObjectList(IntValueSet mo_set)
          Remove all references to list of TWGManagedObjects
 void removeAllLinksToManagedObjectList(LongValueSet mo_set)
          Remove all references to list of TWGManagedObjects
static void removeManagedObjectFromAllSets(TWGManagedObject mo)
          Remove all references in all TWGRelationshipSets to given TWGManagedObject instance.
static void removeManagedObjectListFromAllSets(IntValueSet mo_set)
          Remove all references in all TWGRelationshipSets to given TWGManagedObjects
 void RemoveRelationship(TWGRelationship rel)
          Remove single TWGRelationship instance from set
 void reset()
          Empty all relationships out of the set : deletes all TWGRelationship instances currently in the set
 void updateRelationshipID(TWGRelationship rel, java.lang.String old_id)
          Update hash-by-id-string hash for given relationship instance.
 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, toString, wait, wait, wait
 

Constructor Detail

TWGRelationshipSet

public TWGRelationshipSet(TWGActiveConsole con)
Construct empty set owned by given console

Parameters:
con - - owning console
Method Detail

Delete

public void Delete()
Delete method for relationship set

Overrides:
Delete in class TWGObject

InsertRelationship

public void InsertRelationship(TWGRelationship rel)
                        throws InvalidObjectIDException
Insert single TWGRelationship instance into set

Parameters:
rel - - new relationship
Throws:
InvalidObjectIDException - - invalid/deleted object
InvalidObjectIDException

RemoveRelationship

public void RemoveRelationship(TWGRelationship rel)
                        throws InvalidObjectIDException
Remove single TWGRelationship instance from set

Throws:
InvalidObjectIDException - - invalid/deleted object
InvalidObjectIDException

findRelationshipByID

public TWGRelationship findRelationshipByID(java.lang.String rel_id)
Find TWGRelationship instance by relationship ID

Parameters:
rel_id - - Relationship ID
Returns:
TWGRelationship found, or null if not found

updateRelationshipID

public void updateRelationshipID(TWGRelationship rel,
                                 java.lang.String old_id)
Update hash-by-id-string hash for given relationship instance. Used by TWGRelationship when its relationship ID is updated.

Parameters:
rel - - Updated relationship instance
old_id - - Previous relationship string value (may be null)

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.

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

reset

public void reset()
Empty all relationships out of the set : deletes all TWGRelationship instances currently in the set


removeAllLinksToManagedObject

public void removeAllLinksToManagedObject(TWGManagedObject mo)
Remove all references to a given TWGManagedObject : used when object deleted

Parameters:
mo - - TWGManagedObject to be removed

removeAllLinksToManagedObjectList

public void removeAllLinksToManagedObjectList(LongValueSet mo_set)
Remove all references to list of TWGManagedObjects

Parameters:
mo_set - - list of TWGManagedObject object IDs to remove

removeAllLinksToManagedObjectList

public void removeAllLinksToManagedObjectList(IntValueSet mo_set)
Remove all references to list of TWGManagedObjects

Parameters:
mo_set - - list of TWGManagedObject persistent IDs to remove

removeManagedObjectFromAllSets

public static void removeManagedObjectFromAllSets(TWGManagedObject mo)
Remove all references in all TWGRelationshipSets to given TWGManagedObject instance.

Parameters:
mo - - managed object to be removed

removeManagedObjectListFromAllSets

public static void removeManagedObjectListFromAllSets(IntValueSet mo_set)
Remove all references in all TWGRelationshipSets to given TWGManagedObjects

Parameters:
mo_set - - IDs of TWGManagedObjects to be removed

getOwningActiveConsole

public TWGActiveConsole getOwningActiveConsole()
Get TWGActiveConsole which owns the TWGRelationshipSet

Returns:
active console