com.tivoli.twg.engine
Class TWGConObject

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGConObject
Direct Known Subclasses:
TWGConActiveConsole, TWGConAssociation, TWGConExtension, TWGConFilter, TWGConImageSet, TWGConLicenses, TWGConManagedObject, TWGConManagedObjectFactory, TWGConManagedObjectSet, TWGConManagedObjectStatusGroup, TWGConManagedObjectStatusSet, TWGConPopupEvent, TWGConPrivToken, TWGConRelationship, TWGConRelationshipSet, TWGConServer, TWGConTask, TWGConUser

public abstract class TWGConObject
extends java.lang.Object

Base class for console shadows of engine objects. Primary purpose is to support shadows of unique objects from engine. This is an abstract class, which requires the implementation of the methods needed to support delivery of shadow update records from the engine.


Field Summary
static long INVALID_OBJECT_ID
          Reserved value for invalid object IDs (which are not inserted in the TWGConObject hash table
 
Constructor Summary
TWGConObject(long obj_id)
          Constructor for TWGConObject with given object ID
 
Method Summary
static java.util.Enumeration AllObjects()
          Enumerate all TWGConObjects
static java.util.Enumeration AllObjects(java.lang.Class cls)
          Enumerate all TWGConObject instances derived from a given class.
 void Delete()
          Destructor for TWGConObject: remove object from hash table
static void DeleteObjects(long[] oids, com.tivoli.twg.engine.TWGConObject.TWGConObjectDeltaAccum delta)
          Delete all objects in given list of IDs
static void DeregisterListener(TWGConObjectListener listener)
          Deregister a listener previously registered
static TWGConObject FindObject(long oid)
          Find object, given an object ID
 java.lang.String getBaseClassName()
          Get name of base class for console object
static java.lang.reflect.Constructor LookUpShadowClass(java.lang.String base_class, java.lang.String shad_class)
          Look up or load shadow class for given base class, and return constructor
 long ObjectID()
          Return the object ID
static long ProcessUpdateRequest(TWGUpdateRequestCommand cmd)
          Process a successful update request command
static void RegisterListener(TWGConObjectListener listener)
          Register a listener for TWGConObject update notifications
 void SetObjectID(long oid)
          Change the object ID to a new value
 java.lang.String toString()
          Print attributes of object to a string
abstract  void UpdateUsingShadowRecord(byte[] rec, int rec_off, int rec_len)
          Update object using shadow record created by the the engine object which is matched with this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INVALID_OBJECT_ID

public static final long INVALID_OBJECT_ID
Reserved value for invalid object IDs (which are not inserted in the TWGConObject hash table

See Also:
Constant Field Values
Constructor Detail

TWGConObject

public TWGConObject(long obj_id)
             throws DuplicateObjectIDException
Constructor for TWGConObject with given object ID

Parameters:
obj_id - - object ID of console object
Throws:
DuplicateObjectIDException - if ID is duplicate of existing object ID
Method Detail

Delete

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


ObjectID

public long ObjectID()
Return the object ID

Returns:
the object ID of the TWGConObject instance

SetObjectID

public void SetObjectID(long oid)
                 throws DuplicateObjectIDException
Change the object ID to a new value

Parameters:
oid - - new object ID value
Throws:
DuplicateObjectIDException

FindObject

public static TWGConObject FindObject(long oid)
Find object, given an object ID

Parameters:
oid - - object ID of object to find
Returns:
TWGConObject reference found, or null if not found

AllObjects

public static java.util.Enumeration AllObjects(java.lang.Class cls)
Enumerate all TWGConObject instances derived from a given class.

Parameters:
cls - - class to be scanned for
Returns:
Enumeration for all matching TWGConObject instances

AllObjects

public static java.util.Enumeration AllObjects()
Enumerate all TWGConObjects

Returns:
Enumeration for all TWGConObject instances

toString

public java.lang.String toString()
Print attributes of object to a string

Returns:
string representation of object

RegisterListener

public static void RegisterListener(TWGConObjectListener listener)
Register a listener for TWGConObject update notifications

Parameters:
listener - - TWGConObjectListener to be registered

DeregisterListener

public static void DeregisterListener(TWGConObjectListener listener)
Deregister a listener previously registered

Parameters:
listener - - TWGConObjectListener to be deregistered

UpdateUsingShadowRecord

public abstract void UpdateUsingShadowRecord(byte[] rec,
                                             int rec_off,
                                             int rec_len)
                                      throws TWGConObjectUpdateException
Update object using shadow record created by the the engine object which is matched with this class.

Parameters:
rec - - byte array containing opaque representation of shadowed attributes
rec_off - - offset of start of shadow record in byte array
rec_len - - length of shadow record within byte array
Throws:
TWGConObjectUpdateException - if error during update

LookUpShadowClass

public static java.lang.reflect.Constructor LookUpShadowClass(java.lang.String base_class,
                                                              java.lang.String shad_class)
                                                       throws java.lang.ClassNotFoundException,
                                                              java.lang.NoSuchMethodException,
                                                              java.lang.SecurityException
Look up or load shadow class for given base class, and return constructor

Parameters:
base_class - - name of base class (TWGObject subclass)
shad_class - - name of shadow class (TWGConObject subclass)
Throws:
java.lang.ClassNotFoundException - if shadow class not found
java.lang.NoSuchMethodException - if X(long) constructor not found
java.lang.SecurityException - if access to constructor denied

DeleteObjects

public static void DeleteObjects(long[] oids,
                                 com.tivoli.twg.engine.TWGConObject.TWGConObjectDeltaAccum delta)
Delete all objects in given list of IDs

Parameters:
oids - - array of object IDs

ProcessUpdateRequest

public static long ProcessUpdateRequest(TWGUpdateRequestCommand cmd)
Process a successful update request command

Parameters:
cmd - - Completed TWGUpdateRequestCommand
Returns:
new version stamp value, or 0 if no update

getBaseClassName

public java.lang.String getBaseClassName()
Get name of base class for console object

Returns:
name of base/engine class for console object