"WEBNMS_5 API Docs"

com.adventnet.nms.db.util
Class DBXmlUtility

java.lang.Object
  extended by com.adventnet.nms.db.util.DBXmlUtility

public class DBXmlUtility
extends java.lang.Object

This is a utility used to perform the node manipulations like add node, modify node, inser node, move node and remove node. These node manipulation operations will affect the PanelTree and PanelProps tables in the database. The PanelTree is used store infomation used to form the tree in the client and PanelProps table is used to store the information ( in the form of key-value pairs ) specific to the panels . If the user of this utility wants to update any table other than these two tables he must implement the com.adventnet.nms.db.util.NodeInterface which declares methods for adding , modifying , inserting and removing the node. The user has to register (using registerObjectForTable() )with the table name (which he want to update) and an object instance which implements the com.adventnet.nms.db.util.NodeInterface for the specified table . By doing this registration, whenever the PanelTree and PanelProps are updated, the user specific tables will also be updated.


Constructor Summary
protected DBXmlUtility()
           
 
Method Summary
 boolean addNode(java.lang.String nodeId, java.lang.String nodeType, java.lang.String userName, java.lang.String parent, java.lang.String moduleName, java.util.Properties panelProperties, java.util.Properties viewProperties)
          Adds the node to table specified when registering ( registerObjectForTable() ) and then adds to PanelTree and PanelProps tables.
 boolean addNode(java.lang.String nodeId, java.lang.String nodeType, java.lang.String userName, java.lang.String parent, java.lang.String moduleName, java.util.Properties panelProperties, java.util.Properties viewProperties, boolean isTabView)
           
 java.util.Vector arrangeChild(java.util.Properties dataprops, java.lang.String keystr, java.util.Vector res)
           
 boolean createNode(java.lang.String nodeId, java.lang.String nodeType, java.lang.String userName, java.lang.String parent, java.lang.String previousNode, java.lang.String moduleName, java.util.Properties panelProperties, java.util.Properties viewProperties)
          create node to table ( which is specified during registeration using registerObjectForTable() ) and then inserts or add a node depending whether previousNode is given or not into PanelTree and PanelProps tables.
 boolean deleteAllTraces(java.lang.String moduleName, java.lang.String userName)
          Removes the node from table ( specified during registeration using registerObjectForTable() ) and then removes from the PanelTree and PanelProps tables.
 void deRegisterForUpdates(java.lang.String userName, DBXMLNodeListener listener)
          Removes the listener from the update vector so that the listener will no longer get any update for the node operation.
 java.util.Properties getAllAttributes(java.lang.String userName, java.lang.String id)
          This method returns all the Attribute Name and Value for the given NodeID and UserName from the PanelProps and corresponding view properties example CustomView, Map etc specific properties
 java.util.Vector getAllNodeID(java.lang.String userName)
          This method retuns vector of nodeid present in PanelTree table
 java.util.Vector getAllNodeID(java.lang.String userName, java.lang.String moduleName)
          This method retuns vector of nodeid present in PanelTree table for a user,for a particular moduleName
 java.util.Hashtable getAllPanelAttribute(java.lang.String userName)
          This method returns all the Panel Attribute for the given user.
protected  java.sql.Connection getConnection()
          Returns the Connection object used by this class.
static DBXmlUtility getInstance(java.sql.Connection conn)
          Gets the instance for this class.
 java.lang.String getLastChild(java.lang.String userName, java.lang.String parent)
          This method returns NodeId of the last child present under given parent
 int getMaxChildIndex(java.lang.String userName, java.lang.String parent)
          Returns the maximum child index of the given parent for the given userName.
 java.util.Properties getNodeAttributes(java.lang.String id, java.lang.String userName, java.lang.String moduleName)
          This method returns Attribute Name and Value for the given NodeID and UserName from corresponding view properties example CustomView, Map etc that is specific properties
 int getNodeCount(java.lang.String userName)
          This method returns Number of entries for the givenuser in PanelTree table
 java.util.Properties getNodeIdVsAttribValue(java.lang.String attribName, java.lang.String userName)
          This method is for internal purpose only.
 int getNodeIndex(java.lang.String userName, java.lang.String nodeId)
          This method returns position of the given NODEID under its parent
 int getNodeIndex(java.lang.String userName, java.lang.String nodeId, java.lang.String parent)
          This method returns NODEINDEX of the given NODEID
 java.util.Vector getOrderedData(java.lang.String userName)
          Performs sequencing to get the children of the parents in a sequence order along with other nodes of the user
 java.util.Hashtable getPanelTreeData(java.lang.String userName)
          This method returns Hashtable containing each NodeID and their values from PanelTree.
 java.lang.String getParent(java.lang.String userName, java.lang.String id)
          This method returns parent NodeID for the given NodeID
 java.lang.String getPreviouNodeForNodeIndex(java.lang.String userName, java.lang.String parent, int nodeIndex)
          Deprecated. This method is deprecated due to the spelling mistake, instead use getPreviousNodeForNodeIndex method.
 java.lang.String getPreviousNode(java.lang.String userName, java.lang.String id)
          Get the previousNode for the given nodeId and userName
 java.lang.String getPreviousNodeForNodeIndex(java.lang.String userName, java.lang.String parent, int nodeIndex)
          This method returns PreviousNode for the given node Index
 java.lang.String getRootNodeID(java.lang.String userName, java.lang.String id)
          This method retuns root node id to constructuct the whole tree.
 boolean insertNode(java.lang.String nodeId, java.lang.String nodeType, java.lang.String userName, java.lang.String parent, int nodeIndex, java.lang.String moduleName, java.util.Properties panelProperties, java.util.Properties viewProperties)
          Inserts the node to table ( which is specified during registeration using registerObjectForTable() ) and then inserts into PanelTree and PanelProps tables.
 boolean isDataExist(java.lang.String userName)
          This method returnsboolean true if data exist for the given user in PanelTree
 boolean isInTransaction()
           
 boolean isNodeExist(java.lang.String userName, java.lang.String id)
          This method returns true if the NodeID is present in PanelTree
 boolean isRootNodeExist(java.lang.String userName, java.lang.String parent)
          This method returns boolean true if root node exist for the given user.
 boolean modifyNode(java.lang.String nodeId, java.lang.String userName, java.lang.String moduleName, java.util.Properties panelProperties, java.util.Properties viewProperties)
          Modifies the node in table specified by the moduleName parameter .
 boolean moveNode(java.lang.String nodeId, java.lang.String userName, java.lang.String newParent)
          Moves the node as last child to new parent.
 boolean moveNode(java.lang.String nodeId, java.lang.String userName, java.lang.String newParent, int newNodeIndex)
          Moves the node to the position specified by the newNodeIndex and newParent parameters.
 void notifyTheListeners(java.lang.String userName, int type, java.lang.String nodeId, java.lang.String parent)
          Notifies the listeners of the update.
 void notifyTheListeners(java.lang.String userName, int type, java.lang.String nodeId, java.lang.String parent, java.util.Properties props)
           
 void registerForUpdates(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.,
 void registerObjectForTable(java.lang.String moduleName, NodeInterface nodeInterface)
          Used for registering the based on the table name ( which has to be updated ) with the object which implements the com.adventnet.nms.db.util.NodeInterface.
 boolean removeNode(java.lang.String nodeId, java.lang.String userName, java.lang.String moduleName, boolean deleteAllChild)
          Removes the node from table ( specified during registeration using registerObjectForTable() ) and then removes from the PanelTree and PanelProps tables.
 boolean removeUserEntry(java.lang.String userName)
          This method removes data for the given User From PanelTree, PanelProps , CustomView, CustomViewColumns, CustomViewProps tables .
 void setConnection(java.sql.Connection connection)
           
 void setConnectionFetcher(ConnectionFetcher conn)
           
 boolean updateNode(java.lang.String nodeId, java.lang.String userName, java.util.Properties attrbList)
          This method is used to add a node in PanelTree and PanelProps .Argument attribute list contains all the attributes that are to be updated in PanelTree,PanelProps and Corresponding Module Table.
protected  void validate(java.lang.String varName, java.util.Properties val, boolean checkForEmpty)
          Set the connection.
protected  void validate(java.lang.String varName, java.lang.String val, boolean checkForEmpty)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBXmlUtility

protected DBXmlUtility()
Method Detail

getInstance

public static DBXmlUtility getInstance(java.sql.Connection conn)
Gets the instance for this class.

Parameters:
conn - : Connection object to be used.
Returns:
'DBXmlUtility' instance for this class.

validate

protected void validate(java.lang.String varName,
                        java.util.Properties val,
                        boolean checkForEmpty)
                 throws NmsStorageException
Set the connection.

Parameters:
conn - : Connection object to be used.
Throws:
NmsStorageException

validate

protected void validate(java.lang.String varName,
                        java.lang.String val,
                        boolean checkForEmpty)
                 throws NmsStorageException
Throws:
NmsStorageException

setConnection

public void setConnection(java.sql.Connection connection)

setConnectionFetcher

public void setConnectionFetcher(ConnectionFetcher conn)

getConnection

protected java.sql.Connection getConnection()
                                     throws UserTransactionException
Returns the Connection object used by this class.

Throws:
UserTransactionException

isInTransaction

public boolean isInTransaction()

registerObjectForTable

public void registerObjectForTable(java.lang.String moduleName,
                                   NodeInterface nodeInterface)
Used for registering the based on the table name ( which has to be updated ) with the object which implements the com.adventnet.nms.db.util.NodeInterface. This object passed as second argument is used to invoke the node manipulation opeartions.

Parameters:
moduleName - the name of the table which needs to be updated when updating the PanelTree and PanleProps tables.
nodeInterface - the object instance implementing the com.adventnet.nms.db.util.NodeInterface

registerForUpdates

public void registerForUpdates(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.,

Parameters:
userName - the userName for which the updates are to be received.
listener - the listener registering for the updates.

deRegisterForUpdates

public void deRegisterForUpdates(java.lang.String userName,
                                 DBXMLNodeListener listener)
Removes the listener from the update vector so that the listener will no longer get any update for the node operation.

Parameters:
userName - the userName for which the updates were received.
listener - the listener which has to be deregistered for the updates.

notifyTheListeners

public void notifyTheListeners(java.lang.String userName,
                               int type,
                               java.lang.String nodeId,
                               java.lang.String parent)
Notifies the listeners of the update.

Parameters:
userName - a String the username to be notified.
type - an int type of operation performed
nodeId - a String nodeId for which the operation is performed.
parent - a String the parent of the corresponding node

notifyTheListeners

public void notifyTheListeners(java.lang.String userName,
                               int type,
                               java.lang.String nodeId,
                               java.lang.String parent,
                               java.util.Properties props)

addNode

public boolean addNode(java.lang.String nodeId,
                       java.lang.String nodeType,
                       java.lang.String userName,
                       java.lang.String parent,
                       java.lang.String moduleName,
                       java.util.Properties panelProperties,
                       java.util.Properties viewProperties)
                throws NmsStorageException,
                       UserTransactionException
Adds the node to table specified when registering ( registerObjectForTable() ) and then adds to PanelTree and PanelProps tables.

Parameters:
nodeId - the unique identification for the node being added.
nodeType - the type of the node for the node being added.
userName - the name of the user.
parent - the name of the parent under which the node is to be inserted.
moduleName - the name of the table, to which the node is to be added apart from PanelTree and PanelProps tables.
panelProperties - the java.util.Properties object which contains the attributes which are to be added to the PanelProps table.
viewProperties - the java.util.Properties object which contains the attributes which are to be added to the user-specific table.
Throws:
com.adventnet.nms.util.NmsStorageExceptionif - any problem occurs when adding the node
NmsStorageException
UserTransactionException

addNode

public boolean addNode(java.lang.String nodeId,
                       java.lang.String nodeType,
                       java.lang.String userName,
                       java.lang.String parent,
                       java.lang.String moduleName,
                       java.util.Properties panelProperties,
                       java.util.Properties viewProperties,
                       boolean isTabView)
                throws NmsStorageException,
                       UserTransactionException
Throws:
NmsStorageException
UserTransactionException

insertNode

public boolean insertNode(java.lang.String nodeId,
                          java.lang.String nodeType,
                          java.lang.String userName,
                          java.lang.String parent,
                          int nodeIndex,
                          java.lang.String moduleName,
                          java.util.Properties panelProperties,
                          java.util.Properties viewProperties)
                   throws NmsStorageException,
                          UserTransactionException
Inserts the node to table ( which is specified during registeration using registerObjectForTable() ) and then inserts into PanelTree and PanelProps tables. The node is inserted at the specified node index under the specified parent.

Parameters:
nodeId - the unique identification for the node being inserted.
nodeType - the type of the node for the node being inserted.
userName - the name of the user.
parent - the name of the parent under which the node is to be inserted.
nodeIndex - the position at which the node is to be inserted under the specified parent.
moduleName - the name of the table to which the node is to be inserted in addition to PanelTree and PanelProps tables.
panelProperties - the java.util.Properties object which contains the attributes which are to be inserted to the PanelProps table.
viewProperties - the java.util.Properties object which contains the attributes which are to be inserted to the user-specific table.
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem occurs when inserting the node
NmsStorageException
UserTransactionException

createNode

public boolean createNode(java.lang.String nodeId,
                          java.lang.String nodeType,
                          java.lang.String userName,
                          java.lang.String parent,
                          java.lang.String previousNode,
                          java.lang.String moduleName,
                          java.util.Properties panelProperties,
                          java.util.Properties viewProperties)
                   throws NmsStorageException,
                          UserTransactionException
create node to table ( which is specified during registeration using registerObjectForTable() ) and then inserts or add a node depending whether previousNode is given or not into PanelTree and PanelProps tables.

Parameters:
nodeId - the unique identification for the node being inserted.
nodeType - the type of the node for the node being inserted.
userName - the name of the user.
parent - the name of the parent under which the node is to be inserted.
previousNodex - the previousNodeID to which Node is to be inserted
moduleName - the name of the table to which the node is to be inserted in addition to PanelTree and PanelProps tables.
panelProperties - the java.util.Properties object which contains the attributes which are to be inserted to the PanelProps table.
viewProperties - the java.util.Properties object which contains the attributes which are to be inserted to the user-specific table.
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem occurs when inserting the node
NmsStorageException
UserTransactionException

removeNode

public boolean removeNode(java.lang.String nodeId,
                          java.lang.String userName,
                          java.lang.String moduleName,
                          boolean deleteAllChild)
                   throws NmsStorageException,
                          UserTransactionException
Removes the node from table ( specified during registeration using registerObjectForTable() ) and then removes from the PanelTree and PanelProps tables.

Parameters:
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 childrens of the deleted node else it moves the children as children to the parent of deleted node
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem occurs when removing the node
NmsStorageException
UserTransactionException

getPreviousNode

public java.lang.String getPreviousNode(java.lang.String userName,
                                        java.lang.String id)
                                 throws NmsStorageException,
                                        UserTransactionException
Get the previousNode for the given nodeId and userName

Parameters:
nodeId - the unique identification for the node being removed.
userName - the name of the user.
Returns:
nodeid of the previousNode
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem occurs when removing the node
NmsStorageException
UserTransactionException

getParent

public java.lang.String getParent(java.lang.String userName,
                                  java.lang.String id)
                           throws NmsStorageException,
                                  UserTransactionException
This method returns parent NodeID for the given NodeID

Parameters:
NODEID: - ID
userName - the name of the user.
Returns:
String it returns the parent NodeID of the given NodeID.
Throws:
NmsStorageException - for any database error
UserTransactionException

modifyNode

public boolean modifyNode(java.lang.String nodeId,
                          java.lang.String userName,
                          java.lang.String moduleName,
                          java.util.Properties panelProperties,
                          java.util.Properties viewProperties)
                   throws NmsStorageException,
                          UserTransactionException
Modifies the node in table specified by the moduleName parameter . Only the properties in the PanelProps table and the table specified by moduleName parameter can be modified

Parameters:
nodeId - the unique identification for the node being modified.
userName - the name of the user.
moduleName - the name of the table which is to modified for the given nodeId.
panelProperties - the java.util.Properties object which contains the attributes which are to be modified in the PanelProps table.
viewProperties - the java.util.Properties object which contains the attributes which are to be modified in the user-specific table.
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem occurs when modifying the node
NmsStorageException
UserTransactionException

moveNode

public boolean moveNode(java.lang.String nodeId,
                        java.lang.String userName,
                        java.lang.String newParent,
                        int newNodeIndex)
                 throws NmsStorageException,
                        UserTransactionException
Moves the node to the position specified by the newNodeIndex and newParent parameters. The moveNode operation can be done only in the PanelTree table ( since no other table contains the nodeIndex )

Parameters:
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.
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException

moveNode

public boolean moveNode(java.lang.String nodeId,
                        java.lang.String userName,
                        java.lang.String newParent)
                 throws NmsStorageException,
                        UserTransactionException
Moves the node as last child to new parent.

Parameters:
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.
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException

getLastChild

public java.lang.String getLastChild(java.lang.String userName,
                                     java.lang.String parent)
                              throws NmsStorageException,
                                     UserTransactionException
This method returns NodeId of the last child present under given parent

Parameters:
userName - the name of the user.
parent: - ID
Returns:
String it returns NodeID.
Throws:
java.sql.SQLException - for any database error
NmsStorageException
UserTransactionException

getPreviouNodeForNodeIndex

public java.lang.String getPreviouNodeForNodeIndex(java.lang.String userName,
                                                   java.lang.String parent,
                                                   int nodeIndex)
                                            throws NmsStorageException,
                                                   UserTransactionException
Deprecated. This method is deprecated due to the spelling mistake, instead use getPreviousNodeForNodeIndex method.

This method returns PreviousNode for the given node Index

Parameters:
userName - the name of the user.
parent: - ID
nodeIndex -
Returns:
String it returns NodeID.
Throws:
NmsStorageException - for any database error
UserTransactionException

getPreviousNodeForNodeIndex

public java.lang.String getPreviousNodeForNodeIndex(java.lang.String userName,
                                                    java.lang.String parent,
                                                    int nodeIndex)
                                             throws NmsStorageException,
                                                    UserTransactionException
This method returns PreviousNode for the given node Index

Parameters:
userName - the name of the user.
parent: - ID
nodeIndex -
Returns:
String it returns NodeID.
Throws:
NmsStorageException - for any database error
UserTransactionException

getMaxChildIndex

public int getMaxChildIndex(java.lang.String userName,
                            java.lang.String parent)
                     throws NmsStorageException,
                            UserTransactionException
Returns the maximum child index of the given parent for the given userName. If the parent has no child or for invalid userName or parent it returns zero

Parameters:
userName - the name of the user
parent - the parent for you need the maximum child index
Throws:
NmsStorageException
UserTransactionException

deleteAllTraces

public boolean deleteAllTraces(java.lang.String moduleName,
                               java.lang.String userName)
                        throws NmsStorageException,
                               UserTransactionException
Removes the node from table ( specified during registeration using registerObjectForTable() ) and then removes from the PanelTree and PanelProps tables.

Parameters:
moduleName - the Node that belong to the given moduleName will be 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.
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem occurs when removing the node
NmsStorageException
UserTransactionException

getAllPanelAttribute

public java.util.Hashtable getAllPanelAttribute(java.lang.String userName)
                                         throws NmsStorageException,
                                                UserTransactionException
This method returns all the Panel Attribute for the given user. Method returns a hashtable which consist of nodeId and Properties of Atrribute Name and Value for the given UserName from the PanelProps

Parameters:
userName - Name with wich user had login to
Returns:
Hashtable containing NodeId as key and Properties of Attribute Name and Attribute value
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException

getAllAttributes

public java.util.Properties getAllAttributes(java.lang.String userName,
                                             java.lang.String id)
                                      throws NmsStorageException,
                                             UserTransactionException
This method returns all the Attribute Name and Value for the given NodeID and UserName from the PanelProps and corresponding view properties example CustomView, Map etc specific properties

Parameters:
NODEID - for which attribute should be retrieved
userName - Name with wich user had login to
Returns:
Properties containing Attribute Name as key and Attribute value has Value
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException

getNodeAttributes

public java.util.Properties getNodeAttributes(java.lang.String id,
                                              java.lang.String userName,
                                              java.lang.String moduleName)
                                       throws NmsStorageException,
                                              UserTransactionException
This method returns Attribute Name and Value for the given NodeID and UserName from corresponding view properties example CustomView, Map etc that is specific properties

Parameters:
ID - for which attribute should be retrieved
userName - Name with wich user had login to
moduleName - table where attributes can be retrieved
Returns:
Properties containing Attribute Name as key and Attribute value has Value
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException

getPanelTreeData

public java.util.Hashtable getPanelTreeData(java.lang.String userName)
                                     throws NmsStorageException,
                                            UserTransactionException
This method returns Hashtable containing each NodeID and their values from PanelTree. First time Data for all user represented by "*" is invoked.

Parameters:
userName - the name of the user.
Returns:
Hashtable containing NodeID as Key and NODEID and its values as Properties of NODEID
Throws:
NmsStorageException
UserTransactionException

getRootNodeID

public java.lang.String getRootNodeID(java.lang.String userName,
                                      java.lang.String id)
                               throws NmsStorageException,
                                      UserTransactionException
This method retuns root node id to constructuct the whole tree. Root node is identified with parent="null".

Parameters:
userName - the name of the user.
id - is passed with value "null"
Returns:
parent NODEID which has a parent = "null"
Throws:
NmsStorageException - : For database
UserTransactionException

updateNode

public boolean updateNode(java.lang.String nodeId,
                          java.lang.String userName,
                          java.util.Properties attrbList)
                   throws NmsStorageException
This method is used to add a node in PanelTree and PanelProps .Argument attribute list contains all the attributes that are to be updated in PanelTree,PanelProps and Corresponding Module Table. Required attributes for ModuleTable are removed by the NodeInterface implementation class from attribute list. Rest of the attributes are added in PanelProps. This method is used for populating data from Tree.xml into database for a new user

Parameters:
nodeId - the unique identification for the node for which the arributes are required.
userName - the name of the user.
attrbList - contains attributes specific to the node
Returns:
boolean that it has updated in PanelTree, PanelProps And Corresponding Module Table
Throws:
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException

isDataExist

public boolean isDataExist(java.lang.String userName)
                    throws NmsStorageException,
                           UserTransactionException
This method returnsboolean true if data exist for the given user in PanelTree

Parameters:
userName - the name of the user.
Returns:
boolean true if data exist for the user else false
Throws:
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException

isRootNodeExist

public boolean isRootNodeExist(java.lang.String userName,
                               java.lang.String parent)
                        throws NmsStorageException,
                               UserTransactionException
This method returns boolean true if root node exist for the given user. Arguments are userName and parent which has value "null"

Parameters:
userName - the name of the user.
parent - a String the parent of the root node
Returns:
boolean true if data exist for the user else false
Throws:
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException

getAllNodeID

public java.util.Vector getAllNodeID(java.lang.String userName)
                              throws NmsStorageException,
                                     UserTransactionException
This method retuns vector of nodeid present in PanelTree table

Parameters:
userName - name with wich user has logged inid is passed with value "All"
Returns:
Vector containing list of nodeid
Throws:
com.adventnet.nms.util.NmsStorageException - : From database
NmsStorageException
UserTransactionException

getAllNodeID

public java.util.Vector getAllNodeID(java.lang.String userName,
                                     java.lang.String moduleName)
                              throws NmsStorageException,
                                     UserTransactionException
This method retuns vector of nodeid present in PanelTree table for a user,for a particular moduleName

Parameters:
userName - name with which user has logged inid is passed with value "All"
moduleName - for which all the nodes belonging to this module has to be retrieved.
Returns:
Vector containing list of nodeid
Throws:
com.adventnet.nms.util.NmsStorageException - : From database
NmsStorageException
UserTransactionException

isNodeExist

public boolean isNodeExist(java.lang.String userName,
                           java.lang.String id)
                    throws NmsStorageException,
                           UserTransactionException
This method returns true if the NodeID is present in PanelTree

Parameters:
NODEID: - ID
userName - the name of the user.
Returns:
booleam true: if NodeID exist and false: if NodeID doesn't exist
Throws:
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException

removeUserEntry

public boolean removeUserEntry(java.lang.String userName)
                        throws NmsStorageException,
                               UserTransactionException
This method removes data for the given User From PanelTree, PanelProps , CustomView, CustomViewColumns, CustomViewProps tables . Method returns boolean true if all the data are deleted else false

Parameters:
userName - the name of the user.
Returns:
boolean true if operation is successful else false
Throws:
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException

arrangeChild

public java.util.Vector arrangeChild(java.util.Properties dataprops,
                                     java.lang.String keystr,
                                     java.util.Vector res)

getNodeIndex

public int getNodeIndex(java.lang.String userName,
                        java.lang.String nodeId)
                 throws NmsStorageException,
                        UserTransactionException
This method returns position of the given NODEID under its parent

Parameters:
userName - the name of the user.
NODEID: - ID
Returns:
int the Node Index for the given nodeid
Throws:
NmsStorageException - for any database error
UserTransactionException

getNodeIndex

public int getNodeIndex(java.lang.String userName,
                        java.lang.String nodeId,
                        java.lang.String parent)
                 throws NmsStorageException,
                        UserTransactionException
This method returns NODEINDEX of the given NODEID

Parameters:
userName - the name of the user.
NODEID: - ID
Returns:
int the Node Index for the given nodeid
Throws:
NmsStorageException - for any database error
UserTransactionException

getNodeCount

public int getNodeCount(java.lang.String userName)
                 throws NmsStorageException,
                        UserTransactionException
This method returns Number of entries for the givenuser in PanelTree table

Parameters:
userName - the name of the user.
Returns:
int count of number of entries that given user has in panelTree table
Throws:
NmsStorageException - for any database error
UserTransactionException

getOrderedData

public java.util.Vector getOrderedData(java.lang.String userName)
                                throws NmsStorageException,
                                       UserTransactionException
Performs sequencing to get the children of the parents in a sequence order along with other nodes of the user

Parameters:
userName - a String the userName for whom the nodes to be sequenced
Returns:
a Vector returns the vector of the comlete nodeId for the user, in which children will be sequenced
Throws:
NmsStorageException - if an error occurs
UserTransactionException - if an error occurs

getNodeIdVsAttribValue

public java.util.Properties getNodeIdVsAttribValue(java.lang.String attribName,
                                                   java.lang.String userName)
                                            throws NmsStorageException,
                                                   UserTransactionException
This method is for internal purpose only. It gives a properties object containing the NodeidvsAttribValue and the AttribValuesVsNodeId.

Throws:
NmsStorageException
UserTransactionException

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.