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, xPathSelectIterate
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 Collection<NavuNode> children() throws NavuException
children
in class NavuNode
NavuException
public NavuContainer container(Integer key) throws NavuException
NavuNode
container
hashvalue could be obtained through
ConfNamespace.stringToHash(String)
,
MaapiSchemas.stringToHash(String)
or use the
overloaded method NavuNode.container(String)
container
in class NavuNode
key
- 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 key
public NavuContainer container(String key) throws NavuException
NavuNode
key
.container
in class NavuNode
key
- 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
public NavuContainer container(String prefix, String key) throws NavuException
NavuNode
key
and prefix
.container
in class NavuNode
prefix
- 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 prefix
public NavuContext context()
NavuContext
that this node is
attached to.public List<ConfXMLParam> encodeValues() throws NavuException
NavuNode
NavuNode
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 NavuNode
ConfXMLParam
of the sub-tree
including valuesNavuException
- If the operation could not be performed for some reasonsConfXMLParam
,
ConfXMLParamValue
public List<ConfXMLParam> encodeXML() throws NavuException
NavuNode
NavuNode
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 NavuNode
ConfXMLParam
of the sub-tree
(including key values) with key values.NavuException
- If the operation could not be performed for some reasonsConfXMLParam
,
ConfXMLParamValue
public 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
NavuNode
exists
in class NavuNode
NavuException
@Deprecated public CdbSession getCdbSession(CdbDBType dbType)
NavuContextBase.getReadConfSession()
,
NavuContextBase.getReadConfSession()
or
NavuContextBase.getWriteOperSession()
instead.
Returns the current cdbSession.getCdbSession
in class NavuNode
public DiffIterateOperFlag getChangeFlag()
NavuNode
NavuNode
has
been a subject to by a transaction.getChangeFlag
in class NavuNode
DiffIterateOperFlag
public List<NavuNode> getChanges() throws NavuException
NavuNode
NavuNode
'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 NavuNode
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 List<NavuNode> getChanges(boolean emitSubtree) throws NavuException
NavuNode
NavuNode
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 NavuNode
NavuNode
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
NavuNode
NavuNode
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 NavuNode
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 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
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 NavuNode getParent()
NavuNode
public 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 NavuNode
param
- pre-populated array of ConfXMLParam
ConfXMLParam
where
ConfXMLParamLeaf
is replaced with
ConfXMLParamValue
NavuException
- 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 NavuNode
xml
- XML string representation as the input values to
this action
NavuException
ConfXMLParam
public 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
NavuNode
key
.leaf
in class NavuNode
key
- 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 key
public NavuLeaf leaf(String leaf) throws NavuException
NavuNode
key
.leaf
in class NavuNode
leaf
- 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
public NavuLeaf leaf(String prefix, String leaf) throws NavuException
NavuNode
key
and prefix
.leaf
in class NavuNode
prefix
- 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 prefix
public NavuList list(Integer key) throws NavuException
NavuNode
key
.list
in class NavuNode
key
- 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 key
public NavuList list(String key) throws NavuException
NavuNode
key
.list
in class NavuNode
key
- 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
public NavuList list(String prefix, String key) throws NavuException
NavuNode
key
and prefix
.list
in class NavuNode
prefix
- 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 prefix
public Collection<NavuNode> select(ConfObject[] query) throws NavuException
select
in class NavuNode
query
- NavuException
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 NavuNode setChange(List<ConfObject> kp, DiffIterateOperFlag op, ConfValue oldValue, NavuContext delContext) throws NavuException
setChange
in class NavuNode
kp
- op
- oldValue
- IOException
ConfException
NavuException
@Deprecated public void startCdbSession(CdbDBType dbtype, EnumSet<CdbLockType> lockflags)
startCdbSession
in class NavuNode
public void stopCdbSession()
NavuNode
stopCdbSession
in class NavuNode
public void valueUpdateInd(NavuNode child)
valueUpdateInd
in class NavuNode
public List<NavuNode> xPathSelect(String xPath) throws NavuException
NavuNode
The 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 NavuNode
xPath
- - XPath 1.0 queryNavuException