public abstract class NavuNode extends Object
NavuContainer
, NavuList
, NavuLeaf
etc.
A NavuNode
can be explicitly retrieved
through NavuNode.getNavuNode(ConfPath)
.
//attach to MAAPI context NavuContainer root = new NavuContainer(new NavuContext(maapi, th)); NavuNode node = root.getNavuNode(new ConfPath("/ncs:devices/device{device0}/config"));
a subclass of NanvuNode represents a YANG constructs that
is either a containment element, (i.e., container, list),
a leaf that holds a value, or tailf:action
which
represents an action in the data model.
The interface specifies the minimum requirement that a
NavuNode
should implement. To extend the functionality of the
NavuNode
an explicit cast must be performed.
NavuNode node = ...; if(node.getInfo().isAction()) { NavuAction theAction = (NavuAction)node; theAction.call(); } // or if(node instanceof NavuAction) { NavuAction theAction = (NavuAction)node; theAction.call(); }
The methods in this interface can be divided into four different categories.
NavuNode.container(String)
, NavuNode.leaf(String)
,
NavuNode.list(String)
each retrieves a NavuNode
on the next level.
NavuNode.getParent()
retrieves the NavuNode
for the previous level (parent node). To retrieve all the child elements
on the next level for a given NavuNode
, NavuNode.children()
returns a Collection
of NavuNode
s.
To retrieve descendants of a NavuNode
based on a regular
expression, NavuNode.select(String)
(or an overloaded variant) can be used.
NavuNode
.
NavuNode.getInfo()
, NavuNode.getKeyPath()
, NavuNode.getName()
,
NavuNode.getRootNS()
.
context()
method.
Note that CDB context is deprecated.
Some MAAPI-specific methods areif (node.context().isMaapi()) // node is in MAAPI context else if(node.context().isCdbSession()) // CDB context (deprecated)
NavuNode.getChangeFlag()
,
NavuNode.getChanges()
and NavuNode.xPathSelect(String)
.NavuNode.getValues(String)
and NavuNode.setValues(String)
.There are also methods that does not fall into the above categories,
such as NavuNode.encodeXML()
which is a helpful method in conjunction
with getValues()
to extract a sub-tree.
Constructor and Description |
---|
NavuNode() |
Modifier and Type | Method and Description |
---|---|
Collection<NavuNode> |
children()
Returns a collection containing the children of this node.
|
NavuContainer |
container(ConfNamespace ns,
String containerName)
Returns a reference to a subordinate
container with
the name containerName , belonging to the namespace
ns . |
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)
Deprecated.
|
NavuContext |
context()
Returns the current
NavuContext that this node is
attached to. |
abstract List<ConfXMLParam> |
encodeValues()
Encodes the sub-tree including the current
NavuNode
as the topmost NavuNode as a ConfXMLParam array. |
abstract List<ConfXMLParam> |
encodeXML()
Encodes the sub-tree including the current
NavuNode
as the topmost NavuNode as a ConfXMLParam array. |
abstract boolean |
equals(Object o)
Check the equality of this NavuNode against the targeted
NavuNode.
|
abstract boolean |
exists()
Generic exists test for Navu navigational elements
|
CdbSession |
getCdbSession(CdbDBType dbType)
Deprecated.
|
DiffIterateOperFlag |
getChange()
Deprecated.
|
DiffIterateOperFlag |
getChangeFlag()
Returns the latest change that this
NavuNode has
been a subject to by a transaction. |
List<NavuNode> |
getChanges()
Deprecated.
|
List<NavuNode> |
getChanges(boolean emitSubTree)
Deprecated.
|
List<NavuNode> |
getChanges(boolean emitSubTree,
DiffIterateOperFlag... forOps)
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. |
ConfPath |
getConfPath()
Returns the corresponding ConfPath for the corresponding NavuNode.
|
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[] params)
Read an arbitrary set of sub-elements from this
NavuNode . |
ConfXMLParam[] |
getValues(String xml)
Read an arbitrary set of sub-elements of a container or list entry.
|
ConfXMLParam[] |
getXml(String xml)
Deprecated.
|
int |
hashCode()
Return the hashCode of this NavuNode.
|
NavuLeaf |
leaf(ConfNamespace ns,
String leafName)
Returns a reference to a subordinate
leaf with
the name leafName , belonging to the namespace
ns . |
NavuLeaf |
leaf(Integer key)
Returns a reference to a subordinate
leaf with
the hash value key . |
NavuLeaf |
leaf(String key)
Returns a reference to a subordinate
leaf with
the name key . |
NavuLeaf |
leaf(String prefix,
String key)
Deprecated.
|
NavuLeafList |
leafList(ConfNamespace ns,
String leafListName)
Returns a reference to a subordinate
leaf-list with
the name leafListName , belonging to the namespace
ns . |
NavuLeafList |
leafList(Integer key)
Returns a reference to a subordinate
leaf-list with
the hash value key . |
NavuLeafList |
leafList(String key)
Returns a reference to a subordinate
leaf-list with
the name key . |
NavuLeafList |
leafList(String prefix,
String key)
Deprecated.
|
NavuList |
list(ConfNamespace ns,
String listName)
Returns a reference to a subordinate
list with
the name listName , belonging to the namespace
ns . |
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)
Deprecated.
|
NavuContainer |
namespace(String ns)
The namespace specified here will be used when selecting a child
to this NavuContainer and returns a reference to this NavuContainer
object according to the given namespace id
ns . |
PreparedXMLStatement |
prepareXMLCall(String xml)
Creates a parameterized configuration xml in the style of a
NavuNode.setValues(String) argument. |
abstract void |
reset()
When navigating through NAVU to a certain location.
|
abstract Collection<NavuNode> |
select(ConfObject[] query) |
abstract Collection<NavuNode> |
select(List<String> query) |
abstract Collection<NavuNode> |
select(String query) |
void |
setValues(ConfXMLParam[] params)
Set arbitrary sub-elements of a container or list entry.
|
void |
setValues(String xml)
Set arbitrary sub-elements of a container or list entry.
|
void |
sharedSetValues(ConfXMLParam[] params)
Set arbitrary sub-elements of a container or list entry
with FastMap support, creating backpointers and reference counter.
|
void |
sharedSetValues(String xml)
Set arbitrary sub-elements of a container or list entry
with FastMap support, creating backpointers and reference counter.
|
void |
startCdbSession(CdbDBType dbtype,
EnumSet<CdbLockType> lockflags)
Deprecated.
|
void |
stopCdbSession()
Closes all CdbSessions for the NavuContainer.
|
List<NavuNode> |
xPathSelect(String query)
Evaluates the XPath path expression
query and returns
the resulting node set as list of NavuNode 's. |
void |
xPathSelectIterate(String query,
NavuNodeSetIterate iterate)
Iterate through a NodeSet based on a supplied XPath query.
|
public NavuContext context()
NavuContext
that this node is
attached to.NavuContext
.public NavuNode getNavuNode(ConfPath path) throws NavuException
If the path is relative it is relative this NavuNode .
NavuException
- if the path is invalid according the
schema or does not lead to a instance node.public NavuNodeInfo getInfo()
NaveNodeInfo
regarding this node.
A NavuNodeInfo
is an object which further information
could be retrieved from the current node.
NavuNode
public ConfNamespace getRootNS()
public ConfPath getConfPath()
public String getKeyPath()
NavuNode
NavuException
- If the keypath could not be determinepublic String getName()
public NavuNode getParent()
public Collection<NavuNode> children() throws NavuException
NavuException
public ConfXMLParam[] getValues(ConfXMLParam[] params) throws NavuException
NavuNode
.
Input array of ConfXMLParam
where desired values to be extracted should be replaced with
ConfXMLParamLeaf
in the ConfXMLParam array.
The return value is a copy of the input ConfXMLParam
where instances of ConfXMLParamLeaf
have been replaced with
ConfXMLParamValue
.
params
- 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 ConfXMLParam[] getValues(String xml) throws NavuException
The xml string must be pre-populated with tags and parameterized values ("?") which indicate that the operation should read the values of the corresponding tags.
NOTE: The specified xml string should not contain the version tag (<?xml version="1.0" encoding="UTF-8"?>) and do not wrap xml string with current node tag.
Example - Get tree in a service model:list buzz-service { key name; leaf name { type string; } uses ncs:service-data; ncs:servicepoint buzz-service-servicepoint; container buzz { container servers { list server { key "srv-name"; max-elements "64"; leaf srv-name { type string; } leaf ip { type inet:host; mandatory true; } leaf port { type inet:port-number; default "80"; } container foo { leaf bar { type int64; default "42"; } leaf baz { type int64; default "7"; } } list interface { key "if-name"; max-elements "8"; leaf if-name { type string; } leaf mtu { type int64; default "1500"; } } } } } } NavuContainer buzz = ncsRoot.container(buzzService.hash) .list(buzzService._buzz_service) .elem("service1") .container(buzzService._buzz);ConfXMLParam[] param = buzz.getValues("<buzz xmlns=\"http://com/example/buzzservice\">" + "<servers><server><srv-name>www1</srv-name>" + "<ip>?</ip></server><server>" + "<srv-name>www2</srv-name><ip>?</ip>" + "</server></servers></buzz>");
xml
- XML structure corresponding to the part of the configuration
tree that is to be fetched.NavuException
@Deprecated public ConfXMLParam[] getXml(String xml) throws NavuException
NavuNode.getValues(String)
which should be used instead.xml
- Array which specifies what data
should be retrievedConfXMLParam
NavuException
- If the input parameters does not confirm to the current data
model or external error have occurredpublic void setValues(String xml) throws NavuException
This method shares the same behavior as
NavuNode.setValues(ConfXMLParam[])
but the input parameter is
an XML string.
The XML string passed as the input parameter
should reflect the equivalent ConfXMLParam
array structure.
And its XML string representation:ConfXMLParam[] p = new ConfXMLParam[12]; final int hash = new Ncs().hash(); p[0] = new ConfXMLParamStart(hash, Ncs._config); final int hash2 = new Foo().hash(); p[1] = new ConfXMLParamStart(hash2, Foo._interface); p[2] = new ConfXMLParamStart(hash2, Foo._buzz); p[3] = new ConfXMLParamStart(hash2, Foo._servers); p[4] = new ConfXMLParamStart(hash2, Foo._server); p[5] = new ConfXMLParamValue(hash2, Foo._srv_name, new ConfBuf("www")); p[6] = new ConfXMLParamValue(hash2, Foo._port, new ConfUInt16(80)); p[7] = new ConfXMLParamStop(hash2, Foo._server); p[8] = new ConfXMLParamStop(hash2, Foo._servers); p[9] = new ConfXMLParamStop(hash2, Foo._buzz); p[10] = new ConfXMLParamStop(hash2, Foo._interface); p[11] = new ConfXMLParamStop(hash, Ncs._config);
<ncs:config xmlns:ncs="http://tail-f.com/ns/ncs"> <foo:interface xmlns:foo="http://acme.com/foo"> <foo:buzz> <foo:servers> <foo:server> <foo:srv-name>www</foo:srv-name> <foo:port>80</foo:port> </foo:server> </foo:servers> </foo:buzz> </foo:interface> </ncs:config>
The specified XML string should not contain the "version" tag (<?xml version="1.0" encoding="UTF-8"?>), the method will append it.
The values that are to be set must be legal string representations according to their respective types. The value strings will be validated against the current the schema and the operation will fail if the string representations are incorrect.
Example - Populate tree in a service model:For operational data with lists without keys, list instances cannot be created without passing a pseudo-key. This pseudo-key is used to identify which item in the list to set or update. The pseudo-key has to be specified in the supplied xml-string and is identified by the "<tailf-navu-pseudo-key>1</tailf-navu-pseudo-key>" tag. Internally the pseudo-key value is represented as a ConfInt64 type.list buzz-service { key name; leaf name { type string; } uses ncs:service-data; ncs:servicepoint buzz-service-servicepoint; container buzz { container servers { list server { key "srv-name"; max-elements "64"; leaf srv-name { type string; } leaf ip { type inet:host; mandatory true; } leaf port { type inet:port-number; default "80"; } container foo { leaf bar { type int64; default "42"; } leaf baz { type int64; default "7"; } } list interface { key "if-name"; max-elements "8"; leaf if-name { type string; } leaf mtu { type int64; default "1500"; } } } } } } NavuContainer buzz = ncsRoot.container(buzzService.hash) .list(buzzService._buzz_service) .create("service1") .container(buzzService._buzz);buzz.setValues("<servers><server><srv-name>www1</srv-name>" + "<ip>192.178.0.1</ip>" + "<port>80</port>" + "<foo><bar>55</bar>" + "<baz>44</baz></foo>" + "<interface><if-name>eth0</if-name>" + "<mtu>1500</mtu></interface>" + "<interface><if-name>eth1</if-name>" + "<mtu>1600</mtu></interface></server>" + "<server><srv-name>www2</srv-name>" + "<ip>192.178.0.2</ip>" + "<port>8080</port>" + "<foo><bar>66</bar>" + "<baz>55</baz></foo>" + "<interface><if-name>eth0</if-name>" + "<mtu>1500</mtu></interface>" + "<interface><if-name>eth1</if-name>" + "<mtu>1600</mtu>" + "</interface></server></servers>");
xml
- XML structure corresponding values that will be set.NavuException
NavuNode.setValues(ConfXMLParam[])
,
ConfXMLParam
public void setValues(ConfXMLParam[] params) throws NavuException
The ConfXMLParam
array must be populated with values
according to the specification of the ConfXMLParam
array structure.
If the container or list entry itself, or any sub-elements that are specified as existing, do not exist before this call, they will be created, otherwise the existing values will be updated.
Both mandatory and optional elements may be omitted from the array, and all omitted elements are left unchanged.
To actually delete a non-mandatory leaf or presence container,
ConfNoExists
should be used in the corresponding
ConfXMLParamValue
.
For a list entry, the key values can be specified either in the
path or via key elements in ConfXMLParamValue
-
if the values are in the path, the key elements can be omitted
from the array. For sub-lists present in the array, the key elements
must of course always also be present though,
immediately following the ConfXMLParamStart
element and in
the order defined by the data model.
For a list without keys the "pseudo" key may (or in some cases must) be present in the array, but of course there is no tag value for it, since it isn't present in the data model. In this case we must use a tag value of 0, i.e., it can be set with code like:
ConfXMLParam[] p = new ConfXMLParam[7]; p[1] = new ConfXMLParam(hash, 0, new ConfInt64(42));
params
- ConfXMLParam
array containing configuration to be set.IOException
ConfException
NavuException
public void sharedSetValues(String xml) throws NavuException
This method shares the same behavior as
NavuNode.sharedSetValues(ConfXMLParam[])
but the input parameter is
an XML string.
NavuException
public void sharedSetValues(ConfXMLParam[] params) throws NavuException
NavuException
public PreparedXMLStatement prepareXMLCall(String xml) throws NavuException
Creates a parameterized configuration xml in the style of a
NavuNode.setValues(String)
argument. The string "?" denotes a
parameterized value.
When the values that correspond to ? are known, they can be set
using PreparedXMLStatement.put(int, String)
or PreparedXMLStatement.put(int, ConfObject)
.
Once all parameters have been set, the entire xml can be written using
PreparedXMLStatement.setValues()
.
put
before
setValues
is called, is treated as a
ConfDefault
.
PreparedXMLStatement xmlst = node.prepareXMLCall("<server><srv-name>?</srv-name>" + "<ip>?</ip>" + "<port>?</port>" + "</server>"); xmlst.put(0, new ConfBuf("www1")); xmlst.put(1, new ConfIPv4(new int[] { 192, 168, 10, 12 }); xmlst.put(2, new ConfUInt16(80)); xmlst.setValues();
xml
- Parameterized xml string.NavuException
PreparedXMLStatement
public List<NavuNode> xPathSelect(String query) throws NavuException
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");
query
- XPath 1.0 queryNavuException
public void xPathSelectIterate(String query, NavuNodeSetIterate iterate) throws NavuException
NavuNode.xPathSelect(String)
in this method a supplied
callback is called for each node in the result set.
See NavuNodeSetIterate
.query
- XPath 1.0 queryiterate
- supplied user codeNavuException
public NavuContainer namespace(String ns) throws ConfException, IOException
ns
.ns
- the namespace idConfException
IOException
public NavuContainer container(Integer key) throws NavuException
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)
.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
container
with
the name key
.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(ConfNamespace ns, String containerName) throws NavuException
Returns a reference to a subordinate container
with
the name containerName
, belonging to the namespace
ns
.
Note that if containerName
by itself uniquely identifies a
subordinate container, that container will still have to belong to the
namespace ns
contrary to the functionality of the previous
method using prefix and containerName.
ns
- the namespace objectcontainerName
- 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 containerName
in the namespace
ns
@Deprecated public NavuContainer container(String prefix, String key) throws NavuException
NavuNode.container(ConfNamespace, String)
or #namespace(String).container(String)
instead.NavuException
public NavuLeaf leaf(Integer key) throws NavuException
leaf
with
the hash value key
.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 key) throws NavuException
leaf
with
the name key
.key
- 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(ConfNamespace ns, String leafName) throws NavuException
Returns a reference to a subordinate leaf
with
the name leafName
, belonging to the namespace
ns
.
Note that if leafName
by itself uniquely identifies a
subordinate leaf, that leaf will still have to belong to the
namespace ns
contrary to the functionality of the previous
method using prefix and leafName.
ns
- the namespace objectleafName
- 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 leafName
in the namespace
ns
@Deprecated public NavuLeaf leaf(String prefix, String key) throws NavuException
NavuNode.leaf(ConfNamespace, String)
or #namespace(String).leaf(String)
instead.NavuException
public NavuLeafList leafList(Integer key) throws NavuException
leaf-list
with
the hash value key
.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 key) throws NavuException
leaf-list
with
the name key
.key
- 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(ConfNamespace ns, String leafListName) throws NavuException
Returns a reference to a subordinate leaf-list
with
the name leafListName
, belonging to the namespace
ns
.
Note that if leafListName
by itself uniquely identifies a
subordinate leaf-list, that leaf-list will still have to belong to the
namespace ns
contrary to the functionality of the previous
method using prefix and leafListName.
ns
- the namespace objectleafListName
- 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 leafListName
and ns
@Deprecated public NavuLeafList leafList(String prefix, String key) throws NavuException
NavuNode.leafList(ConfNamespace, String)
or #namespace(String).leafList(String)
instead.NavuException
public NavuList list(Integer key) throws NavuException
list
with the
hash value key
.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
list
with
the name key
.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(ConfNamespace ns, String listName) throws NavuException
Returns a reference to a subordinate list
with
the name listName
, belonging to the namespace
ns
.
Note that if listName
by itself uniquely identifies a
subordinate list, that list will still have to belong to the
namespace ns
contrary to the functionality of the previous
method using prefix and listName.
ns
- the namespace objectlistName
- 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 listName
in the namespace
ns
@Deprecated public NavuList list(String prefix, String key) throws NavuException
NavuNode.list(ConfNamespace, String)
or #namespace(String).list(String)
instead.NavuException
@Deprecated public DiffIterateOperFlag getChange()
NavuNode.getChangeFlag()
instead.public DiffIterateOperFlag getChangeFlag()
NavuNode
has
been a subject to by a transaction.DiffIterateOperFlag
public List<NavuNode> getChanges(NavuContext delContext) throws NavuException
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...)
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 List<NavuNode> getChanges(NavuContext delContext, boolean emitSubTree) throws NavuException
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.
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 List<NavuNode> getChanges(NavuContext delContext, boolean emitSubTree, DiffIterateOperFlag... forOps) throws NavuException
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.
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.@Deprecated public List<NavuNode> getChanges() throws NavuException
NavuNode.getChanges(NavuContext)
NavuException
@Deprecated public List<NavuNode> getChanges(boolean emitSubTree) throws NavuException
NavuNode.getChanges(NavuContext, boolean)
NavuException
@Deprecated public List<NavuNode> getChanges(boolean emitSubTree, DiffIterateOperFlag... forOps) throws NavuException
NavuNode.getChanges(NavuContext, boolean, DiffIterateOperFlag...)
NavuException
@Deprecated public CdbSession getCdbSession(CdbDBType dbType)
NavuContextBase.getReadConfSession()
,
NavuContextBase.getReadConfSession()
or
NavuContextBase.getWriteOperSession()
instead.
Returns the current CdbSession.CdbSession
or null if
this node is attached to a Maapi
context@Deprecated public void startCdbSession(CdbDBType dbtype, EnumSet<CdbLockType> lockflags)
dbtype
- lockflags
- public void stopCdbSession()
public abstract void reset()
public abstract boolean exists() throws NavuException
NavuException
public abstract boolean equals(Object o)
public int hashCode()
ConfPath
of the node. For module
root containers there is no ConfPath
and instead the hash
code is based on the hash code of the module schema.public abstract List<ConfXMLParam> encodeXML() throws NavuException
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
ConfXMLParam
objects corresponding to the
sub-tree of this node, with no values except list keys.NavuException
ConfXMLParam
,
ConfXMLParamValue
public abstract List<ConfXMLParam> encodeValues() throws NavuException
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
ConfXMLParam
objects corresponding to the
sub-tree of this node, including all values.NavuException
ConfXMLParam
,
ConfXMLParamValue
public abstract Collection<NavuNode> select(List<String> query) throws NavuException
query
- a list of regular expression.NavuException
public abstract Collection<NavuNode> select(String query) throws NavuException
query
- a "/" separated regular expression.NavuException
public abstract Collection<NavuNode> select(ConfObject[] query) throws NavuException
query
- NavuException