« Back
Hi
Regarding your query , on analyzing your code snippet, we have noticed that ,in the match criteria which you have set for your managed object, the key value for Managed Object type should be "type" and not "Type".i.e all the letters should be in lower case.The reason being while filtering using TopoAPI.getObjects() , it will look for the property key value as "type". Hence, your Managed Object wouldn;t have been added to your MOVector since you have specified the property key value as "Type".
Hence, on performing the above change, you code should work.For further clarifications, kindy get back to us.
Regards
Vijayalakshmi
Regarding your query , on analyzing your code snippet, we have noticed that ,in the match criteria which you have set for your managed object, the key value for Managed Object type should be "type" and not "Type".i.e all the letters should be in lower case.The reason being while filtering using TopoAPI.getObjects() , it will look for the property key value as "type". Hence, your Managed Object wouldn;t have been added to your MOVector since you have specified the property key value as "Type".
Hence, on performing the above change, you code should work.For further clarifications, kindy get back to us.
Regards
Vijayalakshmi
Dear Ganesh,
Thanks for your mail.
We analyzed your issue and we believe that the following entry in your code snippet will be the root cause of this issue.
MOVector = topoApi.getObjects("ManagedObject",criteria);
Please
note that getObjects() method will return a vector of objects that
match the given criteria where the first argument classname is used to
filter out the objects.
Assume that the below entries were in the database:
| MOID | CLASSNAME | ISSNMP |
| 1 | Node | False |
| 2 | SnmpNode | true |
| 3 | Switch | true |
| 4 | ManagedObject | false |
To fetch all the SNMP Nodes from the Topology Database, We can give the criteria as "isSNMP","true".
The following code snippet can be used to achieve this.
Properties criteria = new Properties();
criteria.put("isSNMP","true");
Vector MOVector = topoAPI.getObjects("SnmpNode",criteria);
This method will search the objects with the match criteria where isSNMP is true. The expected result with the above database entries will be both SnmpNode and Switch. Then the argument classname is used to filter out the objects. This getObjects() method returns only those objects whose classname property is the one passed to this method.
In this case, the classname is "SnmpNode", hence it will return only the corresponding objects (that is with MOID 2)
Please note that if the given classname is incorrect, then this method will return null. In the above example, if the classname passed as "ManagedObject" instead of "SnmpNode", (Refer the below code snippet)
Properties criteria = new Properties();
criteria.put("isSNMP","true");
Vector MOVector = topoAPI.getObjects("ManagedObject",criteria);
Now this method would return null, as the match criteria ("isSNMP" "True") is not satisfied for the CLASSNAME "ManagedObject".
We believe that you have extended the object in your environment, hence you need to make sure that your customized extended object classname is given as the first argument of getObjects() method. This helps to resolve the issue.
You can also try with the sample RMI program that we have tested in our environment and have attached the same for your reference
We believe this helps to resolve your issue.
Do get back to us for any further clarifications in this regard.
Thanks and Regards,
Sharmila
Post Actions
Corp