com.tivoli.twg.engine
Class TWGManagedObjectFactory

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGManagedObjectFactory
All Implemented Interfaces:
TWGBaseShadowedObject, TWGGetSetInterface, TWGShadowedObject
Direct Known Subclasses:
MSCSManagedObjectFactory, TWGClusterManagedObjectFactory, TWGNativeManagedObjectFactory, TWGRMONDeviceObjectFactory, TWGSNMPDeviceObjectFactory

public class TWGManagedObjectFactory
extends TWGPersistentObject
implements TWGShadowedObject, TWGGetSetInterface

TWG Managed Object class. This class is the base class for all managed object types. All managed object extension classes are extensions of this class. This class provides the following function: 1) Maintains an accessable container for all managed objects types. That is, for every extended type of managed object, there exists a collection containing the object IDs of every currently existing object of the class type. Sub-class types are not included in the container. 2) Maintains a collection of every known extension to managed object. This information is typically used during the persistent restore operation at server launch time. It is used to verify registered managed object types.


Field Summary
static byte INSTANCE_OF_CALLBACK
           
static byte INSTANCE_OF_NO
           
static byte INSTANCE_OF_NO_RESPONSE
           
static byte INSTANCE_OF_YES
           
 
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
TWGManagedObjectFactory()
          Default constructor for base TWGManagedObjectFactory instance
TWGManagedObjectFactory(java.lang.String m_o_cname)
          Constructor for creating new TWGManagedObjectFactory instance (usually used by default constructor for TWGManagedObjectFactory subclasses for implementing their creation constructors).
 
Method Summary
protected  void Activate()
          Activate method.
static void ActivateAll()
          Activate all TWGManagedObjectFactory instances
 void addDatabaseList(java.lang.String tableName)
          Add a database table to the database table list.
static void addMoClassAssociation(java.lang.String mo_cname, int oid)
          Add an object ID to a managed object factory's managed object association set.
 void addTask(long task_oid)
          Add a task to the task list using task object reference.
static void addTask(java.lang.String mo_classname, long task_oid)
          Add a task to the task list for a given managed object class using task object ID Note: this method can be used for associating tasks with managed object classes during extension initializaton.
static void addTask(java.lang.String mo_classname, TWGTask task)
          Add a task to the task list for a given managed object class using task object reference.
 void addTask(TWGTask task)
          Add a task to the task list using task object reference.
static void associateDatabaseTable(java.lang.String mo_class, java.lang.String db_class)
          Associate database table class with give managed object class
 void clearPingInterval()
          Clear ping interval.
 boolean containsTask(long taskOid)
          Check if task identifier exists in task list.
 boolean containsTask(TWGTask task)
          Check if task object reference exists in task list.
protected  void Deactivate()
          Deactivate method.
static void DeactivateAll()
          Deactivate all TWGManagedObjectFactory instances
 void Delete()
          Delete method : clean up associations
 long DiscoveryInterval()
          Get automatic discovery interval, in milliseconds
 boolean DiscoverySupported()
          Discovery supported method (default is false)
static void DumpMOFTree()
          Dump MOF tree (debug)
 void emptyDatabaseList()
          Empties the database table list.
static StringValueSet findDatabaseTables(java.lang.String mo_class)
          Find string list containing names of registered database tables
static TWGManagedObjectFactory findFactoryForManagedObject(java.lang.String className)
          Get TWGManagedObjectFactory for given TWGManagedObject class name
static TWGManagedObjectFactory findFactoryForManagedObject(TWGManagedObject obj)
          Get TWGManagedObjectFactory for given TWGManagedObject
static TWGManagedObject findManagedObjectByFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
          Find managed object by fingerprint.
 void freeLicense(TWGManagedObject mo)
          Free license for client of our ManagedObject class
static byte[] getAddressEntryRecord(TWGManagedObject obj)
          Get address entry record for given managed object
 java.lang.String getAddressEntryShadow()
          Get address shadow class name.
 long getAgentPingInterval()
          Get agent ping interrval in milliseconds.
 int[] getAllAssociatedManagedObjectIDs()
          Get array of all managed object IDs associated with the factory
static java.lang.String[] getAllManagedObjectClassNames()
          Get string array of all managed object class names represented by all managed object factories.
static LongKeyTable getAllManagedObjectClassNamesAndOIDs()
          Get set of all managed object factory ID and corresponding managed object class names tuples currently registered in the factory.
static IntValueSet getAllManagedObjectSetAsIds()
          Get all managed objects IDS.
 java.lang.String[] getAttributeIDList()
          Attribute ID enumeration : this method returns a list of strings containing the String names of the attributes supported for a given object.
 int getAttributeType(java.lang.String id)
          Get type of attribute value for given attribute
 DataValue getAttributeValue(java.lang.String id, java.util.Locale loc)
          Get value of attribute with given ID.
 boolean getAutoAddEnabled()
          Returns current setting of Auto-Add feature : subclasses should replace this method with their own implementations.
 boolean getAutoAddSupported()
          Indicates if auto-add of unknown clients is supported : subclasses should replace this method to return 'true' if feature is supported.
 IntValueSet getChildMOFSetAsIds()
          Get set of all child managed object factory IDs.
 java.lang.String GetConShadowClass()
          Get name of console shadow class.
 StringValueSet getDatabaseList()
          Return the database table list for the instance.
 StringValueSet getDatabaseList(boolean traverseParent)
          Return the database table list.
static TWGManagedObjectFactory GetFactoryForManagedObject(java.lang.String mo_classname)
          Return the managed object factory instance for a given TWGManagedObject subclass.
static TWGManagedObjectFactory GetFactoryForManagedObject(TWGManagedObject mo)
          Look up managed object factory instance for a given TWGManagedObject instance.
 long getFilterImageSet()
          Get default filter image set object ID
 int getImageSet()
          Get image set.
 boolean getLicense(TWGManagedObject mo)
          Get license for client of our ManagedObject class
protected  TWGManagedObject getManagedObjectByFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
          Get managed object by managed object fingerprint
 java.lang.String getManagedObjectClassname()
          Get TWGManagedObject classname
 IntValueSet getManagedObjectSetAsIds(boolean includeChildren)
          Get TWGManagedObjectSetAsIds.
static IntValueSet getManagedObjectSetAsIds(java.lang.String mofClassName, boolean includeChildren)
          Get TWGManagedObjectSet.
static TWGManagedObjectFactory[] getMOFInstances()
          Get list of all MOF instances
 long getMorphInterval()
          Get morph interval.
 java.lang.String getName()
          Get name for this instance.
 java.lang.String getName(java.util.Locale locale)
          Get name for this instance.
 java.lang.String getNameKey()
          Get name key
protected  byte[] getOurAddressEntryRecord(TWGManagedObject obj)
          Default address entry record support : unsupported.
 TWGManagedObjectFactory getParentMOF()
          Return reference to parent MOF
 int[] getParentMofIds()
          Get list of parent managed object factory IDs for this factory
 long getPingInterval()
          Get ping interrval in milliseconds.
 long getPingInterval(boolean traverseParent)
          Get ping interval in milliseconds.
 boolean getPingSupported()
          Ping supported method (default is false)
 int getPingType()
          Ping type getter method.
 java.lang.String getResourceBundle()
          Get resource bundle name for this instance
static TWGManagedObjectFactory getRootMOF()
          Return reference to root MOF
 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.
 IntValueSet getTaskListAsIds()
          Return list of associated tasks for specified managed object factory reference.
static IntValueSet getTaskListAsIds(java.lang.String mofClassName)
          Return list of associated tasks for specified managed object factory class name.
 int getTaskListSize()
          Get size of task list.
static java.util.Vector getTreeOrderedMOFList()
          Get tree-ordered list of managed object factories.
static void initialize()
          Managed object factory initializer.
 byte instanceOf(com.tivoli.twg.engine.TWGMofInstanceOf mofInstanceOf, TWGManagedObject mo)
          Test a managed object instance for inclusion into a managed object factory class.
 boolean isAutoClientSecureEnabled()
          Test if automatic secure of unsecure clients option is enabled
 boolean isRootMOF()
          If instance is root MOF, return true
 boolean licenseRequired()
          Test if license is required for clients of this class
static long ProcessAllAutoDiscovery()
          Check for any automatic discovery requests which are due to be run, or elapse time for those not yet due.
static void ProcessAllImmedDiscovery()
          Process immediate discovery request
static void ProcessAllImmedDiscovery(LongValueSet mof_ids)
          Process immediate discovery request on given MOFs
static void removeMoClassAssociation(java.lang.String mo_cname, int oid)
          Remove an object ID from a managed object factory's managed object class association set.
 void removeTask(long task_oid)
          Remove a task from the task list.
 void removeTask(TWGTask task)
          Remove a task from the task list.
protected  void restoreData(TWGPersistentObjectDictionary dictionary, boolean resolveObjectReferences)
          Restore support for persistant object.
protected  void saveData(TWGPersistentObjectDictionary dictionary)
          Save support for persistant object.
protected  void setAddObjectClassname(java.lang.String add_classname)
          Set name of add-object JavaBean (used by console to allow creation of new managed objects).
protected  void setAddressEntryShadow(java.lang.String classname)
          Set address shadow class name.
 void setAgentPingInterval(long intr)
          Set agent ping interval, in milliseconds.
 boolean setAttributeValue(java.lang.String id, DataValue val)
          Set value of attribute with given ID
 boolean setAutoAddEnabled(boolean enab)
          Change setting of auto-add feature : subclasses should replace thid method with their own implementations.
 void setAutoClientSecure(boolean enab)
          Set automatic secure of unsecure clients option, if supported
protected  void setClientSecureSupport(boolean supported)
          Set support for client secure/unsecure feature
 void SetDiscoveryInterval(long intr)
          Set automatic discovery interval, in milliseconds
protected  void SetDiscoverySupported(boolean flg)
          Set discovery supported flag
protected  void setEditObjectClassname(java.lang.String edit_classname)
          Set name of edit-object JavaBean (used by console to allow edit of existing managed objects).
protected  void setFilterImageSet(long flt_imgset)
          Set default filter image set object ID
 void setImageSet(int oid)
          Set image set.
protected  void setLicenseProductCode(int code)
          Set license product code for managed objects
 void setMorphInterval(long intr)
          Set morph interval, in milliseconds.
 void setName(java.lang.String newName)
          Set name to literal value (no resource bundle)
 void setName(java.lang.String newNameKey, java.lang.String newResourceBundle)
          Set name key for this instance.
 void SetObjectID(long oid)
          Set object ID.
 void setPingInterval(long intr)
          Set ping interval, in milliseconds.
protected  void setPingType(int pingType)
          Set ping type.
static void startDiscoveryDaemon()
          Start automatic discovery timer object
 void StartDiscoveryPass()
          Start a discovery pass: operation should return quickly, with actual discovery logic not being completed before the method returns.
 boolean startPing()
          Default ping method for managed object factory.
static void stopDiscoveryDaemon()
          Stop automatic discovery timer object
 java.lang.String toString()
          Returns a string representation of the object.
 void UpdateShadowVersion()
          Update object state version.
 
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject
Destroy, enableAsyncWrites, fromPersistID, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE_OF_CALLBACK

public static final byte INSTANCE_OF_CALLBACK
See Also:
Constant Field Values

INSTANCE_OF_NO_RESPONSE

public static final byte INSTANCE_OF_NO_RESPONSE
See Also:
Constant Field Values

INSTANCE_OF_YES

public static final byte INSTANCE_OF_YES
See Also:
Constant Field Values

INSTANCE_OF_NO

public static final byte INSTANCE_OF_NO
See Also:
Constant Field Values
Constructor Detail

TWGManagedObjectFactory

public TWGManagedObjectFactory()
                        throws java.lang.ClassNotFoundException
Default constructor for base TWGManagedObjectFactory instance

Throws:
java.lang.ClassNotFoundException - if classname can't be loaded

TWGManagedObjectFactory

public TWGManagedObjectFactory(java.lang.String m_o_cname)
                        throws java.lang.ClassNotFoundException
Constructor for creating new TWGManagedObjectFactory instance (usually used by default constructor for TWGManagedObjectFactory subclasses for implementing their creation constructors).

Parameters:
m_o_cname - - TWGManagedObject classname associated with factory
Throws:
java.lang.ClassNotFoundException - if classname can't be loaded
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the object.

See Also:
Object.toString()

Delete

public void Delete()
Delete method : clean up associations

Overrides:
Delete in class TWGObject

SetObjectID

public void SetObjectID(long oid)
                 throws DuplicateObjectIDException
Set object ID. This method subclasses the TWGObject class's SetObjectID. This call is needed so that ManagedObjectFactory class instances can be listed.

Overrides:
SetObjectID in class TWGObject
Parameters:
oid - - new object ID, or INVALID_OBJECT_ID if none
Throws:
DuplicateObjectIDException - if ID is duplicate

initialize

public static void initialize()
                       throws ManagedObjectFactoryInitException
Managed object factory initializer. This method should be called at server initialization in order to populate the managed object factory. TWGExtension class must have been loaded before this method is called. When this is called, all ManagedObjectFactory instances have already been restored. Any TWGManagedObjectFactory subclasses which don't already have an instance created will have one created using the default constructor for the TWGManagedObjectFactory subclass.

Throws:
ManagedObjectFactoryInitException - if error during init

DumpMOFTree

public static void DumpMOFTree()
Dump MOF tree (debug)


findManagedObjectByFingerprint

public static TWGManagedObject findManagedObjectByFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
Find managed object by fingerprint.

Returns:
TWGManagedObject managed object, or null if not found

getManagedObjectByFingerprint

protected TWGManagedObject getManagedObjectByFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
Get managed object by managed object fingerprint

Parameters:
fingerprint - - managed object fingerprint
Returns:
managed object, or null if not found

GetFactoryForManagedObject

public static TWGManagedObjectFactory GetFactoryForManagedObject(java.lang.String mo_classname)
Return the managed object factory instance for a given TWGManagedObject subclass.

Parameters:
mo_classname - - name of TWGManagedObject subclass
Returns:
reference to TWGManagedObjectFactory instance, or null if not found

GetFactoryForManagedObject

public static TWGManagedObjectFactory GetFactoryForManagedObject(TWGManagedObject mo)
Look up managed object factory instance for a given TWGManagedObject instance.

Parameters:
mo - - TWGManagedObject instance
Returns:
reference to TWGManagedObjectFactory instance, or null if not found

ActivateAll

public static void ActivateAll()
                        throws ManagedObjectFactoryActivateException
Activate all TWGManagedObjectFactory instances

Throws:
ManagedObjectFactoryActivateException - if activation failed

Activate

protected void Activate()
                 throws ManagedObjectFactoryActivateException
Activate method. This method is called during server initialization, and is intended to allow subclasses to take any needed actions to begin topology processing. The default Activate() method does nothing.

Throws:
ManagedObjectFactoryActivateException - if an error prevents proper activation of the factory.

DeactivateAll

public static void DeactivateAll()
                          throws ManagedObjectFactoryDeactivateException
Deactivate all TWGManagedObjectFactory instances

Throws:
ManagedObjectFactoryActivateException - if deactivation failed
ManagedObjectFactoryDeactivateException

Deactivate

protected void Deactivate()
                   throws ManagedObjectFactoryDeactivateException
Deactivate method. This method is called during server shutdown, and is intended to allow subclasses to take any needed actions to stop topology processing. The default Deactivate() method does nothing.

Throws:
ManagedObjectFactoryDeactivateException - if an error prevents proper deactivation of the factory.

DiscoverySupported

public boolean DiscoverySupported()
Discovery supported method (default is false)

Returns:
true if supported, false if not

SetDiscoverySupported

protected void SetDiscoverySupported(boolean flg)
Set discovery supported flag

Parameters:
flg - - set to true if discovery supported, else false

DiscoveryInterval

public long DiscoveryInterval()
Get automatic discovery interval, in milliseconds

Returns:
interval, in milliseconds

SetDiscoveryInterval

public void SetDiscoveryInterval(long intr)
Set automatic discovery interval, in milliseconds

Parameters:
intr - - new interval, in milliseconds

ProcessAllAutoDiscovery

public static long ProcessAllAutoDiscovery()
Check for any automatic discovery requests which are due to be run, or elapse time for those not yet due.

Returns:
time, in milliseconds, until next planned autodiscovery, of 0 if indefinite (none are pending)

ProcessAllImmedDiscovery

public static void ProcessAllImmedDiscovery()
Process immediate discovery request


ProcessAllImmedDiscovery

public static void ProcessAllImmedDiscovery(LongValueSet mof_ids)
Process immediate discovery request on given MOFs


StartDiscoveryPass

public void StartDiscoveryPass()
                        throws ManagedObjectFactoryDiscoverException
Start a discovery pass: operation should return quickly, with actual discovery logic not being completed before the method returns. The default method does nothing.

Throws:
ManagedObjectFactoryDiscoverException - if error starting discovery pass

saveData

protected void saveData(TWGPersistentObjectDictionary dictionary)
                 throws TWGPersistentObjectSaveException
Save support for persistant object. This method saves all managed object factory fields that are persistant in nature.

Overrides:
saveData in class TWGPersistentObject
Throws:
TWGPersistentObjectSaveException - if error on save

restoreData

protected void restoreData(TWGPersistentObjectDictionary dictionary,
                           boolean resolveObjectReferences)
                    throws TWGPersistentObjectRestoreException
Restore support for persistant object. This method restores managed object factory fields that are persistant in nature.

Overrides:
restoreData in class TWGPersistentObject
Parameters:
resolveObjectReferences - used to indicate if object references should be resolved during restore.
Throws:
TWGPersistentObjectRestoreException - if restore error

getTaskListAsIds

public static IntValueSet getTaskListAsIds(java.lang.String mofClassName)
                                    throws ManagedObjectFactoryUnregisteredClassException
Return list of associated tasks for specified managed object factory class name. This method returns a list of all task object IDs that have been associated with the specified managed object factory class name. The returned task list includes tasks from the specified class and all parent classes.

Parameters:
mofClassName - - TWGManagedObjectFactory class name to query.
Returns:
IntValueSet of task object IDs. The set may be returned with no entries (empty).
Throws:
ManagedObjectFactoryUnregisteredClassException - if classname not currently registered with managed object factory.

getTaskListAsIds

public IntValueSet getTaskListAsIds()
Return list of associated tasks for specified managed object factory reference. This method returns a list of all task object IDs that have been associated with the specified managed object factory reference. The returned task list includes tasks from the specified class and all parent classes.

Returns:
IntValueSet of task object IDs. The set may be returned with no entries (empty).

addMoClassAssociation

public static void addMoClassAssociation(java.lang.String mo_cname,
                                         int oid)
Add an object ID to a managed object factory's managed object association set. This method will add the specified managed object ID from the specified managed object factory class' association list.

Parameters:
mo_cname - - TWGManagedObject class name supported by TWGManagedObjectFactory to add the specified managed object association.
oid - Managed object ID to be removed.

removeMoClassAssociation

public static void removeMoClassAssociation(java.lang.String mo_cname,
                                            int oid)
Remove an object ID from a managed object factory's managed object class association set. This method will remove the specified managed object ID from the specified managed object factory class' association list.

Parameters:
mo_cname - TWGManagedObject class name supported by TWGManagedObjectFactory from which to remove the specified managed object association.
oid - Managed object ID to be removed.

getName

public java.lang.String getName(java.util.Locale locale)
Get name for this instance. If a resource bundle has not been identified for this object, the "nameKey" is returned.

Parameters:
locale - Locale to be used for the name look-up.
Returns:
Name of this instance.

getName

public java.lang.String getName()
Get name for this instance.

Returns:
Name of this instance.

setName

public void setName(java.lang.String newNameKey,
                    java.lang.String newResourceBundle)
Set name key for this instance.

Parameters:
newNameKey - Resource key for name to be given to this instance.
newResourceBundle - Name of resource bundle (or null if none)

setName

public void setName(java.lang.String newName)
Set name to literal value (no resource bundle)

Parameters:
newName - Name string for instance

getNameKey

public java.lang.String getNameKey()
Get name key

Returns:
name key

getResourceBundle

public java.lang.String getResourceBundle()
Get resource bundle name for this instance

Returns:
bundle name, or null if not defined

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.

getPingSupported

public boolean getPingSupported()
Ping supported method (default is false)

Returns:
true if supported, false if not

clearPingInterval

public void clearPingInterval()
Clear ping interval. This methods clears the ping interval in the instance causing the parent's ping interval to be used.


getPingInterval

public long getPingInterval()
Get ping interrval in milliseconds. This call will traverse the parent class chain and return the first non-deferred value.

Returns:
Interval, in milliseconds.

getPingInterval

public long getPingInterval(boolean traverseParent)
Get ping interval in milliseconds.

Parameters:
traverseParent - TRUE: class chain will be traversed until a non-deferred ping interval is found. FALSE: Parent chain is not traversed. Instance ping interval is returned.
Returns:
Interval, in milliseconds.

setPingInterval

public void setPingInterval(long intr)
Set ping interval, in milliseconds. MOF sub-classes that have a ping type of "TWGPing.PING_TYPE_AGENT_DRIVES_INDIVIDUAL" should overide this method to intercept the ping interval. The overiding method should call this super method at some point in its processing.

Parameters:
intr - - new interval, in milliseconds

setAgentPingInterval

public void setAgentPingInterval(long intr)
Set agent ping interval, in milliseconds.

Parameters:
intr - - new interval, in milliseconds

getAgentPingInterval

public long getAgentPingInterval()
Get agent ping interrval in milliseconds.

Returns:
Interval, in milliseconds.

getMorphInterval

public long getMorphInterval()
Get morph interval.

Returns:
long morph interval (in milliseconds).

setMorphInterval

public void setMorphInterval(long intr)
Set morph interval, in milliseconds.

Parameters:
intr - new interval (in milliseconds)

getDatabaseList

public StringValueSet getDatabaseList()
Return the database table list for the instance. Include parents.

Returns:
List of data base tables.

getDatabaseList

public StringValueSet getDatabaseList(boolean traverseParent)
Return the database table list. A copy of the set is returned.

Parameters:
traverseParent - TRUE: the returned database table list will include all parent lists. FALSE: Return only the table list associated with this MOF instance.
Returns:
List of data base tables.

addDatabaseList

public void addDatabaseList(java.lang.String tableName)
Add a database table to the database table list.

Parameters:
tableName - Name of the database table. Duplicates are not checked for.

emptyDatabaseList

public void emptyDatabaseList()
Empties the database table list.


instanceOf

public byte instanceOf(com.tivoli.twg.engine.TWGMofInstanceOf mofInstanceOf,
                       TWGManagedObject mo)
Test a managed object instance for inclusion into a managed object factory class. This method is used during managed object morphing. It is used by TWGEngine processes to determine the lowest level managed object factory class to which a managed object instance belongs. This method should be implemented by all managed object factory extension classes.

Parameters:
mofInstanceOf - Reference to TWGMofInstanceOf callback interface object.
mo - Reference of managed object instance to be tested.

getAllAssociatedManagedObjectIDs

public int[] getAllAssociatedManagedObjectIDs()
Get array of all managed object IDs associated with the factory

Returns:
array of managed object IDs, as int[]

setImageSet

public void setImageSet(int oid)
Set image set.


getImageSet

public int getImageSet()
Get image set.

Returns:
image object ID.

setAddressEntryShadow

protected void setAddressEntryShadow(java.lang.String classname)
Set address shadow class name. Should be used during subclass constructors to register name of AddressEntryShadow supported.

Parameters:
classname - - name of AddressEntryShadow class (null = none)

getAddressEntryShadow

public java.lang.String getAddressEntryShadow()
Get address shadow class name. Traces to parent factories if not provided, since their methods will be used for address encoding.

Returns:
name of AddressEntryShadow class for our MO family

getAddressEntryRecord

public static byte[] getAddressEntryRecord(TWGManagedObject obj)
Get address entry record for given managed object

Parameters:
obj - - Managed object to request address encoding for
Returns:
byte array containing encoded address record, or null no support

getOurAddressEntryRecord

protected byte[] getOurAddressEntryRecord(TWGManagedObject obj)
Default address entry record support : unsupported. This method should be subclassed by MOF subclasses in order to provide support for encoding address records. Each address record must consist of a list of records (1 or more), ordered from superclass to subclass, with each record consisting of an overall record length (SHORT) and a magic number (SHORT), followed by class-specific data.

Parameters:
obj - - Managed object to request address encoding for
Returns:
byte array containing encoded address record, or null no support

findFactoryForManagedObject

public static TWGManagedObjectFactory findFactoryForManagedObject(TWGManagedObject obj)
Get TWGManagedObjectFactory for given TWGManagedObject

Parameters:
obj - - object whose factory is to be found
Returns:
factory found, or null

findFactoryForManagedObject

public static TWGManagedObjectFactory findFactoryForManagedObject(java.lang.String className)
Get TWGManagedObjectFactory for given TWGManagedObject class name

Returns:
factory found, or null

isRootMOF

public boolean isRootMOF()
If instance is root MOF, return true

Returns:
true if root, false otherwise

getMOFInstances

public static TWGManagedObjectFactory[] getMOFInstances()
Get list of all MOF instances

Returns:
list of MOF instances

getManagedObjectClassname

public java.lang.String getManagedObjectClassname()
Get TWGManagedObject classname

Returns:
TWGManagedObject classname

getTreeOrderedMOFList

public static java.util.Vector getTreeOrderedMOFList()
Get tree-ordered list of managed object factories. This order (depth first) assures that the parent of a given factory will definitely appear before any of its children.

Returns:
vector of MOF references

getParentMOF

public TWGManagedObjectFactory getParentMOF()
Return reference to parent MOF

Returns:
reference to parent, or null if root

getRootMOF

public static TWGManagedObjectFactory getRootMOF()
Return reference to root MOF

Returns:
reference to root MOF

getManagedObjectSetAsIds

public static IntValueSet getManagedObjectSetAsIds(java.lang.String mofClassName,
                                                   boolean includeChildren)
                                            throws ManagedObjectFactoryUnregisteredClassException
Get TWGManagedObjectSet. This method returns a set containing the object IDs of all managed object instances for the specified managed object factory class name.

Parameters:
mofClassName - Name of target managed object factory.
includeChildren - TRUE: include managed object instances for all child managed object factory classes. FALSE: return only managed object instances for the specified managed object factory class.
Returns:
Set of managed object IDS.
Throws:
ManagedObjectFactoryUnregisteredClassException - if classname not currently registered with managed object factory.

getManagedObjectSetAsIds

public IntValueSet getManagedObjectSetAsIds(boolean includeChildren)
Get TWGManagedObjectSetAsIds. This method returns a set containing the object IDs of all managed object instances for the managed object factory instance.

Parameters:
includeChildren - TRUE: include managed object instances for all child managed object factory classes. FALSE: return only managed object instances for the specified managed object factory class.
Returns:
Set of managed object IDS.
Throws:
ManagedObjectFactoryUnregisteredClassException - if classname not currently registered with managed object factory.

getChildMOFSetAsIds

public IntValueSet getChildMOFSetAsIds()
Get set of all child managed object factory IDs.

Returns:
IntValueSet containing all child MOF IDs.

getAllManagedObjectSetAsIds

public static IntValueSet getAllManagedObjectSetAsIds()
Get all managed objects IDS. This method returns a set containing the object IDs of all managed object instances instanciated in the work group server.

Returns:
Set of managed object IDS.

getParentMofIds

public int[] getParentMofIds()
Get list of parent managed object factory IDs for this factory

Returns:
int[] containing parent MOFIDs for this MOF, in order from root MOF including our own factory ID as last element

getAttributeIDList

public java.lang.String[] getAttributeIDList()
Attribute ID enumeration : this method returns a list of strings containing the String names of the attributes supported for a given object. Subclasses of base classes implementing the interface should report additional attributes by adding them to the list returned by the base class.

Specified by:
getAttributeIDList in interface TWGGetSetInterface

getAttributeValue

public DataValue getAttributeValue(java.lang.String id,
                                   java.util.Locale loc)
Get value of attribute with given ID.

Specified by:
getAttributeValue in interface TWGGetSetInterface
Parameters:
id - - attribute ID requested
loc - - locale to use for value, if applicable
Returns:
value object, or null if no value

setAttributeValue

public boolean setAttributeValue(java.lang.String id,
                                 DataValue val)
Set value of attribute with given ID

Specified by:
setAttributeValue in interface TWGGetSetInterface
Parameters:
id - - attribute ID to be set
val - - attribute value to be set
Returns:
true if set successful, false if not successful

getAttributeType

public int getAttributeType(java.lang.String id)
Get type of attribute value for given attribute

Specified by:
getAttributeType in interface TWGGetSetInterface
Parameters:
id - - attribute ID
Returns:
DataValue type of attribute, or DataValue.NONE_TYPE if undefined

getPingType

public int getPingType()
Ping type getter method.

Returns:
Ping type supported for instance. See TWGPing class documentation. TWGPing.PING_TYPE_NOT_SUPPORTED TWGPing.PING_TYPE_SERVER_DRIVES_INDIVIDUAL TWGPing.PING_TYPE_AGENT_DRIVES_INDIVIDUAL

setPingType

protected void setPingType(int pingType)
Set ping type.

Parameters:
pingType - Current ping type for instance. See TWGPing class documentation. TWGPing.PING_TYPE_NOT_SUPPORTED TWGPing.PING_TYPE_SERVER_DRIVES_INDIVIDUAL TWGPing.PING_TYPE_AGENT_DRIVES_INDIVIDUAL

startPing

public boolean startPing()
Default ping method for managed object factory. MOF sub-classes that have a ping type of "TWGPing.PING_TYPE_AGENT_DRIVES_INDIVIDUAL" should overide this method and instigate a ping cycle within themself when this method is called. Typically this method is called at server launch.

Returns:
TRUE: Ping function supported. FALSE: Function not supported for this instance.

addTask

public static void addTask(java.lang.String mo_classname,
                           TWGTask task)
                    throws TWGPersistentObjectSaveException
Add a task to the task list for a given managed object class using task object reference. Note: this method can be used for associating tasks with managed object classes during extension initializaton.

Parameters:
mo_classname - - name of managed object class
task - - Task object reference to be added to the task list.
Throws:
TWGPersistentObjectSaveException - if error during update

addTask

public static void addTask(java.lang.String mo_classname,
                           long task_oid)
                    throws TWGPersistentObjectSaveException
Add a task to the task list for a given managed object class using task object ID Note: this method can be used for associating tasks with managed object classes during extension initializaton.

Parameters:
mo_classname - - name of managed object class
task_oid - - task object ID to be added
Throws:
TWGPersistentObjectSaveException - if error during update

addTask

public void addTask(TWGTask task)
Add a task to the task list using task object reference. Note: this method CANNOT be used for associating tasks with managed object classes during extension initializaton, as MOF instances may not yet be created.

Parameters:
task - Task object reference to be added to the task list.

addTask

public void addTask(long task_oid)
Add a task to the task list using task object reference. Note: this method CANNOT be used for associating tasks with managed object classes during extension initializaton, as MOF instances may not yet be created.

Parameters:
task_oid - - task object ID to be added

removeTask

public void removeTask(TWGTask task)
Remove a task from the task list. Note: this method CANNOT be used for associating tasks with managed object classes during extension initializaton, as MOF instances may not yet be created.

Parameters:
task - Task object reference to be removed.

removeTask

public void removeTask(long task_oid)
Remove a task from the task list. Note: this method CANNOT be used for associating tasks with managed object classes during extension initializaton, as MOF instances may not yet be created.

Parameters:
task_oid - - object identity of task

getTaskListSize

public int getTaskListSize()
Get size of task list.

Returns:
Total number of tasks associated with the managed object factory.

containsTask

public boolean containsTask(long taskOid)
Check if task identifier exists in task list.

Parameters:
taskOid - Task object ID to search for existance.
Returns:
TRUE: Task identifier was found in task list. FALSE: Task identifier was not found in task list.

containsTask

public boolean containsTask(TWGTask task)
Check if task object reference exists in task list.

Parameters:
task - Task object to search for existance.
Returns:
TRUE: Task object was found in task list. FALSE: Task object was not found in task list.

setFilterImageSet

protected void setFilterImageSet(long flt_imgset)
Set default filter image set object ID

Parameters:
flt_imgset - - image set object ID for default filter

getFilterImageSet

public long getFilterImageSet()
Get default filter image set object ID

Returns:
object ID of default filter image set, or -1 if none

getAllManagedObjectClassNames

public static java.lang.String[] getAllManagedObjectClassNames()
Get string array of all managed object class names represented by all managed object factories.

Returns:
String array containing all managed object class names.

getAllManagedObjectClassNamesAndOIDs

public static LongKeyTable getAllManagedObjectClassNamesAndOIDs()
Get set of all managed object factory ID and corresponding managed object class names tuples currently registered in the factory.

Returns:
LongKeyTable containing all MOF ID and MO class name tuples.

findDatabaseTables

public static StringValueSet findDatabaseTables(java.lang.String mo_class)
Find string list containing names of registered database tables

Parameters:
mo_class - - name of managed object class
Returns:
reference to StringValueSet containing database table classnames

associateDatabaseTable

public static void associateDatabaseTable(java.lang.String mo_class,
                                          java.lang.String db_class)
Associate database table class with give managed object class

Parameters:
mo_class - - managed object class
db_class - - database class to be associated with mo_class

setAddObjectClassname

protected void setAddObjectClassname(java.lang.String add_classname)
Set name of add-object JavaBean (used by console to allow creation of new managed objects). Must be called in MOF-subclass' constructor

Parameters:
add_classname - - name of add-object JavaBean

setEditObjectClassname

protected void setEditObjectClassname(java.lang.String edit_classname)
Set name of edit-object JavaBean (used by console to allow edit of existing managed objects). Must be called in MOF-subclass' constructor

Parameters:
edit_classname - - name of edit-object JavaBean

setLicenseProductCode

protected void setLicenseProductCode(int code)
Set license product code for managed objects

Parameters:
code - - product code (0=none)

getLicense

public final boolean getLicense(TWGManagedObject mo)
Get license for client of our ManagedObject class

Parameters:
mo - - managed object to get licenses for
Returns:
true if successful, false if not successful

freeLicense

public final void freeLicense(TWGManagedObject mo)
Free license for client of our ManagedObject class

Parameters:
mo - - managed object to release licenses for

licenseRequired

public final boolean licenseRequired()
Test if license is required for clients of this class

Returns:
true if one or more required, false if not required

setAutoClientSecure

public void setAutoClientSecure(boolean enab)
Set automatic secure of unsecure clients option, if supported

Parameters:
enab - - true if enable, false if disable

isAutoClientSecureEnabled

public boolean isAutoClientSecureEnabled()
Test if automatic secure of unsecure clients option is enabled

Returns:
true if enable, false if disable

setClientSecureSupport

protected void setClientSecureSupport(boolean supported)
Set support for client secure/unsecure feature

Parameters:
supported - - true if feature supported, false if not

getAutoAddSupported

public boolean getAutoAddSupported()
Indicates if auto-add of unknown clients is supported : subclasses should replace this method to return 'true' if feature is supported. Default implementation returns false.

Returns:
true if auro-add feature is supported

getAutoAddEnabled

public boolean getAutoAddEnabled()
Returns current setting of Auto-Add feature : subclasses should replace this method with their own implementations.

Returns:
true if enabled, false if not (default)

setAutoAddEnabled

public boolean setAutoAddEnabled(boolean enab)
Change setting of auto-add feature : subclasses should replace thid method with their own implementations.

Parameters:
enab - - true if enabled, false if disabled
Returns:
new setting (false if not implemented)

startDiscoveryDaemon

public static void startDiscoveryDaemon()
Start automatic discovery timer object


stopDiscoveryDaemon

public static void stopDiscoveryDaemon()
Stop automatic discovery timer object