|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.nms.topodb.ManagedObject
public class ManagedObject
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");
| 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 |
|---|
public ManagedObject()
| Method Detail |
|---|
public java.lang.String getName()
getName in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetOwnerName(),
setName(java.lang.String)public java.lang.Long getMoid()
public void setName(java.lang.String name)
setName in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsname - The unique name for the ManagedObject.setDisplayName(String),
setOwnerName(String),
getName()public void setDisplayName(java.lang.String dName)
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.
dName - The display name for the ManagedObject.getDisplayName()public java.lang.String getDisplayName()
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.
setDisplayName(java.lang.String)public java.lang.String getType()
Users can configure the type of a ManagedObject from the OIDType.conf file based on their OID.
getType in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationssetType(java.lang.String)public void setType(java.lang.String type)
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.
setType in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationstype - The type of the ManagedObjectgetType()public boolean getManaged()
getManaged in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationssetManaged(boolean)public void setManaged(boolean managed)
setManaged in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsmanaged - true to set the object to be managed, false otherwise.getManaged()public boolean getStatusPollEnabled()
getManaged(),
setStatusPollEnabled(boolean)public void setStatusPollEnabled(boolean statusPollEnabled)
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.setManaged(boolean),
getStatusPollEnabled()public int getStatus()
SeverityInfo,
setStatus(int)public void setStatus(int status)
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.
setStatus in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsstatus - The status as an integer value.SeverityInfo,
getStatus()public int getFailureThreshold()
getFailureThreshold in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetFailureCount(),
setFailureThreshold(int)public void setFailureThreshold(int failureThreshold)
setFailureThreshold in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsfailureThreshold - new failureThreshold value for this object.setFailureCount(int),
getFailureThreshold()public int getFailureCount()
getFailureCount in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetFailureThreshold(),
setFailureCount(int)public void setFailureCount(int failureCount)
failureCount - New failureCount value for the ManagedObject.setFailureThreshold(int),
getFailureCount()public int getPollInterval()
getPollInterval in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationssetPollInterval(int)public void setPollInterval(int pollInterval)
setPollInterval in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationspollInterval - The time interval in seconds between two successive status
polling for the ManagedObject.getPollInterval()public long getStatusChangeTime()
getStatusChangeTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetStatusUpdateTime(),
setStatusChangeTime(long)public void setStatusChangeTime(long statusChangeTime)
setStatusChangeTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsstatusChangeTime - 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.getStatusChangeTime()public long getStatusUpdateTime()
getStatusUpdateTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetStatusChangeTime(),
setStatusUpdateTime(long)public void setStatusUpdateTime(long statusUpdateTime)
setStatusUpdateTime in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsstatusUpdateTime - 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 GMTgetStatusUpdateTime()public java.lang.String getTester()
getTester in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
<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.
getUClass(),
UserTester,
setTester(java.lang.String)public void setTester(java.lang.String tester)
setTester in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationstester - 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.
setUClass(String),
getTester(),
UserTesterpublic java.lang.String getUClass()
getUClass in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetTester(),
setUClass(java.lang.String),
UserTesterpublic void setUClass(java.lang.String uClass)
setUClass in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsuClass - The fully qualified name of the user tester class which will
be invoked during status polling of this object.setTester(String),
getUClass(),
UserTesterpublic UserTester getUTest()
setUTest(com.adventnet.nms.netwatch.UserTester)public void setUTest(UserTester uTest)
uTest - An instance of the class specified in the uClass property as
usertester.getUTest()public java.lang.Object getLockId()
setLockId(java.lang.Object),
LockableObjectpublic void setLockId(java.lang.Object lockId)
lockId - The lock object which is the id for lock obtained for the
ManagedObject.getLockId(),
LockableObjectpublic java.lang.String getClassname()
Node objects, this
property will have the value "Node" and not
"com.adventnet.nms.topodb.Node".
getClassname in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationssetClassname(java.lang.String)public void setClassname(java.lang.String classname)
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.
classname - The classname of this ManagedObject instance.getClassname()public java.lang.String getWebNMS()
getWebNMS in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationssetWebNMS(java.lang.String)public void setWebNMS(java.lang.String webNMS)
setWebNMS in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationswebNMS - The name of the WebNMS server that owns this ManagedObject.getWebNMS()public java.lang.String[] getGroupNames()
getGroupNames in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetIsGroup(),
setGroupNames(java.lang.String[])public void setGroupNames(java.lang.String[] groups)
setGroupNames in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgroups - The names of groups to which this ManagedObject belongs.addGroupNames(String[]),
setIsGroup(boolean),
getGroupNames()public java.util.Set<java.lang.String> getGroups()
public void setGroups(java.util.Set<java.lang.String> groups)
public void addGroupNames(java.lang.String[] groups)
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.
groups - The names of groups to which this ManagedObject belongs.removeGroupNames(String[])public void removeGroupNames(java.lang.String[] names)
names - The names of groups to which this ManagedObject belongs.public java.util.Set<java.lang.String> getMembers()
public void setMembers(java.util.Set<java.lang.String> members)
public java.lang.String[] getGroupMembers()
getIsGroup(),
setGroupMembers(java.lang.String[])public void setGroupMembers(java.lang.String[] members)
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.
members - The names of ManagedObjects belonging to this group.setIsGroup(boolean),
addGroupMembers(String[]),
getGroupMembers()public void addGroupMembers(java.lang.String[] members)
setGroupMembers(String[]).
members - The names of ManagedObjects belonging to this group.removeGroupMembers(String[])public void removeGroupMembers(java.lang.String[] members)
members - The names of ManagedObjects belonging to this group.public java.lang.String getParentKey()
getIsContainer(),
setParentKey(java.lang.String)public void setParentKey(java.lang.String key)
key - The parent key of this ManagedObject.setIsContainer(boolean),
getParentKey()public ManagedObject getParentId()
public void setParentId(ManagedObject id)
public java.lang.String[] getChildrenKeys()
getIsContainer(),
setChildrenKeys(java.lang.String[])public void setChildrenKeys(java.lang.String[] keys)
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.
keys - The children keys of this ManagedObject.addChildrenKeys(String[]),
setIsContainer(boolean),
getChildrenKeys()public java.util.List<ManagedObject> getChildren()
public boolean getLazyLoaded()
public void setLazyLoaded(boolean lazy)
public void setChildren(java.util.List<ManagedObject> keys)
public void addChildrenKey(ManagedObject mo)
public void addChildrenKeys(java.lang.String[] keys)
setChildrenKeys(String[]).
keys - The children keys of this ManagedObject.removeChildrenKeys(String[])public void removeChildrenKeys(java.lang.String[] keys)
keys - The children keys of this ManagedObject.public void removeChildren(ManagedObject mo)
public java.lang.String getOwnerName()
setOwnerName(java.lang.String)public void setOwnerName(java.lang.String owner)
owner - The owner name for the ManagedObject.getOwnerName()public boolean getIsGroup()
setIsGroup(boolean)public void setIsGroup(boolean group)
group - The isGroup property of ManagedObject.getIsGroup()public boolean getIsContainer()
setIsContainer(boolean)public void setIsContainer(boolean container)
container - The isContainer property of ManagedObject.getIsContainer()public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
clone in interface DBInterfaceclone in class java.lang.Objectpublic void setProperties(java.util.Properties p)
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
setProperties in interface DBInterfacep - 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
getProperties()public java.util.Properties getProperties()
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
getProperties in interface DBInterface
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 .
setProperties(Properties)public static java.lang.String getStatusColor(int sev)
sev - Integer value of the status.
public static int getStatus(java.lang.String s)
s - Status, represented by a string.
setStatus(int)public void pollStatus()
pollStatus in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
protected int checkStatus()
throws java.rmi.RemoteException
java.rmi.RemoteException - if an error occurspublic java.lang.String getKey()
getKey in interface DBInterfacegetKey in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationspublic java.lang.String getKeyName()
getKeyName in interface DBInterfacegetKeyName in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperations
public void setUserProperty(java.lang.String nam,
java.lang.String val)
mo.setUserProperty("myProp", "myVal");
setUserProperty in interface DBExtendedInterfacenam - Name (key) of the user property to be added.val - Value(as on Object) of the user property to be added.getUserProperty(String),
removeUserProperty(String)public java.lang.String getUserProperty(java.lang.String nam)
getUserProperty in interface DBExtendedInterfacenam - 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.
#setUserProperty(String, Object),
getUserProperties()public java.lang.Object getDynamicUserProperty(java.lang.String nam)
public void setDynamicUserProperty(java.lang.String key,
java.lang.Object value)
public java.lang.String removeUserProperty(java.lang.String nam)
removeUserProperty in interface DBExtendedInterfacenam - Name of the user property to be removed.
public java.util.Properties getUserProperties()
getUserProperties in interface DBExtendedInterfacepublic ManagedObjectTieRefHolder getTieRefHolder_ManagedObject()
public com.adventnet.nms.common.corba.Property_CT[] getProperties_CT()
getProperties_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationssetProperties_CT(com.adventnet.nms.common.corba.Property_CT[])public com.adventnet.nms.topodb.corba.SeverityStateEnum checkStatus_CT()
checkStatus_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationspublic com.adventnet.nms.topodb.corba.SeverityStateEnum getStatus_CT()
getStatus_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationspublic com.adventnet.nms.common.corba.Property_CT[] getUserProperties_CT()
getUserProperties_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationspublic void setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] propertyList)
setProperties_CT in interface com.adventnet.nms.topodb.corba.ManagedObject_CIOperationsgetProperties_CT()public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void setObjMoid(java.lang.Long derivedMoid)
public java.util.Map getMappedProperties()
public void setMappedProperties(java.util.Map mappedProps)
public java.util.Properties getShallowProperties()
public void setShallowProperties(java.util.Properties shallowProperties)
|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||