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 reference to a subordinate
container with
the hash value key. |
NavuContainer |
container(String key)
Returns a reference to a subordinate
container with
the name key. |
NavuContainer |
container(String prefix,
String key)
Use
NavuNode.container(ConfNamespace, String)
or #namespace(String).container(String) instead. |
NavuContext |
context()
Returns the current
NavuContext that this node is
attached to. |
List<ConfXMLParam> |
encodeValues()
Encodes the sub-tree including the current
NavuNode
as the topmost NavuNode as a ConfXMLParam array. |
List<ConfXMLParam> |
encodeXML()
Encodes the sub-tree including the current
NavuNode
as the topmost NavuNode as 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()
Since this method cannot return delete changes in a reliable way
this method is deprecated.
|
List<NavuNode> |
getChanges(boolean emitSubtree)
Since this method cannot return delete changes in a reliable way
this method is deprecated.
|
List<NavuNode> |
getChanges(boolean emitSubtree,
DiffIterateOperFlag... forOps)
Since this method cannot return delete changes in a reliable way
this method is deprecated.
|
List<NavuNode> |
getChanges(NavuContext delcontext)
Return the descendant
NavuNode's
(including this element) that has been affected by
changes to the MAAPI transaction. |
List<NavuNode> |
getChanges(NavuContext delcontext,
boolean emitSubtree)
Return the descendant
NavuNode including this
NavuNode that has been affected by the
current MAAPI transaction. |
List<NavuNode> |
getChanges(NavuContext delContext,
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)). |
NavuLeaf |
leaf(Integer key)
Returns a reference to a subordinate
leaf with
the hash value key. |
NavuLeaf |
leaf(String leaf)
Returns a reference to a subordinate
leaf with
the name key. |
NavuLeaf |
leaf(String prefix,
String leaf)
Use
NavuNode.leaf(ConfNamespace, String)
or #namespace(String).leaf(String) instead. |
NavuLeafList |
leafList(Integer key)
Returns a reference to a subordinate
leaf-list with
the hash value key. |
NavuLeafList |
leafList(String leafList)
Returns a reference to a subordinate
leaf-list with
the name key. |
NavuLeafList |
leafList(String prefix,
String leafList)
Use
NavuNode.leafList(ConfNamespace, String)
or #namespace(String).leafList(String) instead. |
NavuList |
list(Integer key)
Returns a reference to a subordinate
list with the
hash value key. |
NavuList |
list(String key)
Returns a reference to a subordinate
list with
the name key. |
NavuList |
list(String prefix,
String key)
Use
NavuNode.list(ConfNamespace, String)
or #namespace(String).list(String) instead. |
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 and returns
the resulting node set as list of NavuNode's. |
container, getChange, getConfPath, getXml, hashCode, leaf, leafList, list, namespace, prepareXMLCall, setValues, setValues, sharedSetValues, sharedSetValues, xPathSelectIteratepublic List<NavuNode> getChanges(boolean emitSubtree, DiffIterateOperFlag... forOps) throws NavuException
NavuNodeNavuNode.getChanges(NavuContext, boolean, DiffIterateOperFlag...)getChanges in class NavuNodeNavuExceptionpublic List<NavuNode> getChanges(NavuContext delContext, boolean emitSubtree, DiffIterateOperFlag... forOps) throws NavuException
NavuNodeNavuNode including this
NavuNode that has been affected by the
current MAAPI transaction.
Since deletes are already removed in current transactions a delete
context is necessary to retrieve information about delete changes.
The delContext is a NavuContext with a read transaction
on the running database to read deletes. If null delete changes will not
be able to be retrieved.
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 NavuNodedelContext - NavuContext to retrieve deleted values with.emitSubtree - boolean to control subtree changesforOps - operations for which changes are of interest.NavuNode 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 List<NavuNode> xPathSelect(String xPath) throws NavuException
NavuNodequery and returns
the resulting node set as list of NavuNode's.
The expression query will 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");
xPathSelect in class NavuNodexPath - XPath 1.0 queryNavuExceptionpublic List<NavuNode> getChanges() throws NavuException
NavuNodeNavuNode.getChanges(NavuContext)getChanges in class NavuNodeNavuExceptionpublic List<NavuNode> getChanges(NavuContext delcontext) throws NavuException
NavuNodeNavuNode's
(including this element) that has been affected by
changes to the MAAPI transaction.
Since deletes are already removed in current transactions a delete
context is necessary to retrieve information about delete changes.
The delContext is a NavuContext with a read transaction
on the running database to read deletes. If null delete changes will not
be able to be retrieved.
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 NavuNodedelcontext - NavuContext to retrieve deleted values with.NavuNode'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 NavuLeaf leaf(Integer key) throws NavuException
NavuNodeleaf with
the hash value key.leaf in class NavuNodekey - hashed name of the subordinate leafNavuException - if the corresponding subordinate node is not
a leaf node or if there is no subordinate node
with the hash value keypublic NavuLeaf leaf(String leaf) throws NavuException
NavuNodeleaf with
the name key.leaf in class NavuNodeleaf - the name of the subordinate leafNavuException - if the corresponding subordinate node is not
a leaf node or if there is no subordinate node
with the name keypublic NavuLeaf leaf(String prefix, String leaf) throws NavuException
NavuNodeNavuNode.leaf(ConfNamespace, String)
or #namespace(String).leaf(String) instead.leaf in class NavuNodeNavuExceptionpublic NavuLeafList leafList(Integer key) throws NavuException
NavuNodeleaf-list with
the hash value key.leafList in class NavuNodekey - hashed name of the subordinate leaf-listNavuException - if the corresponding subordinate node is not
a leaf-list node or if there is no subordinate node
with the hash value keypublic NavuLeafList leafList(String leafList) throws NavuException
NavuNodeleaf-list with
the name key.leafList in class NavuNodeleafList - the name of the subordinate leaf-listNavuException - if the corresponding subordinate node is not
a leaf-list node or if there is no subordinate node
with the name keypublic NavuLeafList leafList(String prefix, String leafList) throws NavuException
NavuNodeNavuNode.leafList(ConfNamespace, String)
or #namespace(String).leafList(String) instead.leafList in class NavuNodeNavuExceptionpublic NavuList list(Integer key) throws NavuException
NavuNodelist with the
hash value key.list in class NavuNodekey - the hashed name of the subordinate listNavuException - if the corresponding subordinate node is not
a list node or if there is no subordinate node
with the hash value keypublic NavuList list(String key) throws NavuException
NavuNodelist with
the name key.list in class NavuNodekey - the name of the subordinate listNavuException - if the corresponding subordinate node is not
a list node or if there is no subordinate node
with the name keypublic NavuList list(String prefix, String key) throws NavuException
NavuNodeNavuNode.list(ConfNamespace, String)
or #namespace(String).list(String) instead.list in class NavuNodeNavuExceptionpublic NavuContainer container(Integer key) throws NavuException
NavuNodecontainer with
the hash value key.
The container hash value can be obtained as a constant
from a namespace file generated by confdc or
ncsc, or retrieved with one of the methods
ConfNamespace.stringToHash(String) or
MaapiSchemas.stringToHash(String). It is also possible to access
a container based on its name only, using the overloaded method
NavuNode.container(String).container in class NavuNodekey - hashed name of the container to returnNavuException - if the corresponding subordinate node is not
a container or if there is no subordinate node
with the hash value keypublic NavuContainer container(String key) throws NavuException
NavuNodecontainer with
the name key.container in class NavuNodekey - the name of the subordinate containerNavuException - if the corresponding subordinate node is not
a container node or if there is no subordinate node
with the name keypublic NavuContainer container(String prefix, String key) throws NavuException
NavuNodeNavuNode.container(ConfNamespace, String)
or #namespace(String).container(String) instead.container in class NavuNodeNavuExceptionpublic List<NavuNode> getChanges(boolean emitSubtree) throws NavuException
NavuNodeNavuNode.getChanges(NavuContext, boolean)getChanges in class NavuNodeNavuExceptionpublic List<NavuNode> getChanges(NavuContext delcontext, boolean emitSubtree) throws NavuException
NavuNodeNavuNode including this
NavuNode that has been affected by the
current MAAPI transaction.
Since deletes are already removed in current transactions a delete
context is necessary to retrieve information about delete changes.
The delContext is a NavuContext with a read transaction
on the running database to read deletes. If null delete changes will not
be able to be retrieved.
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 NavuNodedelcontext - NavuContext to retrieve deleted values with.emitSubtree - boolean to control subtree changesNavuNode 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 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 List<ConfXMLParam> encodeXML() throws NavuException
NavuNodeNavuNode
as the topmost NavuNode as a ConfXMLParam array.
The returned ConfXMLParam array contains no values except
for list keys. The leaf elements are encoded as ConfXMLParamLeaf.
Therefore, the returning array can be used as a the input parameter
to NavuNode.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
encodeXML in class NavuNodeConfXMLParam objects corresponding to the
sub-tree of this node, with no values except list keys.NavuExceptionConfXMLParam,
ConfXMLParamValuepublic List<ConfXMLParam> encodeValues() throws NavuException
NavuNodeNavuNode
as the topmost NavuNode as a ConfXMLParam array.
As opposed to NavuNode.encodeXML(), the returned ConfXMLParam
array does contain values in the form of ConfXMLParamValue
encodeValues in class NavuNodeConfXMLParam objects corresponding to the
sub-tree of this node, including all values.NavuExceptionConfXMLParam,
ConfXMLParamValuepublic DiffIterateOperFlag getChangeFlag()
NavuNodeNavuNode has
been a subject to by a transaction.getChangeFlag in class NavuNodeDiffIterateOperFlagpublic 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()
NavuNode@Deprecated public void startCdbSession(CdbDBType dbtype, EnumSet<CdbLockType> lockflags)
startCdbSession in class NavuNodepublic void stopCdbSession()
NavuNodestopCdbSession in class NavuNodepublic NavuNode getParent()
NavuNodepublic 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 Collection<NavuNode> select(ConfObject[] query) throws NavuException
select in class NavuNodequery - NavuExceptionpublic 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 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 parameter does
not conform to the current data model or an error
occurs during the read.public NavuNode setChange(List<ConfObject> kp, DiffIterateOperFlag op, ConfValue oldValue, NavuContext delContext) throws NavuException
setChange in class NavuNodekp - op - oldValue - IOExceptionConfExceptionNavuExceptionpublic Collection<NavuNode> children() throws NavuException
children in class NavuNodeNavuExceptionpublic void valueUpdateInd(NavuNode child)
valueUpdateInd in class NavuNode@Deprecated public CdbSession getCdbSession(CdbDBType dbType)
NavuContextBase.getReadConfSession(),
NavuContextBase.getReadConfSession() or
NavuContextBase.getWriteOperSession() instead.
Returns the current cdbSession.getCdbSession in class NavuNodepublic NavuContext context()
NavuContext that this node is
attached to.public ConfNamespace getRootNS()
public 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 boolean equals(Object o)
NavuAction
for equality.
Returns true if the given object is also a
NavuAction and it has the same ConfPath as this
NavuAction.public boolean exists()
throws NavuException
NavuNodeexists in class NavuNodeNavuException