|
"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.db.util.DBXmlUtility
public class DBXmlUtility
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 |
|---|
protected DBXmlUtility()
| Method Detail |
|---|
public static DBXmlUtility getInstance(java.sql.Connection conn)
conn - : Connection object to be used.
protected void validate(java.lang.String varName,
java.util.Properties val,
boolean checkForEmpty)
throws NmsStorageException
conn - : Connection object to be used.
NmsStorageException
protected void validate(java.lang.String varName,
java.lang.String val,
boolean checkForEmpty)
throws NmsStorageException
NmsStorageExceptionpublic void setConnection(java.sql.Connection connection)
public void setConnectionFetcher(ConnectionFetcher conn)
protected java.sql.Connection getConnection()
throws UserTransactionException
UserTransactionExceptionpublic boolean isInTransaction()
public void registerObjectForTable(java.lang.String moduleName,
NodeInterface nodeInterface)
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
public void registerForUpdates(java.lang.String userName,
DBXMLNodeListener listener)
userName - the userName for which the updates are to be received.listener - the listener registering for the updates.
public void deRegisterForUpdates(java.lang.String userName,
DBXMLNodeListener listener)
userName - the userName for which the updates were received.listener - the listener which has to be deregistered for the updates.
public void notifyTheListeners(java.lang.String userName,
int type,
java.lang.String nodeId,
java.lang.String parent)
userName - a String the username to be notified.type - an int type of operation performednodeId - a String nodeId for which the operation is performed.parent - a String the parent of the corresponding node
public void notifyTheListeners(java.lang.String userName,
int type,
java.lang.String nodeId,
java.lang.String parent,
java.util.Properties props)
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
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.
com.adventnet.nms.util.NmsStorageExceptionif - any problem occurs when adding the node
NmsStorageException
UserTransactionException
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
NmsStorageException
UserTransactionException
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
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.
com.adventnet.nms.util.NmsStorageException - if any problem occurs when inserting the node
NmsStorageException
UserTransactionException
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
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 insertedmoduleName - 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.
com.adventnet.nms.util.NmsStorageException - if any problem occurs when inserting the node
NmsStorageException
UserTransactionException
public boolean removeNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String moduleName,
boolean deleteAllChild)
throws 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 childrens of the deleted node else it moves the children as children to the parent of deleted node
com.adventnet.nms.util.NmsStorageException - if any problem occurs when removing the node
NmsStorageException
UserTransactionException
public java.lang.String getPreviousNode(java.lang.String userName,
java.lang.String id)
throws NmsStorageException,
UserTransactionException
nodeId - the unique identification for the node being removed.userName - the name of the user.
com.adventnet.nms.util.NmsStorageException - if any problem occurs when removing the node
NmsStorageException
UserTransactionException
public java.lang.String getParent(java.lang.String userName,
java.lang.String id)
throws NmsStorageException,
UserTransactionException
NODEID: - IDuserName - the name of the user.
NmsStorageException - for any database error
UserTransactionException
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
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.
com.adventnet.nms.util.NmsStorageException - if any problem occurs when modifying the node
NmsStorageException
UserTransactionException
public boolean moveNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String newParent,
int newNodeIndex)
throws 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.
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException
public boolean moveNode(java.lang.String nodeId,
java.lang.String userName,
java.lang.String newParent)
throws 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.
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException
public java.lang.String getLastChild(java.lang.String userName,
java.lang.String parent)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.parent: - ID
java.sql.SQLException - for any database error
NmsStorageException
UserTransactionException
public java.lang.String getPreviouNodeForNodeIndex(java.lang.String userName,
java.lang.String parent,
int nodeIndex)
throws NmsStorageException,
UserTransactionException
getPreviousNodeForNodeIndex method.
userName - the name of the user.parent: - IDnodeIndex -
NmsStorageException - for any database error
UserTransactionException
public java.lang.String getPreviousNodeForNodeIndex(java.lang.String userName,
java.lang.String parent,
int nodeIndex)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.parent: - IDnodeIndex -
NmsStorageException - for any database error
UserTransactionException
public int getMaxChildIndex(java.lang.String userName,
java.lang.String parent)
throws NmsStorageException,
UserTransactionException
userName - the name of the userparent - the parent for you need the maximum child index
NmsStorageException
UserTransactionException
public boolean deleteAllTraces(java.lang.String moduleName,
java.lang.String userName)
throws NmsStorageException,
UserTransactionException
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.
com.adventnet.nms.util.NmsStorageException - if any problem occurs when removing the node
NmsStorageException
UserTransactionException
public java.util.Hashtable getAllPanelAttribute(java.lang.String userName)
throws NmsStorageException,
UserTransactionException
userName - Name with wich user had login to
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException
public java.util.Properties getAllAttributes(java.lang.String userName,
java.lang.String id)
throws NmsStorageException,
UserTransactionException
NODEID - for which attribute should be retrieveduserName - Name with wich user had login to
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException
public java.util.Properties getNodeAttributes(java.lang.String id,
java.lang.String userName,
java.lang.String moduleName)
throws NmsStorageException,
UserTransactionException
ID - for which attribute should be retrieveduserName - Name with wich user had login tomoduleName - table where attributes can be retrieved
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
UserTransactionException
public java.util.Hashtable getPanelTreeData(java.lang.String userName)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.
NmsStorageException
UserTransactionException
public java.lang.String getRootNodeID(java.lang.String userName,
java.lang.String id)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.id - is passed with value "null"
NmsStorageException - : For database
UserTransactionException
public boolean updateNode(java.lang.String nodeId,
java.lang.String userName,
java.util.Properties attrbList)
throws NmsStorageException
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
com.adventnet.nms.util.NmsStorageException - if any problem
NmsStorageException
public boolean isDataExist(java.lang.String userName)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException
public boolean isRootNodeExist(java.lang.String userName,
java.lang.String parent)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.parent - a String the parent of the root node
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException
public java.util.Vector getAllNodeID(java.lang.String userName)
throws NmsStorageException,
UserTransactionException
userName - name with wich user has logged inid is passed with value "All"
com.adventnet.nms.util.NmsStorageException - : From database
NmsStorageException
UserTransactionException
public java.util.Vector getAllNodeID(java.lang.String userName,
java.lang.String moduleName)
throws NmsStorageException,
UserTransactionException
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.
com.adventnet.nms.util.NmsStorageException - : From database
NmsStorageException
UserTransactionException
public boolean isNodeExist(java.lang.String userName,
java.lang.String id)
throws NmsStorageException,
UserTransactionException
NODEID: - IDuserName - the name of the user.
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException
public boolean removeUserEntry(java.lang.String userName)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.
com.adventnet.nms.util.NmsStorageException - for any database error
NmsStorageException
UserTransactionException
public java.util.Vector arrangeChild(java.util.Properties dataprops,
java.lang.String keystr,
java.util.Vector res)
public int getNodeIndex(java.lang.String userName,
java.lang.String nodeId)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.NODEID: - ID
NmsStorageException - for any database error
UserTransactionException
public int getNodeIndex(java.lang.String userName,
java.lang.String nodeId,
java.lang.String parent)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.NODEID: - ID
NmsStorageException - for any database error
UserTransactionException
public int getNodeCount(java.lang.String userName)
throws NmsStorageException,
UserTransactionException
userName - the name of the user.
NmsStorageException - for any database error
UserTransactionException
public java.util.Vector getOrderedData(java.lang.String userName)
throws NmsStorageException,
UserTransactionException
userName - a String the userName for whom the nodes to be sequenced
Vector returns the vector of the comlete nodeId for the user,
in which children will be sequenced
NmsStorageException - if an error occurs
UserTransactionException - if an error occurs
public java.util.Properties getNodeIdVsAttribValue(java.lang.String attribName,
java.lang.String userName)
throws NmsStorageException,
UserTransactionException
NmsStorageException
UserTransactionException
|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||