|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
     This a RMI based API which provides methods to access and modify the user based client tree structure present in the database. This API provides mechanism to do the following tree operations for a particular/'All' user. 'All' user means, all the users for whom, Web NMS maintains the tree structure.
Tree Operations
- Addnode Operation
- Modifynode Operation
- Removenode Operation
- Movenode Operation
These methods operate over a database interface layer, which translate the java objects
to fit into RDBMS tables.The database layer can work with any JDBC complaint RDBMS.
Accessing NmsTreeAPI
This API can be accessed either through RMI or directly from the same JVM. It is published with
the RMI handle TreeAPI in the Web NMS Server. Application running in the same
JVM as that of the Nms server can use the getAPI method.
The example below shows how NmsTreeAPI can be accessed by the above mentioned means from same JVM or through RMI .
Accessing NmsTreeAPI via RMINotification mechanismNmsTreeAPI treeAPI = (NmsTreeAPI) Naming.lookup("//hostname/TreeAPI"); //Here hostname refers to the name of the machine on which the Web NMS Server deployed (BE or FE), where the NmsTreeAPI would be bound.Accessing NmsTreeAPI from the same JVMNmsTreeAPI treeAPI = (NmsTreeAPI)NmsUtil.getAPI("TreeAPI");
DBXMLNodeListener via
register method.
This API also provides mechanism to stop this notification mechansim , by invoking
deRegister method by giving user name.
Web NMS Client is a default application which uses this notification mechanism to construct the tree. Web NMS
client will add, modify, move and remove tree nodes based on the type of notification
which is received from this API.
It should be noted that, to perform tree operations like add, modify, remove and move using the APIs provided an instance of the class PanelTreeNode has to be created to hold the tree node information and passed to the corresponding API methods.
PanelTreeNode| Method Summary | |
boolean |
addNode(PanelTreeNode panelNode)
This method adds a node as the last child of the specified parent in the user defined tree. |
boolean |
deleteAllNodes(java.lang.String userName)
This method removes all tree nodes from the user defined tree (for the specified user). |
void |
deRegister(java.lang.String userName,
DBXMLNodeListener listener)
Removes the listener from the listeners list so that the listener will no longer get any update for the tree node operation. |
int |
getChildCount(java.lang.String userName,
java.lang.String parent)
Returns the child count of the given parent for the given userName. |
java.util.Vector |
getChildList(java.lang.String userName,
java.lang.String moduleName)
This method returns nodeId belonging to the specified module |
int |
getNodeCount(java.lang.String userName)
This method returns number of tree node that exist for a given user. |
PanelTreeNode |
getPanelTreeNode(java.lang.String userName,
java.lang.String nodeId)
Returns PanelTreeNode for the given nodeId and userName. |
java.lang.String |
getParent(java.lang.String userName,
java.lang.String nodeId)
This method returns parent NodeID for the given NodeID |
XMLNode |
getTree(java.lang.String userName,
java.lang.String id)
This method returns hierarchy of the given node (whose id is passed as an argument). |
boolean |
insertNode(PanelTreeNode panelNode)
This method inserts a node in the specified index, under the specified parent in the user defined tree. |
boolean |
modifyNode(PanelTreeNode panelNode)
This method is used to modify a tree node for a particular user or for all the users. |
boolean |
moveNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String newParent)
This method moves the specified tree node (whose nodeId is passed as argument) under the given new parent in the user defined tree. |
boolean |
moveNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String newParent,
int nodeIndex)
This method moves the specified tree node (whose nodeId is passed as argument) to the specific position (specified by the argument index) under the given new parent in the user defined tree. |
boolean |
nodeExist(java.lang.String userName,
java.lang.String nodeId)
This method returns true if the tree node is present in user defined tree. |
void |
register(java.lang.String userName,
DBXMLNodeListener listener)
All the DBXMLNodeListeners will register with the corresponding userName for getting updates on any Node operation viz.,add,delete,modify,insert etc., |
boolean |
removeNode(java.lang.String nodeId,
java.lang.String userName,
boolean deleteAllChild)
This method removes a node from the user defined tree.If deleteAllChild argument is set to true,then the entire hierarchy that means all the child nodes of the specified tree node will be removed from the user defined tree. |
boolean |
removeNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String moduleName,
boolean deleteAllChild)
This method removes a node from the user defined tree.If deleteAllChild argument is set to true,then the entire hierarchy that means all the child nodes of the specified tree node will be removed from the user defined tree. |
void |
updateUserDetail(java.lang.String userName)
This method creates/updates the tree in the database for a given user. |
| Method Detail |
public void register(java.lang.String userName,
DBXMLNodeListener listener)
throws java.rmi.RemoteException
userName - the userName for which the updates are to be received.listener - the listener registering for the updates.
public void deRegister(java.lang.String userName,
DBXMLNodeListener listener)
throws java.rmi.RemoteException
userName - the userName for which the updates were received.listener - the listener which has to be deregistered for the updates.
public boolean addNode(PanelTreeNode panelNode)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
panelNode - a PanelTreeNode which contains data for the nodeid to be addedNmsStorageException - if any problem occurs when adding the node.UserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public boolean insertNode(PanelTreeNode panelNode)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
panelNode - a PanelTreeNode which contains data for the nodeid to be addedNmsStorageException - if any problem occurs when inserting the nodeUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public boolean removeNode(java.lang.String nodeId,
java.lang.String userName,
boolean deleteAllChild)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
nodeId - the unique identification for the node being removed.userName - the name of the user.deleteAllChild - if true delete all the children's of the deleted node else it moves the children as
children to the parent of deleted nodecom.adventnet.nms.util.NmsStorageException - if any problem occurs when removing the node.UserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public boolean removeNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String moduleName,
boolean deleteAllChild)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
nodeId - the unique identification for the node being removed.userName - the name of the user.moduleName - the name of the table, from which the node is to be removed in addition to PanelTree and PanelProps tables.deleteAllChild - if true delete all the children's of the deleted node else it moves the children as children to the parent of deleted nodejava.rmi.RemoteException - if an error occurs when removing the nodeNmsStorageException - if an error occurs when removing the nodeUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public boolean modifyNode(PanelTreeNode panelNode)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
panelNode - a PanelTreeNode which contains data for
the tree node to be modified. A PanelTreeNode object is used to
define how and which tree node is to be modified.
Example PanelTreeNode Object :
// To set the panel properties
PanelTreeNode panelNode = new PanelTreeNode("Events"); // to
modify "Network Events" tree node
panelNode.setUserName("root"); // to modify "Network Events"
tree node of user "root"
Properties panelProperties = new Properties();
panelProperties.put("TREE-NAME","My Network Events");
panelProperties.put("ICON-FILE","images/pc.png");
panelProperties.put("MENU-FILE-NAME","alertsmenu.xml");
panelProperties.put("<UPDATE_ONLY>","true"); // This attribute is
very important to specify whether the given properites are to be updated
or overwritten
panelNode.setPanelProperties(panelProperties);
After constructing the PanelTreeNode object, invoke NmsTreeAPI.modifyNode()
API to modify the tree node.
Sample Code Snippet :
NmsTreeAPI.modifyNode(panelNode);
NmsStorageException - if any problem occurs when modifying the nodeUserTransactionException - If any error occurs inside the
User Transaction block.
This is applicable only when this API is executed within the context of
a User Transaction.UserTransactionException,
PanelTreeNode
public boolean moveNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String newParent)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
nodeId - the unique identification for the node being modified.userName - the name of the user.newParent - the parent under which the node is to be moved.NmsStorageException - if any problemUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public boolean moveNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String newParent,
int nodeIndex)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
nodeId - the unique identification for the node being modified.userName - the name of the user.newNodeIndex - the node index to which node is to be moved.newParent - the parent under which the node is to be moved.NmsStorageException - if any problemUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public int getChildCount(java.lang.String userName,
java.lang.String parent)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
userName - the name of the userparent - the parent for you need the child countUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public java.lang.String getParent(java.lang.String userName,
java.lang.String nodeId)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
NODEID: - IDuserName - NmsStorageException - for any database errorUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public PanelTreeNode getPanelTreeNode(java.lang.String userName,
java.lang.String nodeId)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
PanelTreeNode for the given nodeId and userName.NODEID: - IDuserName - NmsStorageException - for any database errorUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public boolean deleteAllNodes(java.lang.String userName)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
userName - represents the name of the userNmsStorageException - for any database errorUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public java.util.Vector getChildList(java.lang.String userName,
java.lang.String moduleName)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
userName - moduleName - for which nodeId list is requiredNmsStorageException - for any database errorUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public int getNodeCount(java.lang.String userName)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
userName - NmsStorageException - for any database errorUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public boolean nodeExist(java.lang.String userName,
java.lang.String nodeId)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
NODEID: - IDuserName - NmsStorageException - for any database errorUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public XMLNode getTree(java.lang.String userName,
java.lang.String id)
throws java.rmi.RemoteException,
NmsStorageException,
UserTransactionException
userName - NODEID: - IDNmsStorageException - for any database errorUserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
public void updateUserDetail(java.lang.String userName)
throws java.rmi.RemoteException,
com.adventnet.nms.fe.common.CustomViewException,
UserTransactionException
userName - UserTransactionException - If any error occurs inside the User Transaction block.
This is applicable only when this API is executed within the context of a User Transaction.UserTransactionException
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||