com.tivoli.twg.engine
Class TWGNativeManagedObjectFactory

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGManagedObjectFactory
              extended bycom.tivoli.twg.engine.TWGNativeManagedObjectFactory
All Implemented Interfaces:
CommandCompleteListener, com.tivoli.twg.engine.License.KeyListener, TWGBaseShadowedObject, TWGGetSetInterface, TWGServerCommandHandler, TWGShadowedObject

public class TWGNativeManagedObjectFactory
extends TWGManagedObjectFactory
implements CommandCompleteListener, TWGServerCommandHandler, com.tivoli.twg.engine.License.KeyListener

Base class for representing the managed object factory for Director native clients.


Field Summary
static java.lang.String MO_CLASS
          Name of TWGManagedObject class supportd by factory
static java.lang.String NLSCLASS
          Name of NLS resource used for native managed object support
 
Fields inherited from class com.tivoli.twg.engine.TWGManagedObjectFactory
INSTANCE_OF_CALLBACK, INSTANCE_OF_NO, INSTANCE_OF_NO_RESPONSE, 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
TWGNativeManagedObjectFactory()
          Default constructor
TWGNativeManagedObjectFactory(java.lang.String managedObjectClassName)
          Constructor
 
Method Summary
 void Activate()
          Activate the topology processing.
 void CommandComplete(Command cmd)
          Handle completed commands: used internally
 void Deactivate()
          Deactivate the topology processing
 void Delete()
          Delete method : unregister command handlers
 long getAgentPingInterval()
          Get agent ping interval for TWG group
 boolean getAutoAddEnabled()
          Returns current setting of Auto-Add feature
 boolean getAutoAddSupported()
          Indicates if auto-add of unknown clients is supported
static TWGNativeManagedObjectFactory GetFactory()
          Get instance of native managed object factory
protected  TWGManagedObject getManagedObjectByFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
          Get managed object by managed object fingerprint
protected  byte[] getOurAddressEntryRecord(TWGManagedObject obj)
          Address entry record support method.
static int GetTWGGroupTag()
          Get TWG group tag
 byte instanceOf(com.tivoli.twg.engine.TWGMofInstanceOf mofInstanceOf, TWGManagedObject managedObject)
          Test a managed object instance for inclusion into a managed object factory class.
static boolean IsSNIDInTWGGroup(byte[] snidbuf, int snidoff)
          Test SNID to see if system is member of TWG group
 void keysChanged()
          Key set changed
 void ServerCommandReceived(java.lang.String cmdname, Command cmd)
          Handler method for delivering TWGServerCommands for Native Managed Object specific commands
 void setAgentPingInterval(long pingInterval)
          Set agent ping interval for TWG group
 boolean setAutoAddEnabled(boolean enab)
          Change setting of auto-add feature : subclasses should replace thid method with their own implementations.
 void setPingInterval(long intr)
          f7693 Set ping interval, in milliseconds.
 void StartDiscoveryPass()
          Start a discovery pass: operation should return quickly, with actual discovery logic not being completed before the method returns.
 
Methods inherited from class com.tivoli.twg.engine.TWGManagedObjectFactory
ActivateAll, addDatabaseList, addMoClassAssociation, addTask, addTask, addTask, addTask, associateDatabaseTable, clearPingInterval, containsTask, containsTask, DeactivateAll, DiscoveryInterval, DiscoverySupported, DumpMOFTree, emptyDatabaseList, findDatabaseTables, findFactoryForManagedObject, findFactoryForManagedObject, findManagedObjectByFingerprint, freeLicense, getAddressEntryRecord, getAddressEntryShadow, getAllAssociatedManagedObjectIDs, getAllManagedObjectClassNames, getAllManagedObjectClassNamesAndOIDs, getAllManagedObjectSetAsIds, getAttributeIDList, getAttributeType, getAttributeValue, getChildMOFSetAsIds, GetConShadowClass, getDatabaseList, getDatabaseList, GetFactoryForManagedObject, GetFactoryForManagedObject, getFilterImageSet, getImageSet, getLicense, getManagedObjectClassname, getManagedObjectSetAsIds, getManagedObjectSetAsIds, getMOFInstances, getMorphInterval, getName, getName, getNameKey, getParentMOF, getParentMofIds, getPingInterval, getPingInterval, getPingSupported, getPingType, getResourceBundle, getRootMOF, GetShadowRecord, GetShadowVersion, getTaskListAsIds, getTaskListAsIds, getTaskListSize, getTreeOrderedMOFList, initialize, isAutoClientSecureEnabled, isRootMOF, licenseRequired, ProcessAllAutoDiscovery, ProcessAllImmedDiscovery, ProcessAllImmedDiscovery, removeMoClassAssociation, removeTask, removeTask, restoreData, saveData, setAddObjectClassname, setAddressEntryShadow, setAttributeValue, setAutoClientSecure, setClientSecureSupport, SetDiscoveryInterval, SetDiscoverySupported, setEditObjectClassname, setFilterImageSet, setImageSet, setLicenseProductCode, setMorphInterval, setName, setName, SetObjectID, setPingType, startDiscoveryDaemon, startPing, stopDiscoveryDaemon, toString, UpdateShadowVersion
 
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

MO_CLASS

public static final java.lang.String MO_CLASS
Name of TWGManagedObject class supportd by factory

See Also:
Constant Field Values

NLSCLASS

public static final java.lang.String NLSCLASS
Name of NLS resource used for native managed object support

See Also:
Constant Field Values
Constructor Detail

TWGNativeManagedObjectFactory

public TWGNativeManagedObjectFactory()
                              throws java.lang.ClassNotFoundException
Default constructor

Throws:
java.lang.ClassNotFoundException - if MO class not loaded

TWGNativeManagedObjectFactory

public TWGNativeManagedObjectFactory(java.lang.String managedObjectClassName)
                              throws java.lang.ClassNotFoundException
Constructor

Parameters:
managedObjectClassName - - TWGManagedObject class name associated with factory
Throws:
java.lang.ClassNotFoundException - if MO class not loaded
Method Detail

Delete

public void Delete()
Delete method : unregister command handlers

Overrides:
Delete in class TWGManagedObjectFactory

GetFactory

public static TWGNativeManagedObjectFactory GetFactory()
Get instance of native managed object factory

Returns:
TWGNativeManagedObjectFactory instance

instanceOf

public byte instanceOf(com.tivoli.twg.engine.TWGMofInstanceOf mofInstanceOf,
                       TWGManagedObject managedObject)
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.

Overrides:
instanceOf in class TWGManagedObjectFactory
Parameters:
mofInstanceOf - Reference to TWGMofInstanceOf callback interface object.
managedObject - Reference of managed object instance to be tested.
Returns:
byte see TWGManagedObjectFactory.

getManagedObjectByFingerprint

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

Overrides:
getManagedObjectByFingerprint in class TWGManagedObjectFactory
Parameters:
fingerprint - - managed object fingerprint
Returns:
managed object, or null if not found

CommandComplete

public void CommandComplete(Command cmd)
Handle completed commands: used internally

Specified by:
CommandComplete in interface CommandCompleteListener
Parameters:
cmd - - Completed command

IsSNIDInTWGGroup

public static boolean IsSNIDInTWGGroup(byte[] snidbuf,
                                       int snidoff)
Test SNID to see if system is member of TWG group

Parameters:
snidbuf - - buffer for record for system node
snidoff - - offset of record
Returns:
true if is member, false if not

Activate

public void Activate()
              throws ManagedObjectFactoryActivateException
Activate the topology processing.

Overrides:
Activate in class TWGManagedObjectFactory
Throws:
ManagedObjectFactoryActivateException - if error

Deactivate

public void Deactivate()
Deactivate the topology processing

Overrides:
Deactivate in class TWGManagedObjectFactory

GetTWGGroupTag

public static int GetTWGGroupTag()
Get TWG group tag

Returns:
TWG group tag

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.

Overrides:
StartDiscoveryPass in class TWGManagedObjectFactory
Throws:
ManagedObjectFactoryDiscoverException - if error starting discovery pass

ServerCommandReceived

public void ServerCommandReceived(java.lang.String cmdname,
                                  Command cmd)
Handler method for delivering TWGServerCommands for Native Managed Object specific commands

Specified by:
ServerCommandReceived in interface TWGServerCommandHandler
Parameters:
cmdname - - name of extension command
cmd - - command instance received

getOurAddressEntryRecord

protected byte[] getOurAddressEntryRecord(TWGManagedObject obj)
Address entry record support method. This method generates a single record encoding to be interpreted by TWGNativeAddressEntry. The record simply consists of the compressed unicode encoding of the current best IPC path. 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.

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

getAgentPingInterval

public long getAgentPingInterval()
Get agent ping interval for TWG group

Overrides:
getAgentPingInterval in class TWGManagedObjectFactory
Returns:
default ping interval for TWG group (in milliseconds) or 0 when automatic presence check disabled

setPingInterval

public void setPingInterval(long intr)
f7693 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.

Overrides:
setPingInterval in class TWGManagedObjectFactory
Parameters:
intr - - new interval, in milliseconds

setAgentPingInterval

public void setAgentPingInterval(long pingInterval)
Set agent ping interval for TWG group

Overrides:
setAgentPingInterval in class TWGManagedObjectFactory
Parameters:
pingInterval - default ping interval to set for TWG group (in milliseconds) or 0 to disable automatic presence check

keysChanged

public final void keysChanged()
Key set changed

Specified by:
keysChanged in interface com.tivoli.twg.engine.License.KeyListener

getAutoAddSupported

public boolean getAutoAddSupported()
Indicates if auto-add of unknown clients is supported

Overrides:
getAutoAddSupported in class TWGManagedObjectFactory
Returns:
true if auto-add feature is supported (true)

getAutoAddEnabled

public boolean getAutoAddEnabled()
Returns current setting of Auto-Add feature

Overrides:
getAutoAddEnabled in class TWGManagedObjectFactory
Returns:
true if enabled, false if not

setAutoAddEnabled

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

Overrides:
setAutoAddEnabled in class TWGManagedObjectFactory
Parameters:
enab - - true if enabled, false if disabled
Returns:
new setting (false if not implemented)