yangtools.git
9 years agoBug 2362: Added range validation as last part of deserialization. 55/17855/3
Tony Tkacik [Tue, 7 Apr 2015 14:46:38 +0000 (16:46 +0200)]
Bug 2362: Added range validation as last part of deserialization.

Change-Id: I801aa22f868a13c098686aa077c46a378af8dfe4
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMoved implementation of (U)Int* codecs to separate classes 51/17851/1
Tony Tkacik [Tue, 7 Apr 2015 14:10:31 +0000 (16:10 +0200)]
Moved implementation of (U)Int* codecs to separate classes

Change-Id: I589eff7a961d19486529f5d2b5dbc5433988b931
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoIntroduced AbstractIntegerStringCodec. 42/17842/1
Tony Tkacik [Tue, 7 Apr 2015 13:11:20 +0000 (15:11 +0200)]
Introduced AbstractIntegerStringCodec.

All integer codecs were implementing deserialization in
same fashion - detect number format and actual deserialization.

This patchset introduces common abstract class which
does this same and concrete classes only implement construction
of objects.

Change-Id: I03433a2de54b08b3c23967f4f25f5ba465da0a34
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2909 - Gson codec lost correct type"
Tony Tkacik [Tue, 7 Apr 2015 09:32:07 +0000 (09:32 +0000)]
Merge "Bug 2909 - Gson codec lost correct type"

9 years agoBUG-2939: fixup dynamic nodes to cover overwrites 64/17664/12
Robert Varga [Thu, 2 Apr 2015 17:20:18 +0000 (19:20 +0200)]
BUG-2939: fixup dynamic nodes to cover overwrites

Promote inner classes to their proper equivalents. Perform proper lazy
comparison to cover all possible scenarios where the user might
want to examine terminal nodes in greater depth. This is done by
tracking presence of before/after data and fudging appropriate
modification types.

We make sure to not run equals() on the data, as that may introduce very
steep costs -- an overwrite with the same value is still reported as a
full write, not as unmodified.

Change-Id: I0df100a74cfa82ceddeefcfae0ca2a011c608e08
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)"
Robert Varga [Thu, 2 Apr 2015 14:21:46 +0000 (14:21 +0000)]
Merge "Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)"

9 years agoFixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier) 35/17635/1
Tony Tkacik [Thu, 2 Apr 2015 13:35:03 +0000 (15:35 +0200)]
Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)

Change-Id: If77807004779ce6ade106f1bacc9918f98f996ee
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2939: Lazily expanded CandidateNode for writes and deletes 28/17628/3
Tony Tkacik [Thu, 2 Apr 2015 12:39:22 +0000 (14:39 +0200)]
Bug 2939: Lazily expanded CandidateNode for writes and deletes

Introduced Lazily expanded CandidateNodes for writes and deletes
which does not have before or after state and ModificationType
is same for whole subtree.

Change-Id: Ib26774f9a5e76428fefb35e1d053dad95e8752cf
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2393: Extracted CandidateNode from InMemoryDataTreeCandidate 23/17623/1
Tony Tkacik [Thu, 2 Apr 2015 12:27:26 +0000 (14:27 +0200)]
Bug 2393: Extracted CandidateNode from InMemoryDataTreeCandidate

Change-Id: I4941ec32f22456be1411bd7703acac401d81d3de
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoDo not embed java-concurrent-hash-trie-map 06/17506/4
Robert Varga [Tue, 31 Mar 2015 21:44:08 +0000 (23:44 +0200)]
Do not embed java-concurrent-hash-trie-map

The package is a full OSGi bundle, no need to inline it in the user
anymore.

Change-Id: I9560ab80f07769c77a75b9c99043b8dc694ab2a8
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove unneeded null check 04/17504/4
Robert Varga [Tue, 31 Mar 2015 21:14:43 +0000 (23:14 +0200)]
BUG-869: remove unneeded null check

Instanceof checks for null implicitly, no need to be explicit.

Change-Id: I2f378567c34fa7ba7adcf8a6c369c2aa6221badf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: kill more sonar warnings 03/17503/4
Robert Varga [Tue, 31 Mar 2015 21:11:08 +0000 (23:11 +0200)]
BUG-869: kill more sonar warnings

Empty statement, mis-ordered annotations and keywords, unneeded
keywords.

Change-Id: I88a7ba62b5fe22cda96a1b5243a2ae4968c31ab3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove public modifier 02/17502/2
Robert Varga [Tue, 31 Mar 2015 20:55:31 +0000 (22:55 +0200)]
BUG-869: remove public modifier

Public is implied for all methods in an interface, do not specify it
explicitly.

Change-Id: Ic673b60111f9ecf62a6242d3bedf8607036a3403
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: use curly braces 66/17366/4
Robert Varga [Mon, 30 Mar 2015 15:38:45 +0000 (17:38 +0200)]
BUG-869: use curly braces

This clarifies the code a bit.

Change-Id: Icc7c70404942b4497deb060df986ac48610c9204
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agofix for getModifiedChild() in InMemoryDataTreeCandidate 40/17540/1
Jan Hajnar [Wed, 1 Apr 2015 13:28:24 +0000 (15:28 +0200)]
fix for getModifiedChild() in InMemoryDataTreeCandidate

Change-Id: Id28e5d42f2a5552c1519e6ac57aaf6f053e28735
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "Bug 2924: DataCodecTree expose (de)serialization methods for path arguments."
Robert Varga [Tue, 31 Mar 2015 11:19:49 +0000 (11:19 +0000)]
Merge "Bug 2924: DataCodecTree expose (de)serialization methods for path arguments."

9 years agoBug 2924: DataCodecTree expose (de)serialization methods for path arguments. 05/17405/1
Tony Tkacik [Tue, 31 Mar 2015 08:39:37 +0000 (10:39 +0200)]
Bug 2924: DataCodecTree expose (de)serialization methods for path arguments.

Change-Id: I21129df70829a6b9a35af8350352907d46d27de2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-869: remove unused assignment 65/17365/1
Robert Varga [Mon, 30 Mar 2015 15:34:59 +0000 (17:34 +0200)]
BUG-869: remove unused assignment

This assignment in return does not make sense, remove it.

Change-Id: Ie999973df471af9f5364ddf2154a24ce237278dc
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: do not use StringBuffer 64/17364/1
Robert Varga [Mon, 30 Mar 2015 15:33:17 +0000 (17:33 +0200)]
BUG-869: do not use StringBuffer

StringBuilder is the right one, so let's use that one.

Change-Id: Ic84383c05c3cd6bb0eacf9df0bbb3ed9ae46ee3f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: constants should be static 63/17363/1
Robert Varga [Mon, 30 Mar 2015 15:27:13 +0000 (17:27 +0200)]
BUG-869: constants should be static

This makes description a proper constant.

Change-Id: If01937700abd3bc8b8995b1cdbc651007e62c85d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: allow instantiation of SynchronizedDataTreeModification 60/17360/1
Robert Varga [Mon, 30 Mar 2015 15:24:58 +0000 (17:24 +0200)]
BUG-869: allow instantiation of SynchronizedDataTreeModification

create() method should be static.

Change-Id: If0bce2139163fccee8da7d8da4307a6e3d8d2dc3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove public modifier 59/17359/1
Robert Varga [Mon, 30 Mar 2015 15:23:40 +0000 (17:23 +0200)]
BUG-869: remove public modifier

public is implied to all identifiers within the enclosing interface.

Change-Id: I43a50c7d51b73074df6d0456cf0d9d9aab24b819
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-869: remove empty statements 57/17357/1
Robert Varga [Mon, 30 Mar 2015 15:13:29 +0000 (17:13 +0200)]
BUG-869: remove empty statements

Sonar warnings point to semicolons after method definitions and ;;.
Remove all instances.

Change-Id: I1ba067720abd4c9df3a0c457b947736c9bc6313e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2909 - Gson codec lost correct type 38/17338/1
Jan Hajnar [Mon, 30 Mar 2015 12:33:34 +0000 (14:33 +0200)]
Bug 2909 - Gson codec lost correct type

* changed parseXmlValue() method to parse leafref nodes according to
type referenced by leafref.

Change-Id: I6911e22fd2ef8d5845b507ee47d2b1283fb45784
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "BUG-2876: prune empty subtree modifications"
Tony Tkacik [Mon, 30 Mar 2015 08:24:52 +0000 (08:24 +0000)]
Merge "BUG-2876: prune empty subtree modifications"

9 years agoMerge "Bug 2366: Introducing support for statement ANTLR4 parser as defined in RFC602...
Tony Tkacik [Mon, 30 Mar 2015 08:24:14 +0000 (08:24 +0000)]
Merge "Bug 2366: Introducing support for statement ANTLR4 parser as defined in RFC6020, part 6.3"

9 years agoMerge "Add DefaultDataTreeCandidate utility class"
Tony Tkacik [Mon, 30 Mar 2015 08:15:43 +0000 (08:15 +0000)]
Merge "Add DefaultDataTreeCandidate utility class"

9 years agoMerge "Bug 2906 - Added support of entering notification by #streamChild()"
Robert Varga [Fri, 27 Mar 2015 10:52:48 +0000 (10:52 +0000)]
Merge "Bug 2906 - Added support of entering notification by #streamChild()"

9 years agoBug 2906 - Added support of entering notification by #streamChild() 21/17221/2
Tony Tkacik [Fri, 27 Mar 2015 10:04:50 +0000 (11:04 +0100)]
Bug 2906 - Added support of entering notification by #streamChild()

Root Tree Node context did not allowed to enter notification
using binding classes by #streamChild method, since
notifications were cached in different collection.

Added support for entering notifications using such method.

Change-Id: I28779e763a81519d25d71e319776cdc6f179ef33
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2894 - Yang Data Codec Gson: null pointer exception when trying to deseria...
Tony Tkacik [Thu, 26 Mar 2015 16:37:55 +0000 (16:37 +0000)]
Merge "Bug 2894 - Yang Data Codec Gson: null pointer exception when trying to deserialize leafref value"

9 years agoBug 2894 - Yang Data Codec Gson: null pointer exception when trying to 05/17105/2
Jan Hajnar [Tue, 24 Mar 2015 16:52:01 +0000 (17:52 +0100)]
Bug 2894 - Yang Data Codec Gson: null pointer exception when trying to
deserialize leafref value

* added function to serch for module where type was originaly defined,
so correct DataSchemaNode can be found when resolving leafref.

Change-Id: I00fd8fbdfe6f548f465e7e50eed9845e443b1f43
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG-2876: prune empty subtree modifications 68/16968/6
Robert Varga [Sun, 22 Mar 2015 22:25:06 +0000 (23:25 +0100)]
BUG-2876: prune empty subtree modifications

Another container resolution precision improvement: check if operations
under a TOUCH logical operation actually have any effects before
declaring it a SUBTREE_MODIFIED. The improved accuracy allows us to
prune unmodified paths when observed by users of
InMemoryDataTreeCandidate, as we can report actual impact on the data.

Change-Id: I3b71f82c43d6c1bbfa9a9d9008bead572da17bf7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Rename applySubtreeChange()"
Tony Tkacik [Wed, 25 Mar 2015 09:41:07 +0000 (09:41 +0000)]
Merge "Rename applySubtreeChange()"

9 years agoMerge "Rename checkSubtreeModificationApplicable()"
Tony Tkacik [Wed, 25 Mar 2015 09:40:59 +0000 (09:40 +0000)]
Merge "Rename checkSubtreeModificationApplicable()"

9 years agoCleanup checkstyle warnings 87/17087/1
Robert Varga [Wed, 25 Mar 2015 07:01:57 +0000 (08:01 +0100)]
Cleanup checkstyle warnings

We have various reported problems, from missing spaces, javadocs to
undocumented classes and parameters.

Change-Id: I38a15258ea5ba8eb8d97f257a36a4d890165b5a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename applySubtreeChange() 46/17046/1
Robert Varga [Tue, 24 Mar 2015 10:35:48 +0000 (11:35 +0100)]
Rename applySubtreeChange()

This name comes from ModificationType, which does not describe the
logical operation being applied. Rename it to applyTouch() to keep
naming consistent with others.

Change-Id: Id2a1e0f6c1704331bccf8660a13d7bebe8360d7f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename checkSubtreeModificationApplicable() 45/17045/1
Robert Varga [Tue, 24 Mar 2015 10:32:54 +0000 (11:32 +0100)]
Rename checkSubtreeModificationApplicable()

This name comes from the ModificationType enum, which is no longer
applicable internally. Shorted the name to checkTouchApplicable().

Change-Id: I5e1b844330a7b4a798b6a96403fa07de44813e96
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd DefaultDataTreeCandidate utility class 28/16928/3
Robert Varga [Fri, 20 Mar 2015 17:58:47 +0000 (18:58 +0100)]
Add DefaultDataTreeCandidate utility class

We have DataTreeCandidate implementations cropping up in the system,
this provides a simple class for reuse.

Change-Id: I3e0b594fd67b194fc38d4d3a1e2643802772aec1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not use recursive tree creation 17/17017/1
Robert Varga [Mon, 23 Mar 2015 18:23:34 +0000 (19:23 +0100)]
Do not use recursive tree creation

AbstractValueNodeModificationStrategy is creating leaf entries in the
tree. We know for a fact they do not have children, so there is no need
to eagerly instantiate child tree nodes.

The same thing is true for the root node. Since we can deal with lazily
instantiating tree nodes, we do not have to eagerly allocate them.

Change-Id: I1a55cc9d5f43c8b2c92324d470ab533fc06ad95c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix child ordering assumptions 92/16992/4
Robert Varga [Mon, 23 Mar 2015 10:59:57 +0000 (11:59 +0100)]
Fix child ordering assumptions

When instantiating nodes during an operation, we first looked up the
strategy and then specified its child handling strategy to all
intermediate nodes. This means we could have ended up specifying
ordering on a node which does not needed, or (worse) not specifying it
where it was needed.

Clean this up by walking the modification and strategy trees in sync,
bailing if we run out of strategy nodes.

While at it, turn the simple boolean into a full-blown enum, as what we
want to pass down is a tri-state: ORDERED, UNORDERED and NONE. The first
two correspond to previous true and false. The last one is useful for
leaves, as they cannot contain children, which means we can skip
instantiation of a mutable map and just use Collections.emptyMap().

Change-Id: I6ffd48b481a149255325dc31f99b7b23eebc928e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMake LatestOperationHolder final 91/16991/3
Robert Varga [Mon, 23 Mar 2015 14:14:43 +0000 (15:14 +0100)]
Make LatestOperationHolder final

The class is really final DTO, so make that explicit. It is used only
within its package, so lower method visibility.

Change-Id: Icfec15a3acc90dbb22c803ff856d3bcc4f862089
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoTurn ModificationApplyOperation into an abstract class 90/16990/3
Robert Varga [Mon, 23 Mar 2015 14:01:15 +0000 (15:01 +0100)]
Turn ModificationApplyOperation into an abstract class

This functionality is not externally-visible, so we can safely reap the
benefits of having a fixed mathod dispatch.

Change-Id: Iefb54cf852fe304419e4d306e7828a4663b0aebc
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize AbstractDataNodeContainerModificationStrategy loader 97/16997/2
Robert Varga [Mon, 23 Mar 2015 14:29:33 +0000 (15:29 +0100)]
Optimize AbstractDataNodeContainerModificationStrategy loader

The cache loader can be directly instantiated, removing the need for an
intermediate function.

Change-Id: I46329978d93874920adb5b64c00e502418869d6c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename DataNodeContainerModificationStrategy 89/16989/2
Robert Varga [Mon, 23 Mar 2015 13:43:08 +0000 (14:43 +0100)]
Rename DataNodeContainerModificationStrategy

DataNodeContainerModificationStrategy acts as an abstract base class,
which is further finalized by multiple classes. Make sure we make this
fact explicit in its name by calling it
AbstractDataNodeContainerModificationStrategy.

Change-Id: I7dc2b6e99feb542ab120e52d3c8e5f7ee1c35ddd
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename NormalizedNodeContainerModificationStrategy 88/16988/2
Robert Varga [Mon, 23 Mar 2015 13:38:33 +0000 (14:38 +0100)]
Rename NormalizedNodeContainerModificationStrategy

This is an abstract class for nodes which can hold other nodes. Rename
it to AbstractNodeContainerModificationStrategy to make this fact
immediately obvious.

Change-Id: I0cbf418d8351098d3eda83fad2def6b23c61427b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRename ValueNodeModificationStrategy 87/16987/2
Robert Varga [Mon, 23 Mar 2015 13:35:42 +0000 (14:35 +0100)]
Rename ValueNodeModificationStrategy

This is a base class, which is finalized using two different classes.
Make sure it carries 'Abstract' in its name, so it is obvious it is not
a complete strategy.

Change-Id: Ib84bb4574bda7b8f88906b668a5117f69740cddf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSplit out static classes 86/16986/2
Robert Varga [Mon, 23 Mar 2015 13:17:44 +0000 (14:17 +0100)]
Split out static classes

We have a lot of subclasses defined in the same files as the abstract
classes they extend. Split the classes out so we get clear file/class
separation.

Change-Id: I22b2b9943b080d2291cb339f84f068a0cc0defe7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoLower method visibility 85/16985/2
Robert Varga [Mon, 23 Mar 2015 13:13:48 +0000 (14:13 +0100)]
Lower method visibility

A couple of methods are declared as public, but are not visible to the
outside world because their classes are package-visible. Reduce the
declared visibility to make sure this fact is immediately obvious.

Change-Id: Ia5de906619f6098974cada1dcec9f47dbac7f139
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove duplicate import 84/16984/2
Robert Varga [Mon, 23 Mar 2015 13:55:55 +0000 (14:55 +0100)]
Remove duplicate import

Removes an unused import and adds final keywords as appropriate.

Change-Id: I8f5fa9620cba67ea425e99b6cc9f64135a28023a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agocheckApplicable() for DELETE overflows into TOUCH 04/17004/1
Robert Varga [Mon, 23 Mar 2015 15:52:55 +0000 (16:52 +0100)]
checkApplicable() for DELETE overflows into TOUCH

There is a missing split between checking whether DELETE is applicable,
which means we check if TOUCH is applicable, too.

Change-Id: I4636eee5077adb7251867fd9626b17e0b0c50113
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2876: improve ModificationType accuracy"
Tony Tkacik [Mon, 23 Mar 2015 11:25:00 +0000 (11:25 +0000)]
Merge "BUG-2876: improve ModificationType accuracy"

9 years agoMerge "BUG-2876: switch to using the computed ModificationType"
Tony Tkacik [Mon, 23 Mar 2015 11:24:27 +0000 (11:24 +0000)]
Merge "BUG-2876: switch to using the computed ModificationType"

9 years agoMerge "BUG-2876: determine ModificationType while applying changes"
Tony Tkacik [Mon, 23 Mar 2015 11:24:18 +0000 (11:24 +0000)]
Merge "BUG-2876: determine ModificationType while applying changes"

9 years agoMerge "Bug 2843 - Restconf JSON PUT cannot update/create network-topology configurati...
Tony Tkacik [Mon, 23 Mar 2015 11:09:17 +0000 (11:09 +0000)]
Merge "Bug 2843 - Restconf JSON PUT cannot update/create network-topology configuration data"

9 years agoBUG-2876: improve ModificationType accuracy 67/16967/2
Robert Varga [Sun, 22 Mar 2015 22:10:05 +0000 (23:10 +0100)]
BUG-2876: improve ModificationType accuracy

Application of an empty merge into a container results in no
modification of that container. From physical (ModificationType)
perspective, this means we can report UNMODIFIED allowing users
to skip one level of processing.

Also mark follow-up work for improving modification pruning at the cost
of performing a search in the children map.

Change-Id: I9c1c9509d3f6234570892bd90232fca3d76bd2ba
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2876: switch to using the computed ModificationType 66/16966/2
Robert Varga [Sun, 22 Mar 2015 21:51:05 +0000 (22:51 +0100)]
BUG-2876: switch to using the computed ModificationType

Eliminate the explicit checks and reuse whatever we got in the
ModifiedNode.

Change-Id: I3adf9bf9e887f45db0c6a679e8d084a5dc9ab82a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2876: determine ModificationType while applying changes 57/16957/4
Robert Varga [Thu, 19 Mar 2015 21:51:17 +0000 (22:51 +0100)]
BUG-2876: determine ModificationType while applying changes

SchemaAwareApplyOperation is the class which actually determines what is
happening to the data, so it makes sense for it to mark what was
actually done, so that other classes do not get to guess (and arrive at
wrong results).

Also rename ModifiedNode#updateModificationType() to a new name so we
reduce overall naming confusion.

Change-Id: I6436636ed83d2d4a84afc8c9e5e50def1b1ccab0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2843 - Restconf JSON PUT cannot update/create network-topology 78/16978/2
Jan Hajnar [Mon, 23 Mar 2015 10:45:10 +0000 (11:45 +0100)]
Bug 2843 - Restconf JSON PUT cannot update/create network-topology
configuration data

* changed findSchemaNodeByNameAndNamespace() function to check for
most recent revision from potential DataSchemaNodes

Change-Id: Ie706d24e1ec064360c57d3ad073e07d4bc212dba
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoMerge "BUG-2352: Remove commons-io from features"
Tony Tkacik [Mon, 23 Mar 2015 10:08:25 +0000 (10:08 +0000)]
Merge "BUG-2352: Remove commons-io from features"

9 years agoMerge "SchemaAwareApplyOperation: use an immediate return"
Tony Tkacik [Mon, 23 Mar 2015 10:03:40 +0000 (10:03 +0000)]
Merge "SchemaAwareApplyOperation: use an immediate return"

9 years agoMerge "Do not use Iterables when we have a collection"
Tony Tkacik [Mon, 23 Mar 2015 10:01:33 +0000 (10:01 +0000)]
Merge "Do not use Iterables when we have a collection"

9 years agoMerge "BUG-2856: optimize key/leaf reference checking"
Tony Tkacik [Mon, 23 Mar 2015 10:00:06 +0000 (10:00 +0000)]
Merge "BUG-2856: optimize key/leaf reference checking"

9 years agoMerge "BUG-2856: add leaf node simplied by key"
Tony Tkacik [Mon, 23 Mar 2015 09:59:52 +0000 (09:59 +0000)]
Merge "BUG-2856: add leaf node simplied by key"

9 years agoMerge "Make sure YangInstanceIdentifier.EMPTY is retained"
Tony Tkacik [Mon, 23 Mar 2015 09:59:18 +0000 (09:59 +0000)]
Merge "Make sure YangInstanceIdentifier.EMPTY is retained"

9 years agoSchemaAwareApplyOperation: use an immediate return 56/16956/2
Robert Varga [Sun, 22 Mar 2015 14:42:07 +0000 (15:42 +0100)]
SchemaAwareApplyOperation: use an immediate return

Instead of tracking and rechecking the result of search, use an
immediate return statement when a match is found. Clarifies the code
flow.

Change-Id: I08ca3b368d007ab8a880292f75dbdc87b24a7f98
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not use Iterables when we have a collection 64/16964/2
Robert Varga [Sun, 22 Mar 2015 21:16:36 +0000 (22:16 +0100)]
Do not use Iterables when we have a collection

Ever since Ifa6260ebe157c9afde49bbb58043d6ec2fecd189 normalized node
containers and lists expose children as a collection, not iterable. That
means we have direct access to Collection#size(), so let's use that
instead of redirecting through Iterables.

Change-Id: I01c245b6b9daa9512e246213dd346f66c77a5a94
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2297: Standalone model validation tool 79/12479/14
Ladislav Borak [Tue, 4 Nov 2014 07:16:32 +0000 (08:16 +0100)]
Bug 2297: Standalone model validation tool

Initial cut at providing a standalone tool, which is able to run YANG
tools core implementation against a set of models.

Usage:
    java -jar yang-validation-tool-0.7.0-SNAPSHOT-executable.jar \
        --yang-source-dir <DIRECTORY WITH YANG FILES>

Change-Id: I22da7a2c51578eab1e91d0c7cca17a68ea879e7d
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Added META-INF to gitignore to get clean git status"
Robert Varga [Sun, 22 Mar 2015 10:26:25 +0000 (10:26 +0000)]
Merge "Added META-INF to gitignore to get clean git status"

9 years agoBUG-2856: optimize key/leaf reference checking 48/16948/1
Robert Varga [Sun, 22 Mar 2015 10:20:35 +0000 (11:20 +0100)]
BUG-2856: optimize key/leaf reference checking

Since we are already iterating through the key map, we can provide the
corresponding expected value, without forcing another lookup. Introduce
a new method to take advantage of that.

Change-Id: Ia2a40f0ea2f647566059e2d68ec776bc6abc776d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2856: add leaf node simplied by key 47/16947/1
Robert Varga [Sun, 22 Mar 2015 10:13:06 +0000 (11:13 +0100)]
BUG-2856: add leaf node simplied by key

Since we have the cross-reference between key and object leaf nodes, we
enforce the consistency. Unfortunately this is not something obvious to
users. We have enough information to correct the situation, so lower the
check to apply only when an explicit inconsistency is detected.

Change-Id: I9297a7d60e4e8d4cd0680a74c1e45f412f8b5f77
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoextended test coverage of InstanceIdentifier 83/12783/4
Kinsey Nietzsche [Wed, 12 Nov 2014 13:47:30 +0000 (14:47 +0100)]
extended test coverage of InstanceIdentifier

Change-Id: Id18ae2ec969612e6c52a19449453f47e4e7e5fff
Signed-off-by: Kinsey Nietzsche <kinsey.nietzsche@pantheon.sk>
9 years agoextended test coverage of YangModelDependencyInfo.java 63/12763/4
Kinsey Nietzsche [Tue, 11 Nov 2014 15:47:30 +0000 (16:47 +0100)]
extended test coverage of YangModelDependencyInfo.java

Change-Id: I68aec083f29808fda2a06bf40bee0ca930218a73
Signed-off-by: Kinsey Nietzsche <kinsey.nietzsche@pantheon.sk>
9 years agoExtended coverage of YangInstanceIdentifier 77/12677/5
Kinsey Nietzsche [Mon, 10 Nov 2014 14:40:11 +0000 (15:40 +0100)]
Extended coverage of YangInstanceIdentifier

removed failing assertion from InstanceIdentifierTest

Signed-off-by: Kinsey Nietzsche <kinsey.nietzsche@pantheon.sk>
Change-Id: I282c4c7730032c076c017f2c3288807c80628ad0

9 years agoMerge "Introduced skeletons of Contributor and User guide."
Robert Varga [Sun, 22 Mar 2015 09:33:28 +0000 (09:33 +0000)]
Merge "Introduced skeletons of Contributor and User guide."

9 years agoAdded META-INF to gitignore to get clean git status 33/13433/2
Charalampos Kaidos [Sat, 6 Dec 2014 13:43:14 +0000 (15:43 +0200)]
Added META-INF to gitignore to get clean git status

Change-Id: I77d979e3c1e014614a9bdd84d1189880c88b9a94
Signed-off-by: Charalampos Kaidos <ckaidos@intracom-telecom.com>
9 years agoBug 2366: Introducing support for statement ANTLR4 parser as defined in RFC6020,... 25/14925/9
Martin Ciglan [Thu, 5 Feb 2015 15:24:54 +0000 (16:24 +0100)]
Bug 2366: Introducing support for statement ANTLR4 parser as defined in RFC6020, part 6.3

Change-Id: Ia0a789a68819c48f8d5f0bd5f1dbf5405e45e0bc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 2366: Initial implementation of Statement Reactor 51/15351/9
Martin Ciglan [Fri, 20 Mar 2015 12:36:18 +0000 (13:36 +0100)]
Bug 2366: Initial implementation of Statement Reactor

Initial implementation of statement reactor,
which supports:
   - loading linkage statements from models
   - modifiers
   - resolving of forward references
   - building final statments

Implementation currently does not support:

- export of PrefixToQNameModule and QNameToStatementDefinition
  namespaces during loading statement streams.
- copying statement subtrees (useful for uses, augmentations)

Added initial set of tests - which deals with
RFC6020 import resolution.

Change-Id: Idde3ce496228a157ba11c07bccf6f177c52a8fe9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoMerge "Bug 2361: Added prototype implementation using new SPI."
Robert Varga [Sat, 21 Mar 2015 17:22:49 +0000 (17:22 +0000)]
Merge "Bug 2361: Added prototype implementation using new SPI."

9 years agoBug 2361: Added prototype implementation using new SPI. 67/15167/11
Martin Ciglan [Fri, 20 Mar 2015 12:08:03 +0000 (13:08 +0100)]
Bug 2361: Added prototype implementation using new SPI.

This prototype level implementation of module, namespace,
import, uses and container statement shows usage
of meta-level SPI in order to introduce support for
concrete statements.

Note that this is same SPI, which is to be used
to introduce new statement or extension support
directly to the YANG parser.

Change-Id: I5124a06669d48d3a32d585c4c75de5b2228f2eac
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
9 years agoBug 2874: Fixed JSON parsing of choice inside augment 13/16913/1
Tony Tkacik [Fri, 20 Mar 2015 10:53:11 +0000 (11:53 +0100)]
Bug 2874: Fixed JSON parsing of choice inside augment

Code of JSON parser was aware of choice being part of
augmentation, but small typo resulted in not putting
choice inside this augmentation.

Change-Id: I2b90517571e28843e6cc824306be8a864a7c5387
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2352: Remove commons-io from features 76/16476/6
Robert Varga [Fri, 13 Mar 2015 11:08:21 +0000 (12:08 +0100)]
BUG-2352: Remove commons-io from features

Yangtools OSGi artifacts no longer require commons-io at runtime, so
remove it from the feature.

Change-Id: I22fb194cd670f3dbe9af4eb4cdc079bdd2bba29d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 868: Removed Composite Nodes from Yangtools"
Robert Varga [Fri, 20 Mar 2015 07:17:39 +0000 (07:17 +0000)]
Merge "Bug 868: Removed Composite Nodes from Yangtools"

9 years agoMerge "Bug 868: Removed Binding to Composite Node codecs."
Robert Varga [Fri, 20 Mar 2015 07:17:23 +0000 (07:17 +0000)]
Merge "Bug 868: Removed Binding to Composite Node codecs."

9 years agoBug 868: Removed Composite Nodes from Yangtools 38/16838/1
Tony Tkacik [Thu, 19 Mar 2015 15:25:29 +0000 (16:25 +0100)]
Bug 868: Removed Composite Nodes from Yangtools

Change-Id: I69d274d08dbe73900377a6715ac6c6f784e831c1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 868: Removed Binding to Composite Node codecs. 36/16836/1
Tony Tkacik [Thu, 19 Mar 2015 14:29:06 +0000 (15:29 +0100)]
Bug 868: Removed Binding to Composite Node codecs.

Change-Id: Ia54519c88870fada74bd2d7ce579c0e77d687157
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2383: deprecate ModificationType.MERGE 21/16821/3
Robert Varga [Thu, 19 Mar 2015 11:23:57 +0000 (12:23 +0100)]
BUG-2383: deprecate ModificationType.MERGE

The entire ModificationType enum is an accidental leak from the
implementation. The most pressing deficiency is that we do not want to
leak the merge operation, but report it either as a subtree modification
or a write.

Introduce a new type, LogicalOperation, which contains all the current
and use it internally. The new name also implies slight changes in how
the states are called:

ModificationType.UNMODIFIED maps to LogicalOperation.NONE
ModificationType.SUBTREE_MODIFIED maps to LogicalOperation.TOUCH

Change-Id: I446e4391583de060b2ab722deb5c004f60c8e6e7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Reduce InMemoryDataTree logging"
Robert Varga [Thu, 19 Mar 2015 14:34:12 +0000 (14:34 +0000)]
Merge "Reduce InMemoryDataTree logging"

9 years agoBug 868: Made sure Restconf client POC does not use CompositeNodes. 22/16822/4
Tony Tkacik [Thu, 19 Mar 2015 12:21:53 +0000 (13:21 +0100)]
Bug 868: Made sure Restconf client POC does not use CompositeNodes.

Change-Id: I64a940fa86cb0a0f4adccfde401b7073f7bbf9b8
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoReduce InMemoryDataTree logging 85/15585/2
tpantelis [Fri, 20 Feb 2015 00:34:44 +0000 (19:34 -0500)]
Reduce InMemoryDataTree logging

In setSchemaContext it logs the "Attempting to install schema contexts"
message to info which causes significant clutter in the karaf log - as
many as thousands of messages on startup and shutdown. I don't think
this message provides any useful information anyway so I removed it as
a similar message is logged to debug with context.

Change-Id: I0df9c3f49bd8173318b7b68584d066739ae7a562
Signed-off-by: tpantelis <tpanteli@brocade.com>
9 years agoMake sure YangInstanceIdentifier.EMPTY is retained 16/16816/1
Robert Varga [Thu, 19 Mar 2015 10:35:47 +0000 (11:35 +0100)]
Make sure YangInstanceIdentifier.EMPTY is retained

Passing an empty YangInstanceIdentifier through serialize/deserialize
would result in an additional instance. This can reduce efficiency, as
comparison does no longer use same-instance check.

Add a readResolve() method, which will enforce the singleton instance
for empty YangInstanceIdentifier.

Change-Id: Ia5fc28e182f78ce7816c5977a3c3305d8f1b71f3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG 2868: Update iana-if-type with RFC 7224 68/16768/1
Vishal Thapar [Wed, 18 Mar 2015 13:49:13 +0000 (19:19 +0530)]
BUG 2868: Update iana-if-type with RFC 7224

Change-Id: Ide79db6c34fb23bd2c773a614c35d1e436b7d237
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
9 years agoMerge "Bug 2864: Fixed (de)serialization of leafrefs"
Robert Varga [Wed, 18 Mar 2015 11:10:43 +0000 (11:10 +0000)]
Merge "Bug 2864: Fixed (de)serialization of leafrefs"

9 years agoBug 2864: Fixed (de)serialization of leafrefs 52/16752/1
Tony Tkacik [Wed, 18 Mar 2015 10:18:01 +0000 (11:18 +0100)]
Bug 2864: Fixed (de)serialization of leafrefs

Leafrefs in JSON were not properly deserialized
for non-simple types as Instance Identifier
or Identityref, which requires schema-sensitive
parsing.

Reworked JSONCodecFactory to create and store codecs
by DataSchemaNode, since leafref resolution
requires location in data schema tree, which
was not required for other codecs.

Actual codec is selected by looking up schema of
type referenced by leafref and codec is constructed
from that type.

Change-Id: Ia650b99933b177d31bee3f4b38f42e22227120d6
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2857: Tied pre-existing implementation to BindingCodecTree."
Robert Varga [Wed, 18 Mar 2015 09:34:56 +0000 (09:34 +0000)]
Merge "Bug 2857: Tied pre-existing implementation to BindingCodecTree."

9 years agoMerge "Bug 2804: Fixed incorrect emiting of some arguments."
Robert Varga [Wed, 18 Mar 2015 09:33:21 +0000 (09:33 +0000)]
Merge "Bug 2804: Fixed incorrect emiting of some arguments."

9 years agoBug 2857: Tied pre-existing implementation to BindingCodecTree. 01/16701/4
Tony Tkacik [Thu, 12 Mar 2015 11:06:00 +0000 (12:06 +0100)]
Bug 2857: Tied pre-existing implementation to BindingCodecTree.

BindingCodecTree provides public view into backing structure
of binding-data-codec, which was designed and already implemented
as data tree.

By exposing these power-users could build their own
Binding to DOM adapters, where they could customize some aspects
of serialization or precache over-used codecs in order
to speed up performance.

Change-Id: I827eb6014b28d0b6d4256b677ee56d3081ff80b0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2804: Fixed incorrect emiting of some arguments. 02/16702/2
Tony Tkacik [Tue, 17 Mar 2015 14:30:32 +0000 (15:30 +0100)]
Bug 2804: Fixed incorrect emiting of some arguments.

For some YANG or extension statements, arguments
were not emmited as separate YIN element, but as
argument.

Added explicit check which extracts YIN element
information from RFC6020 mapping and ExtensionDefinition.

Change-Id: I8ebfdd21c2890e7eaeaf207ca43a7c4896369130
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2859: Key generation when anonymous Enum was used. 39/16639/3
Tony Tkacik [Mon, 16 Mar 2015 13:31:50 +0000 (14:31 +0100)]
Bug 2859: Key generation when anonymous Enum was used.

Binding list key was generated with incorrect type,
when anonymous enumeration was defined in leaf in grouping
and that leaf was used for list.

Change-Id: Idcb114be49280f77af8054d8d83c5d8e6f453665
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2846 - Ordered-by user is broken again - SFC is broken"
Tony Tkacik [Mon, 16 Mar 2015 10:03:50 +0000 (10:03 +0000)]
Merge "Bug 2846 - Ordered-by user is broken again - SFC is broken"

9 years agoBug 2846 - Ordered-by user is broken again - SFC is broken 22/16622/2
Jan Hajnar [Mon, 16 Mar 2015 08:59:42 +0000 (09:59 +0100)]
Bug 2846 - Ordered-by user is broken again - SFC is broken

* fixed gson codec to create ordered map node when "ordered-by user" is
defined in schema

Change-Id: I81e01aa051405630b58b180b4d730aba64c04b93
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>