mdsal.git
8 years agoBug 4638: Fixed incorrect type derivation in case of keys. 32/30432/1
Tony Tkacik [Tue, 1 Dec 2015 12:40:47 +0000 (13:40 +0100)]
Bug 4638: Fixed incorrect type derivation in case of keys.

Change-Id: I6f03672f2a00569573ba15c551ea4bd946b531a2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-4638: fix up union type definition compatibility 32/30032/15
Robert Varga [Sat, 21 Nov 2015 00:36:52 +0000 (01:36 +0100)]
BUG-4638: fix up union type definition compatibility

Deal with UnionTypes, which need to be instantiated with base YANG
namespace. Also rework reference types to resolve only at base type, to
get accurate namespace resolution.

Change-Id: Iffd590668262f7e233d93302403d179e532fe4a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: fix resultion of leaf-list typedefs 50/30050/6
Robert Varga [Sun, 22 Nov 2015 21:43:55 +0000 (22:43 +0100)]
BUG-4638: fix resultion of leaf-list typedefs

Old parser's use of ExtendedType masked this fall-through, which should
execute only for the base type.

Change-Id: I97d0ade6ede02be8872db214ca7e6f72e3b0e23f
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4638: fix UnionTypeCodec 41/30041/8
Robert Varga [Sat, 21 Nov 2015 17:59:03 +0000 (18:59 +0100)]
BUG-4638: fix UnionTypeCodec

The codec should be checking for UnionTypeDefinition, not UnionType.

Change-Id: I6a4ca9070c068451d16008c6b258d212319d363e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4638: fix decimal restrictions 40/30040/8
Robert Varga [Sat, 21 Nov 2015 17:43:12 +0000 (18:43 +0100)]
BUG-4638: fix decimal restrictions

We need to special-case the handling of decimal64, which the new parser
emits as a base type even when the model specifies non-default
restrictions.

Change-Id: I6a905d53e488f7a0dc50188ab9c67c9d7367b4e5
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4638: Fix construction 31/30031/9
Robert Varga [Sat, 21 Nov 2015 00:04:09 +0000 (01:04 +0100)]
BUG-4638: Fix construction

Do not rely on ExtendedType checks and make sure to resolve proper leaf
type.

Change-Id: Icac903130289e02fb7b1d078867d1320ae642bab
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: use universal checks for base integers 30/30030/7
Robert Varga [Fri, 20 Nov 2015 23:58:09 +0000 (00:58 +0100)]
BUG-4638: use universal checks for base integers

Rather than relying on concrete classes, use schema path based checks
exposed by model.util.type.BaseTypes.

Change-Id: Ia5fd5d908df4db194513f94e6aa93dcbec296760
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: fix union type generation 27/30027/9
Robert Varga [Fri, 20 Nov 2015 23:13:10 +0000 (00:13 +0100)]
BUG-4638: fix union type generation

Various places should not rely on UnionType, but should check for
UnionTypeDefinition.

Change-Id: Id75a4b5eee49faed61ed311c79bb847e05f77dd7
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: fix javaTypeForSchemaDefinitionRestrictedExtTypeTest 26/30026/8
Robert Varga [Fri, 20 Nov 2015 22:58:36 +0000 (23:58 +0100)]
BUG-4638: fix javaTypeForSchemaDefinitionRestrictedExtTypeTest

The test assumes all ranges are on BigIntegers. That is not true with
new model.util.type types, as these use smaller constraints. Fix the
test.

Change-Id: Id132213d19f012f1277633d78aa233612ad8b0a5
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: fix typedefToGeneratedType() 25/30025/8
Robert Varga [Fri, 20 Nov 2015 22:54:41 +0000 (23:54 +0100)]
BUG-4638: fix typedefToGeneratedType()

New parser does not generated ExtendedTypes. Since the callsite is all
about type definitions, it is safe to change that check to a check if
the provided type definitions has a base type.

Change-Id: I39d67b7d4d431c1cc8b212cc81597d667b20a734
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: fix javaTypeForSchemaDefinitionType() 24/30024/7
Robert Varga [Fri, 20 Nov 2015 22:39:36 +0000 (23:39 +0100)]
BUG-4638: fix javaTypeForSchemaDefinitionType()

Rework generation to not check for ExtendedType, but rather reorder the
checks. We first deal with leafrefs/identityrefs. Then we deal with base
types. Once we have cleared those, we know we are dealing with a derived
type, no matter how it is expressed.

Change-Id: I7c0f9f18cdee7f6159b6d4b92f9bccb7682b6f6e
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: fix Restrictions 23/30023/6
Robert Varga [Fri, 20 Nov 2015 22:13:51 +0000 (23:13 +0100)]
BUG-4638: fix Restrictions

This fixes up the implementation to pick up restrictions from other
types than ExtendedType.

Change-Id: I9fb8125c07fdfeb3905df551ab6424c08624e0a7
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: fix resolveLeafSchemaNodeAsMethod() 10/30010/7
Robert Varga [Fri, 20 Nov 2015 17:27:36 +0000 (18:27 +0100)]
BUG-4638: fix resolveLeafSchemaNodeAsMethod()

Deal with new parser's way of emitting types for leaf and not using
ExtendedType. Backward compatibility with the old parser is maintained.

For new parser, the input into code generation will change in case an
the leaf defines a default value: the type will have a default value and
its schema path will match the leaf.

Code generation will need to deal with this and emit the same code
snippets, effectively fudging the inner restricted type. That will be
addressed in a follow-up patch.

Change-Id: If66305d2716a138628ba84e651bb280d588cb773
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4638: eliminate ExtendedType check 98/29998/15
Robert Varga [Wed, 18 Nov 2015 20:24:23 +0000 (21:24 +0100)]
BUG-4638: eliminate ExtendedType check

generatedTypeForExtendedDefinitionType() is called for extended types
only, eliminate the explicit check to make it work with new parser.

Change-Id: Ic4fb2e67dbfdffdc31785ac2ef7c213445e04cd9
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoUse odlparent-lite as artifacts parent 42/30342/1
Thanh Ha [Sun, 29 Nov 2015 22:10:33 +0000 (17:10 -0500)]
Use odlparent-lite as artifacts parent

We created odlparent-lite to provide a minimal pom which allows projects
to publish to the correct server. Without this ${project}-artifacts may
fail to deploy to Nexus.

Change-Id: Ie551d56f4378b1242f20f73244d2dd09e6e6469f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoAdd DOM entity ownership interfaces 64/27664/10
Tom Pantelis [Mon, 28 Sep 2015 14:34:16 +0000 (10:34 -0400)]
Add DOM entity ownership interfaces

Change-Id: I7416d28efdfd10cad6468087f96765baa412ca13
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoAdd binding entity ownership interfaces 62/27662/13
Tom Pantelis [Mon, 28 Sep 2015 11:27:41 +0000 (07:27 -0400)]
Add binding entity ownership interfaces

Change-Id: Ie79ae7a8a7df24b9f8869720dbe7ae6ae7555876
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBUG-4658: fix test to account to BooleanType default 43/30043/3
Robert Varga [Sat, 21 Nov 2015 20:30:15 +0000 (21:30 +0100)]
BUG-4658: fix test to account to BooleanType default

BooleanType does not have a default value, adjust test to take that into
account.

Change-Id: Ice2035738609a95100e52e0ff647cff6a97006b5
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4638: fix a test assertion 22/30022/4
Robert Varga [Fri, 20 Nov 2015 22:44:18 +0000 (23:44 +0100)]
BUG-4638: fix a test assertion

New parser does not generate ExtendedType instances, hence check for
existing base type instead.

Change-Id: I76240075ee44992e570df1478da05ca7704449ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoSimplify resolveLeafSchemaNodeAsMethod() logic 99/29999/6
Robert Varga [Fri, 20 Nov 2015 16:42:03 +0000 (17:42 +0100)]
Simplify resolveLeafSchemaNodeAsMethod() logic

The logic is deeply nested, with unclear dependencies. Refactor it to
make the flow more linear.

Change-Id: I5f408271399b99f63aeb8dec5cfcfdba144f8c14
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix GeneratedTypesBitsTest 97/29997/5
Robert Varga [Fri, 20 Nov 2015 16:39:39 +0000 (17:39 +0100)]
Fix GeneratedTypesBitsTest

GeneratedTypesBitsTest inverts actual and expected values, leading to
confusion when these fail.

Change-Id: Ie689e945e905c56bd3c5a878270c73322591a28f
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 4648: Use interface instead of implementation class. 70/29970/2
Tony Tkacik [Fri, 20 Nov 2015 10:05:15 +0000 (11:05 +0100)]
Bug 4648: Use interface instead of implementation class.

Change-Id: Ie38bf629d962e35df81fb831027e1341eaba61b2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoFixed incorrect default values in isis-topology. 69/29969/2
Tony Tkacik [Fri, 20 Nov 2015 10:01:58 +0000 (11:01 +0100)]
Fixed incorrect default values in isis-topology.

Change-Id: I64e3b1b1d5d1c306921da9157fd7a528e6c26e65
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoMake methods static 90/29890/4
Robert Varga [Wed, 18 Nov 2015 20:24:23 +0000 (21:24 +0100)]
Make methods static

wrapJavaTypeIntoTO() and resolveRegExpressionsFromTypedef()
can be made static.

Change-Id: I1127effa8809bb4c22f10b48f2798c819814195f
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoFix a static call warning 27/29827/4
Robert Varga [Tue, 17 Nov 2015 17:49:25 +0000 (18:49 +0100)]
Fix a static call warning

Since we are binding to a specific implementation, we can invoke the
method statically.

Change-Id: Id5528684f5ac47f8a1e120e4c65a57c32abfe28e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoUse a singleton comparator for Bits 24/29824/4
Robert Varga [Tue, 17 Nov 2015 17:07:23 +0000 (18:07 +0100)]
Use a singleton comparator for Bits

Instead of instatiating a comparator each time we need it, use a
constant instance.

Change-Id: I10125796cd00c5990013af153581db3846199616
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoUse Strings.isNullOrEmpty() 23/29823/4
Robert Varga [Tue, 17 Nov 2015 17:01:37 +0000 (18:01 +0100)]
Use Strings.isNullOrEmpty()

Instead of open-coding the check, use the library.

Change-Id: Idbb42a140e3a52fa3d3b131bd1d674270bd02abd
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoAdd common entity ownership interfaces 20/27620/15
Tom Pantelis [Mon, 28 Sep 2015 04:41:37 +0000 (00:41 -0400)]
Add common entity ownership interfaces

Added genericized entity ownership interfaces that are common between
the DOM and binding interfaces.

The instance identifier type in Entity is what differs between DOM and binding
but it's referenced in most the classes. For the classes that were
genericized, I prefixed then with "Generic" for lack of another/better
name. The intent is to keep the previous class names for the binding
versions (eg Entity, EntityOwnershipService etc), as they will be used most
commonly, and prefix the DOM versions with "DOM" to be consistent with other
md-sal APIs (eg DataBroker). The common classes for the data broker are
prefixed with "Async" but that doesn't really mean anything here so I went
with "Generic".

The other option is to keep the previous class names for the common API
and prefix the derived classes with "Binding" and "DOM" appropriately.
But we've tried to hide the binding concept as mauch as possible so
prefixing with "Binding" would add noise.

Change-Id: I00013f61f7c848c99fdc30740c8ab323448cc976
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFixed NPE in LeafNodeCodecContext.domValueFromString 64/29864/2
Tony Tkacik [Wed, 18 Nov 2015 15:01:36 +0000 (16:01 +0100)]
Fixed NPE in LeafNodeCodecContext.domValueFromString

Change-Id: I089efca778430fd04a53de6e5a025564317acd62
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 4322: return default valued-object 46/29846/3
Igor Foltin [Wed, 18 Nov 2015 09:54:26 +0000 (10:54 +0100)]
Bug 4322: return default valued-object

Fixed the problem with BitsCodec.deserialize
which was reported after merging following patch
https://git.opendaylight.org/gerrit/#/c/28251/

Fixed up tests to reflect fix of Bug 4645 in YangTools.

Change-Id: I59e76c82c1923f33caebf9b3dc7bbbff47505930
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoDo not rely on ExtendedType when looking for the base type 20/29820/2
Robert Varga [Tue, 17 Nov 2015 16:31:34 +0000 (17:31 +0100)]
Do not rely on ExtendedType when looking for the base type

A base type can be recognized as having its base type null, use that
indicator instead of specific implementation class. Also change the
implementation to use a simple loop instead of recursion.

Change-Id: Iff3e78c618bcbb7a33ae7335ea3bafe7cdf203a6
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoDo not import BindingGeneratorUtil.packageNameForGeneratedType() 19/29819/2
Robert Varga [Tue, 17 Nov 2015 14:37:29 +0000 (15:37 +0100)]
Do not import BindingGeneratorUtil.packageNameForGeneratedType()

This method is polymorphic, with one of its flavors being deprecated.
Silence a deprecation warning by not using a static import.

Change-Id: Ia4cc4cd2aeef003e047f4ae0729f51de958a152a
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoDo not use EnumerationType in BindingRuntimeContext 13/29813/2
Robert Varga [Tue, 17 Nov 2015 12:41:39 +0000 (13:41 +0100)]
Do not use EnumerationType in BindingRuntimeContext

This is a preparatory patch, which makes handling of enumerations based
on interfaces rather than a deprecated implementation.

Change-Id: I0b2f610d63df2f4151d620e1e7638b8bf01b9b36
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoDo not use SchemaPath.getPath() 12/29812/2
Robert Varga [Tue, 17 Nov 2015 12:31:05 +0000 (13:31 +0100)]
Do not use SchemaPath.getPath()

Use SchemaPath.getPathFromRoot() instead.

Change-Id: Ic7b7ede59dbe8826197e1e131be855590d0a3d98
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4322: return default valued-object 51/28251/11
Igor Foltin [Tue, 3 Nov 2015 07:17:56 +0000 (08:17 +0100)]
BUG-4322: return default valued-object

This patch modifies DataObjectCodecContext to return a default value
generated from the 'default' statement when a request is made for a
field which is not present in NormalizedNodes.

That has the effect of leaves with default value being seen as set to
the default value.

Added unit tests.

Change-Id: I99c97d796a9b32557955c4b0bd95d0051ab56f5c
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoSpeed up BindingGeneratorUtil.makeSerializable() 50/29350/3
Robert Varga [Tue, 3 Nov 2015 21:35:36 +0000 (22:35 +0100)]
Speed up BindingGeneratorUtil.makeSerializable()

Instead of performing lookup on every call, use a thread-local instance
which can be reused.

Change-Id: I45e7170bcfe06bb76f87d723a703f9849e9da4a3
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoSpeed TypeProviderImpl up a bit 49/29349/3
Robert Varga [Tue, 3 Nov 2015 21:34:43 +0000 (22:34 +0100)]
Speed TypeProviderImpl up a bit

Perform defensive checks before performing expensive computation. Also
make private methods static as appropriate.

Change-Id: I649b1d5ea4cac5c1617036e9e074f5a123bfc602
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse a dedicated typedef resolver 48/29348/3
Robert Varga [Mon, 2 Nov 2015 16:24:50 +0000 (17:24 +0100)]
Use a dedicated typedef resolver

DataNodeIterator is excessively expensive for extraction of a list of
typedefs. Create a dedicated class to do that.

Change-Id: Ibf980bfe85113b5d996754c4ba6e32fd14d5ab69
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 4360: Removed incorrect precondition for class nesting. 98/29598/1
Tony Tkacik [Thu, 12 Nov 2015 14:21:48 +0000 (15:21 +0100)]
Bug 4360: Removed incorrect precondition for class nesting.

Change-Id: I665c89934872f0685d594631d0e81db4a4413284
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoGenerate sources to target/generated-classes/mdsal-binding 39/27339/3
Tony Tkacik [Wed, 23 Sep 2015 09:33:21 +0000 (11:33 +0200)]
Generate sources to target/generated-classes/mdsal-binding

Change-Id: Ibb49339b58d7fee5f2b301a2e71d9500d893d923
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoRevert "Bug 1672: Generated javadoc contains symbols of javadoc comment tags" 12/29512/1
Robert Varga [Tue, 10 Nov 2015 18:19:50 +0000 (18:19 +0000)]
Revert "Bug 1672: Generated javadoc contains symbols of javadoc comment tags"

This reverts commit 8d273cee83b985508fb231617f3cd23d121d38eb, as it looks like it broke controller.

Change-Id: I679ae4dac8bdf5a838ad8babfcf451958fbda904
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 1672: Generated javadoc contains 35/26235/6
Igor Foltin [Mon, 28 Sep 2015 14:08:43 +0000 (16:08 +0200)]
Bug 1672: Generated javadoc contains
symbols of javadoc comment tags

Fixed encoding of html tags
and yang description in generated
javadoc comments.

Change-Id: Ic0512287345bc633c36325217e89aa9726a4056b
Signed-off-by: Igor Foltin <igor.foltin@pantheon.sk>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBug 1435: Introduced DOM Data Commit Cohort & Validation APIs 81/29181/4
Tony Tkacik [Tue, 3 Nov 2015 11:57:03 +0000 (12:57 +0100)]
Bug 1435: Introduced DOM Data Commit Cohort & Validation APIs

Introduced DOM Data Broker level APIs for 3PC commit cohorts
and utility abstract class for implementing Data Tree validator.

Change-Id: I54ca7e022f8dee278c8cd9156514b62dd37cfc97
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoFix for unknown statements used without prefix 50/29250/2
Martin Ciglan [Wed, 4 Nov 2015 10:36:18 +0000 (11:36 +0100)]
Fix for unknown statements used without prefix
in tested YANG models.

Change-Id: I4d40be3785320a7d1be66fb5b77f25171998fc89
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoBug 4570: Test fix after automatic removal of empty non-presence containers 32/29132/1
Peter Kajsa [Mon, 2 Nov 2015 13:50:22 +0000 (14:50 +0100)]
Bug 4570: Test fix after automatic removal of empty non-presence containers

Some tests in mdsal failed after automatic removal of empty non-presence containers
introduced by this patch set:
https://git.opendaylight.org/gerrit/#/c/17030/26

Change-Id: I7cd53986cf33daf35c4a3cbe96a4343ad5e40313
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoUpgrade upstream versions 23/27723/5
Stephen Kitt [Thu, 1 Oct 2015 08:06:17 +0000 (10:06 +0200)]
Upgrade upstream versions

Where possible rely on odlparent:
* maven.javadoc.version
* xmlunit
* javassist
* xml-apis
* osgi-core
* javax.ws.rs-api
* reporting configuration

Update the following dependencies:
* maven-verifier 1.5 -> 1.6
* groovy 2.1.6 -> 2.4.5
* maven-core, maven-plugin-api 3.1.1 -> 3.3.3
* xtend 2.7.3 -> 2.8.4
* jersey-client 2.0 -> 2.22
* com.lmax:disruptor 3.3.0 -> 3.3.2
* build-helper-maven-plugin 1.8 -> 1.9.1
* plexus-container-default 1.5.6 -> 1.6

Drop equinoxSDK381:org.eclipse.osgi which appears to no longer be
necessary.

Change-Id: Ia97ee869f0018ea4c1a14352f11c8898fe0968eb
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoBug890 - Adding ietf-inet-types 2013-07-15 yang model 99/27799/9
Wojciech Dec [Fri, 2 Oct 2015 09:55:11 +0000 (11:55 +0200)]
Bug890 - Adding ietf-inet-types 2013-07-15 yang model

Change-Id: I195646ee95dd8b3e6b4a39b773e5eb6c462fe0ca
Signed-off-by: Wojciech Dec <wdec@cisco.com>
8 years agoUse Objects.hashCode()/equals() in generated DTOs 50/28250/3
Robert Varga [Sat, 10 Oct 2015 13:22:12 +0000 (15:22 +0200)]
Use Objects.hashCode()/equals() in generated DTOs

Using java.util.Objects reduces complexity of generated code, leading to
leaner class files.

Change-Id: I941ede7cf9f60a9372864048bccdbb1650d2f5cf
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoRemove default BindingGeneratorImpl constructor 10/27610/3
Robert Varga [Tue, 29 Sep 2015 18:57:43 +0000 (20:57 +0200)]
Remove default BindingGeneratorImpl constructor

The default verbose constructor has been deprecated in Lithium, remove
it.

Change-Id: Ib54981b117ea1557138ab1820f6f41b7766973cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix various eclipse warnings 09/27609/3
Robert Varga [Tue, 29 Sep 2015 19:07:48 +0000 (21:07 +0200)]
Fix various eclipse warnings

Raw types and method which could be static.

Change-Id: I19dcd742674944877f4b7b53d11068f630c826db
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoCleanup whitespace/formatting in codecs 52/28252/3
Robert Varga [Sat, 10 Oct 2015 17:05:21 +0000 (19:05 +0200)]
Cleanup whitespace/formatting in codecs

This is a drive-by cleanup of whitespace.

Change-Id: Ib691ab3a04ee25938d4c1bd670ae62a01162565a
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoDo not emit empty strings for Generated*BuilderImpl 35/27535/3
Robert Varga [Mon, 28 Sep 2015 13:48:50 +0000 (15:48 +0200)]
Do not emit empty strings for Generated*BuilderImpl

With a null argument, we can end up creating quite a few empty strings,
which end up being non-shared. Place an explicit check and return an
interned empty string instead.

Change-Id: I4fd9126c9502f2c80c76ca3bb38aa94a99d3ae4b
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoReuse attach-sources from odlparent 34/27534/3
Robert Varga [Thu, 24 Sep 2015 15:13:50 +0000 (17:13 +0200)]
Reuse attach-sources from odlparent

odlparent already defines these, no need to override.

Change-Id: Ied060b4f746f470cde8bd61178169f3ad60d06df
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoModuleInfoBackedContext uses YangTextSchemaResolver. 75/27975/2
Tony Tkacik [Tue, 6 Oct 2015 16:19:21 +0000 (18:19 +0200)]
ModuleInfoBackedContext uses YangTextSchemaResolver.

This removes locking from ModuleInfoBackedContext
and improves perforamance characteristic during
access from multiple threads.

Change-Id: I8c6c3d228fcdb384761185f5347cde284490fbde
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-4367 Make ModuleInfoBackedContext also a source provider 53/27653/3
Maros Marsalek [Wed, 30 Sep 2015 13:18:58 +0000 (15:18 +0200)]
BUG-4367 Make ModuleInfoBackedContext also a source provider

Change-Id: Ibf80071e4af4480a32e1c233738edfd4c866d450
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoFix maven-bundle-plugin not scanning transitive dependencies 31/27831/1
Robert Varga [Fri, 2 Oct 2015 16:10:12 +0000 (18:10 +0200)]
Fix maven-bundle-plugin not scanning transitive dependencies

New version of the plugin seems disregard the Embed-Transitive
directive, leading to a failure to inline needed packages. Fix this up
by explicitly specifying them as dependencies.

Change-Id: Id8275584b57a14444b632b64c33e8afa9a01e16b
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoWait for schemas when transforming BA->NormalizedNode 61/27661/2
Maros Marsalek [Wed, 30 Sep 2015 14:22:53 +0000 (16:22 +0200)]
Wait for schemas when transforming BA->NormalizedNode

If the transformation fails due to missing schema, codec tries to wait for
the models to become available. The assumption is that if there already are
the BA classes, its likely that the schemas will follow shortly.

This improvement should fix possible race conditions during ODL startup.

Change-Id: I101b77d6ca8f247c271bed0a18fff20de43c24bf
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoHandle null BindingRuntimeContext in BindingToNormalizedNodeCodec 10/27210/3
Tom Pantelis [Mon, 14 Sep 2015 10:55:43 +0000 (06:55 -0400)]
Handle null BindingRuntimeContext in BindingToNormalizedNodeCodec

In the getModuleBlocking method, if timing is right, runtimeContext may
be null when it is accessed to get the SchemaContext. It is set in the
onGlobalContextUpdated method which may not have been called yet prior
to getModuleBlocking. There's already code to wait for schema via the
futureSchema so it shold check for null runtimeContext as well. Also
runtimeContext shoild be volatile as it's accessed by multiple threads.

Change-Id: I335b0c359d58f3c58da34c7255b75ac793e49bd6
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoDo not emit unknown nodes into javadoc. 59/27659/2
Tony Tkacik [Wed, 30 Sep 2015 13:57:12 +0000 (15:57 +0200)]
Do not emit unknown nodes into javadoc.

Change-Id: I6b9ea2b752e07583ee48eda5705a03dbe96566c4
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoAdd generated yang dirs to .gitignore 07/27207/2
Tom Pantelis [Mon, 14 Sep 2015 10:17:37 +0000 (06:17 -0400)]
Add generated yang dirs to .gitignore

Change-Id: I283d9b5040840feb3287073cc14a33d8a0b9402c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 3654: Introduction of latest topology model 99/27599/5
Tony Tkacik [Tue, 29 Sep 2015 16:40:12 +0000 (18:40 +0200)]
Bug 3654: Introduction of latest topology model

Introduced latest revision of ietf-network model.

Change-Id: If83d5646c881c1cf1424317e75c5bd81c36e06dd
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 3670 (part 4/5 - mdsal): Use of new statement parser in yang-maven-plugin 04/27204/6
Peter Kajsa [Mon, 21 Sep 2015 13:04:18 +0000 (15:04 +0200)]
Bug 3670 (part 4/5 - mdsal): Use of new statement parser in yang-maven-plugin

Parser switch in mdsal:
- parser switch in ModuleInfoBackedContext

Yangtools retest:
- BUG-1485: remove deprecated range methods
- Mockito bug fix
- binding-generator-impl unit test switch to new statement parser
- null pointer in BindingGeneratorImpl fix

Change-Id: Iab1e130f29b98db95f842b2628b2a280f3cf26e0
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoIntern package names 60/27560/5
Robert Varga [Mon, 28 Sep 2015 21:02:51 +0000 (23:02 +0200)]
Intern package names

Analysis of a heap dump has shown that we are ending up with a lot of
duplicate strings containing generate Java code package names.
Instantiate an interner which normalize these to a single instance.

Change-Id: Id6faa0474ee5fe9417732a08ba6027f7e68fb5d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoDo not store code snippets in BindingRuntimeContext 59/27559/7
Robert Varga [Mon, 28 Sep 2015 20:29:22 +0000 (22:29 +0200)]
Do not store code snippets in BindingRuntimeContext

Analysis of a heap dump shows we retain a fair amount of strings which
represent the QNAME member of generated classes via ConstantImpl. This
should not be happening, as the logic to create QNames in generated
classes should be part of the templates and only emitted to source code.

Teach ClassTemplate how to generate QName constants and only store the
QName in the Constant, saving the overhead of Strings.

Change-Id: I41951f969e273bc2ef4527ef3d95d4bed45c1b7f
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBump xtend to 2.8.4 58/27558/6
Robert Varga [Mon, 28 Sep 2015 14:37:32 +0000 (16:37 +0200)]
Bump xtend to 2.8.4

Just a regular update.

Change-Id: I02caac3cedb20dd13c2802cc909081e1a1ae03f4
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3868: Introduction of DOM Cursor APIs. 05/25905/7
Tony Tkacik [Mon, 24 Aug 2015 19:41:43 +0000 (21:41 +0200)]
Bug 3868: Introduction of DOM Cursor APIs.

Change-Id: I722216172dcf4ee2b40f25daf4adf55d3ce3291f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoUse Objects.equals() 11/27511/1
Robert Varga [Sun, 27 Sep 2015 16:55:01 +0000 (18:55 +0200)]
Use Objects.equals()

This simplifies implementations of equals() method.

Change-Id: Ib58c7417607f85224ab6d452dab2a8aac604c055
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse Objects.hashCode() 02/27502/2
Robert Varga [Sun, 27 Sep 2015 13:27:55 +0000 (15:27 +0200)]
Use Objects.hashCode()

Instead of open0-coded conditionals, use the utility method, hence
making our code more linear.

Change-Id: I2fcfef8982aebe8e2c81bf8145fb35255591d688
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemoved DataChangeListener in favour of DataTreeChangeListener 50/27350/4
Tony Tkacik [Wed, 23 Sep 2015 12:51:00 +0000 (14:51 +0200)]
Removed DataChangeListener in favour of DataTreeChangeListener

DataChangeListener does not have place in new Beryllium APIs,
since it behaviour could be built on top of DataTreeChangeListener.

DataChangeListener concept will still reside in controller-provided
APIs, but not MD-SAL project APIs.

Change-Id: I1cbae306b76f4456cf93ec34e5e020e02aae8147
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoRenamed Data(ReadOnly|WriteOnly) to DataTree(Read|Write) 47/27347/4
Tony Tkacik [Wed, 23 Sep 2015 12:34:57 +0000 (14:34 +0200)]
Renamed Data(ReadOnly|WriteOnly) to DataTree(Read|Write)

Renamed interfaces and classes prefixed with Data
to DataTree and ommited Only, since new APIs does not
provide combitation of both behaviours.

Change-Id: I7e3377464659e2f902bb93e149a77d6184e72f46
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoRemoved ReadWriteTransaction concept from APIs. 45/27345/4
Tony Tkacik [Wed, 23 Sep 2015 12:21:23 +0000 (14:21 +0200)]
Removed ReadWriteTransaction concept from APIs.

Change-Id: I0cdbb4b67806eb0374acd679ded07e57b436b724
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoAdded type-safe DataObjectModification#getModifiedChildren 52/27352/5
Tony Tkacik [Wed, 23 Sep 2015 13:00:14 +0000 (15:00 +0200)]
Added type-safe DataObjectModification#getModifiedChildren

Change-Id: I0489a1dd41c825f74f9fc1f9c8af38ab8c5d8830
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 4301: Incorrect union generated code when using decimal64 75/27275/2
Martin Ciglan [Tue, 22 Sep 2015 12:51:25 +0000 (14:51 +0200)]
Bug 4301: Incorrect union generated code when using decimal64

Binding Java API Generator shouldn't generate getValue() method
for java.math BigDecimal & BigInteger types, representing
YANG decimal64 & uint64 types.

This is just a port from yangtools.

Change-Id: I8f50003296d1004f9799c96950f49b4a38732137
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoAdded create method to DataTreeIdentifier 43/27343/2
Tony Tkacik [Wed, 23 Sep 2015 12:00:49 +0000 (14:00 +0200)]
Added create method to DataTreeIdentifier

Change-Id: I96799fefa432392d5dfd441603d36cab922e2460
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 4327 - Fixed DataTreeChangeListener registration in PingPongDataBroker 64/27164/3
Michal Polkorab [Fri, 18 Sep 2015 14:10:59 +0000 (16:10 +0200)]
Bug 4327 - Fixed DataTreeChangeListener registration in PingPongDataBroker

 - delegate broker was incorrectly queried for DOMDataTreeChangeService
 - it must ask for supported extensions instead of instanceof

Change-Id: I0310926893fc517bb1e1dca48d4966d6ffc18c74
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
8 years agoBUG-2399: handle APPEARED/DISAPPEARED modification types 15/27215/1
Robert Varga [Mon, 21 Sep 2015 15:32:53 +0000 (17:32 +0200)]
BUG-2399: handle APPEARED/DISAPPEARED modification types

This adds support for handling the appeared/disappeared modification
types when instantiating a lazy data object.

Change-Id: I7a00d2c31dcc382b8b90d4a1125ec932e3075281
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-2399: take into account new ModificationTypes 08/27108/2
Robert Varga [Thu, 17 Sep 2015 03:39:35 +0000 (05:39 +0200)]
BUG-2399: take into account new ModificationTypes

APPEARED/DISAPPEARED changes may occur when structural containers come
and go. These should be treated as WRITE and DELETE for change
resolution purposes.

Change-Id: I22d7c76f149b8f72decb1c81ce960cd60ba8dc6c
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-865: remove the use of ModificationType.MERGE 06/27106/1
Robert Varga [Thu, 17 Sep 2015 03:33:45 +0000 (05:33 +0200)]
BUG-865: remove the use of ModificationType.MERGE

Change-Id: I5209acc1ec3165dc2d4e25851cfea50f91df524c
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4309: package iana-afn-safi 00/27100/1
Robert Varga [Thu, 17 Sep 2015 01:40:22 +0000 (03:40 +0200)]
BUG-4309: package iana-afn-safi

This fixes a failure to package iana-afn-safi.

Change-Id: I325561606a3f48e0e337f67c639011cf15cd63b7
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-865: remove use of deprecated APIs 99/26999/1
Robert Varga [Tue, 15 Sep 2015 04:56:12 +0000 (06:56 +0200)]
BUG-865: remove use of deprecated APIs

YANG parser is going to lose these, do not use them.

Change-Id: Id33e324ee0661902addb9537af34504b28d762e5
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemove duplicate dependency 98/26998/1
Robert Varga [Tue, 15 Sep 2015 04:55:55 +0000 (06:55 +0200)]
Remove duplicate dependency

Maven warns about it, remove it.

Change-Id: I6823d825a74679c66c7d2cdc08425ae8572ca6a8
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse odlparent configuration for jacoco 99/26299/3
Thanh Ha [Wed, 2 Sep 2015 02:58:42 +0000 (22:58 -0400)]
Use odlparent configuration for jacoco

Change-Id: Ic8c5e9730ea5f50e6b7ad1f345840de20cae7738
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoStore DOMDataTreeProducer in ShardingTable 44/26244/5
Tony Tkacik [Mon, 31 Aug 2015 16:11:22 +0000 (18:11 +0200)]
Store DOMDataTreeProducer in ShardingTable

Change-Id: I785c10c68eb5b5ce09d103685488c2965340d3d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoGeneralized ShardingTableEntry into generic 43/26243/5
Tony Tkacik [Mon, 31 Aug 2015 15:57:11 +0000 (17:57 +0200)]
Generalized ShardingTableEntry into generic

ShardingTableEntry was generalized into generic structure
which is indexed by YangInstanceIdentifier and may
store any arbitrary structure.

This allows for tree-base index not only of shards,
but also producers and listeners, which may be useful
during resharding operations.

Change-Id: Idde0cca1b0f4292bab0c06a0fede67fb25992e83
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 3868: Added support for bounding producers 36/26236/5
Tony Tkacik [Mon, 31 Aug 2015 14:01:29 +0000 (16:01 +0200)]
Bug 3868: Added support for bounding producers

ShardedDOMDataTree and ShardedDOMDataTreeProducer are updated
to support bounding of producers to listeners.

- Added simple loop detection for listener to not directly
listen on subtrees it is bound to.y

Change-Id: I1328a01a9629d4c7e7cab36acaf6082ba4bacb3d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 3868: Added support for DOMDataTreeListener 31/26231/5
Tony Tkacik [Mon, 31 Aug 2015 12:10:27 +0000 (14:10 +0200)]
Bug 3868: Added support for DOMDataTreeListener

Added really simplistic and naive implementation
for DOMDataTreeListener, which is just enough
to listen on underlying data store and capture
current state.

Implementation is synchronized and does not
survive resharding currently.

Added simple base unit test to test registration
fo listener and receiving data change events.

Change-Id: I07eded569207e93bb4bb311236261b5cb7982903
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 3869: Fixed ShardedDOMDataTree to adhere to API 18/26218/4
Tony Tkacik [Mon, 31 Aug 2015 08:59:12 +0000 (10:59 +0200)]
Bug 3869: Fixed ShardedDOMDataTree to adhere to API

ShardingTableEntry:
 - Replaced emptyMap with HashMap to allow to populate
   table entry
 - Fixed #remove(Iterator) to remove registration

ShardedDOMWriteTransaction:
 - Checks if writen path is delegated to other child
   producer.
 - submit() invokes DOMDataTreeProducer in order
   to notify when transaction is submitted.

ShardedDOMDataTreeProducer
 - #transactionSubmitted() clears openTx field
   in order to allow to allocate next transaction
   or close producer.

Added unit tests which tests ShardedDOMDataTree
to adhere to Shard & Producer API contracts defined
in DOMDataTreeService and DOMDataTreeProducerService

Change-Id: I39fae5f40e5b8a1cd07fcbe183c937b5c5bda348
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3866: Introduced Binding Adapters for DataTreeProducer 19/25919/2
Tony Tkacik [Mon, 24 Aug 2015 19:26:52 +0000 (21:26 +0200)]
Bug 3866: Introduced Binding Adapters for DataTreeProducer

Change-Id: I55518ce6de7edaf8bd68d6d2fccd217684b48536
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 3867: Introduced Binding APIs for Data Tree Producer. 92/25892/6
Tony Tkacik [Mon, 24 Aug 2015 14:53:16 +0000 (16:53 +0200)]
Bug 3867: Introduced Binding APIs for Data Tree Producer.

Change-Id: I234581af7704446b0a3af64723528647b58505f0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoMerge "Fix duplicate artifact inclusion"
Tony Tkacik [Mon, 14 Sep 2015 07:51:03 +0000 (07:51 +0000)]
Merge "Fix duplicate artifact inclusion"

8 years agoMerge changes I4b3820fd,Ib225745c
Tony Tkacik [Mon, 14 Sep 2015 07:50:25 +0000 (07:50 +0000)]
Merge changes I4b3820fd,Ib225745c

* changes:
  BUG-4264: deprecate packageNameForTypeDefinition()
  BUG-4264: do not duplicate strings needlessly

8 years agoFix a deprecation warning 89/26889/1
Robert Varga [Mon, 24 Aug 2015 15:43:36 +0000 (17:43 +0200)]
Fix a deprecation warning

SchemaNode.getPath() is deprecated, this is a simple migration.

Change-Id: Ic7b16a6aace06eaddd2562709c48d74ceab6191c
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoAdd mdsal-model-artifacts to binding-parent 78/26778/2
Florin Coras [Thu, 10 Sep 2015 16:33:44 +0000 (18:33 +0200)]
Add mdsal-model-artifacts to binding-parent

Given the migration to use the MD-SAL project, dependencies like
ietf-inet-types and ietf-yang-types are now imported via
org.opendaylight.mdsal.model instead of org.opendaylight.yangtools.model
groupId. However, the dependency management section of the
binding-parent does not include mdsal-model-artifacts, where the
previously mentioned artifacts are declared. This breaks imports in
bundles inheriting from binding-parent.

Change-Id: Id19c36862f8ab8bbfa70f8a538619070cf8814d7
Signed-off-by: Florin Coras <fcoras@cisco.com>
8 years agoBug 4145: Issue augmenting choice inside a list 03/26503/3
Peter Kajsa [Fri, 4 Sep 2015 07:50:42 +0000 (09:50 +0200)]
Bug 4145: Issue augmenting choice inside a list

The problem occurs when target node of uses-augment statement
is added by uses from another grouping and the uses statement
is not directly inside the grouping, but it is nested below
other elements (e.g. list, container etc.) in the grouping.
In this case the original of the target node is not found and
the IllegalStateException is thrown.

Change-Id: I1b0329d5da754251040894c0ccfe920bf8190aa4
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
8 years agoFix duplicate artifact inclusion 06/26606/1
Robert Varga [Mon, 7 Sep 2015 12:17:27 +0000 (14:17 +0200)]
Fix duplicate artifact inclusion

Duplicate dependency is triggering a maven warning, remove it.

Change-Id: Ia38455e648f8fd8fc8eb98aec5e5313be11ebbdf
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4264: deprecate packageNameForTypeDefinition() 56/26556/3
Robert Varga [Sat, 5 Sep 2015 19:21:58 +0000 (21:21 +0200)]
BUG-4264: deprecate packageNameForTypeDefinition()

This method is only used in tests and is broken, schedule it for
removal.

Change-Id: I4b3820fd9e02d4903087271e2982390e8c2573a2
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4264: do not duplicate strings needlessly 55/26555/3
Robert Varga [Sat, 5 Sep 2015 19:10:54 +0000 (21:10 +0200)]
BUG-4264: do not duplicate strings needlessly

This patch adds safeguards for string transformation methods to check if
the result is the same as input. This should address the string
duplication issues.

Change-Id: Ib225745ce35b492997edc60abd1abb3e41032795
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse NodeIdentifier.create() 49/26549/1
Robert Varga [Fri, 4 Sep 2015 00:01:38 +0000 (02:01 +0200)]
Use NodeIdentifier.create()

Using create() results in reused instances, thus lowering memory
footprint.

Change-Id: If1a1a3c3c74567374093a76df6e00ed7110b4f1c
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoMerge changes from topic 'be/migration/mdsal'
Robert Varga [Fri, 4 Sep 2015 13:54:41 +0000 (13:54 +0000)]
Merge changes from topic 'be/migration/mdsal'

* changes:
  Removed not-building code.
  Removed left-over dependencies to YANGTools models.

8 years agoRemoved not-building code. 75/26475/1
Tony Tkacik [Thu, 3 Sep 2015 17:29:02 +0000 (19:29 +0200)]
Removed not-building code.

Change-Id: Id89947a47aa2e5de19ac967013892a1e6a132fd3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>