Class NavuAction
Although the NavuAction implements NavuNode
the usage of this class only to call the action with given parameters
and it is limited in functionality specifies in NavuNode.
-
Method Summary
Modifier and TypeMethodDescriptioncall()Issues an action with empty parameterscall(ConfXMLParam[] params) Issues an action call with given parametersIssues an action call with given parameterchildren()Return the children of this node.Returns a reference to a subordinatecontainerwith the hash valuekey.Returns a reference to a subordinatecontainerwith the namekey.context()Returns the currentNavuContextthat this node is attached to.Encodes the sub-tree including the currentNavuNodeas the topmostNavuNodeas aConfXMLParamarray.Encodes the sub-tree including the currentNavuNodeas the topmostNavuNodeas aConfXMLParamarray.booleanCompares the specified object with thisNavuActionfor equality.booleanexists()Generic exists test for Navu navigational elementsReturns the latest change that thisNavuNodehas been a subject to by a transaction.getChanges(boolean emitSubtree) getChanges(boolean emitSubtree, DiffIterateOperFlag... forOps) getChanges(NavuContext delcontext) Return the descendantNavuNode's (including this element) that has been affected by changes to theMAAPItransaction.getChanges(NavuContext delcontext, boolean emitSubtree) Return the descendantNavuNodeincluding thisNavuNodethat has been affected by the current MAAPI transaction.getChanges(NavuContext delContext, boolean emitSubtree, DiffIterateOperFlag... forOps) Return the descendantNavuNodeincluding thisNavuNodethat has been affected by the current MAAPI transaction.getInfo()Returns theNaveNodeInforegarding this node.Returns the absolute keypath of this node.getName()Returns the name of this NavuNode.getNavuNode(ConfPath path) Retrieve a NavuNode based on the given absolute or relativepath.Returns the parent of the node.Returns the root namespace of the topmost ancestor.getValues(ConfXMLParam[] param) Invokes or call an action defined in the data model (seetailf_yang_extensions(5)).Invokes or call an action defined in the data model (seetailf_yang_extensions(5)).inthashCode()Return the hashCode of this NavuNode.Returns a reference to a subordinateleafwith the hash valuekey.Returns a reference to a subordinateleafwith the namekey.Returns a reference to a subordinateleaf-listwith the hash valuekey.Returns a reference to a subordinateleaf-listwith the namekey.Returns a reference to a subordinatelistwith the hash valuekey.Returns a reference to a subordinatelistwith the namekey.voidreset()Not supported does nothingselect(ConfObject[] query) Not supported returns only an empty CollectionNot supported returns only an empty CollectionsetChange(List<ConfObject> kp, DiffIterateOperFlag op, ConfValue oldValue, NavuContext delContext) Sets the change type on a node.voidCloses all CdbSessions for the NavuContainer.toString()voidvalueUpdateInd(NavuNode child) xPathSelect(String xPath) Evaluates the XPath path expressionqueryand returns the resulting node set as list ofNavuNode's.Methods inherited from class com.tailf.navu.NavuNode
container, getConfPath, leaf, leafList, list, namespace, prepareXMLCall, setValues, setValues, sharedSetValues, sharedSetValues, xPathSelectIterate
-
Method Details
-
getChanges
public List<NavuNode> getChanges(boolean emitSubtree, DiffIterateOperFlag... forOps) throws NavuException - Throws:
NavuException
-
xPathSelect
Description copied from class:NavuNodeEvaluates the XPath path expressionqueryand returns the resulting node set as list ofNavuNode's.The expression
querywill be evaluated using this node as the context node.Example:
NavuContainer = root.container(myns._somecontainer1) .container(myns._somecontainer2).container(myns._servers); // Retrieve all the entries of the server list "server" servers.xPathSelect("server"); // Retrieve all child nodes of servers with srv-name = www1 servers.xPathSelect("server[srv-name='www1']/*"); // Retrieve all leaf ip nodes of servers with srv-name = www1 servers.xPathSelect("server[srv-name='www1']/ip");- Overrides:
xPathSelectin classNavuNode- Parameters:
xPath- XPath 1.0 query- Returns:
- a collection a nodes marching the query
- Throws:
NavuException
-
getChanges
- Throws:
NavuException
-
leaf
Description copied from class:NavuNodeReturns a reference to a subordinateleafwith the hash valuekey.- Overrides:
leafin classNavuNode- Parameters:
key- hashed name of the subordinate leaf- Returns:
- reference to a subordinate container node
- Throws:
NavuException- if the corresponding subordinate node is not a leaf node or if there is no subordinate node with the hash valuekey
-
leaf
Description copied from class:NavuNodeReturns a reference to a subordinateleafwith the namekey.- Overrides:
leafin classNavuNode- Parameters:
leaf- the name of the subordinate leaf- Returns:
- reference to a subordinate leaf node
- Throws:
NavuException- if the corresponding subordinate node is not a leaf node or if there is no subordinate node with the namekey
-
leaf
- Throws:
NavuException
-
leafList
Description copied from class:NavuNodeReturns a reference to a subordinateleaf-listwith the hash valuekey.- Overrides:
leafListin classNavuNode- Parameters:
key- hashed name of the subordinate leaf-list- Returns:
- reference to a subordinate leaf-list node
- Throws:
NavuException- if the corresponding subordinate node is not a leaf-list node or if there is no subordinate node with the hash valuekey
-
leafList
Description copied from class:NavuNodeReturns a reference to a subordinateleaf-listwith the namekey.- Overrides:
leafListin classNavuNode- Parameters:
leafList- the name of the subordinate leaf-list- Returns:
- reference to a subordinate leaf-list node
- Throws:
NavuException- if the corresponding subordinate node is not a leaf-list node or if there is no subordinate node with the namekey
-
leafList
- Throws:
NavuException
-
list
Description copied from class:NavuNodeReturns a reference to a subordinatelistwith the hash valuekey.- Overrides:
listin classNavuNode- Parameters:
key- the hashed name of the subordinate list- Returns:
- reference to a subordinate list node
- Throws:
NavuException- if the corresponding subordinate node is not a list node or if there is no subordinate node with the hash valuekey
-
list
Description copied from class:NavuNodeReturns a reference to a subordinatelistwith the namekey.- Overrides:
listin classNavuNode- Parameters:
key- the name of the subordinate list- Returns:
- reference to a subordinate list node
- Throws:
NavuException- if the corresponding subordinate node is not a list node or if there is no subordinate node with the namekey
-
list
- Throws:
NavuException
-
container
Description copied from class:NavuNodeReturns a reference to a subordinatecontainerwith the hash valuekey. Thecontainerhash value can be obtained as a constant from a namespace file generated byconfdcorncsc, or retrieved with one of the methodsConfNamespace.stringToHash(String)orMaapiSchemas.stringToHash(String). It is also possible to access a container based on its name only, using the overloaded methodNavuNode.container(String).- Overrides:
containerin classNavuNode- Parameters:
key- hashed name of the container to return- Returns:
- reference to a subordinate container node
- Throws:
NavuException- if the corresponding subordinate node is not a container or if there is no subordinate node with the hash valuekey
-
container
Description copied from class:NavuNodeReturns a reference to a subordinatecontainerwith the namekey.- Overrides:
containerin classNavuNode- Parameters:
key- the name of the subordinate container- Returns:
- reference to a subordinate container node
- Throws:
NavuException- if the corresponding subordinate node is not a container node or if there is no subordinate node with the namekey
-
container
- Throws:
NavuException
-
getChanges
- Throws:
NavuException
-
encodeXML
Description copied from class:NavuNodeEncodes the sub-tree including the currentNavuNodeas the topmostNavuNodeas aConfXMLParamarray.The returned
ConfXMLParamarray contains no values except for list keys. The leaf elements are encoded asConfXMLParamLeaf. Therefore, the returning array can be used as a the input parameter toNavuNode.getValues(ConfXMLParam[])on the current node's parent.NavuNode node = ...; ConfXMLParam[] cxa = node.encodeXML().toArray(new ConfXMLParam[0]); // cxa contains a structure that does not contain values except for // keys in list elements NavuNode parent = node.getParent(); ConfXMLParam[] cxb = parent.getValues(cxa); // cxb contains the same sub-tree with all the values
- Specified by:
encodeXMLin classNavuNode- Returns:
- A list of
ConfXMLParamobjects corresponding to the sub-tree of this node, with no values except list keys. - Throws:
NavuException- See Also:
-
encodeValues
Description copied from class:NavuNodeEncodes the sub-tree including the currentNavuNodeas the topmostNavuNodeas aConfXMLParamarray.As opposed to
NavuNode.encodeXML(), the returnedConfXMLParamarray does contain values in the form ofConfXMLParamValue- Specified by:
encodeValuesin classNavuNode- Returns:
- A list of
ConfXMLParamobjects corresponding to the sub-tree of this node, including all values. - Throws:
NavuException- See Also:
-
getChangeFlag
Returns the latest change that thisNavuNodehas been a subject to by a transaction.- Overrides:
getChangeFlagin classNavuNode- Returns:
- Flag for the latest change
- See Also:
-
getInfo
Description copied from class:NavuNodeReturns theNaveNodeInforegarding this node.A
NavuNodeInfois an object which further information could be retrieved from the current node. -
getKeyPath
Description copied from class:NavuNodeReturns the absolute keypath of this node.- Overrides:
getKeyPathin classNavuNode- Returns:
- A String representing the absolute keypath that this
NavuNode
-
getName
Description copied from class:NavuNodeReturns the name of this NavuNode. -
stopCdbSession
public void stopCdbSession()Description copied from class:NavuNodeCloses all CdbSessions for the NavuContainer. This is only necessary the case if the the NavuContainer was created with a constructor for CDB access. In such cases it is important to call this method as soon as the NavuContainer has been used. The reason for this is to release any locks on the CDB database as soon as possible. Calling this method several times under the life-cycle of the NavuContainer object is supported.- Overrides:
stopCdbSessionin classNavuNode
-
getParent
Description copied from class:NavuNodeReturns the parent of the node. -
reset
public void reset()Not supported does nothing -
select
Not supported returns only an empty Collection- Specified by:
selectin classNavuNode- Parameters:
query- a list of regular expression.- Returns:
- a collection a nodes marching the query
- Throws:
NavuException
-
select
Not supported returns only an empty Collection- Specified by:
selectin classNavuNode- Parameters:
query- a "/" separated regular expression.- Returns:
- a collection a nodes marching the query
- Throws:
NavuException
-
select
- Specified by:
selectin classNavuNode- Parameters:
query-- Returns:
- a collection a nodes matching a Regular Expression query
- Throws:
NavuException
-
getValues
Invokes or call an action defined in the data model (seetailf_yang_extensions(5)).The XML input value to this action is the eqvivalent
ConfXMLParam[]structure.The retrn uarrays are the parameters for and results from the action, respectively, and use the
ConfXMLParam.- Overrides:
getValuesin classNavuNode- Parameters:
xml- XML string representation as the input values to thisaction- Throws:
NavuException- See Also:
-
getValues
Invokes or call an action defined in the data model (seetailf_yang_extensions(5)). The params and values arrays are the parameters for and results from the action, respectively, and use theConfXMLParam.- Overrides:
getValuesin classNavuNode- Parameters:
param- pre-populated array ofConfXMLParam- Returns:
- Array of
ConfXMLParamwhereConfXMLParamLeafis replaced withConfXMLParamValue - Throws:
NavuException- If the input parameter does not conform to the current data model or an error occurs during the read.
-
children
Return the children of this node.- Overrides:
childrenin classNavuNode- Returns:
- children of this node
- Throws:
NavuException
-
context
Returns the currentNavuContextthat this node is attached to. -
getRootNS
Returns the root namespace of the topmost ancestor. -
call
Issues an action with empty parameters- Returns:
- result from this action call
- Throws:
NavuException
-
call
Issues an action call with given parameters- Parameters:
params- parameters to the action call- Throws:
NavuException- if the NavuContext is not created with Maapi
-
call
Issues an action call with given parameter- Parameters:
xml- parameters as corresponding xml string data- Throws:
NavuException
-
toString
-
equals
Compares the specified object with thisNavuActionfor equality. Returnstrueif the given object is also aNavuActionand it has the sameConfPathas thisNavuAction. -
hashCode
public int hashCode()Description copied from class:NavuNodeReturn the hashCode of this NavuNode. For most nodes, the hash code is based on theConfPathof the node. For module root containers there is noConfPathand instead the hash code is based on the hash code of the module schema. -
exists
Description copied from class:NavuNodeGeneric exists test for Navu navigational elements- Specified by:
existsin classNavuNode- Returns:
- boolean
- Throws:
NavuException
-