"WEBNMS_5 API Docs"

com.adventnet.nms.topodb
Class ManagedObject

java.lang.Object
  extended by com.adventnet.nms.topodb.ManagedObject
All Implemented Interfaces:
DBExtendedInterface, DBInterface, com.adventnet.nms.topodb.corba.ManagedObject_CIOperations, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
CORBANode, ManagedGroupObject, TopoObject

public class ManagedObject
extends java.lang.Object
implements DBExtendedInterface, java.io.Serializable, java.lang.Cloneable, com.adventnet.nms.topodb.corba.ManagedObject_CIOperations

This class is the base class for representing any object that is to be managed. All the Network Elements discovered by the WebNMS System are represented by a corresponding derivative of this class and stored in the database for persistence. It is not mandatory for all the derivatives of the Managed Object to be stored in the DataBase. It is to be stored in the DB only if persistence is required.

By extending this class when creating network objects, WebNMS applications can take advantage of status polling, event and alert management, map generation and management, and other functions in a consistent way. The attributes of this object are necessary for the functionality provided by the core WebNMS modules, eg:- the tester, pollInterval and uClass determine the functionality of status polling for the ManagedObject.

Often applications do not need to create their own subclasses of ManagedObject, since it allows for easily storing custom properties in ManagedObject itself. ManagedObject contains a member field userProperties and methods #setUserProperty(String, Object) and getUserProperty(String) which allow applications to store their data in an instance of this class, and access the data.

For example, by writing discovery filters, an ethernet hub management application can add properties specific to managing hubs to the managed object (e.g. SnmpNode subclass of ManagedObject) that is passed to the discovery filter.

The Managed property of this class is 'true' when instantiated. By default a ManagedObject has no relationship established. The 'isGroup' and 'isContainer' properties of the Managed Object can be used to relate them with one another.

 
  Like,
        obj.setUserProperty("hub","true"); 
 
  and retrieve it using the property by doing a call 
        String isItHub = obj.getUserProperty("hub");
 
 

See Also:
Serialized Form

Constructor Summary
ManagedObject()
          Constructor to instantiate the ManagedObject.
 
Method Summary
 void addChildrenKey(ManagedObject mo)
          for internal use only
 void addChildrenKeys(java.lang.String[] keys)
          Adds the children keys to the already existing list of childrenKeys.
 void addGroupMembers(java.lang.String[] members)
          Adds the group members to the already existing list of groupMembers.
 void addGroupNames(java.lang.String[] groups)
          Adds the group names to the already existing list of groupNames.
 com.adventnet.nms.topodb.corba.SeverityStateEnum checkStatus_CT()
          corba: ManagedObject_CIOperations interface method.
protected  int checkStatus()
          This method is called to check the status of the object.
 java.lang.Object clone()
          Gets a cloned copy of the ManagedObject.
 boolean equals(java.lang.Object o)
           
 java.util.List<ManagedObject> getChildren()
          for internal use only.
 java.lang.String[] getChildrenKeys()
          Gets the children keys of this object.
 java.lang.String getClassname()
          Gets the actual class name of this ManagedObject instance.
 java.lang.String getDisplayName()
          Gets the display name of the ManagedObject.
 java.lang.Object getDynamicUserProperty(java.lang.String nam)
          for internal use only.
 int getFailureCount()
          Gets the failureCount of the ManagedObject.
 int getFailureThreshold()
          Gets the failureThreshold of this ManagedObject.
 java.lang.String[] getGroupMembers()
          Gets the names of ManagedObjects belonging to this group.
 java.lang.String[] getGroupNames()
          Gets the groups to which this object belongs.
 java.util.Set<java.lang.String> getGroups()
          for internal use only.
 boolean getIsContainer()
          Gets the isContainer property of the ManagedObject.
 boolean getIsGroup()
          Gets the isGroup property of the ManagedObject.Determines whether the ManagedObject is a group object or not.When Managed Objects are found to be related ( having many-to-many relationship ), aggregate or Group relationship can be established between them.
 java.lang.String getKey()
          Deprecated. as of WebNMS5, instead use getName(). Since the ownerName will not be used, this method will return object name alone.
 java.lang.String getKeyName()
          Method implemented as this class implements the DBInterface, returns the name of the field which is used as the key for this object type.
 boolean getLazyLoaded()
          for internal use only.
 java.lang.Object getLockId()
          Gets the current lock object associated with the ManagedObject.
 boolean getManaged()
          Gets the value of the managed property of the ManagedObject.
 java.util.Map getMappedProperties()
          for internal use only.
 java.util.Set<java.lang.String> getMembers()
          for internal use only.
 java.lang.Long getMoid()
          for internal use only.
 java.lang.String getName()
          Gets the name of the ManagedObject.
 java.lang.String getOwnerName()
          Deprecated. ownerName is no more a constituent of ManagedObject primary key
 ManagedObject getParentId()
          for internal use only.
 java.lang.String getParentKey()
          Gets the parent key of this object.
 int getPollInterval()
          Gets the status polling interval of the ManagedObject.
 com.adventnet.nms.common.corba.Property_CT[] getProperties_CT()
          corba: ManagedObject_CIOperations interface method.
 java.util.Properties getProperties()
          Gets the values of all the properties (including the user properties) of the ManagedObject, in a Properties object.
 java.util.Properties getShallowProperties()
          for internal use only.
 com.adventnet.nms.topodb.corba.SeverityStateEnum getStatus_CT()
          corba: ManagedObject_CIOperations interface method.
 int getStatus()
          Gets the current status of the ManagedObject.
static int getStatus(java.lang.String s)
          Returns the integer value for status from the given string.
 long getStatusChangeTime()
          Gets the statusChangeTime of the ManagedObject.
static java.lang.String getStatusColor(int sev)
          Returns the status as a string, given the integer value of the status.
 boolean getStatusPollEnabled()
          Gets the value of the statusPollEnabled property of the ManagedObject.
 long getStatusUpdateTime()
          Gets the statusUpdateTime of the ManagedObject.
 java.lang.String getTester()
          Gets the tester currently used for status polling, of the ManagedObject.
 ManagedObjectTieRefHolder getTieRefHolder_ManagedObject()
          Returns the tie ref holder for the object.
 java.lang.String getType()
          Gets the type of the ManagedObject.
 java.lang.String getUClass()
          Gets the name of the user class that is used for status polling, for the object.
 com.adventnet.nms.common.corba.Property_CT[] getUserProperties_CT()
          corba: ManagedObject_CIOperations interface method.
 java.util.Properties getUserProperties()
          Get all the user properties of the ManagedObject.
 java.lang.String getUserProperty(java.lang.String nam)
          Get the value of the user property with the given name (key).
 UserTester getUTest()
          Gets the custom test class to allow for user-specific testing.
 java.lang.String getWebNMS()
          Get the name of the WebNMS server that owns this ManagedObject.
 int hashCode()
           
 void pollStatus()
          Does a status poll for the ManagedObject.
 void removeChildren(ManagedObject mo)
          for internal use only
 void removeChildrenKeys(java.lang.String[] keys)
          Removes the list of keys from the childrenKeys property of ManagedObject.
 void removeGroupMembers(java.lang.String[] members)
          Removes the list of groupMembers from the groupMembers property of ManagedObject.
 void removeGroupNames(java.lang.String[] names)
          Removes the list of groupNames from the groupNames property of ManagedObject.
 java.lang.String removeUserProperty(java.lang.String nam)
          Remove the specified user property from the ManagedObject.
 void setChildren(java.util.List<ManagedObject> keys)
          for internal use only.
 void setChildrenKeys(java.lang.String[] keys)
          Sets the children keys of this object.
 void setClassname(java.lang.String classname)
          Sets the actual class name of this ManagedObject instance.
 void setDisplayName(java.lang.String dName)
          Sets the display name for the ManagedObject.
 void setDynamicUserProperty(java.lang.String key, java.lang.Object value)
          for internal use only.
 void setFailureCount(int failureCount)
          Sets the failureCount for the ManagedObject.
 void setFailureThreshold(int failureThreshold)
          Sets the failureThreshold for this ManagedObject.
 void setGroupMembers(java.lang.String[] members)
          Sets the names of ManagedObjects belonging to this group.
 void setGroupNames(java.lang.String[] groups)
          Sets the group names to which this object belongs.
 void setGroups(java.util.Set<java.lang.String> groups)
          for internal use only.
 void setIsContainer(boolean container)
          Sets the isContainer property of the ManagedObject.
 void setIsGroup(boolean group)
          Sets the isGroup property of the ManagedObject.
 void setLazyLoaded(boolean lazy)
          for internal use only.
 void setLockId(java.lang.Object lockId)
          Sets the current lock object associated with the ManagedObject.
 void setManaged(boolean managed)
          Sets the value of the managed property of the ManagedObject.
 void setMappedProperties(java.util.Map mappedProps)
          for internal use only.
 void setMembers(java.util.Set<java.lang.String> members)
          for internal use only.
 void setName(java.lang.String name)
          Sets the name of the ManagedObject.
 void setObjMoid(java.lang.Long derivedMoid)
          for internal use only.
 void setOwnerName(java.lang.String owner)
          Deprecated. ownerName is no more a constituent of ManagedObject primary key
 void setParentId(ManagedObject id)
          for internal use only.
 void setParentKey(java.lang.String key)
          Sets the parent key for the object.
 void setPollInterval(int pollInterval)
          Sets the status polling interval for the ManagedObject.
 void setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] propertyList)
          corba: ManagedObject_CIOperations interface method.
 void setProperties(java.util.Properties p)
          Sets the given values to the properties of the ManagedObject.
 void setShallowProperties(java.util.Properties shallowProperties)
          for internal use only.
 void setStatus(int status)
          Sets the current status of the ManagedObject.
 void setStatusChangeTime(long statusChangeTime)
          Sets the statusChangeTime for the ManagedObject.
 void setStatusPollEnabled(boolean statusPollEnabled)
          Sets the value of the statusPollingEnabled property of the ManagedObject.
 void setStatusUpdateTime(long statusUpdateTime)
          Sets the statusUpdateTime of the ManagedObject.
 void setTester(java.lang.String tester)
          Sets the tester currently used for status polling, for the ManagedObject.
 void setType(java.lang.String type)
          Sets the type of the ManagedObject.
 void setUClass(java.lang.String uClass)
          Sets the name of the user class that is used for status polling, for the object.
 void setUserProperty(java.lang.String nam, java.lang.String val)
          Adds a new user property to the ManagedObject, with the given value.
 void setUTest(UserTester uTest)
          Sets the custom test class to allow for user-specific testing.
 void setWebNMS(java.lang.String webNMS)
          Sets the WebNMS server name that owns this ManagedObject.
 java.lang.String toString()
          Returns the name of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedObject

public ManagedObject()
Constructor to instantiate the ManagedObject.

Method Detail

getName

public java.lang.String getName()
Gets the name of the ManagedObject. The ManagedObject is stored with its name and ownerName as the combined key in the database and hence their combination has to be unique. Hence if ownerName is 'null', name has to be unique for a Managed Object.

Specified by:
getName in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The unique name of the ManagedObject.
See Also:
getOwnerName(), setName(java.lang.String)

getMoid

public java.lang.Long getMoid()
for internal use only.


setName

public void setName(java.lang.String name)
Sets the name of the ManagedObject. If 'ownerName' is null, name has to be unique for a Managed Object, because the ManagedObject is stored with its name and owner as the key in the database The setName() method also sets the display name to be same as the name of the ManagedObject.

Specified by:
setName in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
name - The unique name for the ManagedObject.
See Also:
setDisplayName(String), setOwnerName(String), getName()

setDisplayName

public void setDisplayName(java.lang.String dName)
Sets the display name for the ManagedObject. In the GUI, the ManagedObjects are identified by their displayName property, which is supposed to be more intuitive regarding the identification of the object. Whereas, the name can just be any string, with the only constraint that it has to be unique.

For example, the name of the DHCP node objects are set to their physical address and their display name is set to their current DNS name, as it would be very difficult to identify objects with their physical address in the GUI.

Parameters:
dName - The display name for the ManagedObject.
See Also:
getDisplayName()

getDisplayName

public java.lang.String getDisplayName()
Gets the display name of the ManagedObject. In the GUI, the ManagedObjects are identified by their displayName property, which is supposed to be more intuitive regarding the identification of the object. Whereas, the name can just be any string, with the only constraint that it has to be unique.

For example, the name of the DHCP node objects are set to their physical address and their display name is set to their current DNS name, as it would be very difficult to identify objects with their physical address in the GUI.

Returns:
The display name of the ManagedObject.
See Also:
setDisplayName(java.lang.String)

getType

public java.lang.String getType()
Gets the type of the ManagedObject. The type property identifies the type of the object, like whether it is a Network, Node or an Interface object or some user specified type like Router, Switch etc.

Users can configure the type of a ManagedObject from the OIDType.conf file based on their OID.

Specified by:
getType in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The type of the ManagedObject.
See Also:
setType(java.lang.String)

setType

public void setType(java.lang.String type)
Sets the type of the ManagedObject. The type property identifies the type of the object, like whether it is a Network, Node or an Interface object or some user specified type like Router, Switch etc. The type could also be used to signify the operating system of an Object.

Users can configure the type of a ManagedObject from the OIDType.conf file based on the OID value. In this case, the type is set if the objectID matches the OID specified in the OIDType.data.

Specified by:
setType in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
type - The type of the ManagedObject
See Also:
getType()

getManaged

public boolean getManaged()
Gets the value of the managed property of the ManagedObject. The managed property identifies whether the object is currently being managed or not. Only if the object is managed (i.e. managed property is true), status polling and statistics collection will be done for the object. The managed property is 'true' for any object by default.

Specified by:
getManaged in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
true if the object is managed, false otherwise.
See Also:
setManaged(boolean)

setManaged

public void setManaged(boolean managed)
Sets the value of the managed property of the ManagedObject. The managed property identifies whether the object is currently being managed or not. Only if the object is managed (i.e. managed property is true), status polling and statistics collection will be done for the object. The managed property is 'true' for any object by default.

Specified by:
setManaged in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
managed - true to set the object to be managed, false otherwise.
See Also:
getManaged()

getStatusPollEnabled

public boolean getStatusPollEnabled()
Gets the value of the statusPollEnabled property of the ManagedObject. The property identifies whether the status polling has been enabled for the object or not. Setting this value to false, prevents the ManagedObject from being scheduled for status polling. Only when both 'isManaged' and 'statusPollEnabled' is 'true', status polling is scheduled for the object.

Returns:
true if status polling is enabled for the object, false otherwise.
Since:
WebNMS2.3 to enable or disable status polling for an object.
See Also:
getManaged(), setStatusPollEnabled(boolean)

setStatusPollEnabled

public void setStatusPollEnabled(boolean statusPollEnabled)
Sets the value of the statusPollingEnabled property of the ManagedObject. Setting this value to false, prevents the ManagedObject from being scheduled for status polling. Only when both 'isManaged' and 'statusPollEnabled' is 'true', status polling is scheduled for the object. By default the status polling is enabled for the Managed Objects, but it is disabled for nodes and networks. It can be enabled for nodes and networks using the parameter 'ENABLE_SP_FOR_IFC_PARENTS' (true/false), in conf/NmsProcessesBE.

Parameters:
statusPollEnabled - true to enable the object to be scheduled for status polling, false otherwise. When statusPollEnabled is set to false, failureThreshold of the object will be set to 1.
Since:
WebNMS2.3 to enable or disable status polling for an object.
See Also:
setManaged(boolean), getStatusPollEnabled()

getStatus

public int getStatus()
Gets the current status of the ManagedObject. The status property is used to identify the operational status of the Network Element that is represented by this ManagedObject. The status property can take the integer values defined for the various severities in the SeverityInfo.conf file.

Returns:
Integer, specifying the current status of the object.
See Also:
SeverityInfo, setStatus(int)

setStatus

public void setStatus(int status)
Sets the current status of the ManagedObject. The status property is used to identify the operational status of the Network Element that is represented by this ManagedObject. The status property can take the integer values defined for the various severities in the SeverityInfo.conf file, that have criticality and the "unknown" severity.

This method checks for the validity of the given argument, and sets the status of the object only if it is valid. A valid status is one whose value corresponds to the severities with criticality or "unknown" severity defined in SeverityInfo.conf. Otherwise the status of the object is left unchanged. By default the status will be 'clear' for a Managed Object if it is Managed and it is 'unknown' if it is UnManaged.

Specified by:
setStatus in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
status - The status as an integer value.
See Also:
SeverityInfo, getStatus()

getFailureThreshold

public int getFailureThreshold()
Gets the failureThreshold of this ManagedObject. FailureThreshold is the number of consecutive failed status poll attempts, to declare the object to be failed. A status change event, with the severity of the failed object, will be generated for the ManagedObject when the status polling for the object fails for "failureThreshold" times.

Specified by:
getFailureThreshold in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The failureThreshold value of this object.
See Also:
getFailureCount(), setFailureThreshold(int)

setFailureThreshold

public void setFailureThreshold(int failureThreshold)
Sets the failureThreshold for this ManagedObject. FailureThreshold is the number of consecutive failed status poll attempts, to declare the object to be failed. A status change event for the ManagedObject will be generated when the status polling for the object fails for "failureThreshold" times. The value of failureThreshold should always be greater than or equal to 1, and this method does not allow values less than 1 to be set for failureThreshold. When status Poll is disabled for the object by setting statusPollEnabled as false, value of failureThreshold will not be allowed to change. The default value of Failure Threshold is 1.

Specified by:
setFailureThreshold in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
failureThreshold - new failureThreshold value for this object.
See Also:
setFailureCount(int), getFailureThreshold()

getFailureCount

public int getFailureCount()
Gets the failureCount of the ManagedObject. It is a counter to indicate how many consecutive attempts of status poll for this object has failed. The count is reset to 0, once the object is declared as failed or when the object recovers after the failure. The failureCount will be incremented once, for each successive failure of the status poll and when the value of failureCount becomes equal to that of failureThreshold, the object will be declared as failed.

Specified by:
getFailureCount in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The current failureCount value of the ManagedObject.
See Also:
getFailureThreshold(), setFailureCount(int)

setFailureCount

public void setFailureCount(int failureCount)
Sets the failureCount for the ManagedObject. It is a counter to indicate how many consecutive attempts of status poll for this object has failed. The count is reset to 0, once the object is declared as failed or when the object recovers after the failure. The failureCount will be incremented once, for each successive failure of the status poll and when the value of failureCount becomes equal to that of failureThreshold, the object will be declared as failed. The status poll will fail for the object if its status has a value corresponding to the severities with criticality other than clear, as defined in SeverityInfo.conf. The object recovers from failure once the status changes back to clear.

Parameters:
failureCount - New failureCount value for the ManagedObject.
See Also:
setFailureThreshold(int), getFailureCount()

getPollInterval

public int getPollInterval()
Gets the status polling interval of the ManagedObject. This value is the time, in seconds, between two consecutive status polling for this object. Periodic status polling will be scheduled, based on their pollInterval value, for all the ManagedObjects in the database.

Specified by:
getPollInterval in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The time interval in seconds between two successive status polling of the ManagedObject.
See Also:
setPollInterval(int)

setPollInterval

public void setPollInterval(int pollInterval)
Sets the status polling interval for the ManagedObject. This value is the time, in seconds, between two consecutive status polling for this object. Periodic status polling will be scheduled, based on their pollInterval value, for all the ManagedObjects in the database. The default value is 30 minutes. The object is not scheduled for status polling if the value is less than or equal to zero. The pollInterval can also be set from the OIDType.conf file based on the OID of the Managed Object.

Specified by:
setPollInterval in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
pollInterval - The time interval in seconds between two successive status polling for the ManagedObject.
See Also:
getPollInterval()

getStatusChangeTime

public long getStatusChangeTime()
Gets the statusChangeTime of the ManagedObject. This is the time at which the status of the ManagedObject last changed. The time is represented as the number of milliseconds that elapsed between Jan 1, 1970 00:00:00 GMT and the time at which the status of the object last changed.

Specified by:
getStatusChangeTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The time at which the status of the object last changed, as the number of milliseconds that elapsed since Jan 1, 1970 00:00:00 GMT.
See Also:
getStatusUpdateTime(), setStatusChangeTime(long)

setStatusChangeTime

public void setStatusChangeTime(long statusChangeTime)
Sets the statusChangeTime for the ManagedObject. This is the time at which the status of the ManagedObject last changed. The time is represented as the number of milliseconds that elapsed between Jan 1, 1970 00:00:00 GMT and the time at which the status of the object last changed. The user can verify the last change in status, from this value.

Specified by:
setStatusChangeTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
statusChangeTime - The time at which the Status of the object last changed, as the number of milliseconds that elapsed since Jan 1, 1970 00:00:00 GMT.
See Also:
getStatusChangeTime()

getStatusUpdateTime

public long getStatusUpdateTime()
Gets the statusUpdateTime of the ManagedObject. This is the time at which status polling was last done for this object. The time is represented as the number of milliseconds that elapsed between Jan 1, 1970 00:00:00 GMT and the time at which the status polling was last done for the object. This attribute is updated every time a status poll is done for the object, irrespective of the result of the status poll. Hence the user can verify if the status polling for the object has been performed or not, from this value.

Specified by:
getStatusUpdateTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The time at which status polling was last done for this object, as the number of milliseconds that elapsed since Jan 1,1970 00:00:00 GMT
See Also:
getStatusChangeTime(), setStatusUpdateTime(long)

setStatusUpdateTime

public void setStatusUpdateTime(long statusUpdateTime)
Sets the statusUpdateTime of the ManagedObject. This is the time at which status polling was last done for this object. The time is represented as the number of milliseconds that elapsed between Jan 1, 1970 00:00:00 GMT and the time at which the status polling was last done for the object. This attribute is updated every time a status poll is done for the object, irrespective of the result of the status poll. Hence the user can verify if the status polling for the object has taken place or not, from this value.

Specified by:
setStatusUpdateTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
statusUpdateTime - The time when Status Polling was last done for this object, as the number of milliseconds that elapsed since Jan 1,1970 00:00:00 GMT
See Also:
getStatusUpdateTime()

getTester

public java.lang.String getTester()
Gets the tester currently used for status polling, of the ManagedObject. The tester property specifies what is to be done on status polling, for the ManagedObject. The values allowed are "ping" (default), "snmpping" and "usertest". If the value usertest is used, the uClass field should be set with the name of the UserTester class. In NMS the value "max" is also used for nodes and interfaces. It basically propagates the status of the interface to the node, network.

Specified by:
getTester in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
String specifying the current tester used for this object
        <b>"ping"</b> - ICMP ping is used for status polling (defined only for
                   its subclasses like n/w, nodes, interfaces ).
        <b>"snmpping"</b> - A SNMP Get Request is used for status polling (defined only for
                   its subclasses like n/w, nodes, interfaces ).
        <b>"usertest"</b> - The user's class, specified in the uClass property,
                         is used for status polling.
 
See Also:
getUClass(), UserTester, setTester(java.lang.String)

setTester

public void setTester(java.lang.String tester)
Sets the tester currently used for status polling, for the ManagedObject. The tester property specifies what is to be done on status polling, for the ManagedObject. The values allowed are "ping" (default), "snmpping" and "usertest". If the value usertest is used, the uClass field should be set with the name of the UserTester class. In NMS the value "max" is also used for nodes and interfaces. It basically propagates the status of the interface to the node, network. If the tester is null, the NMS returns "specialPurposeSeverity" during status polling. When the specialPurposeSeverity is returned, no operation is performed during the status polling.

Specified by:
setTester in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
tester - String specifying the tester to be used for this object.
        <b>"ping"</b> - ICMP ping is used for status polling (defined only for
                   its subclasses like n/w, nodes, interfaces ).
        <b>"snmpping"</b> - A SNMP Get Request is used for status polling (defined only for
                   its subclasses like n/w, nodes, interfaces ).
        <b>"usertest"</b> - The user's class, specified in the uClass property,
                         is used for status polling.
 
See Also:
setUClass(String), getTester(), UserTester

getUClass

public java.lang.String getUClass()
Gets the name of the user class that is used for status polling, for the object. The uClass property specifies the class to be invoked during status polling, for the ManagedObject. This has effect only if the "tester" property is set to the value "usertest".

Specified by:
getUClass in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The fully qualified name of the user tester class which will be invoked during status polling of this object.
See Also:
getTester(), setUClass(java.lang.String), UserTester

setUClass

public void setUClass(java.lang.String uClass)
Sets the name of the user class that is used for status polling, for the object. The uClass property specifies the class to be invoked during status polling, for the ManagedObject. This has effect only if the "tester" property is set to the value "usertest". If a non-existing class or null is given, the NMS returns specialPurposeSeverity.

Specified by:
setUClass in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
uClass - The fully qualified name of the user tester class which will be invoked during status polling of this object.
See Also:
setTester(String), getUClass(), UserTester

getUTest

public UserTester getUTest()
Gets the custom test class to allow for user-specific testing. No object specific details should be stored here as the same instance of this class is used for all the TopoObjects. It will be null if userTest is not specified.

Returns:
An instance of the class specified in the uClass property as usertester.
See Also:
setUTest(com.adventnet.nms.netwatch.UserTester)

setUTest

public void setUTest(UserTester uTest)
Sets the custom test class to allow for user-specific testing. No object specific details should be stored here as the same instance of this class is used for all the TopoObjects.

Parameters:
uTest - An instance of the class specified in the uClass property as usertester.
See Also:
getUTest()

getLockId

public java.lang.Object getLockId()
Gets the current lock object associated with the ManagedObject. The WebNMS supports locking of ManagedObjects at the application level. Currently, the WebNMS uses the lockId property of the ManagedObject internally to support the application level locking.

Returns:
The lock object associated with the ManagedObject.
See Also:
setLockId(java.lang.Object), LockableObject

setLockId

public void setLockId(java.lang.Object lockId)
Sets the current lock object associated with the ManagedObject. The WebNMS supports locking of ManagedObjects at the application level. Currently, the WebNMS uses the lockId property of the ManagedObject internally to support the application level locking. This method should not be used by the users, as it might break the locks applied, if any, over the ManagedObject.

Parameters:
lockId - The lock object which is the id for lock obtained for the ManagedObject.
See Also:
getLockId(), LockableObject

getClassname

public java.lang.String getClassname()
Gets the actual class name of this ManagedObject instance. This property is used when restoring the ManagedObject subclass when it is stored in a Relational Database. This property stores just the class name and not it's fully qualified name. For example, for Node objects, this property will have the value "Node" and not "com.adventnet.nms.topodb.Node".

Specified by:
getClassname in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The classname of this ManagedObject instance.
See Also:
setClassname(java.lang.String)

setClassname

public void setClassname(java.lang.String classname)
Sets the actual class name of this ManagedObject instance. This property is used when restoring the ManagedObject subclass when it is stored in a Relational Database. This property stores just the class name and not it's fully qualified name. For example, for Node objects, this property will have the value "Node" and not "com.adventnet.nms.topodb.Node". Hence the user has to set the value of this property to the custom MO classname. The property must not be modified by the user for the default MOs, as the NMS uses it internally to identify the classname of the Managed Object.

Parameters:
classname - The classname of this ManagedObject instance.
See Also:
getClassname()

getWebNMS

public java.lang.String getWebNMS()
Get the name of the WebNMS server that owns this ManagedObject.

Specified by:
getWebNMS in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The name of the WebNMS server that owns this ManagedObject.
See Also:
setWebNMS(java.lang.String)

setWebNMS

public void setWebNMS(java.lang.String webNMS)
Sets the WebNMS server name that owns this ManagedObject.

Specified by:
setWebNMS in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
webNMS - The name of the WebNMS server that owns this ManagedObject.
See Also:
getWebNMS()

getGroupNames

public java.lang.String[] getGroupNames()
Gets the groups to which this object belongs. The 'isGroup' property of the Managed Object determines if the object is a Group Object or not. If group relationship is establised between the ManagedObjects, with this instance of ManagedObect being one of the member of a group, then the corresponding Group Object will be returned.

Specified by:
getGroupNames in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
An array of strings, listing the names of groups to which this ManagedObject belongs. Returns null if there are no groupNames set for the object.
See Also:
getIsGroup(), setGroupNames(java.lang.String[])

setGroupNames

public void setGroupNames(java.lang.String[] groups)
Sets the group names to which this object belongs. The 'isGroup' property of the Managed Object determines if the object is a Group Object or not. If group relationship is establised between the ManagedObjects, with this instance of ManagedObect being one of the member of a group, then the corresponding Group Object will be returned. If there are groupNames already existing for the object, this method removes them and sets the groupNames to the names of the argument passed. It doesn't modify the property if null is passed. Using this method and a subsequent call to the updateObject API would inturn update the groupMembers property of the Group Objects. Note that the updateObject would modify the object in the DataBase only if the groups set using this method are valid.

Specified by:
setGroupNames in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Parameters:
groups - The names of groups to which this ManagedObject belongs.
See Also:
addGroupNames(String[]), setIsGroup(boolean), getGroupNames()

getGroups

public java.util.Set<java.lang.String> getGroups()
for internal use only.


setGroups

public void setGroups(java.util.Set<java.lang.String> groups)
for internal use only.


addGroupNames

public void addGroupNames(java.lang.String[] groups)
Adds the group names to the already existing list of groupNames. It sets the property to the corresponding groupName, only if it is not already present in the list. If there are no groupNames in the list, it inturn makes a call to setGroupNames(String[]). Using this method and a subsequent call to the updateObject API would inturn update the groupMembers property of the Group Objects too. Note that the updateObject would modify the object in the DataBase only if the groups set using this method are valid.

Parameters:
groups - The names of groups to which this ManagedObject belongs.
Since:
WebNMS2.3 to append groupNames to the existing list of values.
See Also:
removeGroupNames(String[])

removeGroupNames

public void removeGroupNames(java.lang.String[] names)
Removes the list of groupNames from the groupNames property of ManagedObject. This method removes corresponding the groupNames, only if it is present in the groupName property. If this method is invoked with a 'null' argument, the groupNames are not affected. Using this method and a subsequent call to the updateObject API would inturn update the groupMembers property of the Group Objects too.

Parameters:
names - The names of groups to which this ManagedObject belongs.
Since:
WebNMS2.3 to remove groupNames from the existing list of values.

getMembers

public java.util.Set<java.lang.String> getMembers()
for internal use only.


setMembers

public void setMembers(java.util.Set<java.lang.String> members)
for internal use only.


getGroupMembers

public java.lang.String[] getGroupMembers()
Gets the names of ManagedObjects belonging to this group. A group relationship can be establised between ManagedObjects, in case they have many-to-many relationship. Any ManagedObject is considered to be a Group Object if 'isGroup' property is true or if it is an instance of a class which implements GroupInterface. This property is defined only for a Group Object. Note that a group object by itself, being a Managed Object, could be a member of some parent GroupObject.

Returns:
An array of strings, listing the names of ManagedObjects which belong to this group. Returns null if there are no members for the Group.
See Also:
getIsGroup(), setGroupMembers(java.lang.String[])

setGroupMembers

public void setGroupMembers(java.lang.String[] members)
Sets the names of ManagedObjects belonging to this group. A group relationship can be establised between ManagedObjects, in case they have many-to-many relationship. Any ManagedObject is considered to be a Group Object if 'isGroup' property is true or if it is an instance of a class which implements GroupInterface. This property is defined only for a Group Object. Note that a group object by itself, being a ManagedObject, could be a member of some parent GroupObject.

If there are groupMembers already existing for the object, this method removes them and sets the groupMembers to the names of the argument passed. It doesn't modify the property if null is passed. Using this method and a subsequent call to the updateObject API would inturn update the groupNames property of the members too.

Parameters:
members - The names of ManagedObjects belonging to this group.
See Also:
setIsGroup(boolean), addGroupMembers(String[]), getGroupMembers()

addGroupMembers

public void addGroupMembers(java.lang.String[] members)
Adds the group members to the already existing list of groupMembers. It sets the property to the members passed to the method, only if it is not already present in the list. Using this method and a subsequent call to the updateObject API would inturn update the groupNames property of the members too. If there are no groupMembers in the list, it inturn makes a call to setGroupMembers(String[]).

Parameters:
members - The names of ManagedObjects belonging to this group.
Since:
WebNMS2.3 to append groupMembers to the existing list of values.
See Also:
removeGroupMembers(String[])

removeGroupMembers

public void removeGroupMembers(java.lang.String[] members)
Removes the list of groupMembers from the groupMembers property of ManagedObject. This method removes the members, only if it is present in the groupMembers property. If this method is invoked with a 'null' argument, the groupMembers are not affected. Using this method and a subsequent call to the updateObject API would inturn update the groupNames property of the members too.

Parameters:
members - The names of ManagedObjects belonging to this group.
Since:
WebNMS2.3 to remove groupMembers from the existing list of values.

getParentKey

public java.lang.String getParentKey()
Gets the parent key of this object. This property can be used to relate objects using the containment relationship.

Returns:
The parent key of this ManagedObject. Returns null if there is no parent for the object.
See Also:
getIsContainer(), setParentKey(java.lang.String)

setParentKey

public void setParentKey(java.lang.String key)
Sets the parent key for the object. This property can be used to relate objects using the containment relationship. Any object is a container, if isContainer is 'true' or if it is an instance of a class which implements ContainerInterface. Using this method and a subsequent call to the updateObject API would inturn update the childrenKeys property of the Container Object too. Note that the updateObject would modify the object in the DataBase only if the parent set using this method is valid.

Parameters:
key - The parent key of this ManagedObject.
See Also:
setIsContainer(boolean), getParentKey()

getParentId

public ManagedObject getParentId()
for internal use only.


setParentId

public void setParentId(ManagedObject id)
for internal use only.


getChildrenKeys

public java.lang.String[] getChildrenKeys()
Gets the children keys of this object. This property can be used to relate objects using the containment relationship. Any object is a container, if isContainer is 'true' or if it is an instance of a class which implements ContainerInterface.

Returns:
An array of strings listing the children keys of this ManagedObject. Returns null if there are no children for the Container Object.
See Also:
getIsContainer(), setChildrenKeys(java.lang.String[])

setChildrenKeys

public void setChildrenKeys(java.lang.String[] keys)
Sets the children keys of this object. This property can be used to relate objects using the containment relationship. Any object is a container, if isContainer is 'true' or if it is an instance of a class which implements ContainerInterface. This property is defined only for a parent Object / container.

If there are childrenKeys already existing for the object, this method removes them and sets the childrenKeys to the names of the argument passed. It doesn't modify the property if null is passed. Using this method and a subsequent call to the updateObject API would inturn update the parentKey property of the children objects too.

Parameters:
keys - The children keys of this ManagedObject.
See Also:
addChildrenKeys(String[]), setIsContainer(boolean), getChildrenKeys()

getChildren

public java.util.List<ManagedObject> getChildren()
for internal use only.


getLazyLoaded

public boolean getLazyLoaded()
for internal use only.


setLazyLoaded

public void setLazyLoaded(boolean lazy)
for internal use only.


setChildren

public void setChildren(java.util.List<ManagedObject> keys)
for internal use only.


addChildrenKey

public void addChildrenKey(ManagedObject mo)
for internal use only


addChildrenKeys

public void addChildrenKeys(java.lang.String[] keys)
Adds the children keys to the already existing list of childrenKeys. It sets the property to the children passed as argument, only if it is not already present in the list. Using this method and a subsequent call to the updateObject API would inturn update the parentKey property of the children objects too. If there are no groupMembers in the list, it inturn makes a call to setChildrenKeys(String[]).

Parameters:
keys - The children keys of this ManagedObject.
Since:
WebNMS2.3 to add children to the existing list of values.
See Also:
removeChildrenKeys(String[])

removeChildrenKeys

public void removeChildrenKeys(java.lang.String[] keys)
Removes the list of keys from the childrenKeys property of ManagedObject. This method removes the keys passed as argument, only if it is present in the childrenKeys property. If this method is invoked with a 'null' argument, the childrenKeys are not affected. Using this method and a subsequent call to the updateObject API would inturn update the childrenKeys property of the parent too.

Parameters:
keys - The children keys of this ManagedObject.
Since:
WebNMS2.3 to remove children from the existing list of values.

removeChildren

public void removeChildren(ManagedObject mo)
for internal use only


getOwnerName

public java.lang.String getOwnerName()
Deprecated. ownerName is no more a constituent of ManagedObject primary key

Gets the owner name of the ManagedObject. The ownerName property is used at a higher level to uniquely identify the ManagedObject. When the name property can no longer be used as the unique identification key for the ManagedObject, ownerName is used in conjunction with the name to do so.

Returns:
The owner name of the ManagedObject.
See Also:
setOwnerName(java.lang.String)

setOwnerName

public void setOwnerName(java.lang.String owner)
Deprecated. ownerName is no more a constituent of ManagedObject primary key

Sets the owner name of the ManagedObject. The ownerName property is used at a higher level to uniquely identify the ManagedObject. When the name property can no longer be used as the unique identification key for the ManagedObject, ownerName is used in conjunction with the name to do so.

Parameters:
owner - The owner name for the ManagedObject.
See Also:
getOwnerName()

getIsGroup

public boolean getIsGroup()
Gets the isGroup property of the ManagedObject.Determines whether the ManagedObject is a group object or not.When Managed Objects are found to be related ( having many-to-many relationship ), aggregate or Group relationship can be established between them. Hence the users can manage them as a single entity instead of managing them as individual Managed Objects. The add, update and delete operations related to Group, will correspondingly update the members and groups of the object.

Returns:
The isGroup property of ManagedObject.
Since:
NMS2.3 to identify a Group Object.
See Also:
setIsGroup(boolean)

setIsGroup

public void setIsGroup(boolean group)
Sets the isGroup property of the ManagedObject. Determines whether the ManagedObject is a group object or not. Any Managed Object is considered as a Group object, if isGroup property of the ManagedObject is 'true'. When Managed Objects are found to be related ( having many-to-many relationship ), aggregate or Group relationship can be established between them. Hence the users can manage them as a single entity instead of managing them as individual Managed Objects. The add, update and delete operations related to Group, will correspondingly update the members and groups of the object. It must always be made sure that the Group object should be added to the database before its members are associated with it.

Parameters:
group - The isGroup property of ManagedObject.
Since:
NMS2.3 to identify a Group Object.
See Also:
getIsGroup()

getIsContainer

public boolean getIsContainer()
Gets the isContainer property of the ManagedObject. Determines whether the ManagedObject is a container or not.When Managed Objects are found to be related ( having one-to-one or one-to-many relationship ), containment relationship can be established between them. Hence the user can manage them as a single entity instead of managing them as individual Managed Objects. The add, update and delete operations related to container, will correspondingly update its children.

Returns:
The isContainer property of ManagedObject.
Since:
NMS2.3 to identify a Container.
See Also:
setIsContainer(boolean)

setIsContainer

public void setIsContainer(boolean container)
Sets the isContainer property of the ManagedObject. Determines whether the ManagedObject is a container or not.When Managed Objects are found to be related ( having one-to-one or one-to-many relationship ), containment relationship can be established between them. Hence the user can manage them as a single entity instead of managing them as individual Managed Objects. The add, update and delete operations related to container, will correspondingly update its children. As far as the relationship is considered, the NMS assumes that the first object to go into the DataBase, is the Container Object. Hence the operations will produce fruitful result only if the Container Object is present before the relationship is established.

Parameters:
container - The isContainer property of ManagedObject.
Since:
NMS2.3 to identify a Container.
See Also:
getIsContainer()

toString

public java.lang.String toString()
Returns the name of this object. Super classes can override this method and provide their own implementation. Method getName() and this method returns the same thing.

Overrides:
toString in class java.lang.Object
Returns:
The unique name of the ManagedObject.

clone

public java.lang.Object clone()
Gets a cloned copy of the ManagedObject. Sub-Classes should override this method to clone themselves properly.

Specified by:
clone in interface DBInterface
Overrides:
clone in class java.lang.Object
Returns:
The cloned copy of the ManagedObject.

setProperties

public void setProperties(java.util.Properties p)
Sets the given values to the properties of the ManagedObject. This method can be used to set the values of more than one property in one go, instead of using the get/set methods for each property. The values to be set for the properties are specified in a Properties object, the keys being the corresponding identifiers of the properties themselves.

The name of the ManagedObject cannot be modified or set using this method. If the name is specified with it's exisitng value in the argument Properties object, then the other properties will be updated with the given values. If an attempt is made to change the name, then this method will ignore the new name & will update other properties.

Derived classes should override this method and invoke super.setProperties() at the end of this method. If the Object is to be updated in the database the TopoAPI.updateObject() method should be invoked after doing the setProperties() on the object.

Note: An important point to be noted for the derived classes. This setProperties as of WebNMS 2.0 also takes care of setting the User Properties as well .This is done by removing the properties which have already been set and treating the remaining properties as user properties. So it is required that after the Derived classes have set their properties they remove it from the properties object they pass when calling super.setProperties(); This is to ensure the properties are not duplicated in the userProperties too. This will ensure that the user properties reflect correctly and do not contain redundant information.

  For example : Let us suppose a class called MyExtension extends 
  ManagedObject and has a field String myfield = "";
  In the setProperties method (of class MyExtension) the correct code snippet should
  be
 
 public void setProperties(Properties p) {
        if (p == null)
                return;
        if ((s = p.getProperty("myfield")) != null) {
                myfield = s;
                p.remove("myfield");
        }
        //For an Interger property,
        if ((s = p.getProperty("myfield")) != null) {
                pollInterval = Integer.parseInt(s);
                prop.remove("myfield");
        }
        //For a boolean property,
        if ((s = p.getProperty("myfield")) != null) {
                managed = (new Boolean(s)).booleanValue();
                prop.remove("myfield");
        }
        super.setProperties(p);
 }
 
 
 

The above example should be followed in all the sub-classes of ManagedObject

Specified by:
setProperties in interface DBInterface
Parameters:
p - The properties and their values to be set, as a Properties object.

The following are the keys to be used in the argument Properties object, for the corresponding property of the ManagedObject.

  <b>
        pollInterval, status, statusChangeTime, statusUpdateTime, 
        displayName, failureCount, failureThreshold, type, tester, 
        uClass, classname, webNMS, groupNames, managed, 
        stringstatus, groupMembers, parentKey, childrenKeys, 
        ownerName, isGroup, isContainer and all user properties.
  </b> 
  Note : All values for the default Properties  must be specified as strings. The setProperties method
  implementation should take care of casting the values to the appropriate type.The additional property added as Dynamic
  Schema Extension should be specified as the corresponding Object type.For example let us say you have added an additional property
  say deviceNumber of datatype integer for the ManagedObject table through Dynamic Schema Extendion.In that case you can set the value for
  this property as follows
  
  ManagedObject obj=new ManagedObject();
  obj.setName("device1");
  Properties prop=new Properties();
  prop.put("type","ManagedObject");//since type is the default property for ManagedObject give the value as type String
  prop.put("managed","true");//since managed is thd default property for ManagedObject ,give the value as type String
  prop.put("deviceNumber",new Integer(5));//since deviceNumber property is added through Dynamic Schema Extension ,give the vaule as type Integer
  
  
  
 
See Also:
getProperties()

getProperties

public java.util.Properties getProperties()
Gets the values of all the properties (including the user properties) of the ManagedObject, in a Properties object. Derived classes should override this method and invoke the super.getProperties() in the begining of the method inorder to correctly return super classes' properties.
  For example : Let us suppose a class called MyExtension extends 
  ManagedObject and has a property String myfield = "";
  The getProperties method code should be,
 
 public Properties getProperties() {
        Properties p = super.getProperties();
        p.put("myfield", myfield);
        // for a interger property
        p.put("myfield", (new Integer(myfield)).toString());
        // for a boolean
        p.put("managed", String.valueOf(managed));
 
        return p;
 }
 
 

The above example should be followed in all the sub-classes of ManagedObject

Specified by:
getProperties in interface DBInterface
Returns:
A Properties object containing all the properties of the ManagedObject.
  The Properties object returned from this method will have the following
  keys, to get the values of the corresponding ManagedObject properties.
  <b>
        name, pollInterval, status, statusChangeTime, statusUpdateTime, 
        displayName, failureCount, failureThreshold, type, tester, uClass, 
        classname, webNMS, groupNames, managed, stringstatus, groupMembers, 
        parentKey, childrenKeys, isGroup, isContainer and all user properties.
  </b>
  Note : All values for the default properties returned will be of type String. Users have to cast the
  String value into appropriate type. The values returned for the properties added through 
  Dynamic Schema Extension will be returned as the correponding Object type as specified during setting the value for that property
  via the setProperties(Properties) method .
 
See Also:
setProperties(Properties)

getStatusColor

public static java.lang.String getStatusColor(int sev)
Returns the status as a string, given the integer value of the status. The status string is taken from SeverityInfo.conf file. If the integer value passed, matches one of the severities defined in the SeverityInfo.conf file, it returns the corresponding string value. Otherwise it returns 'Unknown' as the severity.

Parameters:
sev - Integer value of the status.
Returns:
String corresponding to the integer value of the status, as defined in the SeverityInfo.conf file.

getStatus

public static int getStatus(java.lang.String s)
Returns the integer value for status from the given string.

Parameters:
s - Status, represented by a string.
Returns:
Integer value corresponding to the specified status string, as specified in the SeverityInfo.conf file.
See Also:
setStatus(int)

pollStatus

public void pollStatus()
Does a status poll for the ManagedObject. This method is called whenever the status polling of this object has to be done. By default this method is called every polling period to check for status of the object. This method calls the checkStatus method which has to be overridden by derived classes. The checkStatus method basically returns the current status of the object based on the tester set for the object. This method takes care of generating the appropriate status update event if the current status of the object changes from its previous value. It just updates the statusUpdateTime when there is no change in status. When the failureThreshold is greater than 1, the failureCount and statusUpdateTime is updated and no event is generated.

Specified by:
pollStatus in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations

checkStatus

protected int checkStatus()
                   throws java.rmi.RemoteException
This method is called to check the status of the object. The status checking is done by doing the test specified by the tester property. If the tester is "usertest", it calls the UserTester defined in the uClass. This method returns specialPurposeSeverity for other values of the tester. Derived classes should override this method and provide their own status checking, in case they want the status checking specific to their class. The default status check defined for this class is performed if the method is not overridden in the derived classes.

Returns:
current status of the object as an interger.
Throws:
java.rmi.RemoteException - if an error occurs

getKey

public java.lang.String getKey()
Deprecated. as of WebNMS5, instead use getName(). Since the ownerName will not be used, this method will return object name alone.

Method implemented as this class implements the DBInterface, returns the unique key for this Managed Object. The value of the "name" attribute is the unique key for any instance of the ManagedObject if the ownerName is 'null'. If owenrName is set for the Managed Object, it returns the key as a combination of name and ownerName, tab separated. Derived classes should not override this method.

Specified by:
getKey in interface DBInterface
Specified by:
getKey in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The unique key of this ManagedObject.

getKeyName

public java.lang.String getKeyName()
Method implemented as this class implements the DBInterface, returns the name of the field which is used as the key for this object type. This field will be used as the primary key for the corresponding ManagedObject table when the ownerName is null. Derived classes should not override this method.

Specified by:
getKeyName in interface DBInterface
Specified by:
getKeyName in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
Returns:
The string "name" which is the unique key of the ManagedObject

setUserProperty

public void setUserProperty(java.lang.String nam,
                            java.lang.String val)
Adds a new user property to the ManagedObject, with the given value. If the key of the user property to be added is similar to the identifier of any of the ManagedObject properties, then the user property is not added. The value of the user property is specified as an Object and is stored as a corresponding value of the property within NMS. Users have to take care of the type of the user property themselves. If an already exisiting user property is added again, the previous one is overwritten by the current one. The user property for a ManagedObject can be set in the following way:
 mo.setUserProperty("myProp", "myVal");
 

Specified by:
setUserProperty in interface DBExtendedInterface
Parameters:
nam - Name (key) of the user property to be added.
val - Value(as on Object) of the user property to be added.
See Also:
getUserProperty(String), removeUserProperty(String)

getUserProperty

public java.lang.String getUserProperty(java.lang.String nam)
Get the value of the user property with the given name (key). This method will return the user property value as an Object, and the users must take care of casting it to the appropriate type.

Specified by:
getUserProperty in interface DBExtendedInterface
Parameters:
nam - Name of the user property whose value is to be obtained. Returns null when there is no user property present with the name passed as argument to the method.
Returns:
Value of the user property, as an Object.
See Also:
#setUserProperty(String, Object), getUserProperties()

getDynamicUserProperty

public java.lang.Object getDynamicUserProperty(java.lang.String nam)
for internal use only.


setDynamicUserProperty

public void setDynamicUserProperty(java.lang.String key,
                                   java.lang.Object value)
for internal use only.


removeUserProperty

public java.lang.String removeUserProperty(java.lang.String nam)
Remove the specified user property from the ManagedObject. Given the name (key) of the already exisitng user property, this method will remove it from the ManagedObject.

Specified by:
removeUserProperty in interface DBExtendedInterface
Parameters:
nam - Name of the user property to be removed.
Returns:
The value(as on Object) of the user property that was removed, null if the user property does not exist.

getUserProperties

public java.util.Properties getUserProperties()
Get all the user properties of the ManagedObject. This method will return all the user properties of the ManagedObject in a Properties object. The user property names will be the keys in the returned Properties object, with the corresponding values (as Strings).

Specified by:
getUserProperties in interface DBExtendedInterface
Returns:
A properties object containing all the user properties of the ManagedObject.

getTieRefHolder_ManagedObject

public ManagedObjectTieRefHolder getTieRefHolder_ManagedObject()
Returns the tie ref holder for the object.

Returns:
the tie ref holder

getProperties_CT

public com.adventnet.nms.common.corba.Property_CT[] getProperties_CT()
corba: ManagedObject_CIOperations interface method. Used in NMS for corba operations.

Specified by:
getProperties_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
See Also:
setProperties_CT(com.adventnet.nms.common.corba.Property_CT[])

checkStatus_CT

public com.adventnet.nms.topodb.corba.SeverityStateEnum checkStatus_CT()
corba: ManagedObject_CIOperations interface method. Used in NMS for corba operations.

Specified by:
checkStatus_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations

getStatus_CT

public com.adventnet.nms.topodb.corba.SeverityStateEnum getStatus_CT()
corba: ManagedObject_CIOperations interface method. Used in NMS for corba operations.

Specified by:
getStatus_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations

getUserProperties_CT

public com.adventnet.nms.common.corba.Property_CT[] getUserProperties_CT()
corba: ManagedObject_CIOperations interface method. Used in NMS for corba operations.

Specified by:
getUserProperties_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations

setProperties_CT

public void setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] propertyList)
corba: ManagedObject_CIOperations interface method. Used in NMS for corba operations.

Specified by:
setProperties_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
See Also:
getProperties_CT()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setObjMoid

public void setObjMoid(java.lang.Long derivedMoid)
for internal use only.


getMappedProperties

public java.util.Map getMappedProperties()
for internal use only.


setMappedProperties

public void setMappedProperties(java.util.Map mappedProps)
for internal use only.


getShallowProperties

public java.util.Properties getShallowProperties()
for internal use only.


setShallowProperties

public void setShallowProperties(java.util.Properties shallowProperties)
for internal use only.


"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.