yangtools.git
10 years agoFixed parsing of typedef statement. Refactored YangParserImpl to improve code readabi... 80/680/1
Martin Vitez [Tue, 11 Jun 2013 09:55:29 +0000 (11:55 +0200)]
Fixed parsing of typedef statement. Refactored YangParserImpl to improve code readability.
Added methods to LeafSchemaNode interface. Updated tests.

Change-Id: I63c84a5c0c3c4f6c68b8c2dabdcbb66266496000
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoModified construction of built-in yang types. 79/679/1
Martin Vitez [Wed, 5 Jun 2013 14:18:01 +0000 (16:18 +0200)]
Modified construction of built-in yang types.

Base yang types can not be restricted now. Every restriction causes creation of new ExtendedType with default yang type as base type.
Updated tests.

Change-Id: I04b2a0a069dcf4f7b3a3d1220c742fed047cba3a
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoRefactored SchemaPath for yang java types. Fixed SchemaPath for augmented nodes types. 78/678/1
Martin Vitez [Thu, 30 May 2013 14:03:54 +0000 (16:03 +0200)]
Refactored SchemaPath for yang java types. Fixed SchemaPath for augmented nodes types.
Updated yang java types constructors. Updated tests accordingly.

Change-Id: Ifeb1ddc96c89350579c837414dceeab624ef17ab
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBumped version of Maven YANG tools to 0.5.1-SNAPSHOT 77/677/1
Tony Tkacik [Tue, 28 May 2013 14:44:41 +0000 (16:44 +0200)]
Bumped version of Maven YANG tools to 0.5.1-SNAPSHOT

 - Removed unnecessary dependencies from YANG Maven Tools integration tests.
 - Added Attach Sources and Javadoc to deploy phase

Change-Id: I456c06538c944ae53d4f12827be4a64726b8233b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed dependency management. 61/661/1
lsedlak [Tue, 28 May 2013 14:44:41 +0000 (16:44 +0200)]
Fixed dependency management.

Fixed dependency management for Binding Generator and Yang projects.

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoMore javadocs added to yang-model-api. 60/660/1
Martin Vitez [Mon, 20 May 2013 11:20:54 +0000 (13:20 +0200)]
More javadocs added to yang-model-api.
Deleted not used KeyDefinition class.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded support for resolving augmentations. 76/676/1
lsedlak [Mon, 20 May 2013 16:35:22 +0000 (18:35 +0200)]
Added support for resolving augmentations.

Added implementation into BindingGeneratorImpl to support generation of augmentati statements from yang models.
Added AugmentedTypeTest and augmented-test-models for testing of agumentation functionality.

Added ability to generate Java Interfaces that extends generic types.
Added Augmentation and Augmentable interfaces into yang-binding project.

Fixed bug in bad equals resolving in AbstractBaseType in binding-generator-util;
Added ReferencedTypeImpl into binding-generator-util;

Added findParentModule static method into SchemaContextUtil for resolving Module from SchemaNode in Schema Tree;
Added DATA_OBJECT, augmentableTypeFor and augmentationTypeFor into Types for referencing of Augmentable<T>, Augmentation<T> and DataObject interfaces defined in yang-binding;

Fixed incorrect resolving of namespaces and package names during generation of interfaces from yang lists;
Fixed bug in TypeProvider in resolving of extended types extended from multiple extended types;
Added ControllerTest and controller-models as test resources;
Changed position of revision date during package generation -> Now revision date comes after namespace;

Change-Id: I687925a622853bb6c9a809f17efd980c2960ae39
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed tests. Added javadocs to yang-model-api. 59/659/1
Martin Vitez [Fri, 17 May 2013 15:48:08 +0000 (17:48 +0200)]
Fixed tests. Added javadocs to yang-model-api.
Minor formatting changes performed in yang-model-parser-impl.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed augment schema path resolving. 58/658/1
Martin Vitez [Tue, 7 May 2013 14:05:24 +0000 (16:05 +0200)]
Fixed augment schema path resolving.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded support for implements and extends of GeneratedType; 57/657/1
lsedlak [Tue, 7 May 2013 11:11:59 +0000 (13:11 +0200)]
Added support for implements and extends of GeneratedType;

Added functionality to store List of implementing Generation Types into
GeneratedType and GeneratedTypeBuilder;
Added functionality to store Extending Transfer Object for
GeneratedTransferObject and GeneratedTOBuilder;

Fixed:
DataNodeIterator no longer returns augmented containers, lists, leafs
and leaflists - only non augmented module schema tree;
Added findDataSchemaNode for given SchemaPath into SchemaContextUtil;

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoAdded line number to error messages. 75/675/1
Martin Vitez [Mon, 6 May 2013 07:12:46 +0000 (09:12 +0200)]
Added line number to error messages.

Change-Id: I180438f8e617ca910b16d524576e88650d966bbd
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdated POM files and versions to SNAPSHOT 74/674/1
Tony Tkacik [Fri, 3 May 2013 13:45:49 +0000 (15:45 +0200)]
Updated POM files and versions to SNAPSHOT

Change-Id: I28b16eb8811d928440a18eb2e16df9253cc92562
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAdded generate To File for specified directory. 56/656/1
lsedlak [Thu, 2 May 2013 13:06:12 +0000 (15:06 +0200)]
Added generate To File for specified directory.

Added overloading method generateToFile with File as input parameter and
List of Files as result;
Removed unused import in BaseTypeProvider test and BaseYangTypes;

Changed binding-generator, yang and sal maven pom files to use java 1.7;

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoExpanded UnknownSchemaNode implementation, refactored java source code generation. 55/655/1
Martin Vitez [Tue, 30 Apr 2013 14:02:15 +0000 (16:02 +0200)]
Expanded UnknownSchemaNode implementation, refactored java source code generation.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed SchemaPath resolution for base YANG types. 73/673/1
Martin Vitez [Fri, 26 Apr 2013 09:42:59 +0000 (11:42 +0200)]
Fixed SchemaPath resolution for base YANG types.
Refactored refine statement parsing.

Change-Id: Ic00b86c611f1f56b69d9e09bf197d9ddb79da145
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed bugs in parsing enumeration, augment, identity. 54/654/1
Martin Vitez [Thu, 25 Apr 2013 11:54:16 +0000 (13:54 +0200)]
Fixed bugs in parsing enumeration, augment, identity.
Refactored SchemaPath construction for int, uint, decimal64, string and union types.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoImplemented YANG identityref type parsing. 53/653/1
Martin Vitez [Wed, 24 Apr 2013 15:34:56 +0000 (17:34 +0200)]
Implemented YANG identityref type parsing.
Refactored augmentation parsing. Added tests.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoImplemented refine statement parsing. 52/652/1
Martin Vitez [Wed, 24 Apr 2013 06:33:45 +0000 (08:33 +0200)]
Implemented refine statement parsing.
Implemented choice statement parsing.
Implemented anyxml statement parsing.
Added EmptyType. Added more tests. Fixed bugs.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded capability to resolve Enumeration type definitions; 51/651/1
lsedlak [Tue, 23 Apr 2013 13:48:53 +0000 (15:48 +0200)]
Added capability to resolve Enumeration type definitions;

Added ReferencedTypeImpl for resolving of referenced enumeration types;
Modified GeneratedTypeBuilder for setting correct package name for
enumeration types defined as inner enums in Generated Types;
Modified EnumBuilder added extends of Type interface in
binding-model-api;
Added test case for resolving of Leaf Enumeration in GeneratedTypesTest;

Modified BindingGeneratorImpl accordingly:
Added Implementation to resolve Enumeration type,
The Schema Tree traversal methods removed - replaced by
DataNodeIterator,

Refactored TypeProviderImpl - resolving of leafrefs now through
SchemaContextUtil methods;

Chenged package name in code-generator-demo to
org.opendaylight.controller.yang;

Added DataNodeIterator and SchemaContextUtil into yang-model-util

Fixed Raw TypeDefinition in ExtendedType implementation;
Fixed SchemaPath setting in EnumerationType implementation - added two
parametric constructors that contains SchemaPath parameter;
Updated parseTypeBody method in YangModelBuilderUtil in
yang-model-parser-impl - added Enumeration constructor call with schema
path parameter;
Fixed constructor with XPath parameter visbility in Leafref
implementation;

Added extension of AugmentationTarget for ChoiceNode in yang-model-api;

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoFixed implementation of TypeProviderImpl for Leafref resolving. 72/672/1
lsedlak [Wed, 17 Apr 2013 14:21:26 +0000 (16:21 +0200)]
Fixed implementation of TypeProviderImpl for Leafref resolving.

Since the modification of resolving of inner type definitions as
ExtendedTypes there had to be done minor modifications in
javaTypeForSchemaDefinitionType and baseTypeForExtendedType methods.
Also the SchemaPath no longer contains the module name as first element
so the module name is now retrieved directly from SchemaContext
via findModuleByNamespace method;

Added findModuleByName and findModuleByNamespace into SchemaContext in
yang-model-api;

Added implementation of findModuleByName and findModuleByNamespace for
private implementation of SchemaContextImpl in YangModelParserImpl;
Fixed possible resource leak in resolveModuleBuildersFromStreams in
YangModelBuilderImpl - implemented loadStreams and closeStreams methods;

Added implementation of test case for resolving of leafrefs and leafref
types from multiple modules;

Fixed wrong constructor call of Leafref Type Definition in parseTypeBody
method in YangModelBuilderUtil;

Fixed resolving of SchemaPath for Type statement in
YangModelParserListenerImpl;

Change-Id: I6a037a746562d856d12ea71d3fb095e902e1c204
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoRedirecting Caught and Uncaught Exceptions to OSGI Console and Log File 50/650/1
Maurice Qureshi [Fri, 19 Apr 2013 19:14:02 +0000 (12:14 -0700)]
Redirecting Caught and Uncaught Exceptions to OSGI Console and Log File

The existing mechanism int the Controller allows the exceptions to be printed only
the console. This applies to both caught and uncaught exception. If the console
buffer is not too large and gets overwritten or gets cleared, there is no way for
the user to know what exceptions occurred. This commit implements a new mechanism
by which both types of exceptions will get printed on the console as well as logged
to the file.

Signed-off-by: Maurice Qureshi <maquresh@cisco.com>
10 years agoRefactored YANG types resolving. 49/649/1
Martin Vitez [Tue, 16 Apr 2013 08:43:34 +0000 (10:43 +0200)]
Refactored YANG types resolving.

Fixed YANG union type parsing. Refactored code after PMD check.
Fixed organization statement in test files.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdate the API generation code and code generation sample 71/671/1
Lukas Sedlak [Thu, 11 Apr 2013 21:47:40 +0000 (14:47 -0700)]
Update the API generation code and code generation sample

Fixed bug in generation of package names.

Change-Id: I8314f44ddf08aceb29b0ccccbb81d2c0eaf54d1d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoYANG model parser refactoring 48/648/1
Martin Vitez [Mon, 8 Apr 2013 08:31:04 +0000 (10:31 +0200)]
YANG model parser refactoring
-fix YANG types constraints resolving
-added tests
-removed unused test files

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoRefactored YangModelParserImpl 47/647/1
mvitez [Thu, 4 Apr 2013 13:48:56 +0000 (15:48 +0200)]
Refactored YangModelParserImpl
Renamed Identityref to IdentityrefType
Renamed IdentityType to IdentitySchemaNode and moved from yang-model-util to yang-model-api + refactored as interface
Added tests

Signed-off-by: mvitez <mvitez@cisco.com>
10 years agoFixed bug in naming conventions. 46/646/1
lsedlak [Thu, 4 Apr 2013 13:04:19 +0000 (15:04 +0200)]
Fixed bug in naming conventions.
In yang-data-util changed package name from
org.opendaylight.controller.data.util to
org.opendaylight.controller.yang.data.util;
In yang-model-api changed package name from
org.opendaylight.controller.model.api.type to
org.opendaylight.controller.yang.model.api.type;
In yang-model-util changed package name from
org.opendaylight.controller.model.util to
org.opendaylight.controller.yang.model.util;

Refactored and updated all imports dependant on projects
yang-model-util, yang-model-api and yang-model-util

Signed-off-by: lsedlak <lsedlak@cisco.com>
10 years agoFixed bugs in naming conventions of packages. 70/670/1
lsedlak [Thu, 4 Apr 2013 13:04:19 +0000 (15:04 +0200)]
Fixed bugs in naming conventions of packages.

In yang-data-util changed package name from
org.opendaylight.controller.data.util to
org.opendaylight.controller.yang.data.util;
In yang-model-api changed package name from
org.opendaylight.controller.model.api.type to
org.opendaylight.controller.yang.model.api.type;
In yang-model-util changed package name from
org.opendaylight.controller.model.util to
org.opendaylight.controller.yang.model.util;

Added junit test for resolving Yang types from multiple Yang modules;
Fixed typo in QName of Uint64.java to uint64 QName;

Refactored and updated all imports dependant on projects
yang-model-util, yang-model-api and yang-model-util

Change-Id: I13779030a9823a821fc06d5b9a90e195da3e0a1a
Signed-off-by: lsedlak <lsedlak@cisco.com>
10 years agoFixed YANG union type resolving in yang model parser. 45/645/1
mvitez [Wed, 3 Apr 2013 13:28:38 +0000 (15:28 +0200)]
Fixed YANG union type resolving in yang model parser.

Signed-off-by: mvitez <mvitez@cisco.com>
10 years agoAdded YANG typedef support in the YANG parser 69/669/1
Martin Vitez [Thu, 28 Mar 2013 13:19:31 +0000 (14:19 +0100)]
Added YANG typedef support in the YANG parser

Added javadoc to builders
Added JUnit test
Fixed hashCode and equals implementation (now only based on QName) for schema Node TOs.

Change-Id: I0d064391ac8de2c77258d3817ce4f7f50ea90350
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdated YANG Type definitions and documentation in YANG Model Utils. 44/644/1
Lukas Sedlak [Thu, 28 Mar 2013 12:58:52 +0000 (13:58 +0100)]
Updated YANG Type definitions and documentation in YANG Model Utils.

Splitted Integer Type into Unsigned and Signed Integer Type.
Updated documentation.

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded javadoc and RFC references to Java YANG model. 43/643/1
Lukas Sedlak [Thu, 28 Mar 2013 12:09:04 +0000 (13:09 +0100)]
Added javadoc and RFC references to Java YANG model.

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge from development repository. 42/642/1
Tony Tkacik [Mon, 25 Mar 2013 13:25:07 +0000 (14:25 +0100)]
Merge from development repository.
See commit log bellow for more details.

    commit d3f7ff74377f55c106ca28a43c936ef4d3bcb5e2
    Author: mvitez <mvitez@cisco.com>
    Date:   Mon Mar 25 10:15:36 2013 +0100

        improve some code

    commit a0bec74e277e7afcc0f6867ba2d7527d4e25db60
    Author: mvitez <mvitez@cisco.com>
    Date:   Mon Mar 25 09:26:59 2013 +0100

        added typedef and augment resolving, added tests

    commit 32fff33187321463bb27b5c11b63a71d8dbc104e
    Merge: 562dbeb e6b3057
    Author: lsedlak <lsedlak@cisco.com>
    Date:   Fri Mar 22 15:27:59 2013 +0100

        Merge branch 'binding-api'

    commit e6b30574b2598c289ea90be6588151dc7cb7b0fa
    Author: lsedlak <lsedlak@cisco.com>
    Date:   Fri Mar 22 15:16:12 2013 +0100

        Added Implementation of getPathStatement into Identityref.java;

    commit ef70678b2127fd56d062d99a20a02de401262b29
    Author: lsedlak <lsedlak@cisco.com>
    Date:   Fri Mar 22 15:14:28 2013 +0100

        Added RevisionAwareXPath into interface definition;

    commit 78cb3c64716f7cf2788dfaf61906a07481bcd9df
    Author: mvitez <mvitez@cisco.com>
    Date:   Fri Mar 22 13:40:05 2013 +0100

        added implementation of SchemaContext

    commit 45769c7721eb9832cd43c04a020f1ca7f52172ef
    Author: lsedlak <lsedlak@cisco.com>
    Date:   Fri Mar 22 13:55:26 2013 +0100

        Changed parameter in generateTypes from Module to SchemaContext;
        Implemented changes in generatedTypes in BindingGeneratorImpl.java;
        Implemented changes in GeneratedTypesTest.java;

    commit 562dbebbbbfec341c98885ad80b87f3d8d05c3f7
    Author: mvitez <mvitez@cisco.com>
    Date:   Fri Mar 22 13:40:05 2013 +0100

        added implementation of SchemaContext

    commit c4ea91257946fa1f3cd44a148af7a44e254b661f
    Author: lsedlak <lsedlak@cisco.com>
    Date:   Fri Mar 22 11:09:50 2013 +0100

        Added definition: getExtensions into SchemaContext.java;

    commit 8b239e3fb4a322baa36867d4ce41f2c142a8ef76
    Author: mvitez <mvitez@cisco.com>
    Date:   Fri Mar 22 10:46:27 2013 +0100

        fix Demo, GeneratedTypesTest

    commit 6564270ea304905ccb91718066c7aa65b5430ecb
    Author: mvitez <mvitez@cisco.com>
    Date:   Fri Mar 22 10:33:26 2013 +0100

        rename packages

    commit f3326c65f7de3ce77137b0c972aff32aa5d6f6c6
    Author: mvitez <mvitez@cisco.com>
    Date:   Thu Mar 21 17:45:24 2013 +0100

        renamed YangModelParserImpl-> YangModelParserListenerImpl

    commit 26fa647a676f9c466a010536e9d972486adbb904
    Author: Anton Tkacik <ttkacik@cisco.com>
    Date:   Thu Mar 21 15:49:55 2013 +0100

        Added SAL Binding SPI

    commit e60fb750ef193d8456cb1196b4d13f12f44ad276
    Author: lsedlak <lsedlak@cisco.com>
    Date:   Thu Mar 21 17:27:05 2013 +0100

        Added yang-model-parser-api module into pom definition;

    commit c7023e3f2ae7defeadba319c40011ed4f90bfb4f
    Author: Anton Tkacik <ttkacik@cisco.com>
    Date:   Thu Mar 21 11:22:50 2013 +0100

        Renamed Controller architecture to OpenDayLightController SAL

    commit 985d3e66977876be83db6cba92753ef3ade3edf2
    Merge: 9c9c027 39c8c01
    Author: mvitez <mvitez@cisco.com>
    Date:   Thu Mar 21 15:31:53 2013 +0100

        more progress on yang java model

    commit 9c9c0271a4b7b35177164e94e1677dabecd88ca8
    Author: mvitez <mvitez@cisco.com>
    Date:   Thu Mar 21 13:58:59 2013 +0100

        more progress on yang java model

    commit 5609186d6b22a89f8d0568962bb8d0657818cee4
    Merge: c26cf1d 5adfb70
    Author: mvitez <mvitez@cisco.com>
    Date:   Wed Mar 20 18:14:34 2013 +0100

        getExtensionSchemaNodes changed to getUnknownSchemaNodes;
        Whole package org.opendaylight.controller.model.parser.builder
        refactored accordingly;

    commit 820716ed377f4a7878a1f6373095053eb4ababd0
    Author: mvitez <mvitez@cisco.com>
    Date:   Thu Mar 21 10:04:44 2013 +0100

        added equals, hashCode

    commit c26cf1d917811ab0d5473342d253314f62d6e0a1
    Author: mvitez <mvitez@cisco.com>
    Date:   Wed Mar 20 18:13:56 2013 +0100

        more progress on yang java model

    commit 32e3b9dbef20ab6d8e40d9eded3c452a7f23fdc2
    Author: mvitez <mvitez@cisco.com>
    Date:   Wed Mar 20 15:44:10 2013 +0100

        Changed getLengthConstraint to getLengthConstraints and
        changed return value from LengthConstraint to Set of LengthConstraints;
        Updated BinaryType implementation accordingly;

    commit e8419305c2b7b3197734c8d89d77be25f2d78440
    Author: mvitez <mvitez@cisco.com>
    Date:   Wed Mar 20 15:44:10 2013 +0100

        more progress on yang java model

    commit 6b0283f178366831306456d59431b5747f6c038b
    Author: mvitez <mvitez@cisco.com>
    Date:   Wed Mar 20 12:08:31 2013 +0100

        Added method definitions for RevisionAwareXPath interface;

    commit 463884e9e9e21ff03a3b89b590d0b08d9dd2d9b7
    Author: mvitez <mvitez@cisco.com>
    Date:   Wed Mar 20 12:08:31 2013 +0100

        rework augment parsing

    commit b2fe0c91d7cf184252e2516ad15cdd50e01130a7
    Author: mvitez <mvitez@cisco.com>
    Date:   Tue Mar 19 18:18:28 2013 +0100

        fix test

    commit cd388c2f7fd0460ca068270035ab0acdaa9e5e79
    Author: mvitez <mvitez@cisco.com>
    Date:   Tue Mar 19 18:16:33 2013 +0100

        more progress on yang java model

    commit 638c43548ca83c739131118a404c7b1d454055db
    Merge: 2b0fb2c 36f2f95
    Author: mvitez <mvitez@cisco.com>
    Date:   Tue Mar 19 15:21:27 2013 +0100

        GeneratedType changed to Type in return value of
        generateTypes method;
        Implemented composite key resolving through GeneratedTOBuilder;
        Added test cases for composite key generation;
        Added list-composite-key.yang file for testing purposes;

Change-Id: I9145a87945cc4638ff454f268eb37dd1bf8b3142
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoInitial opendaylight infrastructure commit!! 41/641/1
Giovanni Meo [Fri, 22 Mar 2013 11:46:02 +0000 (12:46 +0100)]
Initial opendaylight infrastructure commit!!

Change-Id: I2f6610f89c8c32dc6dab4e6982ce06a9b038a85a
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
10 years agoInitial empty repository
Andrew Grimberg [Thu, 18 Jul 2013 22:42:35 +0000 (22:42 +0000)]
Initial empty repository