mdsal.git
10 years agoBUG-1021: improve efficiency of generated builders.
Martin Vitez [Fri, 16 May 2014 08:28:48 +0000 (10:28 +0200)]
BUG-1021: improve efficiency of generated builders.

Improved construction of augmentation field.

Change-Id: I5106c271dd7d73eafd3c35678a78a9906a1aa8c2
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Fix a warning generic warning"
Tony Tkacik [Thu, 15 May 2014 06:56:59 +0000 (06:56 +0000)]
Merge "Fix a warning generic warning"

10 years agoFix a warning generic warning
Robert Varga [Wed, 14 May 2014 06:47:54 +0000 (08:47 +0200)]
Fix a warning generic warning

We do not need to use <T>, just use <?>, making eclipse happy.

Change-Id: Id22b775ca4e9a9d11a42697586e6cbb09197c01c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Don't throw NPE if we fail to find ChildOf interface"
Tony Tkacik [Mon, 12 May 2014 16:22:27 +0000 (16:22 +0000)]
Merge "Don't throw NPE if we fail to find ChildOf interface"

10 years agoDon't throw NPE if we fail to find ChildOf interface
Robert Varga [Mon, 12 May 2014 14:26:05 +0000 (16:26 +0200)]
Don't throw NPE if we fail to find ChildOf interface

Check for null return, this NPE can happen in the following path:

2014-05-12 06:56:56.740 PDT [http-bio-8080-exec-3] WARN  o.o.y.s.b.g.i.LazyGeneratedCodecRegistry - Exception during preparation of instance identifier codec for  path InstanceIdentifier{targetType=interface org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix, path=[org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.Node1, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.PathComputationClient, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLsp, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.reported.lsp.Path, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Ero, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix]}.
java.lang.NullPointerException: null
at org.opendaylight.yangtools.yang.binding.util.BindingReflections.isAugmentationChild(BindingReflections.java:173) ~[bundlefile:na]
at org.opendaylight.yangtools.sal.binding.generator.impl.InstanceIdentifierCodecImpl._serializePathArgument(InstanceIdentifierCodecImpl.java:165) ~[bundlefile:na]

Change-Id: I8d4b94d3c98dbf1f6cae36ab015282ae7afa098f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: improve waitForSchema() reliability
Robert Varga [Sun, 11 May 2014 20:29:29 +0000 (22:29 +0200)]
BUG-981: improve waitForSchema() reliability

SchemaLock.waitForSchema() should not check presence of codecs, but
rather only look at available definitions. Rework it such that it is
more useful.

Change-Id: I0e6240dad78d1e4987b3c7e8b4171b0e117e4792
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: force callers to handle exceptions
Robert Varga [Sun, 11 May 2014 16:01:35 +0000 (18:01 +0200)]
BUG-981: force callers to handle exceptions

This patch makes sure all the callsites acknowledge that the
transformer generator may fail. Also introduces proper chaining so we do
not lose information.

Change-Id: Ifce672b52a4f9d07104778f4e5060f51804747cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: make some methods static and non-public
Robert Varga [Sun, 11 May 2014 13:34:30 +0000 (15:34 +0200)]
BUG-981: make some methods static and non-public

These two methods can be made static, allowing for further code
reorganization. Also renames log to LOG to comply with standards.

Change-Id: I63abecfbb3d2fc891b6f37123cf503e8d20dc289
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: untangle interfaces
Robert Varga [Sun, 11 May 2014 11:05:34 +0000 (13:05 +0200)]
BUG-981: untangle interfaces

This patch untangles the interactions between the three classes that
constitute the binding generator implementation. This provides a
baseline for analyzing thread safety and ensuring its proper function.

TypeResolver is a new interface, which encapsulates the lookup services
provided by RuntimeGeneratedMappingServiceImpl to TransformerGenerator.

AbstractTransformerGenerator is a new abstract class, which defines the
interface of TransformerGenerator to the rest of the package, such that
Java classes do not have direct dependency on xtend code. Furthermore it
acts defines the interface which the xtend code expects of the Java
runtime.

Change-Id: I0a4fdc23aa25c69e45a3cea63aab0168ee2fe3ce
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 981: Make sure InstanceIdentifier codec is able to deserialize all written data.
Tony Tkacik [Sun, 11 May 2014 16:22:27 +0000 (18:22 +0200)]
Bug 981: Make sure InstanceIdentifier codec is able to deserialize all written data.

Preparation is done in LocationAwareDispatchCodec, which
is location-aware, hand-written (not generated) and it's
direct subclass AugmentableCompositeCodec has one instance
associated with every generated codec for data containers
and it's method adaptForPath is triggered allways for
first run of parent codec in different location.

This make sure when codec is reused via groupings
it has proper initialization for use in that place.

Change-Id: If15a07caa26162de1e34e9656968b120925a2011
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-981: RuntimeGeneratedMappingServiceImpl thread safety
Robert Varga [Sun, 11 May 2014 09:52:04 +0000 (11:52 +0200)]
BUG-981: RuntimeGeneratedMappingServiceImpl thread safety

This patch improves and documents thread safety of waiting for schema to
become available. There was an obvious race condition between schema
context change and registering for notification.

Change-Id: Ieb3999b3d6af5fbbee63015c92a87353a71229d7
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: improve RuntimeGeneratedMappingServiceImpl clarity
Robert Varga [Sat, 10 May 2014 21:55:10 +0000 (23:55 +0200)]
BUG-981: improve RuntimeGeneratedMappingServiceImpl clarity

This clarifies some of the locking interactions and well as it isolates
privay value.

Change-Id: Ic8961c9f9d32307fdd582191cab55bc633d081c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: cleanup superfluous use of Callable
Robert Varga [Sat, 10 May 2014 14:54:20 +0000 (16:54 +0200)]
BUG-981: cleanup superfluous use of Callable

As it turns out, wrapping code in a callable is completely unnecessary.
Removing it makes the code much more clear and allows for proper
inspection.

Change-Id: Ib57c9996fc8faaa8388736d469334eb2952bf018
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: defensive checks
Robert Varga [Sun, 11 May 2014 08:59:46 +0000 (10:59 +0200)]
BUG-981: defensive checks

This patch rewrites getClassForPath() to be more defensive and helpful
in diagnosing problems.

Change-Id: I24cd31819f0aea7f67bf6bc2e6c65168b1f3cae5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-731: fix order of modifiers"
Tony Tkacik [Sat, 10 May 2014 18:21:56 +0000 (18:21 +0000)]
Merge "BUG-731: fix order of modifiers"

10 years agoMerge "Remove unused imports"
Tony Tkacik [Sat, 10 May 2014 18:20:11 +0000 (18:20 +0000)]
Merge "Remove unused imports"

10 years agoBUG-731: fix order of modifiers
Robert Varga [Thu, 8 May 2014 06:48:18 +0000 (08:48 +0200)]
BUG-731: fix order of modifiers

'abstract protected' -> 'protected abstract' et al.

Change-Id: Id124ddc8281a5f880b9cd5b1e1b2de5a6722b391
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: add curly braces
Robert Varga [Thu, 8 May 2014 06:11:01 +0000 (08:11 +0200)]
BUG-731: add curly braces

Automated addition of curly braces.

Change-Id: I475657dc778601124610d0415cdf05e6a4495cc5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-731: remove unneded temp variables"
Tony Tkacik [Sat, 10 May 2014 17:00:58 +0000 (17:00 +0000)]
Merge "BUG-731: remove unneded temp variables"

10 years agoMerge "BUG-731: make sure utility classes are not instantiated"
Tony Tkacik [Sat, 10 May 2014 17:00:41 +0000 (17:00 +0000)]
Merge "BUG-731: make sure utility classes are not instantiated"

10 years agoBUG-981: remove use of deprecated getPath()
Robert Varga [Sat, 10 May 2014 14:27:42 +0000 (16:27 +0200)]
BUG-981: remove use of deprecated getPath()

Here we're only iterating through, so there's no need to get the
Collection.

Change-Id: I32f9005dafc8df8ae059bb5da2c6d57132749219
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-893: improve ClassLoaderUtils safety
Robert Varga [Sat, 10 May 2014 14:00:17 +0000 (16:00 +0200)]
BUG-893: improve ClassLoaderUtils safety

There is a slight possiblity for
ClassLoaderUtils.withClassLoaderAndLock() to not release the lock. Fix
this by refactoring it properly and letting users pick which flavor of
the method they want to use.

Change-Id: I07edd05323d26bfdf6800fbcd28ad9c150599a74
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-893: do not use deprecated contructor
Robert Varga [Sat, 10 May 2014 13:50:03 +0000 (15:50 +0200)]
BUG-893: do not use deprecated contructor

This gets rid of using JavassistUtils' deprecated contructor. It also
removes storage of ClassPool, so it makes it easier to reason about it.

Change-Id: I2deb15e7ce85527bdfb7fb79ae46bb5d25466ca2
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-983: remove the use of xtend Conversions
Robert Varga [Sat, 10 May 2014 10:27:14 +0000 (12:27 +0200)]
BUG-983: remove the use of xtend Conversions

This removes the last remnant of xtend for this codebase. As it turns
out, it make the code much more efficient, too.

Change-Id: Ie6f67ae308075c9af79a2a849309002d501dc646
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-983: prepare for proper wrapping
Robert Varga [Sat, 10 May 2014 10:04:17 +0000 (12:04 +0200)]
BUG-983: prepare for proper wrapping

This patch introduces a factory method to get instances, such that there
only ever is a single instance for a particular class pool. This fixes
the potential issue of adding a class path multiple times.

Change-Id: Ia8ff47674b768bd85ae50200734b8f14927f8a5c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-983: convert sneakyThrow into checked exception
Robert Varga [Sat, 10 May 2014 09:45:08 +0000 (11:45 +0200)]
BUG-983: convert sneakyThrow into checked exception

This documents the type of exceptions the utility classes can throw.

Change-Id: I98433a4650872d2c0c379ab2784cb25f97da7757
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-893: fix loaderClassPaths safety
Robert Varga [Sat, 10 May 2014 09:29:28 +0000 (11:29 +0200)]
BUG-893: fix loaderClassPaths safety

This fixes thread safety of loaderClassPaths, as there was a
TOCTOU error. Furthermore this actually populates the map, such that we
do not continue to add classloaders.

Drive-bys include final keywords and cleanup on utility classes.

Change-Id: I3c96a4e98b242d34d7036bcb81f71f36ff88223c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: harden exception handling
Robert Varga [Sat, 10 May 2014 09:00:38 +0000 (11:00 +0200)]
BUG-981: harden exception handling

This patch hardens the RuntimeGeneratedMappingServiceImpl error handling
by eliminating the use of sneakyThrow and properly chaining/logging
error causes.

Change-Id: Ia974c8cce3aab8c0f12dd318e4168932a025bb07
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoRevert "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15. Rename"
Robert Varga [Thu, 8 May 2014 09:38:22 +0000 (11:38 +0200)]
Revert "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15.  Rename"

This reverts commit a0862137aa3baf9c47ff54a3ca81dfff846baef4. The reason
is incomplete patch, which is missing key features. It also breaks
upstram (controller) build.

Change-Id: I0d4f0dc089cc7afd324dace1386cc88234480401
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoRemove unused imports
Robert Varga [Thu, 10 Apr 2014 21:45:54 +0000 (23:45 +0200)]
Remove unused imports

Change-Id: I1cbc9fb3941c8630df21fc63ecf68576a883ae8c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: remove unneded temp variables
Robert Varga [Wed, 7 May 2014 12:14:47 +0000 (14:14 +0200)]
BUG-731: remove unneded temp variables

Holding temporary variables just before returning them -- not really
useful, so fix the warnings.

Change-Id: I169f7ce215145c9d39dbb041c88680f8b7d241c4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: make sure utility classes are not instantiated
Robert Varga [Wed, 7 May 2014 09:00:11 +0000 (11:00 +0200)]
BUG-731: make sure utility classes are not instantiated

Change-Id: Icdda7afefa3e67c2b3a1b14ad0bbab565963a779
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15. Rename older...
Jan Medved [Thu, 8 May 2014 04:14:12 +0000 (04:14 +0000)]
Merge "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15.  Rename older versions as ietf-inet-types@2010-09-24.yang and ietf-yang-types@2010-09-24.yang."

10 years agoBUG-970: Fix bug in BindingMapping.getClassName.
Martin Vitez [Wed, 7 May 2014 10:37:42 +0000 (12:37 +0200)]
BUG-970: Fix bug in BindingMapping.getClassName.

Numeric class name prefix was not handled.

Change-Id: I88bc2d6324e87b7837f1c04abda53b1cb3b73f62
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge changes I412fb3fc,Iccef8d2e
Tony Tkacik [Wed, 7 May 2014 08:35:22 +0000 (08:35 +0000)]
Merge changes I412fb3fc,Iccef8d2e

* changes:
  BUG-592: introduce InstanceIdentifier.child()
  BUG-592: Format BI InstanceIdentifier

10 years agoAdd ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15. Rename
Rob Adams [Tue, 6 May 2014 21:20:07 +0000 (14:20 -0700)]
Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15.  Rename
older versions as ietf-inet-types@2010-09-24.yang and
ietf-yang-types@2010-09-24.yang.

Change-Id: I1df03675f6796440c71ad4ab41b0e04a20f5a716
Signed-off-by: Rob Adams <readams@readams.net>
10 years agoBUG-832 Fix deserialization of Empty type leaves.
Maros Marsalek [Wed, 30 Apr 2014 11:29:09 +0000 (13:29 +0200)]
BUG-832 Fix deserialization of Empty type leaves.

Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Change-Id: I4474f6790a7c17b9f3a0b5fb54a9fdc93dc0e72c

10 years agoBUG-592: introduce InstanceIdentifier.child()
Robert Varga [Thu, 10 Apr 2014 20:52:15 +0000 (22:52 +0200)]
BUG-592: introduce InstanceIdentifier.child()

These methods return an immediate descendant of the base identifier.
It turns out these utility methods are open-coded on quite a few places.

Change-Id: I412fb3fcdf538a71fca1d4cb180ac4bc2a9eaeb1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 527: fixed augment deserialization from xml.
Martin Vitez [Thu, 3 Apr 2014 11:07:04 +0000 (13:07 +0200)]
Bug 527: fixed augment deserialization from xml.

Refactored deserialization process to work with augment target node InstanceIdentifier.
Codec for augmentation binded to augment target node InstanceIdentifier.
Added method isAcceptable to AugmentationCodec.
Added new interface AugmentableCodec.
Updated tests.

Change-Id: I8d83e21183b8dd55e197f3d0ad1efc68c962c842
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-592: Migrate users to new build() method
Robert Varga [Wed, 26 Mar 2014 20:38:08 +0000 (21:38 +0100)]
BUG-592: Migrate users to new build() method

The static builder method is deprecated, move users off of it.

Change-Id: I2b6758c13e2eb4c6357b97f37de327594a1a7faf
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-592: Optimize equals() a bit
Robert Varga [Wed, 26 Mar 2014 18:50:06 +0000 (19:50 +0100)]
BUG-592: Optimize equals() a bit

This commit optimizes the equals() method by attempting to bypass the
full check of iterables by looking at cached state that is derived from
them.

Change-Id: I10b6e7164874992ae0dc041cffd934d292e61694
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-592: Rework instance identifier"
Tony Tkacik [Wed, 23 Apr 2014 08:04:32 +0000 (08:04 +0000)]
Merge "BUG-592: Rework instance identifier"

10 years agoBUG-592: Rework instance identifier
Robert Varga [Wed, 26 Mar 2014 14:18:50 +0000 (15:18 +0100)]
BUG-592: Rework instance identifier

This patch reworks the way InstanceIdentifier is implemented, gearing it
up for performance.

The entire implementation is based on Iterables instead of Lists, which
allows us to avoid copying them over and over as we construct new
identifiers. Simple .child() operation is a lot quicker, saving
instantiation of two intermediate classes.

The implementation gets rid of constructors, such that there is no
direct construction, but rather all paths are validated for content.
This also acts as a gate-keeper, enforcing the immutable nature of the
identifier.

Another optimization is that the hashCode() value is now built
incrementally as more members are added and cached.

InstanceIdentifierBuilder, now a full class, does not explictly copy the
base identifier, but reuses it -- there is no reason not to, as the base
identifier is immutable.

Change-Id: I0826ed3169a107c8f4b6e3026569e87387305ce0
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 735 - Part 1 - add ietf-restconf.yang back into yang-tools."
Tony Tkacik [Wed, 16 Apr 2014 13:23:00 +0000 (13:23 +0000)]
Merge "Bug 735 - Part 1 - add ietf-restconf.yang back into yang-tools."

10 years agoBug:700 Mapped description from the yang file to the generated java file
Debolina Bandyopadhyay [Tue, 15 Apr 2014 22:55:58 +0000 (15:55 -0700)]
Bug:700 Mapped description from the yang file to the generated java file

Change-Id: I732d7d4b2c708295ec1358994b4078d35de1769b
Signed-off-by: Debolina Bandyopadhyay <dbandyop@cisco.com>
10 years agoBug 735 - Part 1 - add ietf-restconf.yang back into yang-tools.
Devin Avery [Mon, 14 Apr 2014 18:45:54 +0000 (14:45 -0400)]
Bug 735 - Part 1 - add ietf-restconf.yang back into yang-tools.

Added a bundle into yang-tools to ship the ietf-restconf.yang yang file, required by MD-SAL.

NOTE: We are adding the first draft (00) of the ietf-restconf.yang so we
dont have to upgrade all of the other core yang files. It appears that
ietf-yang-types would need to be upgraded as well if we went with the
latest ietf releases. That should happen, but as part of an intention
upgrade to all ietf core.

Note: Gerrit DRAFT https://git.opendaylight.org/gerrit/#/c/6185 provideds
the fixes to the controller project to resolve the issue with the restconf
/modules endpoint, but we can not push that one forward until the yangtools
(this CS) is pushed to master because of dependencies.

Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoBug 613: Minimize use of xtend in binding-generator-impl.
Martin Vitez [Tue, 1 Apr 2014 08:20:39 +0000 (10:20 +0200)]
Bug 613: Minimize use of xtend in binding-generator-impl.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Bug 447 - Yang documentation generator improvements"
Tony Tkacik [Tue, 8 Apr 2014 09:53:38 +0000 (09:53 +0000)]
Merge "Bug 447 - Yang documentation generator improvements"

10 years agoMerge "Fix for Bug 586."
Tony Tkacik [Tue, 8 Apr 2014 09:51:29 +0000 (09:51 +0000)]
Merge "Fix for Bug 586."

10 years agoBug 447 - Yang documentation generator improvements
Milos Fabian [Thu, 3 Apr 2014 14:29:11 +0000 (16:29 +0200)]
Bug 447 - Yang documentation generator improvements

-added summaries at the top of page + linked localy
-added nested child nodes of grouping and augmentation nodes
-added local links between type definitions and their users
-minor fixes

Change-Id: I573f4ee257e66c140e52327534e840801f7b3c5f
Signed-off-by: Milos Fabian <milfabia@cisco.com>
10 years agoFix for Bug 586.
Martin Vitez [Fri, 28 Mar 2014 14:56:36 +0000 (15:56 +0100)]
Fix for Bug 586.

Fixed generation of list key properties.
Updated test.

Change-Id: Icfe7e1fa6a5bfb3c8c2b4bedf808e5fbae797359
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFix for Bug 527.
Martin Vitez [Mon, 24 Mar 2014 09:23:28 +0000 (10:23 +0100)]
Fix for Bug 527.

Fixed codec loading for choice case nodes.
Fixed bug in parser when handling uses/augment target path.
Helper methods from BindingGeneratorImpl moved to SchemaContextUtil class.
Added test.

Change-Id: Id1b835150cdad2c278bd9c125d5369822b75639a
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBug 525 : Document the InstanceIdentifier API
Moiz Raja [Wed, 26 Mar 2014 00:50:07 +0000 (17:50 -0700)]
Bug 525 : Document the InstanceIdentifier API

Change-Id: If42682fe4dfd715d95f5f081eae8027836f316e0
Signed-off-by: Moiz Raja <moraja@cisco.com>
10 years agoAnother set of warning fixes
Robert Varga [Wed, 19 Mar 2014 15:46:08 +0000 (16:46 +0100)]
Another set of warning fixes

Change-Id: Ic2bd07eb6490174e7f6a8808652dabeec122866c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Fixed possible NPE in CodecMapping."
Robert Varga [Wed, 19 Mar 2014 11:49:07 +0000 (11:49 +0000)]
Merge "Fixed possible NPE in CodecMapping."

10 years agoFixed possible NPE in CodecMapping.
Martin Vitez [Thu, 13 Mar 2014 14:52:03 +0000 (15:52 +0100)]
Fixed possible NPE in CodecMapping.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Fix for Bug 511 (model + integration-test)"
Tony Tkacik [Tue, 18 Mar 2014 11:04:18 +0000 (11:04 +0000)]
Merge "Fix for Bug 511 (model + integration-test)"

10 years agoMerge "Fix for Bug 511 (yang)"
Tony Tkacik [Tue, 18 Mar 2014 11:03:44 +0000 (11:03 +0000)]
Merge "Fix for Bug 511 (yang)"

10 years agoMerge "Fix for Bug 511 (code-generator)"
Tony Tkacik [Tue, 18 Mar 2014 11:03:22 +0000 (11:03 +0000)]
Merge "Fix for Bug 511 (code-generator)"

10 years agoFix for Bug 511 (model + integration-test)
Martin Vitez [Tue, 18 Mar 2014 08:18:30 +0000 (09:18 +0100)]
Fix for Bug 511 (model + integration-test)

Removed \r characters from yang-ext.yang and from integration-test project.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFix for Bug 511 (yang)
Martin Vitez [Thu, 13 Mar 2014 12:00:30 +0000 (13:00 +0100)]
Fix for Bug 511 (yang)

Removed \r characters from all projects under yang directory.

Change-Id: I46a47d523449bc159ea508143d9a06726f8259ff
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFix for Bug 511 (code-generator)
Martin Vitez [Thu, 13 Mar 2014 10:38:27 +0000 (11:38 +0100)]
Fix for Bug 511 (code-generator)

Removed \r characters from all projects under code-generator directory.

Change-Id: Ic6af8cc1b686c62caeaab9e5f2595a597750cafe
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdd ability to get yang sources from SchemaContext.
Tomas Olvecky [Mon, 10 Mar 2014 12:17:05 +0000 (13:17 +0100)]
Add ability to get yang sources from SchemaContext.

SchemaContext should provide yang source code of parsed module files.
To identify modules, move YANGModuleIdentifier from binding-generator-spi
to yang-model-api: ModuleIdentifier. This interface can represent
both modules and submodules in SchemaContext. Add methods to SchemaContext
to iterate ove ModuleIdentifiers and get their source.
In order to maintain backwards compatibility no new parsing method was created,
so submodules cannot be supported now in new methods.
Adding this functionality removes need for most methods defined in
org.opendaylight.yangtools.yang.model.parser.api.YangModelParser .
It is advised that after this change parser api would be refactored to
have a method taking collection of input streams as input
and returning SchemaContext.
Other small changes:
Externalize SimpleDateFormat wrapped in ThreadLocal
Add toString to AbstractObjectRegistration
Add guava dependency to yang-model-api for Optional goodness
Add ModuleIdentifierImpl convenience class allowing users to seach source by
 module name.

Change-Id: I8a46fa699bbd829e5d4a488ebc99012a66fc196d
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
10 years agoMerge "Fix for Bug 497."
Tony Tkacik [Wed, 12 Mar 2014 10:15:20 +0000 (10:15 +0000)]
Merge "Fix for Bug 497."

10 years agoMerge "Better logging for codegen's generateModuleInfos"
Tony Tkacik [Wed, 12 Mar 2014 10:08:04 +0000 (10:08 +0000)]
Merge "Better logging for codegen's generateModuleInfos"

10 years agoMerge "Fix for Bug 496."
Tony Tkacik [Wed, 12 Mar 2014 09:59:21 +0000 (09:59 +0000)]
Merge "Fix for Bug 496."

10 years agoMerge "Migrate RuntimeGeneratedMappingServiceImpl to use SchemaContextListener"
Tony Tkacik [Wed, 12 Mar 2014 09:50:44 +0000 (09:50 +0000)]
Merge "Migrate RuntimeGeneratedMappingServiceImpl to use SchemaContextListener"

10 years agoFix for Bug 497.
Martin Vitez [Mon, 10 Mar 2014 17:09:34 +0000 (18:09 +0100)]
Fix for Bug 497.

Added generation of toString in YangModuleInfoTemplate.

Change-Id: I4a4781618dc58baa4764be378e92c26c7d15f5a2
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBetter logging for codegen's generateModuleInfos
Tomas Olvecky [Tue, 11 Mar 2014 12:39:41 +0000 (13:39 +0100)]
Better logging for codegen's generateModuleInfos

Change-Id: I14798f5f7caf9324344351141751be0001ef3a83
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
10 years agoMerge "Added initial draft of Normalized Yang Data Tree model."
Martin Vitez [Tue, 11 Mar 2014 10:25:54 +0000 (10:25 +0000)]
Merge "Added initial draft of Normalized Yang Data Tree model."

10 years agoMigrate RuntimeGeneratedMappingServiceImpl to use SchemaContextListener
Robert Varga [Sun, 9 Mar 2014 18:29:46 +0000 (19:29 +0100)]
Migrate RuntimeGeneratedMappingServiceImpl to use SchemaContextListener

Moves the implemented interface higher up the chain, allowing its users
to start relying on SchemaContextListener -- fixing deprecations
warnings in the process.

Drive-by:
- organized imports to remove unused import
- remove unused field

Change-Id: Ic77e3775317daedd94f6cff6ea6eabdb0ea3dde0
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix for Bug 496.
Martin Vitez [Mon, 10 Mar 2014 15:15:03 +0000 (16:15 +0100)]
Fix for Bug 496.

If leafref type contains invalid path, no warning was reported and no methods were generated from this leaf/leaf-list.
Added exception throwing if leafref target is not found.
Updated tests.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoIntroduce ClassLoadingStrategy,ModuleInfoRegistry interface, copy SchemaStoreProvider...
Tomas Olvecky [Mon, 10 Mar 2014 08:47:28 +0000 (09:47 +0100)]
Introduce ClassLoadingStrategy,ModuleInfoRegistry interface, copy SchemaStoreProvider from md-sal.

To decouple implementation from interface introduce ClassLoadingStrategy and ModuleInfoRegistry interfaces.This allows intercepting
read/write operations.
Copy SchemaContextProvider from org.opendaylight.controller.sal.dom.broker.impl .

Change-Id: Ifebc0f0adbb265f4a4e492c0a9b54f07cc17fe01
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
10 years agoFix for Bug 489.
Martin Vitez [Thu, 6 Mar 2014 16:09:25 +0000 (17:09 +0100)]
Fix for Bug 489.

Current code generator version was unable to generate sources for augmentation defined under uses statement
if augment points to nested node (not top level node added by uses).

Failing example:

container c {
    uses route-subobjects {
        augment "links/link" {
            leaf id {
                type string;
            }
        }
    }
}

AugmentationSchemaBuilderImpl: fixed bug in parsing augment target path for augmentations defined under uses.
BindingGeneratorImpl: fixed resolving of augment package name.
BindingGeneratorUtil: added new method to generate package name.

Added tests.

Change-Id: Ie48b2fffc0e6449bf5c13b5a6b636cbd837ffb54
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Fix for Bug 295."
Tony Tkacik [Tue, 4 Mar 2014 09:30:48 +0000 (09:30 +0000)]
Merge "Fix for Bug 295."

10 years agoFix for Bug 295.
Martin Vitez [Mon, 3 Mar 2014 11:35:03 +0000 (12:35 +0100)]
Fix for Bug 295.

Changes in GeneratorJavaFile:
 - produced warning when more than one file with same name is going to be generated
 - constructor parameter type changed from Set to Collection
 - removed unused method generateStringToJavaFile

Fixed implementation of isAcceptable(Type type) in InterfaceGenerator.
Added test.

Change-Id: If2cc5ccf27b15f3749628a6c7059de6703dda213
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Fixed for Bug 468."
Tony Tkacik [Thu, 27 Feb 2014 16:50:50 +0000 (16:50 +0000)]
Merge "Fixed for Bug 468."

10 years agoFixed for Bug 468.
Martin Vitez [Wed, 26 Feb 2014 14:32:52 +0000 (15:32 +0100)]
Fixed for Bug 468.

Fixed prefix resolution of augment target path parts on parser level.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed missing predicate in package name regex. Improved error reporting.
Tony Tkacik [Wed, 26 Feb 2014 11:23:09 +0000 (12:23 +0100)]
Fixed missing predicate in package name regex. Improved error reporting.

Change-Id: If76fe681e37a5421621754d088de99b14eeae05d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 466:Fixed namespace and revision resolution for empty augmentations.
Tony Tkacik [Wed, 26 Feb 2014 10:45:24 +0000 (11:45 +0100)]
Bug 466:Fixed namespace and revision resolution for empty augmentations.

Change-Id: I85af4d15d7f4a6b604461084e9ff4f73b103cca1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed possible NPE, improved logging.
Martin Vitez [Wed, 26 Feb 2014 08:19:28 +0000 (09:19 +0100)]
Fixed possible NPE, improved logging.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed NPE caused by tryToLoadAugmentations in LazyGeneratedCodecRegistry.
Tony Tkacik [Tue, 25 Feb 2014 14:32:01 +0000 (15:32 +0100)]
Fixed NPE caused by tryToLoadAugmentations in LazyGeneratedCodecRegistry.

Change-Id: I3142a629b9bd366a960c79447134d87f36f47e25
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed generation of toString method in builder template.
Martin Vitez [Thu, 20 Feb 2014 15:06:40 +0000 (16:06 +0100)]
Fixed generation of toString method in builder template.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFix for Bug-427.
Milos Fabian [Wed, 19 Feb 2014 00:10:36 +0000 (01:10 +0100)]
Fix for Bug-427.

Added test for mapping from dom (with nested augmenation nodes) to data object.
Added javadocs.

Change-Id: I0d0c08092c6485afb820d9bfbb352cf934f282f3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Signed-off-by: Milos Fabian <milfabia@cisco.com>
10 years agoAdded initial draft of Normalized Yang Data Tree model.
Tony Tkacik [Fri, 21 Feb 2014 16:38:14 +0000 (17:38 +0100)]
Added initial draft of Normalized Yang Data Tree model.

Change-Id: Ic50335f8a7bfe0fa4d7c239c997f6ca090b9b506
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-432: Start fixing the Registration contract
Robert Varga [Wed, 19 Feb 2014 02:23:06 +0000 (03:23 +0100)]
BUG-432: Start fixing the Registration contract

Registration should be a generic construct, not tied to a particular
object. Unfortunately that requires API-level breakage which needs to be
orchestrated with the users.

As a first step introduce ObjectRegistration concept which is equivalent
with the current Registration concept and gently nudge the users towards
it.

Change-Id: I05723cffcc41bfa2355b5e75d3e675c4809a772a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix various warnings
Robert Varga [Wed, 19 Feb 2014 03:24:14 +0000 (04:24 +0100)]
Fix various warnings

Change-Id: I68b53f84356885213577a0d793e69f38d5971a6a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Add injectable LoadingStrategy to RuntimeGeneratedMappingServiceImpl."
Tony Tkacik [Wed, 19 Feb 2014 14:24:35 +0000 (14:24 +0000)]
Merge "Add injectable LoadingStrategy to RuntimeGeneratedMappingServiceImpl."

10 years agoAdd injectable LoadingStrategy to RuntimeGeneratedMappingServiceImpl.
Maros Marsalek [Wed, 19 Feb 2014 10:52:55 +0000 (11:52 +0100)]
Add injectable LoadingStrategy to RuntimeGeneratedMappingServiceImpl.

This allows config-managed to inject ModuleInfoBackedContext as LoadingStrategy in order to resolve Identity classes.

Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoFixed getClassName method.
Martin Vitez [Mon, 17 Feb 2014 17:07:29 +0000 (18:07 +0100)]
Fixed getClassName method.

If string contained point character, it wasn't escaped and cause compile errors.

Change-Id: I3d2179133a160adb8e1c79649e880aee124e40f3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed incorrect path construction in JUnit tests.
Martin Vitez [Mon, 17 Feb 2014 11:54:30 +0000 (12:54 +0100)]
Fixed incorrect path construction in JUnit tests.

Change-Id: I0a9d73876ea0dd6263d414e91070d405fef9069b
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFix of $YangModuleInfoImpl for ext. yang models
Lukas Sedlak [Mon, 17 Feb 2014 11:38:53 +0000 (03:38 -0800)]
Fix of $YangModuleInfoImpl for ext. yang models

Fixed bug in writeJavaSource method in CodeGeneratorImpl. If package does not exist the dir structure is created.
Without this fix yang models containing only extension definitions could not be generated.

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoMerge "Fixed DataObjectReadingUtil to resolve multiple items from lists if InstanceId...
Robert Varga [Fri, 14 Feb 2014 22:05:32 +0000 (22:05 +0000)]
Merge "Fixed DataObjectReadingUtil to resolve multiple items from lists if InstanceIdentifier is wildcarded."

10 years agoFixed DataObjectReadingUtil to resolve multiple items from lists if InstanceIdentifie...
Tony Tkacik [Fri, 14 Feb 2014 21:07:33 +0000 (22:07 +0100)]
Fixed DataObjectReadingUtil to resolve multiple items from lists if InstanceIdentifier is wildcarded.

Change-Id: Iac3d30c548435d1f3a8575ec6f11ac09cd72bb3d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Fixed bug in code generator when handling case defined in grouping as augment...
Lukas Sedlak [Fri, 14 Feb 2014 20:21:00 +0000 (20:21 +0000)]
Merge "Fixed bug in code generator when handling case defined in grouping as augment target."

10 years agoRevert "Added ietf-restconf yang module"
Tony Tkacik [Fri, 14 Feb 2014 18:10:00 +0000 (18:10 +0000)]
Revert "Added ietf-restconf yang module"

This reverts commit 9003fb310abfa2773e570424dd4b38953beb0673.

Change-Id: Ifd9255b63b76fa1e697361a6b16826921999695a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Temporarily reverted "Update ietf-inet-types and ietf-yang-types with RFC6991""
Tony Tkacik [Fri, 14 Feb 2014 18:09:27 +0000 (18:09 +0000)]
Merge "Temporarily reverted "Update ietf-inet-types and ietf-yang-types with RFC6991""

10 years agoTemporarily reverted "Update ietf-inet-types and ietf-yang-types with RFC6991"
Tony Tkacik [Fri, 14 Feb 2014 17:55:38 +0000 (17:55 +0000)]
Temporarily reverted "Update ietf-inet-types and ietf-yang-types with RFC6991"

Upstream dependencies did not honor warnings which required them to specify model revision.

Change-Id: I7ac5d5820bf47fb2e429eb8b8c6ef060b6eab652
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Added ietf-restconf yang module"
Tony Tkacik [Fri, 14 Feb 2014 16:59:29 +0000 (16:59 +0000)]
Merge "Added ietf-restconf yang module"

10 years agoMerge "Update ietf-inet-types and ietf-yang-types with RFC6991"
Tony Tkacik [Fri, 14 Feb 2014 16:59:16 +0000 (16:59 +0000)]
Merge "Update ietf-inet-types and ietf-yang-types with RFC6991"