com.tivoli.twg.engine.cluster
Class TWGClusterManagedObject

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGManagedObject
              extended bycom.tivoli.twg.engine.cluster.TWGClusterManagedObject
All Implemented Interfaces:
TWGBaseShadowedObject, TWGGetSetDescInterface, TWGGetSetInterface, TWGPersistentObjectSubclassRestorable, TWGShadowedObject
Direct Known Subclasses:
MSCSManagedObject

public class TWGClusterManagedObject
extends TWGManagedObject

Class for managed objects representing clusters. Object represents the general idea of a cluster, including the common concepts of membership by other managed objects in the cluster.


Field Summary
static java.lang.String CLASSNAME
           
 
Fields inherited from class com.tivoli.twg.engine.TWGManagedObject
CLIENT_SERVICE_NOT_SUPPORTED, CLIENT_SERVICE_START_FAILED, CLIENT_SERVICE_START_SUCCEEDED, CLIENT_SERVICE_STOP_FAILED, CLIENT_SERVICE_STOP_SUCCEEDED, MO_SHADOW_ATTRIB_FLAGS_OFF, MO_SHADOW_CNTTASK_OFF, MO_SHADOW_HDRLEN, MO_SHADOW_HDRLEN_001, MO_SHADOW_HDRLEN_OFF, MO_SHADOW_IMGSET_OFF, MO_SHADOW_OFFNAME_OFF, MO_SHADOW_OFFTASK_OFF, MO_SHADOW_PINGINT_OFF, MO_SHADOW_STATE_OFF, MOSTATE_ERROR_OFFLINE, MOSTATE_ERROR_ONLINE, MOSTATE_INDETERMINATE, MOSTATE_INVALID_OBJECT, MOSTATE_NORMAL_OFFLINE, MOSTATE_NORMAL_ONLINE, MOSTATE_UNKNOWN, MOSTATE_UNLICENSED, SHADOWCLASSNAME
 
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
TWGClusterManagedObject()
          Default constructor for cluster managed object
TWGClusterManagedObject(IntValueSet init_moids)
          Constructor for creating new cluster
 
Method Summary
 boolean addNewMember(TWGManagedObject new_mo)
          Add new member managed object to cluster : requires save() to be called afterward
protected  void copyTo(TWGManagedObject managedObject)
          Copy instance data to another managed object.
 void Delete()
          Destructor for TWGClusterManagedObject: remove object from lists
 void Destroy()
          Destroy for TWGClusterManagedObject
 java.lang.String getAttributeDescription(java.lang.String id, java.util.Locale loc)
          Get description string for given attribute in given locale
 java.lang.String[] getAttributeIDList()
          Attribute ID enumeration : this method is expected to return 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
 java.lang.String getAttributeValueString(java.lang.String id, java.util.Locale loc)
          Get descriptive value string for given attribute in given locale
 int[] getMemberIDs()
          Get list of member object IDs
 boolean isMember(int mo_id)
          Test to see if managed object is member of cluster
 boolean isMember(TWGManagedObject mo)
          Test to see if managed object is member of cluster
 boolean removeMember(int rem_moid)
          Remove member managed object from cluster : requires save() to be called afterward
 boolean removeMember(TWGManagedObject rem_mo)
          Remove member managed object from cluster : requires save() to be called afterward
protected  void restoreData(TWGPersistentObjectDictionary dictionary, boolean resolveObjectReferences)
          Restore support for persistant object.
protected  void saveData(TWGPersistentObjectDictionary dictionary)
          Save support for persistant object.
 boolean setAttributeValue(java.lang.String id, DataValue val)
          Set value of attribute with given ID
 void SetObjectID(long oid)
          Set object ID.
 
Methods inherited from class com.tivoli.twg.engine.TWGManagedObject
AddClientService, addDatabaseRecord, addTask, addTask, categorizedManagedObjectIDs, clearPingInterval, ClientServiceStart, ClientServiceStart, ClientServiceStop, ClientServiceStop, containsTask, containsTask, deregisterNewOSListener, FindByAttributeValue, FindByAttributeValue, getAddressEntryRecord, getAddressEntryShadowClass, getAgentPingInterval, getAgentTimezoneOffset, getAllManagedObjectIDs, getAllManagedObjects, GetClientServices, GetConShadowClass, getDatabaseList, getEventCorrelator, getFingerprint, getImageSet, getLicenseVersionRequired, getManagedObjectByID, getManagedObject sSupportingClientService, getMof, getName, getOEMID, getPinger, getPingInterval, getPingInterval, getPingType, GetShadowRecord, GetShadowVersion, getState, getTaskListAsIds, getTaskListSize, initializeRestoredLicenses, initializeRestoredStatusGroups, ipAddressChangeNotify, isAccessDenied, isAccessRequestSupported, isAttribFlagSet, isClientSecureSupported, IsClientServiceSupported, isClientUnsecure, isConsoleDeletable, isConsoleRenamable, isEncryptionEnabled, isPowerdownSupported, isRestartSupported, isServerMO, isShutdownSupported, isTMADetectable, isTMADetected, isWakeOnLANSupported, licenseGranted, licenseRequired, ObjectAddressEntryChangeNotify, ObjectChangedNotify, ObjectCreateNotify, ObjectDestroyNotify, ObjectStateChangeNotify, processGrantRevokeLicense, registerClientServiceSubscriber, registerIPAddressChangeListener, RegisterLifeCycleListener, registerNewOSListener, RegisterStateListener, reissueLicenses, removeAllTaskAssociations, removeAllTaskAssociations, RemoveClientService, removeTask, removeTask, ReplaceClientServiceList, reportOSTypeAndVersion, requestAccess, requestClientSecure, requestPowerdown, requestRestart, requestShutdown, requestWakeOnLAN, saveAndUpdateIfNeeded, setAccessDenied, setAccessRequestSupported, setAgentPingInterval, setAgentTimezoneOffset, setAsServerMO, setClientSecureSupported, setClientUnsecureFlag, setConsoleDeletable, setConsoleRenamable, setEncryptionEnabled, setEventCorrelator, setImageSet, setName, setOEMID, setPinger, setPingInterval, setPowerdownSupported, setRestartSupported, setShutdownSupported, setState, setTMADetectable, setTMADetected, setWakeOnLANSupported, startPing, startPing, startPing, startPingWithReauthenticate, synchronizedObjectWithDatabase, toString, unregisterClientServiceSubscriber, unregisterIPAddressChangeListener, UnregisterLifeCycleListener, UnregisterStateListener, updateNameInDatabaseRecord, UpdateShadowVersion, updateStateInDatabaseRecord
 
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject
enableAsyncWrites, fromPersistID, initialize, 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

CLASSNAME

public static final java.lang.String CLASSNAME
See Also:
Constant Field Values
Constructor Detail

TWGClusterManagedObject

public TWGClusterManagedObject()
Default constructor for cluster managed object


TWGClusterManagedObject

public TWGClusterManagedObject(IntValueSet init_moids)
Constructor for creating new cluster

Parameters:
init_moids - - initial set of member managed object IDs
Method Detail

copyTo

protected void copyTo(TWGManagedObject managedObject)
Copy instance data to another managed object.

Overrides:
copyTo in class TWGManagedObject
Parameters:
managedObject - target managed object.

Delete

public void Delete()
Destructor for TWGClusterManagedObject: remove object from lists

Overrides:
Delete in class TWGManagedObject

Destroy

public void Destroy()
             throws TWGObjectDestroyException
Destroy for TWGClusterManagedObject

Overrides:
Destroy in class TWGManagedObject
Throws:
TWGObjectDestroyException - if error during destroy

saveData

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

Overrides:
saveData in class TWGManagedObject
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 fields that are persistant in nature.

Overrides:
restoreData in class TWGManagedObject
Throws:
TWGPersistentObjectRestoreException - if restore error

addNewMember

public boolean addNewMember(TWGManagedObject new_mo)
                     throws InvalidObjectIDException
Add new member managed object to cluster : requires save() to be called afterward

Parameters:
new_mo - - new managed object to be added
Returns:
true if member added, false already was member
Throws:
InvalidObjectIDException - if bad MO or cluster object

removeMember

public boolean removeMember(TWGManagedObject rem_mo)
                     throws InvalidObjectIDException
Remove member managed object from cluster : requires save() to be called afterward

Parameters:
rem_mo - - managed object to be removed
Returns:
true if was member, false if was not
Throws:
InvalidObjectIDException - if bad MO or cluster object

removeMember

public boolean removeMember(int rem_moid)
                     throws InvalidObjectIDException
Remove member managed object from cluster : requires save() to be called afterward

Parameters:
rem_moid - - Persistent ID of managed object to be removed
Returns:
true if was member, false if was not
Throws:
InvalidObjectIDException

isMember

public boolean isMember(TWGManagedObject mo)
Test to see if managed object is member of cluster

Parameters:
mo - - managed object to be checked

isMember

public boolean isMember(int mo_id)
Test to see if managed object is member of cluster

Parameters:
mo_id - - persistent ID of managed object to be checked

getMemberIDs

public int[] getMemberIDs()
Get list of member object IDs


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 Managed object class instances can be registered with the appropriate TreeNode instances within the ManagedObjectFactory.

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

getAttributeIDList

public java.lang.String[] getAttributeIDList()
Description copied from class: TWGManagedObject
Attribute ID enumeration : this method is expected to return 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
Overrides:
getAttributeIDList in class TWGManagedObject

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
Overrides:
getAttributeValue in class TWGManagedObject
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
Overrides:
setAttributeValue in class TWGManagedObject
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
Overrides:
getAttributeType in class TWGManagedObject
Parameters:
id - - attribute ID
Returns:
DataValue type of attribute, or DataValue.NONE_TYPE if undefined

getAttributeDescription

public java.lang.String getAttributeDescription(java.lang.String id,
                                                java.util.Locale loc)
Get description string for given attribute in given locale

Specified by:
getAttributeDescription in interface TWGGetSetDescInterface
Overrides:
getAttributeDescription in class TWGManagedObject
Parameters:
id - - attribute ID
loc - - locale to use for description
Returns:
description string, or null if not available

getAttributeValueString

public java.lang.String getAttributeValueString(java.lang.String id,
                                                java.util.Locale loc)
Get descriptive value string for given attribute in given locale

Specified by:
getAttributeValueString in interface TWGGetSetDescInterface
Overrides:
getAttributeValueString in class TWGManagedObject
Parameters:
id - - attribute ID
loc - - locale to use for description
Returns:
descriptive string for attribute value, or null if not available