yangtools.git
9 years agoMerge "Make sure maven artifacts are provided"
Tony Tkacik [Sun, 8 Mar 2015 10:37:21 +0000 (10:37 +0000)]
Merge "Make sure maven artifacts are provided"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:37:07 +0000 (10:37 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:48 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:37 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"

9 years agoMerge "Do not rely on transitive dependencies"
Tony Tkacik [Sun, 8 Mar 2015 10:36:28 +0000 (10:36 +0000)]
Merge "Do not rely on transitive dependencies"

9 years agoAnyXml NormalizedNode wraps a DOMResult value 84/16084/4
Maros Marsalek [Thu, 5 Mar 2015 14:07:27 +0000 (15:07 +0100)]
AnyXml NormalizedNode wraps a DOMResult value

Instead of wrapping a CompositeNode, a DOM result is used as inner value for
AnyXml. XML -> NormalizedNode parser was updated as well as NormalizedNode ->
XML stream writer.

Change-Id: I8cb6875bf395385d0f10d16d5e9d7361e9172e5a
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoPreserve backwards compatibility in DomToNormalizedNodeParserFactory 29/16129/2
Maros Marsalek [Fri, 6 Mar 2015 08:21:57 +0000 (09:21 +0100)]
Preserve backwards compatibility in DomToNormalizedNodeParserFactory

Restore the former constructor with only CodecProvider but make it deprecated

Change-Id: I1cd9c9af4ac16baa228503fb125a587614a52d2e
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMake sure maven artifacts are provided 79/16079/1
Robert Varga [Thu, 5 Mar 2015 13:38:46 +0000 (14:38 +0100)]
Make sure maven artifacts are provided

We expect these to be provided, not brought in explicitly.

Change-Id: I36d86f4c8beea33d6f279ba8986d1e987efe514d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 78/16078/1
Robert Varga [Thu, 5 Mar 2015 13:30:24 +0000 (14:30 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings. Also remove use of
deprecated types and speed up stringuilder usage by passing characters
instead of strings where possible.

Change-Id: I3131166a2fedf09743e6baf4159ba15357a37993
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 77/16077/1
Robert Varga [Thu, 5 Mar 2015 13:30:02 +0000 (14:30 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.

Change-Id: I88f7b68cd2fdddf0bb39c2bbc8f2c8533de22006
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unnecessary casts 76/16076/1
Robert Varga [Thu, 5 Mar 2015 13:28:51 +0000 (14:28 +0100)]
Remove unnecessary casts

xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.

Change-Id: Ic28a868eeef8167a1f7e8b3946c2ea13526818dc
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not rely on transitive dependencies 75/16075/1
Robert Varga [Thu, 5 Mar 2015 13:00:23 +0000 (14:00 +0100)]
Do not rely on transitive dependencies

Maven core and build API should have scope=provided.

Change-Id: Id34b075fb92247507a61b79daee6c4ab73647f53
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoXML -> NormalizedNodes parser identity-ref/instance-id/leafref support 21/16021/2
Maros Marsalek [Wed, 4 Mar 2015 14:08:33 +0000 (15:08 +0100)]
XML -> NormalizedNodes parser identity-ref/instance-id/leafref support

The parsers now pars leaves of mentioned types properly.

Change-Id: I73e07079e27005dd2c22c239da6f81bdd2ef43a1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoAdd AnyXml support to NormalizedNode parser 77/15977/2
Maros Marsalek [Tue, 3 Mar 2015 15:37:40 +0000 (16:37 +0100)]
Add AnyXml support to NormalizedNode parser

Change-Id: Iea8d1f8ba29788118a4fc44f8ed71fd759373e49
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Remove unneeded build declarations in features"
Tony Tkacik [Wed, 4 Mar 2015 11:00:12 +0000 (11:00 +0000)]
Merge "Remove unneeded build declarations in features"

9 years agoAdd rpc support to NormalizedNode writers 76/15976/1
Maros Marsalek [Tue, 3 Mar 2015 15:37:19 +0000 (16:37 +0100)]
Add rpc support to NormalizedNode writers

Change-Id: Id306a397351e35ff8b86d967d219ed37f98a3648
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoRemove unneeded build declarations in features 58/15858/2
Robert Varga [Sun, 1 Mar 2015 09:03:54 +0000 (10:03 +0100)]
Remove unneeded build declarations in features

features-parent defines all the things we need, so the entire build
section can go.

Change-Id: I90f061cd2b01471714738166d5d4c3662513a8a7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd more NormalizedNodes.findNode() alternatives 91/15891/4
Robert Varga [Mon, 2 Mar 2015 10:17:05 +0000 (11:17 +0100)]
Add more NormalizedNodes.findNode() alternatives

In some calling contexts we already have an optional and/or do not have
the path encapsulated in YangInstanceIdentifier.

Change-Id: I87ddbefb2e8c36ccff26a35c24d0b01644a2d1e9
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoUse Collection.size() instead of Iterables.size() 53/15853/2
Robert Varga [Sat, 28 Feb 2015 21:03:00 +0000 (22:03 +0100)]
Use Collection.size() instead of Iterables.size()

Now that NormalizedNodeContainer returns a Collection of children, we
can use its size() method directly, speeding things up just a little
bit.

Change-Id: I7b336d0029084140ea853716a38f8abb87da7c26
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Make sure NormalizedNodeContainer uses Collection"
Tony Tkacik [Mon, 2 Mar 2015 14:28:45 +0000 (14:28 +0000)]
Merge "Make sure NormalizedNodeContainer uses Collection"

9 years agoMerge "DataContainerNodeBuilder should take a Collection"
Tony Tkacik [Mon, 2 Mar 2015 14:28:35 +0000 (14:28 +0000)]
Merge "DataContainerNodeBuilder should take a Collection"

9 years agoMerge changes Ie600f25f,I99deeb57,I63bddcfe
Tony Tkacik [Sun, 1 Mar 2015 14:52:29 +0000 (14:52 +0000)]
Merge changes Ie600f25f,I99deeb57,I63bddcfe

* changes:
  Cap LazyCollections list
  Introduce UnmodifiableCollection
  Expand known immutables

9 years agoMerge topic 'stable/helium'
Tony Tkacik [Sun, 1 Mar 2015 14:52:03 +0000 (14:52 +0000)]
Merge topic 'stable/helium'

* changes:
  Optimize getChild()
  Fix OrderedNodeContainer javadoc
  Fix ImmutableOrderedLeafSetNode.size()
  Fix EmptyImmutableUnkeyedListNode.getChild()

9 years agoMake sure NormalizedNodeContainer uses Collection 52/15852/1
Robert Varga [Sat, 28 Feb 2015 09:01:11 +0000 (10:01 +0100)]
Make sure NormalizedNodeContainer uses Collection

Instead of an Iterable, specify a collection, as that makes the number
of elements known.

Change-Id: Ifa6260ebe157c9afde49bbb58043d6ec2fecd189
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDataContainerNodeBuilder should take a Collection 31/15831/2
Robert Varga [Fri, 27 Feb 2015 18:17:57 +0000 (19:17 +0100)]
DataContainerNodeBuilder should take a Collection

List is too specific a collection to pass down into the builder. We care
only for it be Iterable, so a Collection is a reasonable middle ground.

Change-Id: Ifa3b455df76e7abd4ede387f67d2d8fcabd41545
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoCap LazyCollections list 51/15851/1
Robert Varga [Sat, 28 Feb 2015 08:58:57 +0000 (09:58 +0100)]
Cap LazyCollections list

When we move from a singleton to an ArrayList, specify the size as 2, as
the arraylist can grow beyond that, but will not waste space if it
remains at two elements.

Change-Id: Ie600f25f9e59aa5321f335b380d6d6930e4492ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoIntroduce UnmodifiableCollection 50/15850/1
Robert Varga [Sat, 28 Feb 2015 17:51:29 +0000 (18:51 +0100)]
Introduce UnmodifiableCollection

This is a utility class which recognizes itself and Guava's
ImmutableCollection subclasses during contruction, preventing unneeded
encapsulation.

Change-Id: I99deeb570a74ecee5f0bb8a89c25b363284e5f6e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoExpand known immutables 49/15849/1
Robert Varga [Sat, 28 Feb 2015 09:00:23 +0000 (10:00 +0100)]
Expand known immutables

Void and Boolean are immutable types, too. Also use ImmutableSet instead
of a hown-grown utility.

Change-Id: I63bddcfe5a8538065378a2259bf8bdc58f76d620
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize getChild() 48/15848/1
Robert Varga [Sat, 28 Feb 2015 20:22:00 +0000 (21:22 +0100)]
Optimize getChild()

The classes are so they can access children directly. This saves
instantiation of unmodifiable view and checks related to that.

Change-Id: Ia16373c92401c4b9d0dca61a0b5c5b491fc3f2e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix OrderedNodeContainer javadoc 47/15847/1
Robert Varga [Sat, 28 Feb 2015 20:27:59 +0000 (21:27 +0100)]
Fix OrderedNodeContainer javadoc

Documents the generic argument and fixes a typo.

Change-Id: Ibd00a95df9ea86acfd0d67f57d8adfca6f611f27
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix ImmutableOrderedLeafSetNode.size() 46/15846/1
Robert Varga [Sat, 28 Feb 2015 20:29:22 +0000 (21:29 +0100)]
Fix ImmutableOrderedLeafSetNode.size()

The method always returned 0, which seems to have been missed.

Change-Id: Icdc8ec423aabd3cf7dc163670de6929d63bff3be
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix EmptyImmutableUnkeyedListNode.getChild() 45/15845/1
Robert Varga [Sat, 28 Feb 2015 20:47:24 +0000 (21:47 +0100)]
Fix EmptyImmutableUnkeyedListNode.getChild()

The interface contract states that we should throw
IndexOutOfBoundsException rather than returning null.

Change-Id: Ia1186a925dfe2b4e7bc89b92be4239f10b693f4e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove unneeded dependencies 39/15539/5
Robert Varga [Fri, 20 Feb 2015 11:34:41 +0000 (12:34 +0100)]
Remove unneeded dependencies

slf4j bridge should no longer be necessary, so remove it, along with
dependencyManagement override.

Change-Id: Ia8035c7167a46c30142a643d094b3a6a1f19ee03
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoIntroduce ImmutableNodes.choiceNode() 21/15821/1
Robert Varga [Fri, 27 Feb 2015 12:04:22 +0000 (13:04 +0100)]
Introduce ImmutableNodes.choiceNode()

This is a convenience method, just like containerNode().

Change-Id: I984e31b56b2d8faaeab6db0634f34583434e294f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2539: Properly report incorrect Instance Identifiers"
Tony Tkacik [Thu, 26 Feb 2015 15:36:36 +0000 (15:36 +0000)]
Merge "Bug 2539: Properly report incorrect Instance Identifiers"

9 years agoMerge "Fix ImmutableNodes.containerNode()"
Tony Tkacik [Thu, 26 Feb 2015 15:34:55 +0000 (15:34 +0000)]
Merge "Fix ImmutableNodes.containerNode()"

9 years agoBug 2539: Properly report incorrect Instance Identifiers 82/15782/1
Tony Tkacik [Mon, 19 Jan 2015 14:24:12 +0000 (15:24 +0100)]
Bug 2539: Properly report incorrect Instance Identifiers

Binding Data Codec throws IllegalArgumentException
with description for incorrect instance identifiers
instead of generic NullPointerExceptions.

Change-Id: Ia47c83925a18f029c70b2816e2fcb58632027e3c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG 1975 - yang unkeyed list is transformed to map node 89/11489/13
Jozef Gloncak [Tue, 23 Sep 2014 13:21:21 +0000 (15:21 +0200)]
BUG 1975 - yang unkeyed list is transformed to map node

Parsers and serializer for base, for concrete DOM type and
for composite node structure to normalized node conversion
were added/modified to make it possible parse|serialize
unkeyed list to|from UnkeyedListNode and parse
OrderedListNode.

yang-data-operations artifact - was added UnkeyedListNodeModification
class to handle cases when unkeyed list is loaded
from input stream

Change-Id: Ia3a9554dea00bb9d424495a2b6ed1f96765be738
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
(cherry picked from commit 13b0a924410d92a6d49182161d54cf2cdc50ad56)

9 years agoFix ImmutableNodes.containerNode() 78/15778/1
Robert Varga [Thu, 26 Feb 2015 14:04:15 +0000 (15:04 +0100)]
Fix ImmutableNodes.containerNode()

Down-casting to a NormalizedNode<?, ?> prevents the resulting container
from being useful as a child.

Change-Id: Ie426685091a55eb6d3770c127d8685c74f66d045
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge changes I4f081454,Ibe6f283d,I83acfee3,If7a08ff1,Ia0f847dd, ...
Tony Tkacik [Thu, 26 Feb 2015 08:29:44 +0000 (08:29 +0000)]
Merge changes I4f081454,Ibe6f283d,I83acfee3,If7a08ff1,Ia0f847dd, ...

* changes:
  Spellcheck AugmentableDataNodeContainerEmitterSource
  Use simple string concat in DataObjectSerializerSource
  Fix BindingNormalizedNodeCodecRegistry thread safety
  Compact BitsCodec
  Do not declare Exception as thrown
  DataContainerCodecPrototype should be final
  Fix code alignment

9 years agoFix array validation 63/15763/3
Robert Varga [Thu, 26 Feb 2015 06:12:03 +0000 (07:12 +0100)]
Fix array validation

BGP unit tests show up a failure involving byte[] keys:

org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataValidationException$IllegalListKeyException: Illegal value for key: (urn:opendaylight:params:xml:ns:yang:bgp-linkstate?revision=2015-02-10)route-key, in: (urn:opendaylight:params:xml:ns:yang:bgp-linkstate?revision=2015-02-10)linkstate-route[{(urn:opendaylight:params:xml:ns:yang:bgp-linkstate?revision=2015-02-10)route-key=[B@6e685e6c}], actual value: [B@5b0902b4, expected value from key: [B@6e685e6c
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataValidationException.checkListKey(DataValidationException.java:60)
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder.checkKeys(ImmutableMapEntryNodeBuilder.java:101)
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder.build(ImmutableMapEntryNodeBuilder.java:94)
        at org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder.build(ImmutableMapEntryNodeBuilder.java:22)
        at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter.endNode(ImmutableNormalizedNodeStreamWriter.java:129)
        at org.opendaylight.yangtools.binding.data.codec.impl.BindingToNormalizedStreamWriter.endNode(BindingToNormalizedStreamWriter.java:89)
        at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.routes.linkstate.routes.LinkstateRoute$StreamWriter.serialize(DataObjectSerializerPrototype.java)
        at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry$DataObjectSerializerProxy.serialize(BindingNormalizedNodeCodecRegistry.java:273)
        at org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry.toNormalizedNode(BindingNormalizedNodeCodecRegistry.java:99)
        at org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec.toNormalizedNode(BindingToNormalizedNodeCodec.java:56)

This boils down to how we compare the objects. Using Objects.equals() does
not cover arrays. Switching to deepEquals() solves the problem.

Change-Id: I725dbfca2af11e5b7c6213a8f650109383f13af8
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSpellcheck AugmentableDataNodeContainerEmitterSource 55/15755/2
Robert Varga [Wed, 25 Feb 2015 22:34:26 +0000 (23:34 +0100)]
Spellcheck AugmentableDataNodeContainerEmitterSource

Simple rename of an internal class to fix a typo.

Change-Id: I4f081454b5612d2960ff85158ca5cdf2adf17519
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoUse simple string concat in DataObjectSerializerSource 54/15754/2
Robert Varga [Wed, 25 Feb 2015 22:32:40 +0000 (23:32 +0100)]
Use simple string concat in DataObjectSerializerSource

Allocating a default-sized StringBuilder is not optimal, we'd really
want to preallocate it with the initial string, at which point it
becomes not much more than a simple concat.

Change-Id: Ibe6f283dccebb347982561c4acacf615a8fff4cf
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix BindingNormalizedNodeCodecRegistry thread safety 38/15738/2
Robert Varga [Wed, 25 Feb 2015 16:16:36 +0000 (17:16 +0100)]
Fix BindingNormalizedNodeCodecRegistry thread safety

Registry has a codecContext, which can be asynchronously updated. Make
sure it is volatile, so that any changes are guaranteed to propagate.

Change-Id: I83acfee3bb5f3bf3de6873161dd491e7d5882988
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoCompact BitsCodec 37/15737/2
Robert Varga [Wed, 25 Feb 2015 16:19:56 +0000 (17:19 +0100)]
Compact BitsCodec

Instead of an if/else block, just use the result and store it directly
into array.

Change-Id: If7a08ff1a644b8bfbf023d8e5393896eb4e9b643
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not declare Exception as thrown 36/15736/2
Robert Varga [Wed, 25 Feb 2015 16:28:42 +0000 (17:28 +0100)]
Do not declare Exception as thrown

This Callable never throws, so do not declare the exception, fixing a
sonar warning.

Change-Id: Ia0f847dd31ebc09d91993ded5e5bb2fc6486b7d6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDataContainerCodecPrototype should be final 35/15735/2
Robert Varga [Wed, 25 Feb 2015 16:19:01 +0000 (17:19 +0100)]
DataContainerCodecPrototype should be final

Let's help the runtime by declaring the class final, as it is
package-private and does not have descendants.

Change-Id: I8d994dc307c0d831b92a95775fd21e39f3ef1fd0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix code alignment 34/15734/2
Robert Varga [Wed, 25 Feb 2015 16:18:13 +0000 (17:18 +0100)]
Fix code alignment

Declaration and comment missed one leading space, fix that.

Change-Id: I198a96668ec0ad94b1b1118949988e88321f8b43
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoYANG JSON codec can be used inside other JSON stream. 19/15719/3
Tony Tkacik [Wed, 25 Feb 2015 12:44:22 +0000 (13:44 +0100)]
YANG JSON codec can be used inside other JSON stream.

This is useful for emitting root element, which is
not present in YANG schema.

This also allows to introduce special support of
emitting get-config and get RPC bodies, which
are using data tree schema for anyxml, and
emitted stream is still considered valid YANG JSON
according to specification.

Change-Id: Ie01afc93834bf4e9ee4981a71413ae477dee0766
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Fix checkListKey not checking actual/expected values"
Tony Tkacik [Wed, 25 Feb 2015 15:27:51 +0000 (15:27 +0000)]
Merge "Fix checkListKey not checking actual/expected values"

9 years agoMark classes/fields as final 21/15721/1
Robert Varga [Wed, 25 Feb 2015 13:43:26 +0000 (14:43 +0100)]
Mark classes/fields as final

Making sure that we follow coding patterns, will actually improve what
the JIT can do for us.

Change-Id: I125a6c058ea603d2e9545c42ff8ab969372c371d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoSkip ArrayList instantiation during deserialization 16/15716/2
Robert Varga [Wed, 25 Feb 2015 11:24:36 +0000 (12:24 +0100)]
Skip ArrayList instantiation during deserialization

We use the ArrayList just as an index holder, after which we just
extract the underlying array. The libraries by default perform a copy
and then JIT has to prove what is going on to remove that overhead.

Let's make it super-easy instead by filling the array ourselves.

Change-Id: Ib48992538b3cd8a9a0c11011fe444e24b23dc825
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2689: Cast exception when serializing L3Address from groupbasedpolicy policy... 58/15558/3
Martin Ciglan [Fri, 20 Feb 2015 15:10:15 +0000 (16:10 +0100)]
BUG-2689: Cast exception when serializing L3Address from groupbasedpolicy policy.yang

When deserializing L3AddressKey, alphabetical order of key arguments
didn't match with order of related QNames as defined in yang model.

The binding-independent world retains the ordering specified in model,
while the binding-aware world requires constructor arguments to be
alpha-sorted.

Change-Id: Icb277fed97d0984ca1a60aa7add7817db727facc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Updated Json Stream Writer to use gson JsonWriter."
Tony Tkacik [Wed, 25 Feb 2015 08:04:59 +0000 (08:04 +0000)]
Merge "Updated Json Stream Writer to use gson JsonWriter."

9 years agoMerge "Fix supporting-node in topology model so it can actually be used."
Robert Varga [Wed, 25 Feb 2015 06:07:52 +0000 (06:07 +0000)]
Merge "Fix supporting-node in topology model so it can actually be used."

9 years agoFix supporting-node in topology model so it can actually be used. 75/15475/2
Ed Warnicke [Wed, 18 Feb 2015 19:09:39 +0000 (12:09 -0700)]
Fix supporting-node in topology model so it can actually be used.

supporting-node in the topology model *only* has a node-ref
The node-ref is a leafref, which only provides the node-id
for the node.  Since we have no notion of what topology the supporting node
is in, we can't find it.

Change-Id: Ibc5829a45d97bb5a95abee07b397447a4cd509e0
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoBug 2361: Added meta-level SPI for building any statement-based models. 66/15166/12
Tony Tkacik [Wed, 11 Feb 2015 20:28:37 +0000 (21:28 +0100)]
Bug 2361: Added meta-level SPI for building any statement-based models.

This meta-level SPI is designed for components, which introduces
support for conrete statements, identifier namespaces or effective
model inference to the YANG parser.

Change-Id: Iff35085fa5a44568c449a5e1e34ee371768dd88b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 2497: Added YIN Export for Effective Schema Context. 58/15258/7
Tony Tkacik [Thu, 29 Jan 2015 17:16:53 +0000 (18:16 +0100)]
Bug 2497: Added YIN Export for Effective Schema Context.

Added initial implementation of YIN schema export,
which uses current Schema Context and effective API
to infer model.

Once the parser will be updated to preserve declared model,
this implementation will be hugely simplified only to subset
of current implemention - which is implementation
of StatementTextWriter interface.

Change-Id: I2c57ab90b6cb9f42c6156253c8600709c19b349e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 2444: Added concrete API definitions for YANG statements."
Robert Varga [Wed, 18 Feb 2015 13:45:38 +0000 (13:45 +0000)]
Merge "Bug 2444: Added concrete API definitions for YANG statements."

9 years agoFix maven plugin not recognizing transitive interfaces 59/15459/1
Robert Varga [Wed, 18 Feb 2015 10:46:51 +0000 (11:46 +0100)]
Fix maven plugin not recognizing transitive interfaces

An implenter does not need to directly implement the interface, but can
rely on it being captured somewhere else. Instead of custom magic, use
Class.isAssignableFrom() to check for compatibility.

Change-Id: I1e21b9880eb0a48bbe6027518cea39fef13b6ec6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2444: Added concrete API definitions for YANG statements. 78/14678/12
Tony Tkacik [Thu, 29 Jan 2015 16:39:25 +0000 (17:39 +0100)]
Bug 2444: Added concrete API definitions for YANG statements.

Introduced type captures of DeclaredStatement for RFC6020 statments
along with some convenience getters to decrease need of users
to look up statements in collections.

This getters conveys RFC6020 semantic, but does not prevent
access to any statements which may be introduced in later
versions of YANG.

Change-Id: I7ca3265aa7fc141446515e27f02c37ff3b5903dc
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-2179: split logging out of CodeGenerator 88/15388/5
Robert Varga [Mon, 16 Feb 2015 22:10:12 +0000 (23:10 +0100)]
BUG-2179: split logging out of CodeGenerator

Currently SPI requires downstream users to import maven infrastructure
even if they are not using it. Split the two maven-related injection
methods into dedicated interfaces.

MavenLogAware is automatically deprecated, as maven 3.1+ works with
slf4j out of the box, hence Log injection is no longer needed.

Change-Id: Ibedc158d9bdbcf66c2df94fd578929729fa26821
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2179: remove plexus-slf4j-logging 86/15386/3
Robert Varga [Mon, 16 Feb 2015 21:46:01 +0000 (22:46 +0100)]
BUG-2179: remove plexus-slf4j-logging

Maven 3.1.1 already supports slf4j as its native logging API, no need to
pull in the bridge.

Change-Id: Ia436a7e806aba46290c46d8389eb8d017b78f512
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Update Objects->MoreObjects"
Tony Tkacik [Mon, 16 Feb 2015 14:55:57 +0000 (14:55 +0000)]
Merge "Update Objects->MoreObjects"

9 years agoMerge "Do not override inherited groupId"
Tony Tkacik [Mon, 16 Feb 2015 14:55:50 +0000 (14:55 +0000)]
Merge "Do not override inherited groupId"

9 years agoUpdated Json Stream Writer to use gson JsonWriter. 74/13574/14
Peter Kajsa [Thu, 11 Dec 2014 15:43:02 +0000 (16:43 +0100)]
Updated Json Stream Writer to use gson JsonWriter.

Custom implementation of JSON writing methods has been replaced with native
com.google.gson.stream.JsonWriter methods. Among other things, this rework
resolves issues (bugs) with escape characters in string values being written
into Json (e.g. new lines in strings etc.).

Important notice: com.google.gson.stream.JsonWriter enforces that output
must start with '{' and end with '}', otherwise
'java.lang.IllegalStateException:Nesting problem' is thrown.

So our original output looks for an example like:
"my-module:top-container": {
...
}

Now, new output looks as following:
{
  "my-module:top-container": {
  ...
  }
}
.

Change-Id: I8073285d003015721d54887ddbff0484d7db89c8
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
9 years agoMerge "Bug 2512: Added skeleton of Statement Source APIs."
Tony Tkacik [Mon, 16 Feb 2015 09:46:55 +0000 (09:46 +0000)]
Merge "Bug 2512: Added skeleton of Statement Source APIs."

9 years agoUpdate Objects->MoreObjects 29/15329/3
Robert Varga [Sat, 14 Feb 2015 20:34:11 +0000 (21:34 +0100)]
Update Objects->MoreObjects

Guava 18 introduces MoreObjects so it does not clash on naming with
Java7 or later. Also migrate Objects.equal() to Objects.equals().

Change-Id: I467c27b4f3a25c98df68facd9f9a566126c99096
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoDo not override inherited groupId 28/15328/2
Robert Varga [Sat, 14 Feb 2015 20:33:32 +0000 (21:33 +0100)]
Do not override inherited groupId

Change-Id: I09c0e23d3a7991c8068e36b23270cc631de11c5e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Remove features-builder"
Tony Tkacik [Mon, 16 Feb 2015 09:42:54 +0000 (09:42 +0000)]
Merge "Remove features-builder"

9 years agoMerge "Add a warning about features-test being moved"
Tony Tkacik [Mon, 16 Feb 2015 09:21:20 +0000 (09:21 +0000)]
Merge "Add a warning about features-test being moved"

9 years agoMerge "Remove xtend.version definition"
Tony Tkacik [Mon, 16 Feb 2015 09:21:13 +0000 (09:21 +0000)]
Merge "Remove xtend.version definition"

9 years agoBug 2512: Added skeleton of Statement Source APIs. 65/15165/7
Tony Tkacik [Wed, 11 Feb 2015 20:31:40 +0000 (21:31 +0100)]
Bug 2512: Added skeleton of Statement Source APIs.

Introduces StatementStreamSource and StatementWriter,
in order to support any YANG statement-based serialization
of YANG model without requiring concrete statement model.

This allows common APIs for YANG text and YIN XML parsers
in order to produce enough information to infer effective
model.

Change-Id: Ia1237d0c1969dd81e5b6729eda6ed895fd5db819
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoRemove <repositories> and <pluginRepositories> sections 78/15178/2
Thanh Ha [Wed, 11 Feb 2015 23:25:03 +0000 (18:25 -0500)]
Remove <repositories> and <pluginRepositories> sections

It is recommended that developers and servers configure this locally via
settings.xml.

https://lists.opendaylight.org/pipermail/discuss/2015-January/004482.html

Change-Id: Ifc89c520b593abedaca80be3706775bef747db15
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
9 years agoRemove features-builder 74/15274/2
Robert Varga [Fri, 13 Feb 2015 18:40:34 +0000 (19:40 +0100)]
Remove features-builder

The functionality has been moved to odlparent, so there's no need to
retain it here.

Change-Id: I270f3e1aa1e9a1c69e744c4df1ffd97996f66188
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd a warning about features-test being moved 73/15273/3
Robert Varga [Fri, 13 Feb 2015 18:37:26 +0000 (19:37 +0100)]
Add a warning about features-test being moved

We have migrated the code away and will be killing this one in Lithium.

Change-Id: I204ee8e33179772853d8bf2eb914e418191df94c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemove xtend.version definition 27/15327/1
Robert Varga [Sat, 14 Feb 2015 20:04:26 +0000 (21:04 +0100)]
Remove xtend.version definition

There is no longer a need for it.

Change-Id: I244c1a09d1a7ff065b9cd21751fbce31d87768e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFixup build failures introduced by guava 18 12/15312/2
Robert Varga [Sat, 14 Feb 2015 07:45:08 +0000 (08:45 +0100)]
Fixup build failures introduced by guava 18

This fixes the fallout from the version skew.

Change-Id: I8678102ce3eda0f5904c9551eb4f4f83bc1b9480
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 2512: Initial design of YANG statement meta-model."
Robert Varga [Fri, 13 Feb 2015 18:22:46 +0000 (18:22 +0000)]
Merge "Bug 2512: Initial design of YANG statement meta-model."

9 years agoBug 2512: Initial design of YANG statement meta-model. 77/14677/9
Tony Tkacik [Thu, 29 Jan 2015 16:37:09 +0000 (17:37 +0100)]
Bug 2512: Initial design of YANG statement meta-model.

Analysis of several new functional requirements for YANG parser,
showed  need to define meta-model of YANG model, which
could be used for transformation and processing of different YANG model
serialization formats (YANG text and YIN).

This new model introduces additional concept from YANG:

  - Statement
     - DeclaredStatement
     - EffectiveStatement
  - StatementDefinition
  - IdentifierNamespace

This basic building blocks allow us to describe with these APIs
any YANG statement model, which may be introduced down the line
in form of YANG extensions or updates to YANG specification,
which does not affect statement principle.

Change-Id: I9d42eaeba41fc388ed84dc7071d8e38755daab5d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG 2413 - tracking in yang grouping"
Tony Tkacik [Fri, 13 Feb 2015 14:39:37 +0000 (14:39 +0000)]
Merge "BUG 2413 - tracking in yang grouping"

9 years agoMerge "BUG 2307: Filtering proxy for Schema context functionality"
Tony Tkacik [Fri, 13 Feb 2015 09:02:54 +0000 (09:02 +0000)]
Merge "BUG 2307: Filtering proxy for Schema context functionality"

9 years agoBUG 2307: Filtering proxy for Schema context functionality 97/14597/9
Marian Dubai [Thu, 29 Jan 2015 09:29:51 +0000 (10:29 +0100)]
BUG 2307: Filtering proxy for Schema context functionality

Change-Id: If4c2231993ae70144f677625df100fa078695863
Signed-off-by: Marian Dubai <mdubai@cisco.com>
9 years agoMerge "Migrate to use odlparent features-test"
Tony Tkacik [Thu, 12 Feb 2015 17:36:59 +0000 (17:36 +0000)]
Merge "Migrate to use odlparent features-test"

9 years agoMerge "Remove repository declaration"
Tony Tkacik [Thu, 12 Feb 2015 17:36:02 +0000 (17:36 +0000)]
Merge "Remove repository declaration"

9 years agoMigrate to use odlparent features-test 62/14162/3
Robert Varga [Thu, 15 Jan 2015 02:16:29 +0000 (03:16 +0100)]
Migrate to use odlparent features-test

The code from features-test has been migrated over to odlparent. This
patch makes sure we use that artifact instead of the yangtools-provided
one.

Change-Id: I15b92ed55b838a85e9787f69d4647693a551f461
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 2624 - XXX.getQName() should return namespace of module to which XXX 41/15141/1
Peter Kajsa [Wed, 11 Feb 2015 12:53:12 +0000 (13:53 +0100)]
Bug 2624 - XXX.getQName() should return namespace of module to which XXX
belongs.

For more information, please see the Bug 2624.

Change-Id: I47bdc55bb90ad91a31110f9edfa842a39bcdf9ec
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
9 years agoMerge "Make JSON serializer always serialize empty containers"
Tony Tkacik [Tue, 10 Feb 2015 12:40:03 +0000 (12:40 +0000)]
Merge "Make JSON serializer always serialize empty containers"

9 years agoMake JSON serializer always serialize empty containers 06/15106/1
Maros Marsalek [Tue, 10 Feb 2015 12:08:23 +0000 (13:08 +0100)]
Make JSON serializer always serialize empty containers

Even if their presence is not required

Change-Id: I5913a3a07d39be14391488ae88f0243c0c7189d3
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG 2413 - tracking in yang grouping 00/15100/1
Vaclav Demcak [Tue, 10 Feb 2015 08:52:48 +0000 (09:52 +0100)]
BUG 2413 - tracking in yang grouping

Change-Id: I284006a735c711ff9faf4d9e953906bb8f21fa06
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
9 years agoRemove repository declaration 71/15071/2
Robert Varga [Mon, 9 Feb 2015 15:52:36 +0000 (16:52 +0100)]
Remove repository declaration

Repositories are managed by settings.xml, so remove them from parent.

Change-Id: I5e377c5c3601ef3988c8397311fb120864cda4f1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMark yang generated source location as a source directory. 87/15087/2
Nathan Harmon [Mon, 9 Feb 2015 21:19:39 +0000 (13:19 -0800)]
Mark yang generated source location as a source directory.

Change-Id: I958affa226e9e34a795ffea42450976ca9ef4697
Signed-off-by: Nathan Harmon <nathan.harmon@hp.com>
9 years agoMake dependencyManagement mandatory 99/15099/1
Robert Varga [Tue, 10 Feb 2015 07:09:02 +0000 (08:09 +0100)]
Make dependencyManagement mandatory

Activating on existence of src/main/yang leads to different things being
defined when this pom is used in build vs. offlne.

Change-Id: I86cf9b2e9fc77fcad1c3868137eec5082766ae90
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRemoved unused dependency on yang-binding from yang-model-util 61/15061/1
Tony Tkacik [Mon, 9 Feb 2015 08:21:58 +0000 (09:21 +0100)]
Removed unused dependency on yang-binding from yang-model-util

Change-Id: I73275351cf6736a5bf881533f8633c2137ab245a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoAdd notification support to SchemaTracker 47/14547/2
Maros Marsalek [Tue, 27 Jan 2015 16:39:09 +0000 (17:39 +0100)]
Add notification support to SchemaTracker

This allows serialization of notification from NormalizedNode writer

Change-Id: Id3fdf415aef7ceae271bbc187ba578f37434e90b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoFix possible null pointer in NormalizedNode XML stream writer 46/14546/2
Maros Marsalek [Wed, 21 Jan 2015 13:28:39 +0000 (14:28 +0100)]
Fix possible null pointer in NormalizedNode XML stream writer

Change-Id: Ifc768335f54ce4110e54b094da4809716fdc7618
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Introduce javax.annonations to concepts"
Tony Tkacik [Thu, 5 Feb 2015 09:56:40 +0000 (09:56 +0000)]
Merge "Introduce javax.annonations to concepts"

9 years agoMerge "Document the Path concept."
Tony Tkacik [Thu, 5 Feb 2015 09:56:31 +0000 (09:56 +0000)]
Merge "Document the Path concept."

9 years agoMerge changes I7aea2237,Ie8e125e5
Tony Tkacik [Thu, 5 Feb 2015 09:51:22 +0000 (09:51 +0000)]
Merge changes I7aea2237,Ie8e125e5

* changes:
  Remove ietf-netconf
  Eliminate unused pluginManagement section

9 years agoMerge changes Id14ebb05,I2a431693
Tony Tkacik [Thu, 5 Feb 2015 09:49:41 +0000 (09:49 +0000)]
Merge changes Id14ebb05,I2a431693

* changes:
  Add copyright header and fix whitespace
  Fix lifecycle mapping errors in eclipse