mdsal.git
8 years agoBUG-2825: do not instantiate a temporary string 72/35372/5
Robert Varga [Thu, 25 Feb 2016 02:01:36 +0000 (03:01 +0100)]
BUG-2825: do not instantiate a temporary string

In case of a classifier being present, it is sufficient to adjust the
logical string length we are going to touch.

Change-Id: I33a4bf70042bab1bf720975eeb6482709111969c
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-2825: do not instatiate temporary array 71/35371/5
Robert Varga [Thu, 25 Feb 2016 01:57:03 +0000 (02:57 +0100)]
BUG-2825: do not instatiate temporary array

Change-Id: I1450116d13f9381d04c01f6a4b4f46a1b840cd9e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-2825: move code around and improve hex lookup 70/35370/5
Robert Varga [Thu, 25 Feb 2016 01:44:43 +0000 (02:44 +0100)]
BUG-2825: move code around and improve hex lookup

This patch moves the individual blocks around so we end up with faster
hex lookup.

Change-Id: Ib2e2043f9d4dd28c77fe36012eb21506cad14687
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-2825: expand IPv6 test suite 84/35384/2
Robert Varga [Thu, 25 Feb 2016 11:48:00 +0000 (12:48 +0100)]
BUG-2825: expand IPv6 test suite

This adds some framework for ease of writing test cases and adds some
more.

Change-Id: I85ddc21e90b35629332a51fba8e9751d6f6457c9
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-2825: rename method name 85/35385/2
Robert Varga [Thu, 25 Feb 2016 11:54:14 +0000 (12:54 +0100)]
BUG-2825: rename method name

Shorten the method name for clarity.

Change-Id: I2e9c6e9cd1232dc4d4dbd1f5722b84e55fc9eec7
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-2825: simplify test clarity 83/35383/1
Robert Varga [Thu, 25 Feb 2016 11:39:44 +0000 (12:39 +0100)]
BUG-2825: simplify test clarity

Change-Id: Id672b1b13abd9a5d59608e14884d85a06e51d72a
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-2825: import IPv6 test 82/35382/1
Robert Varga [Thu, 25 Feb 2016 11:36:08 +0000 (12:36 +0100)]
BUG-2825: import IPv6 test

Imports the basic test from Ipv6UtilsTest.

Change-Id: I8f221b8172040fa053680ff8561552b88b16210c
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-2825: import IPv6 parsing code 65/35365/1
Robert Varga [Thu, 25 Feb 2016 01:18:19 +0000 (02:18 +0100)]
BUG-2825: import IPv6 parsing code

This is a movement of code from
I7b436c3cf06a24d6ebb745c9a0d8c04ab1d43ee8.

Change-Id: I566575b9cd226f1f2c8ed026d602b4cfa96576c2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoAdd prefix-to-bytes conversion 90/35290/1
Robert Varga [Tue, 23 Feb 2016 20:22:53 +0000 (21:22 +0100)]
Add prefix-to-bytes conversion

Direct conversion to a single array, contains the address plus the
prefix at the last byte (unsigned).

Change-Id: I365ea3f04aa5f22edda7af4970c8fee1c51d809e
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoAdd IpAddress-to-bytes conversion 47/35247/1
Robert Varga [Mon, 22 Feb 2016 16:38:41 +0000 (17:38 +0100)]
Add IpAddress-to-bytes conversion

This adds utilities aware of the validated format, making them correct
with respect to zone identifiers. The IPv4 conversion is also faster due
to the fact it can rely on well-formedness of the argument.

Change-Id: I28014d15107562e7dc6193eb6f8198586e839d5b
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix same-package check 19/35219/3
Robert Varga [Mon, 22 Feb 2016 18:08:34 +0000 (19:08 +0100)]
Fix same-package check

The check using getClass() is completely broken. Use getClassName() and
perform a string match.

Change-Id: I95187117119e949d2492725022825726bd4639a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoAdd MacAddress-to-bytes conversion 16/35216/5
Robert Varga [Mon, 22 Feb 2016 16:38:41 +0000 (17:38 +0100)]
Add MacAddress-to-bytes conversion

This is useful and can rely on well-formedness of the mac address.

Change-Id: Ia41ecc74ed8ef3c3560cc920305cc4a9bff028dc
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUnify prefix splitting 95/35195/1
Robert Varga [Mon, 22 Feb 2016 14:00:52 +0000 (15:00 +0100)]
Unify prefix splitting

Instead of duplicating code, create a static utility method to perform
the string split.

Change-Id: I3c25b1cff00fa61e037dc94fb9951fd998567455
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoMore IetfInetUtil methods 89/35189/1
Robert Varga [Mon, 22 Feb 2016 13:37:40 +0000 (14:37 +0100)]
More IetfInetUtil methods

Fix IPv6 address formatting and introduce more conversion methods.

Change-Id: Ib032166819bed9c31932ad6b7c33db6263b12f6c
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoUse zero-compressed IPv6 addresses 41/35141/1
Robert Varga [Sat, 20 Feb 2016 22:58:24 +0000 (23:58 +0100)]
Use zero-compressed IPv6 addresses

Guava provides a utility method which converts Inet6Address to
zero-compressed string.

Change-Id: I182800b9a555cc620d397ef6f1d8eec9315c6dea
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoFix wrong groupId 04/35104/1
Robert Varga [Fri, 19 Feb 2016 14:59:19 +0000 (15:59 +0100)]
Fix wrong groupId

Change-Id: I1d38ba9a8f0fe65d8ec4ead15022f5951e2915a9
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoInherit from odlparent-lite 70/35070/2
Robert Varga [Fri, 19 Feb 2016 12:24:25 +0000 (13:24 +0100)]
Inherit from odlparent-lite

No need to perform the entire odlparent thing in aggregator, inherit
from -lite.

Change-Id: I7dd6dccf97ee3f1fc50730ae078be0416f08041d
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoDo not use deprecated APIs 54/35054/2
Tony Tkacik [Fri, 19 Feb 2016 10:12:39 +0000 (11:12 +0100)]
Do not use deprecated APIs

Changed imports from deprecated yangtools.binding.codec
to mdsal.binding.dom.codec which are replacement.

Change-Id: Ia29840f02252d599e38fe82b42d0754fe8fbb5bd
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-2825: add utility methods for instantiating DTOs 69/34869/10
Robert Varga [Thu, 18 Feb 2016 00:49:05 +0000 (01:49 +0100)]
BUG-2825: add utility methods for instantiating DTOs

Change-Id: I9a98c55b850bf13695c8f581f8acee81705d570b
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoCorrect generator path 47/35047/2
Robert Varga [Fri, 19 Feb 2016 09:38:42 +0000 (10:38 +0100)]
Correct generator path

It should point to generated-sources, not to generated-classes.
Otherwise it is not correctly ignored by checkstyle.

Change-Id: Ic369d99ee063289fb529d4d63638d8206683bbf9
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix checkstyle warnings 46/35046/3
Robert Varga [Fri, 19 Feb 2016 08:39:09 +0000 (09:39 +0100)]
Fix checkstyle warnings

Wrong order of imports and braindead if(){.

Change-Id: Iedf8e712c350f373410a8c558b30792c9deda763
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemove use of QName.cachedReference() 91/34891/1
Robert Varga [Thu, 18 Feb 2016 09:48:48 +0000 (10:48 +0100)]
Remove use of QName.cachedReference()

This method in obsolete, use intern() instead.

Change-Id: Ib81bb55117138a697722dbf4ab2348a8a2643922
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoTurn a method static 90/34890/1
Robert Varga [Thu, 18 Feb 2016 09:47:34 +0000 (10:47 +0100)]
Turn a method static

Change-Id: Id82bb4cb0b8e070811aae5cd29fbb984f79325b3
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRemove unused imports 40/34640/2
Robert Varga [Sun, 14 Feb 2016 23:03:36 +0000 (00:03 +0100)]
Remove unused imports

Change-Id: Id3081743b7c9bead6ac2d6ec73943fb092a95a4c
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4202: ForeignShardModificationContext should check readiness 44/34644/3
Robert Varga [Sun, 14 Feb 2016 23:22:53 +0000 (00:22 +0100)]
BUG-4202: ForeignShardModificationContext should check readiness

This adds the defenses needed to make sure this context does not get
abused.

Change-Id: I8ab60018d567715ab96c0e0ff4cfcf8f0c412793
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix versions import 45/34145/2
Robert Varga [Tue, 2 Feb 2016 15:00:57 +0000 (16:00 +0100)]
Fix versions import

Change-Id: I3e672756f0ee59eb7a61fcacfc048762907723f2
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4202: Initial prototype of subshard aware Shard implementation 43/32143/10
Tony Tkacik [Tue, 5 Jan 2016 15:29:58 +0000 (16:29 +0100)]
BUG-4202: Initial prototype of subshard aware Shard implementation

Drop-in new functionality without actually wiring it to the outside
world.

Change-Id: I86abc031896b72b7f3e373156cf5b0f334a1471a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoEnable site generation for mdsal 30/34630/2
Thanh Ha [Sat, 6 Feb 2016 04:52:59 +0000 (23:52 -0500)]
Enable site generation for mdsal

Change-Id: I9c01bd8ac2a4d3c011e271535e435ab2412b5445
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix javadoc formatting issues in mdsal-binding-* 29/34629/2
Thanh Ha [Sat, 6 Feb 2016 20:01:03 +0000 (15:01 -0500)]
Fix javadoc formatting issues in mdsal-binding-*

- Fix javadoc '<' and '>' to &lt; and &gt; escape characters
- Fix @link syntax issues
- Fix missing @throws definitions

Change-Id: I7f52dbdf7ae9e25e3ac37753bce78e8732730aaa
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix javadoc formatting issues mdsal-binding-generator-* 28/34628/1
Thanh Ha [Sat, 6 Feb 2016 05:08:28 +0000 (00:08 -0500)]
Fix javadoc formatting issues mdsal-binding-generator-*

- Fix javadoc '<' and '>' to &lt; and &gt; escape characters
- Fix @link syntax issues
- Fix missing @throws definitions

Change-Id: Ia0a3859f50fabae747fb090098ade5836d594eda
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 1672: Generated javadoc contains symbols of javadoc comment tags 07/33207/4
Igor Foltin [Thu, 21 Jan 2016 13:26:16 +0000 (14:26 +0100)]
Bug 1672: Generated javadoc contains symbols of javadoc comment tags

Angle brackets in javadoc comments generated from
yang statement descriptions are now properly encoded.

Change-Id: I9138c32cc912d2c4695da8e1d2e2e988f16194e1
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoUse revision range for importing lmax 83/33883/1
Robert Varga [Tue, 2 Feb 2016 11:05:46 +0000 (12:05 +0100)]
Use revision range for importing lmax

Do not use the property, but rather a revision range.

Change-Id: Id0994e99fb7aad734f19c1571bb35ee2d531db9d
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG 4869: Remove lmax version declaration 20/33820/1
Tony Tkacik [Fri, 29 Jan 2016 09:57:20 +0000 (10:57 +0100)]
BUG 4869: Remove lmax version declaration

 - use odl-lmax feature

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

8 years agoBUG-5019: adjust to changed NormalizedNodeStreamWriter API 31/33231/2
Robert Varga [Thu, 21 Jan 2016 17:34:03 +0000 (18:34 +0100)]
BUG-5019: adjust to changed NormalizedNodeStreamWriter API

This patch adds the required information for leafSetEntry() method.

Change-Id: I057d4d6f9ee6aaac1e6a1b0e5da27b8e92ced717
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRevert "Bump yangtools to 1.0.0-SNAPSHOT" 13/33313/1
Thanh Ha [Thu, 21 Jan 2016 23:24:13 +0000 (18:24 -0500)]
Revert "Bump yangtools to 1.0.0-SNAPSHOT"

This reverts commit 4013b20c7440d69d8b926901827d632ec8d44574.

Not sure {{VERSION}} needed to be changed after all.

Change-Id: Iedad9279d3c3fe750d6882628212f22cdaf83872
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBump yangtools to 1.0.0-SNAPSHOT 09/33309/1
Thanh Ha [Thu, 21 Jan 2016 23:14:08 +0000 (18:14 -0500)]
Bump yangtools to 1.0.0-SNAPSHOT

Change-Id: I2a088e738056669a13cab2edf6def0e8dd73ab4d
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBump yangtools to 1.0.0-SNAPSHOT 77/33277/2
Thanh Ha [Thu, 21 Jan 2016 21:03:37 +0000 (16:03 -0500)]
Bump yangtools to 1.0.0-SNAPSHOT

Change-Id: If0996a4bd580f7288ac53e4654b7d195ba89839f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoEmit schema nodes in BindingToNormalizedStreamWriter 67/32967/2
Robert Varga [Mon, 18 Jan 2016 21:50:52 +0000 (22:50 +0100)]
Emit schema nodes in BindingToNormalizedStreamWriter

ImmutableNormalizedNodeStreamWriter has memory optimizations based on
knowledge gleaned from a node's schema. More specifically it can reuse
instances of leaf and leafset entries if their value is known to have
low cardinality.

Change-Id: Ie3ef3489e12501b43341da0fc97994984fe5c625
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBug 4647: Binding Codec does not provide leaf default value for identityref 11/32411/2
Igor Foltin [Tue, 12 Jan 2016 12:12:29 +0000 (13:12 +0100)]
Bug 4647: Binding Codec does not provide leaf default value for identityref

Fixed handling of leaf default value for identityref type
even when there is a prefix in the default value.

Also removed obsolete code.

Change-Id: I5a4e1bf67705538f95f001a6eee42926d20c64b4
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBug 2784: status deprecated is not interpreted as annotation 90/32290/7
Martin Ciglan [Fri, 8 Jan 2016 16:03:44 +0000 (17:03 +0100)]
Bug 2784: status deprecated is not interpreted as annotation

Issues mentioned below have been fixed in this patch:
1. status deprecated is ignored for YANG elements in Javadocs
2. Annotation @deprecated is not provided in Javadocs
3. Annotation @Deprecated for compiler/developer purpose is not provided in generated Java structures

Change-Id: I5f3984d6810cd88a383a33f32b3b5d6a5072fd57
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoBumping versions by 0.1.0 for next dev cycle 89/32689/1
Thanh Ha [Fri, 15 Jan 2016 00:57:35 +0000 (19:57 -0500)]
Bumping versions by 0.1.0 for next dev cycle

Change-Id: I2518103345525fa92072116fbb0123436b19384b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoExplicitly set .gitreview defaultbranch to master 45/32645/1
Thanh Ha [Thu, 14 Jan 2016 21:43:52 +0000 (16:43 -0500)]
Explicitly set .gitreview defaultbranch to master

Change-Id: I10fada27548dcefe5f24f9bc4f28c11076894261
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 1435: Fixed incorrect links in javadoc. 74/32574/2
Tony Tkacik [Thu, 14 Jan 2016 12:35:30 +0000 (13:35 +0100)]
Bug 1435: Fixed incorrect links in javadoc.

Change-Id: I9fe40c4253c2375b18af5e6c42b4decf9e1fe519
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 1435: Added Binding Commit Cohort APIs and adapters. 73/32573/3
Tony Tkacik [Thu, 14 Jan 2016 12:35:03 +0000 (13:35 +0100)]
Bug 1435: Added Binding Commit Cohort APIs and adapters.

Change-Id: I7ec8b54542af307a2ec2390d3e397f771c2bc1cc
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-2062: handle ordered leaf-lists 61/32261/2
Robert Varga [Fri, 8 Jan 2016 08:11:07 +0000 (09:11 +0100)]
BUG-2062: handle ordered leaf-lists

This is forward-port on the Lithium fix, migrated to the mdsal project.

Change-Id: I46d94c281b904125fecb9636e513daa0c65c93cf
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoRevert "Bug 4647: Binding Codec does not provide leaf default value for identityref" 89/32089/2
Robert Varga [Mon, 4 Jan 2016 16:06:20 +0000 (16:06 +0000)]
Revert "Bug 4647: Binding Codec does not provide leaf default value for identityref"

This reverts commit 397c6e7e20a48c80fa19c3f10ed838f0cd81a758.

With this change SFC fails, as the default value has to be resolved as a prefix.

Change-Id: I19a5bd258579eee400d9d8700563d69b7898d689
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 4621: Insufficient diagnostic information 89/31089/4
Filip.Gregor [Wed, 9 Dec 2015 16:38:19 +0000 (17:38 +0100)]
Bug 4621:  Insufficient diagnostic information

minor fix

Change-Id: I7c2abae410e3a05f0b687f6ebff13dfe4494f72e
Signed-off-by: Filip.Gregor <fgregor@cisco.com>
8 years agoBug 4647: Binding Codec does not provide leaf default value for identityref 58/31758/1
Igor Foltin [Tue, 22 Dec 2015 07:25:29 +0000 (08:25 +0100)]
Bug 4647: Binding Codec does not provide leaf default value for identityref

Fixed handling of leaf default value for identityref type.

Also removed obsolete code.

Change-Id: Id442f25512f445e0fff5c9e9aef314813e2c35d4
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
8 years agoBUG-4764: resolve serializer body before javassist callout 39/31439/2
Robert Varga [Wed, 16 Dec 2015 15:08:50 +0000 (16:08 +0100)]
BUG-4764: resolve serializer body before javassist callout

This moves the body generation phase out of the javassist lock, so that
it can perform cache lookups without the risk of hitting an AB-BA
deadlock.

Change-Id: I40d0237fef100f90bed9e91e3825a4121e4c503d
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 4202: Introduced DOMDataTreePrefixTable 11/31411/3
Tony Tkacik [Wed, 16 Dec 2015 09:34:33 +0000 (10:34 +0100)]
Bug 4202: Introduced DOMDataTreePrefixTable

ShardingTable is handy utility to use DOMDataTreeIdentifiers
as prefixes in prefix table to lookup closest applicable value.

Renamed class to DOMDataTreePrefixTable, documented it
and made it public.

Change-Id: I7a487c2fdfda66d200fa565a12cc07dd0536d462
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-4743: fix setters for generated classes 32/31032/4
Robert Varga [Wed, 9 Dec 2015 00:55:40 +0000 (01:55 +0100)]
BUG-4743: fix setters for generated classes

Generated classes enforce restrictions in their constructors. Builders
should not generate checkers which duplicates these while setting the
value.

Change-Id: I7467a91e5c229bccbac00950294576fc60ce2622
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoCleanup builder enforcement 27/31027/4
Robert Varga [Tue, 8 Dec 2015 22:56:54 +0000 (23:56 +0100)]
Cleanup builder enforcement

A more natural place for generating these is with the setters which call
them. Move generation to generateSetters().

Also make setters' arguments final.

Also colocate length enforcement with range enforcement and eliminate a
superfluous empty if() block.

Change-Id: I0e844879f47527d692e148485157ef61db215862
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4743: compare constraints before emitting them 23/31023/9
Robert Varga [Tue, 8 Dec 2015 22:15:40 +0000 (23:15 +0100)]
BUG-4743: compare constraints before emitting them

When checking constraints of a particular type, check to see if the
constraints are not inherited from the base type. If they are, do not
emit them again.

Change-Id: I611ab7e2696a3c1be09d4f088bb8ab9f79f6fa80
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoSet general-entity version in model/artifacts 42/31142/2
Vratko Polak [Thu, 10 Dec 2015 14:13:29 +0000 (15:13 +0100)]
Set general-entity version in model/artifacts

Change-Id: Ida754ae6e19f62f93b396ba5961040fee65dadd0
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
8 years agoFix mdsal-model-artifacts 68/31068/1
Robert Varga [Wed, 9 Dec 2015 12:51:24 +0000 (13:51 +0100)]
Fix mdsal-model-artifacts

Corresponding features is not mentioned, breaking the usual import
contract.

Change-Id: I8922aa87414325c0e0b1623c98849cf6e0cd35fb
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoAdd isCandidateRegistered EOS method 05/30205/7
Tom Pantelis [Wed, 25 Nov 2015 02:13:32 +0000 (21:13 -0500)]
Add isCandidateRegistered EOS method

A new method, isCandidateRegistered, was recently added to the
EntityOwnershipService interface in the currently used API so added it
to the new interface.

Change-Id: I7aa44d53e0cd23ab4103406b2d0f7a43909993f9
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoAdd entity ownership binding -> DOM adapter 09/27709/8
Tom Pantelis [Mon, 28 Sep 2015 17:19:28 +0000 (13:19 -0400)]
Add entity ownership binding -> DOM adapter

Change-Id: I1e685d16cd66abe67006f98f317c4d5489f239d8
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoAdd general-entity yang to common 84/27684/9
Tom Pantelis [Mon, 28 Sep 2015 11:29:51 +0000 (07:29 -0400)]
Add general-entity yang to common

Change-Id: Iebf021d92a475174ceadb76895b5553b37df06ed
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFixed regression of Bug 4699 82/30482/2
Tony Tkacik [Wed, 2 Dec 2015 12:41:09 +0000 (13:41 +0100)]
Fixed regression of Bug 4699

Added special case to leaf method resolution
to use derived type instead of restricted type
to lookup for Java Method.

Change-Id: Ibba83be142f97485cc0f5139da68788a018c4b48
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoSwitch from QName#cachedReference() to QName#intern() 40/30440/1
Robert Varga [Tue, 1 Dec 2015 14:43:48 +0000 (15:43 +0100)]
Switch from QName#cachedReference() to QName#intern()

cachedReference() has been deprecated, use intern() instead.

Change-Id: Ie38f30f528fbfc4119bc10637902f43db4c09da8
Signed-off-by: Robert Varga <rovarga@cisco.com>
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>