public class NavuAction extends NavuNode
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.
| Modifier and Type | Method and Description |
|---|---|
ConfXMLParam[] |
call()
Issues an action with empty parameters
|
ConfXMLParam[] |
call(ConfXMLParam[] params)
Issues an action call with given parameters
|
ConfXMLParam[] |
call(String xml)
Issues an action call with given parameter
|
Collection<NavuNode> |
children()
Return the children of this node.
|
NavuContainer |
container(Integer key)
Returns a subordinate reference to a container according to
the given hash value.
|
NavuContainer |
container(String key)
Returns a subordinate reference to NavuNode according to
the given string
key. |
NavuContainer |
container(String prefix,
String key)
Returns a subordinate reference to container according to
the given
key and prefix. |
NavuContext |
context()
Returns the current
NavuContext that this node is
attached to. |
List<ConfXMLParam> |
encodeValues()
Encoding the sub-tree including the current
NavuNode
as the topmost NavuNode to a ConfXMLParam array. |
List<ConfXMLParam> |
encodeXML()
Encoding the sub-tree including the current
NavuNode
as the topmost NavuNode to a ConfXMLParam array. |
boolean |
equals(Object o)
Compares the specified object with this
NavuAction
for equality. |
boolean |
exists()
Generic exists test for Navu navigational elements
|
CdbSession |
getCdbSession(CdbDBType dbType)
Deprecated.
|
DiffIterateOperFlag |
getChangeFlag()
Returns the latest change that this
NavuNode has
been a subject to by a transaction. |
List<NavuNode> |
getChanges()
Return the descendant
NavuNode's
(including this element) that has been affected by
changes to the MAAPI transaction. |
List<NavuNode> |
getChanges(boolean emitSubtree)
Return the descendant
NavuNode including this
NavuNode that has been affected by the
current MAAPI transaction. |
List<NavuNode> |
getChanges(boolean emitSubtree,
DiffIterateOperFlag... forOps)
Return the descendant
NavuNode including this
NavuNode that has been affected by the
current MAAPI transaction. |
NavuNodeInfo |
getInfo()
Returns the
NaveNodeInfo regarding this node. |
String |
getKeyPath()
Returns the absolute keypath of this node.
|
String |
getName()
Returns the name of this NavuNode.
|
NavuNode |
getNavuNode(ConfPath path)
Retrieve a NavuNode based on the given absolute or relative
path.
|
NavuNode |
getParent()
Returns the parent of the node.
|
ConfNamespace |
getRootNS()
Returns the root namespace of the topmost ancestor.
|
ConfXMLParam[] |
getValues(ConfXMLParam[] param)
Invokes or call an action defined in the data model (see
tailf_yang_extensions(5)). |
ConfXMLParam[] |
getValues(String xml)
Invokes or call an action defined in the data model (see
tailf_yang_extensions(5)). |
int |
hashCode()
Returns the hash code value for this
NavuAction. |
NavuLeaf |
leaf(Integer key)
Returns a subordinate reference to a leaf node according to
the given hash value
key. |
NavuLeaf |
leaf(String leaf)
Returns a subordinate reference to a NavuNode according to
the given string
key. |
NavuLeaf |
leaf(String prefix,
String leaf)
Returns a subordinate reference to leaf according to
the given
key and prefix. |
NavuList |
list(Integer key)
Returns a subordinate reference to list according to
the given hash value
key. |
NavuList |
list(String key)
Returns a subordinate reference to NavuNode according to
the given string
key. |
NavuList |
list(String prefix,
String key)
Returns a subordinate reference to list according to
the given
key and prefix. |
void |
reset()
Not supported does nothing
|
Collection<NavuNode> |
select(ConfObject[] query) |
Collection<NavuNode> |
select(List<String> query)
Not supported returns only an empty Collection
|
Collection<NavuNode> |
select(String query)
Not supported returns only an empty Collection
|
NavuNode |
setChange(List<ConfObject> kp,
DiffIterateOperFlag op,
ConfValue oldValue,
NavuContext delContext)
Sets the change type on a node.
|
void |
startCdbSession(CdbDBType dbtype,
EnumSet<CdbLockType> lockflags)
Deprecated.
|
void |
stopCdbSession()
Closes all CdbSessions for the NavuContainer.
|
String |
toString() |
void |
valueUpdateInd(NavuNode child) |
List<NavuNode> |
xPathSelect(String xPath)
Evaluates the XPath Path expression query returns
resulting node set as list of NavuNode's.
|
getChange, getConfPath, getXml, prepareXMLCall, setValues, setValues, sharedSetValues, sharedSetValues, xPathSelectIteratepublic ConfXMLParam[] call() throws NavuException
NavuExceptionpublic ConfXMLParam[] call(ConfXMLParam[] params) throws NavuException
params - parameters to the action callNavuException - if the NavuContext is not created with
Maapipublic ConfXMLParam[] call(String xml) throws NavuException
xml - parameters as corresponding xml string dataNavuExceptionpublic Collection<NavuNode> children() throws NavuException
children in class NavuNodeNavuExceptionpublic NavuContainer container(Integer key) throws NavuException
NavuNodecontainer hashvalue could be obtained through
ConfNamespace.stringToHash(String),
MaapiSchemas.stringToHash(String) or use the
overloaded method NavuNode.container(String)container in class NavuNodekey - hashed value of the container to returnNavuException - if the corresponding subordinate node is not
a container or if subordinate node has no matching container
with the hash value keypublic NavuContainer container(String key) throws NavuException
NavuNodekey.container in class NavuNodekey - the name of the subordinate containerNavuException - if the corresponding subordinate node is not
a container node or if subordinate node has no matching container
with the name keypublic NavuContainer container(String prefix, String key) throws NavuException
NavuNodekey and prefix.container in class NavuNodeprefix - the prefix for the namespacekey - the name of the subordinate containerNavuException - if the corresponding subordinate node is not
a container node or if subordinate node has no matching container
with the name key and prefixpublic NavuContext context()
NavuContext that this node is
attached to.public List<ConfXMLParam> encodeValues() throws NavuException
NavuNodeNavuNode
as the topmost NavuNode to a ConfXMLParam array.
As opposed to encodeXML, the returning ConfXMLParam array
does contain values in form of ConfXMLParamValue
encodeValues in class NavuNodeConfXMLParam of the sub-tree
including valuesNavuException - If the operation could not be performed for some reasonsConfXMLParam,
ConfXMLParamValuepublic List<ConfXMLParam> encodeXML() throws NavuException
NavuNodeNavuNode
as the topmost NavuNode to a ConfXMLParam array.
The returning ConfXMLParam array contains no values except
for list keys. The leaf elements are encoded as ConfXMLParamLeaf
therefore the returning array could be used as a input parameter
to NavuNode.getValues(ConfXMLParam[]) on the current elements parent.
NavuNode node = ...; //cxa contains structure that does not contains values except for //keys in list elements ConfXMLParam[] cxa = node.encodeXML().toArray(new ConfXMLParam[0]); NavuNode parent = node.getParent(); //contains sub-tree with all the values ConfXMLParam[] cxb = parent.getValues(cxa);
encodeXML in class NavuNodeConfXMLParam of the sub-tree
(including key values) with key values.NavuException - If the operation could not be performed for some reasonsConfXMLParam,
ConfXMLParamValuepublic boolean equals(Object o)
NavuAction
for equality. Returns true if and only if the specified object
is also a NavuAction and its keypath
is equals.public boolean exists()
throws NavuException
NavuNodeexists in class NavuNodeNavuException@Deprecated public CdbSession getCdbSession(CdbDBType dbType)
NavuContextBase.getReadConfSession(),
NavuContextBase.getReadConfSession() or
NavuContextBase.getWriteOperSession() instead.
Returns the current cdbSession.getCdbSession in class NavuNodepublic DiffIterateOperFlag getChangeFlag()
NavuNodeNavuNode has
been a subject to by a transaction.getChangeFlag in class NavuNodeDiffIterateOperFlagpublic List<NavuNode> getChanges() throws NavuException
NavuNodeNavuNode's
(including this element) that has been affected by
changes to the MAAPI transaction.
The default behavior is to emit the affected descendant and
include all the affected NavuNode's regardless of
type of change.
To filter out specific type of change use the methods
NavuNode.getChanges(boolean, DiffIterateOperFlag...)
getChanges in class NavuNodeNavuNode's that has been affected by
the changes to the current MAAPI transaction.NavuException - Is returned if we try to iterate on a
transaction which is in the wrong state and not attached.public List<NavuNode> getChanges(boolean emitSubtree) throws NavuException
NavuNodeNavuNode including this
NavuNode that has been affected by the
current MAAPI transaction.
The emitSubtree flag specified if the desired sub-tree
should be included in the return set. If set to true
then the behavior is to include the whole sub-tree of affected
NavuNode's.
If set to false the sibling changes to the current transaction is to only included.
getChanges in class NavuNodeNavuNode that has been affected by
changes to the current MAAPI transaction.NavuException - Is returned if we try to iterate on changes on a
transaction which is in the wrong state and not attached.public List<NavuNode> getChanges(boolean emitSubtree, DiffIterateOperFlag... forOps) throws NavuException
NavuNodeNavuNode including this
NavuNode that has been affected by the
current MAAPI transaction.
The emitSubtree flag specified if the desired sub-tree
should be included in the return set. If set to true
then the behavior is to include the whole sub-tree of affected
NavuNode's.
If set to false the sibling NavuNode
that has been affected by changes to the current
transaction is to be included.
The forOps argument specifies those specific changes
that the NavuNode previously NavuNode's to be
included filter out the set
that does not match the specified arguments.
getChanges in class NavuNodeNavuNode that has been affected by
changes to the current MAAPI transaction.NavuException - Is returned if we try to iterate on a
transaction which is in the wrong state and not attached.public NavuNodeInfo getInfo()
NavuNodeNaveNodeInfo regarding this node.
A NavuNodeInfo is an object which further information
could be retrieved from the current node.
public String getKeyPath()
NavuNodegetKeyPath in class NavuNodeNavuNodepublic String getName()
NavuNodepublic NavuNode getNavuNode(ConfPath path) throws NavuException
NavuNodeIf the path is relative it is relative this NavuNode .
getNavuNode in class NavuNodeNavuException - if the path is invalid according the
schema or does not lead to a instance node.public NavuNode getParent()
NavuNodepublic ConfNamespace getRootNS()
public ConfXMLParam[] getValues(ConfXMLParam[] param) throws NavuException
tailf_yang_extensions(5)).
The params and values arrays are the
parameters for and results from the action, respectively, and use the
ConfXMLParam.getValues in class NavuNodeparam - pre-populated array of ConfXMLParamConfXMLParam where
ConfXMLParamLeaf is replaced with
ConfXMLParamValueNavuException - If the input parameters does
not confirm to the current data model or external
error have occurredpublic ConfXMLParam[] getValues(String xml) throws NavuException
tailf_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.
getValues in class NavuNodexml - XML string representation as the input values to
this actionNavuExceptionConfXMLParampublic int hashCode()
NavuAction.
This implementation uses exactly the code that is used to define the hash code for a String.
public NavuLeaf leaf(Integer key) throws NavuException
NavuNodekey.leaf in class NavuNodekey - hashed value of the subordinate leafNavuException - if the corresponding subordinate node is not
a leaf node or if subordinate node has no matching leaf
with the hash value keypublic NavuLeaf leaf(String leaf) throws NavuException
NavuNodekey.leaf in class NavuNodeleaf - the name of the subordinate leafNavuException - if the corresponding subordinate node is not
a leaf node or if subordinate node has no matching leaf
with the name keypublic NavuLeaf leaf(String prefix, String leaf) throws NavuException
NavuNodekey and prefix.leaf in class NavuNodeprefix - the prefix for the namespaceleaf - the name of the subordinate leafNavuException - if the corresponding subordinate node is not
a leaf node or if subordinate node has no matching leaf
with the name key and prefixpublic NavuList list(Integer key) throws NavuException
NavuNodekey.list in class NavuNodekey - the name of the subordinate listNavuException - if the corresponding subordinate node is not
a list node or if subordinate node has no matching list
with the hash value keypublic NavuList list(String key) throws NavuException
NavuNodekey.list in class NavuNodekey - the name of the subordinate listNavuException - if the corresponding subordinate node is not
a list node or if subordinate node has no matching list
with the name keypublic NavuList list(String prefix, String key) throws NavuException
NavuNodekey and prefix.list in class NavuNodeprefix - the prefix for the namespacekey - the name of the subordinate listNavuException - if the corresponding subordinate node is not
a list node or if subordinate node has no matching list
with the name key and prefixpublic Collection<NavuNode> select(ConfObject[] query) throws NavuException
select in class NavuNodequery - NavuExceptionpublic Collection<NavuNode> select(List<String> query) throws NavuException
select in class NavuNodequery - a list of regular expression.NavuExceptionpublic Collection<NavuNode> select(String query) throws NavuException
select in class NavuNodequery - a "/" separated regular expression.NavuExceptionpublic NavuNode setChange(List<ConfObject> kp, DiffIterateOperFlag op, ConfValue oldValue, NavuContext delContext) throws NavuException
setChange in class NavuNodekp - op - oldValue - IOExceptionConfExceptionNavuException@Deprecated public void startCdbSession(CdbDBType dbtype, EnumSet<CdbLockType> lockflags)
startCdbSession in class NavuNodepublic void stopCdbSession()
NavuNodestopCdbSession in class NavuNodepublic void valueUpdateInd(NavuNode child)
valueUpdateInd in class NavuNodepublic List<NavuNode> xPathSelect(String xPath) throws NavuException
NavuNodeThe expression query will be evaluated using this node as the context node. examples:
NavuContainer =
root.container(myns._somecontainer1).
container(myns._somecontainer2).container(myns._servers);
//retrieve all the instance entries of the server list "server"
servers.xPathSelect("server");
//retrieve all child nodes of instance with srv-name: www1
//entries of the server list "server"
servers.xPathSelect("server[srv-name='www1']/*");
//retrieve all leaf ip node of instance with srv-name: www1
//entries of the server list "server"
servers.xPathSelect("server[srv-name='www1']/ip");
xPathSelect in class NavuNodexPath - - XPath 1.0 queryNavuException