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, xPathSelectIterate
public List<NavuNode> getChanges(boolean emitSubtree, DiffIterateOperFlag... forOps) throws NavuException
NavuNode
NavuNode.getChanges(NavuContext, boolean, DiffIterateOperFlag...)
getChanges
in class NavuNode
NavuException
public List<NavuNode> getChanges(NavuContext delContext, boolean emitSubtree, DiffIterateOperFlag... forOps) throws NavuException
NavuNode
NavuNode
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 NavuNode
delContext
- 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
NavuNode
query
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 NavuNode
xPath
- XPath 1.0 queryNavuException
public List<NavuNode> getChanges() throws NavuException
NavuNode
NavuNode.getChanges(NavuContext)
getChanges
in class NavuNode
NavuException
public List<NavuNode> getChanges(NavuContext delcontext) throws NavuException
NavuNode
NavuNode
'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 NavuNode
delcontext
- 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
NavuNode
leaf
with
the hash value key
.leaf
in class NavuNode
key
- 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 key
public NavuLeaf leaf(String leaf) throws NavuException
NavuNode
leaf
with
the name key
.leaf
in class NavuNode
leaf
- 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 key
public NavuLeaf leaf(String prefix, String leaf) throws NavuException
NavuNode
NavuNode.leaf(ConfNamespace, String)
or #namespace(String).leaf(String)
instead.leaf
in class NavuNode
NavuException
public NavuLeafList leafList(Integer key) throws NavuException
NavuNode
leaf-list
with
the hash value key
.leafList
in class NavuNode
key
- 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 key
public NavuLeafList leafList(String leafList) throws NavuException
NavuNode
leaf-list
with
the name key
.leafList
in class NavuNode
leafList
- 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 key
public NavuLeafList leafList(String prefix, String leafList) throws NavuException
NavuNode
NavuNode.leafList(ConfNamespace, String)
or #namespace(String).leafList(String)
instead.leafList
in class NavuNode
NavuException
public NavuList list(Integer key) throws NavuException
NavuNode
list
with the
hash value key
.list
in class NavuNode
key
- 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 key
public NavuList list(String key) throws NavuException
NavuNode
list
with
the name key
.list
in class NavuNode
key
- 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 key
public NavuList list(String prefix, String key) throws NavuException
NavuNode
NavuNode.list(ConfNamespace, String)
or #namespace(String).list(String)
instead.list
in class NavuNode
NavuException
public NavuContainer container(Integer key) throws NavuException
NavuNode
container
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 NavuNode
key
- 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 key
public NavuContainer container(String key) throws NavuException
NavuNode
container
with
the name key
.container
in class NavuNode
key
- 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 key
public NavuContainer container(String prefix, String key) throws NavuException
NavuNode
NavuNode.container(ConfNamespace, String)
or #namespace(String).container(String)
instead.container
in class NavuNode
NavuException
public List<NavuNode> getChanges(boolean emitSubtree) throws NavuException
NavuNode
NavuNode.getChanges(NavuContext, boolean)
getChanges
in class NavuNode
NavuException
public List<NavuNode> getChanges(NavuContext delcontext, boolean emitSubtree) throws NavuException
NavuNode
NavuNode
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 NavuNode
delcontext
- 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
NavuNode
If the path is relative it is relative this NavuNode .
getNavuNode
in class NavuNode
NavuException
- if the path is invalid according the
schema or does not lead to a instance node.public List<ConfXMLParam> encodeXML() throws NavuException
NavuNode
NavuNode
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 NavuNode
ConfXMLParam
objects corresponding to the
sub-tree of this node, with no values except list keys.NavuException
ConfXMLParam
,
ConfXMLParamValue
public List<ConfXMLParam> encodeValues() throws NavuException
NavuNode
NavuNode
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 NavuNode
ConfXMLParam
objects corresponding to the
sub-tree of this node, including all values.NavuException
ConfXMLParam
,
ConfXMLParamValue
public DiffIterateOperFlag getChangeFlag()
NavuNode
NavuNode
has
been a subject to by a transaction.getChangeFlag
in class NavuNode
DiffIterateOperFlag
public NavuNodeInfo getInfo()
NavuNode
NaveNodeInfo
regarding this node.
A NavuNodeInfo
is an object which further information
could be retrieved from the current node.
public String getKeyPath()
NavuNode
getKeyPath
in class NavuNode
NavuNode
public String getName()
NavuNode
@Deprecated public void startCdbSession(CdbDBType dbtype, EnumSet<CdbLockType> lockflags)
startCdbSession
in class NavuNode
public void stopCdbSession()
NavuNode
stopCdbSession
in class NavuNode
public NavuNode getParent()
NavuNode
public Collection<NavuNode> select(List<String> query) throws NavuException
select
in class NavuNode
query
- a list of regular expression.NavuException
public Collection<NavuNode> select(String query) throws NavuException
select
in class NavuNode
query
- a "/" separated regular expression.NavuException
public Collection<NavuNode> select(ConfObject[] query) throws NavuException
select
in class NavuNode
query
- NavuException
public 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 NavuNode
xml
- XML string representation as the input values to
this action
NavuException
ConfXMLParam
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 NavuNode
param
- pre-populated array of ConfXMLParam
ConfXMLParam
where
ConfXMLParamLeaf
is replaced with
ConfXMLParamValue
NavuException
- 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 NavuNode
kp
- op
- oldValue
- IOException
ConfException
NavuException
public Collection<NavuNode> children() throws NavuException
children
in class NavuNode
NavuException
public 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 NavuNode
public NavuContext context()
NavuContext
that this node is
attached to.public ConfNamespace getRootNS()
public ConfXMLParam[] call() throws NavuException
NavuException
public 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 dataNavuException
public 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
NavuNode
exists
in class NavuNode
NavuException