yangtools.git
10 years agoFixed NPE when dealing with union and identityref types. 14/814/2
Martin Vitez [Wed, 7 Aug 2013 09:22:40 +0000 (11:22 +0200)]
Fixed NPE when dealing with union and identityref types.

Change-Id: Ib866d9d6deb300345741fd36702af8cb3c8f043c
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdated binding-generator-impl to support more extensible logic. 08/808/1
Tony Tkacik [Tue, 6 Aug 2013 14:34:55 +0000 (16:34 +0200)]
Updated binding-generator-impl to support more extensible logic.

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoJava builder pattern is not generated for rcp and grouping elements 06/806/1
msunal [Tue, 6 Aug 2013 14:15:10 +0000 (16:15 +0200)]
Java builder pattern is not generated for rcp and grouping elements

- added method for checking whether generated type implements Augmentable interface.
If generated type is from rcp or grouping element then the generated type does not implement
Augmentable and java builder pattern is not generated.
- added test way that a generated type implements Augmentable into GeneratorJavaFileTest
- bugfix:
bug - javax.management.Notification import was used in generated interfaces extending Notification.
consequences - Therefore generated interfaces contained errors. javax.management.
fix - Notification was replaced by org.opendaylight.yangtools.yang.binding.Notification

Signed-off-by: Martin Sunal <msunal@cisco.com>
10 years agoRenamed base package names from org.opendaylight.controller to org.opendaylight.yangt... 02/802/1
Martin Vitez [Tue, 6 Aug 2013 11:58:29 +0000 (13:58 +0200)]
Renamed base package names from org.opendaylight.controller to org.opendaylight.yangtools.
Updated imports.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdated yangtools version to 0.5.6-SNAPSHOT. 99/799/4
Martin Vitez [Tue, 6 Aug 2013 07:20:14 +0000 (09:20 +0200)]
Updated yangtools version to 0.5.6-SNAPSHOT.

Moved all yang-* modules under yang directory. Updated poms.
Fixed bug in yang uses processing.

Change-Id: I4b65a92d4e827bf05aa95ef234394c0eed49c0a9
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded 'code-generator' and 'model' projects from controller project. 98/798/1
Martin Vitez [Mon, 5 Aug 2013 18:23:25 +0000 (20:23 +0200)]
Added 'code-generator' and 'model' projects from controller project.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed qname of nodes defined by uses statement. 86/786/1
Martin Vitez [Mon, 5 Aug 2013 07:28:50 +0000 (09:28 +0200)]
Fixed qname of nodes defined by uses statement.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoRefactored parsing of yang uses statement. 67/767/1
Martin Vitez [Thu, 1 Aug 2013 15:11:39 +0000 (17:11 +0200)]
Refactored parsing of yang uses statement.

Added more tests.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoVersion increased to 0.5.5-SNAPSHOT. 65/765/1
Martin Vitez [Thu, 1 Aug 2013 08:50:12 +0000 (10:50 +0200)]
Version increased to 0.5.5-SNAPSHOT.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed build problems with yang-maven-plugin. 61/761/1
Martin Vitez [Wed, 31 Jul 2013 14:43:08 +0000 (16:43 +0200)]
Fixed build problems with yang-maven-plugin.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded more tests. Fixed javadocs. 58/758/6
Martin Vitez [Wed, 31 Jul 2013 09:36:51 +0000 (11:36 +0200)]
Added more tests. Fixed javadocs.

Changed antlr generated code directory from org.opendaylight.controller to org.opendaylight.yangtools.

Change-Id: Ief5b41b6c0200df3f6085e01d5d0060270eefc9e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoReplaced 'controller' with 'yangtools' in all package names. 44/744/1
Martin Vitez [Tue, 30 Jul 2013 15:55:25 +0000 (17:55 +0200)]
Replaced 'controller' with 'yangtools' in all package names.

Changed groupId in poms from org.opendaylight.yang to org.opendaylight.yangtools.
Added more tests.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed bugs in antlr lexer and parser. Fixed distributionManagement section in pom... 42/742/1
Martin Vitez [Tue, 30 Jul 2013 09:56:56 +0000 (11:56 +0200)]
Fixed bugs in antlr lexer and parser. Fixed distributionManagement section in pom.xml.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoReplaced package names from org.opendaylight.controller to org.opendaylight.yangtools... 32/732/4
Martin Vitez [Mon, 29 Jul 2013 11:30:06 +0000 (13:30 +0200)]
Replaced package names from org.opendaylight.controller to org.opendaylight.yangtools in yang-parser-api,  yang-parser-impl and yang-model-api.

Change-Id: Ie07ccb5d41c37874a3c4551e7a584e3cf34caa51
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoRenamed yang-model-parser-api -> yang-parser-api. 31/731/1
Martin Vitez [Mon, 29 Jul 2013 10:01:00 +0000 (12:01 +0200)]
Renamed yang-model-parser-api -> yang-parser-api.

Renamed yang-model-parser-impl -> yang-parser-impl.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoRenamed maven-yang-plugin -> yang-maven-plugin. 30/730/1
Martin Vitez [Mon, 29 Jul 2013 09:36:26 +0000 (11:36 +0200)]
Renamed maven-yang-plugin -> yang-maven-plugin.

Renamed maven-yang -> yang-maven-plugin-spi.
Renamed maven-yang-plugin-it -> yang-maven-plugin-it.

Updated '.gitignore'.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed poms. Updated '.gitignore'. 95/695/1
Martin Vitez [Wed, 24 Jul 2013 13:43:08 +0000 (15:43 +0200)]
Fixed poms. Updated '.gitignore'.

YangToSourcesPluginTestIT temporary ignored.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoUpdate parent pom. Add '.gitignore'. 68/668/1
Martin Vitez [Wed, 24 Jul 2013 08:15:59 +0000 (10:15 +0200)]
Update parent pom. Add '.gitignore'.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoProjects moved under correct parent. 93/693/1
Martin Vitez [Fri, 19 Jul 2013 09:15:10 +0000 (11:15 +0200)]
Projects moved under correct parent.

Moved code-generator/maven-yang -> yang/.
Moved code-generator/maven-yang-plugin -> yang/.
Moved code-generator/maven-yang-plugin-it -> yang/.
Moved code-generator/yang-model-parser-api -> yang/.
Moved code-generator/yang-model-parser-impl -> yang/.

Configured site plugin for project. Fixed some javadocs.
Fixed bug in ParserUtils causing NullPointerException.
Fixed bug in resolving uses statement.
Improved tests.

Change-Id: Ia7567544fbe006f0cf87055c6633c04b5ce2c50e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agogroovy node-tree integration 92/692/1
Michal Rehak [Mon, 24 Jun 2013 06:31:00 +0000 (08:31 +0200)]
groovy node-tree integration
logging

fixing groovy tree generating

added params for surefire

lazy node2node map fixing

changed api according to dom usage
added lazy implementation of dom
added unit tests of this dom
changed abstract implementation in yang-data-util according to new api

improved groovy generated tree and testing
removed large testing files
added copyright comments
removed maven-surefire-plugin jConsole argument (plugin fails to start, if property not defined)

Change-Id: I00b9fcbc20ce5d120128940b7b569d7a14628a6e
Signed-off-by: Michal Rehak <mirehak@cisco.com>
10 years agoYANG typedefs generation as class with extends key word 91/691/1
Jozef Gloncak [Thu, 11 Jul 2013 08:49:23 +0000 (10:49 +0200)]
YANG typedefs generation as class with extends key word
In case that YANG typedef isn't specified as base type then corresponding
class will be generated with EXTENDS key word and corresponding extended
class.

Change-Id: I36143f485b8e68f471e2a3021ceb7ddc4ad9df2f
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoBumped version of yang-prototype to 0.5.4-SNAPSHOT. 90/690/1
Martin Vitez [Wed, 10 Jul 2013 12:01:19 +0000 (14:01 +0200)]
Bumped version of yang-prototype to 0.5.4-SNAPSHOT.

Change-Id: Idacefac91a2d86606debf8a75f6cab2cf1303b98
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded YANG extensions module 89/689/1
Tony Tkacik [Tue, 9 Jul 2013 15:22:53 +0000 (17:22 +0200)]
Added YANG extensions module

  - Added YANG extensions module which defines
    - Context-aware RPCs
    - Named Augmentations

Change-Id: I7b6cb7f579c519dfa726f966df466ad6c9e6aee1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMinor code refactoring and improvements. 88/688/1
Martin Vitez [Tue, 9 Jul 2013 15:10:20 +0000 (17:10 +0200)]
Minor code refactoring and improvements.

Change-Id: Ifdc5b45e610037ef14eed6c97885deb1075aa884
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agofirst implementation of yang-data-api 87/687/1
Michal Rehak [Thu, 27 Jun 2013 14:01:29 +0000 (16:01 +0200)]
first implementation of yang-data-api

created maven project
added basic implementations of api
added unit tests
changed api according to implementation

Change-Id: I888371d5a7afc46c843f882bee9bfcaa19d5ccbc
Signed-off-by: Michal Rehak <mirehak@cisco.com>
10 years agoAdded more tests for yang parser. Updated current tests. 67/667/1
Martin Vitez [Thu, 4 Jul 2013 11:50:25 +0000 (13:50 +0200)]
Added more tests for yang parser. Updated current tests.

Improved parsing of deviation statement. Added getDataChildByName method to DataNodeContainerBuilder.
Fixed resolving of pattern constraint.
Renamed YangModelBuilderUtil -> ParserListenerUtils.
Renamed some test files.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded support to generate types from Choices and Cases added by augmentation. 66/666/1
lsedlak [Wed, 3 Jul 2013 15:37:59 +0000 (17:37 +0200)]
Added support to generate types from Choices and Cases added by augmentation.

Added implementation into BindingGeneratorImpl to suppor of generating Generated Types for Choices and Cases from augmentations;
Extended ChoiceNode API and ChoiceNodeBuilder to getCaseNodeByName methods;
Fixed findSchemaNodeForGivenPath in SchemaContextUtil to support of traversal through Choice and Case nodes in data schema tree;

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoImplemented ordering of yang module data nodes. Added Comparators utility class. 86/686/1
Martin Vitez [Tue, 2 Jul 2013 12:13:48 +0000 (14:13 +0200)]
Implemented ordering of yang module data nodes. Added Comparators utility class.
Added checking for duplicate nodes. Added getParent() method to Builder interface.
Removed unused TypeDefinitionAwareBuilder interface.
Fixed bug in processing augmentation of choice node.
Added more logs, javadocs, tests.

Change-Id: I6d7a504cdb516c267d42b99091120649027b453d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded support to generate interfaces from Choices and Cases. 65/665/1
lsedlak [Mon, 1 Jul 2013 15:47:09 +0000 (17:47 +0200)]
Added support to generate interfaces from Choices and Cases.

Added implementation to support generation of generated types from Choice and Case schema nodes from yang models into BindingGeneratorImpl;
Added test case and test files for test of generation of Generated Types;

Fixed bug in GeneratorUtil when imports were generated wrongly if the name of type was same as the name of interface/class.

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoRefactored parsing of YANG uses statement. 85/685/1
Martin Vitez [Thu, 27 Jun 2013 14:26:12 +0000 (16:26 +0200)]
Refactored parsing of YANG uses statement.

Uses statement now add nodes from referenced grouping to context where uses is defined. Added GroupingMember interface as marker interface for nodes defined in grouping.
Fixed parsing of config statement: when config is not specified, the default is same as parent schema node. If top node does not specify config, default is true.
Added ConfigNode as marker interface for nodes which can contains 'config' statement.
Added AbstractSchemaNodeBuilder as base class for builders of SchemaNode nodes.
Updated tests.

Change-Id: Ibabcf590608bdf482258826fa250692507a71c01
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFixed bug in GeneratedPropertyBuilderImpl. 64/664/1
lsedlak [Thu, 27 Jun 2013 14:26:15 +0000 (16:26 +0200)]
Fixed bug in GeneratedPropertyBuilderImpl.

Default value for GeneratedProperty is set to true;
Added extends of AbstractBaseType for EnumerationBuilderImpl, AnnotationTypeBuilderImpl, AbstractGeneratedTypeBuilder and AbstractGeneratedType;

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
10 years agoBumped version of YANG tools to 0.5.3-SNAPSHOT 63/663/1
Tony Tkacik [Thu, 27 Jun 2013 10:56:15 +0000 (12:56 +0200)]
Bumped version of YANG tools to 0.5.3-SNAPSHOT

Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAdded support for parsing yang models with already resolved context. 84/684/1
Martin Vitez [Mon, 24 Jun 2013 09:48:14 +0000 (11:48 +0200)]
Added support for parsing yang models with already resolved context.

Added rebuild method to AugmentationTargetBuilder interface to support augmentation of resolved context.
Refactored YangParserImpl to improve readability, internal utility methods moved to ParserUtils class.
Added test to check parsing with context.
Added YangErrorListener to redirect antlr4 error messages from standard error output to logger.
Added more javadocs.

Change-Id: I838646cc4b3593a03420c1b578ee39c043f89e3d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded validation of range and length constraints. 62/662/1
Martin Vitez [Mon, 17 Jun 2013 13:04:54 +0000 (15:04 +0200)]
Added validation of range and length constraints.
Fixed base range constraints of yang uint built-in types. Made rpc input and output statement optional.
Changed formatting of files to conform new sun_coding_style template. Added more tests.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBumped version of YANG tools to 0.5.2-SNAPSHOT 83/683/1
Tony Tkacik [Fri, 14 Jun 2013 12:29:39 +0000 (14:29 +0200)]
Bumped version of YANG tools to 0.5.2-SNAPSHOT

Change-Id: I4151e59cfb51ff934ce3c3c18090a30fb4a4179e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAdded support for source code generation from identity statement, grouping statement... 82/682/1
Martin Vitez [Thu, 13 Jun 2013 15:25:18 +0000 (17:25 +0200)]
Added support for source code generation from identity statement, grouping statement and identityref type statement.
Introduce new BaseIdentity class as base for all classes generated from identity statements.
Introduce new WildcardType interface to add possibility to generate wildcard java type parameters in generated code.
Updated tests.

Change-Id: I99de20dc4268be43ec9966461aeb75521fe5dd6c
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdded Support for Union Type def resolving and bug fixes. 81/681/1
lsedlak [Tue, 11 Jun 2013 15:08:25 +0000 (17:08 +0200)]
Added Support for Union Type def resolving and bug fixes.

Added implementation into TypeProviderImpl to proper resolve union type definitions;
Added UnionDependencySort for correct resolution of multiple unions in same yang model;
Added support for resolving of imported union types from multiple modules;
Added tests for Union Type def resolving;

Fixed Resolving of typedef Enumerations - now the Enumeration is resolved as standalone enum typedef name .java;
Fixed resolving of Inner Enumerations;
Fixed resolving of referenced Inner Enumerations through leafref definition;
Added EnumGenerator class for generating of Enum definitions and inner Enum definitions;
Fixed generation of Enumeration type through code writer;
Fixed generation of Enumeration package name in case of inner enum definition in Class and Generated Transfer Objects;
Added capability to generate inner enums into ClassCodeGenerator and InterfaceGenerator;

Fixed of missing apostrophe in createToString method in GeneratorUtil.java in case when more than one property should be generated in toString method;

Fixed platform specific bug in maven-yang-plugin incorrect retieval of maven dependency in YangToSourcesProcessor.java;
Fixed platform specific bug in maven-yang-plugin-it - hard coded resource paths replaced for getClass().getResource calls;

Added support into BindingGenerator API to suppor of generation of Types with restriction of specified modules that will be generated;
Added implementation of generateTypes in BindingGeneratorImpl;

Added tests and test resources for testing Enumeration gen. types
Added test resources for augment relative xpath testing;

Fixed improper implementation of hashCode and equals in ExtendedType in yang-model-util;
Fixed findParentModule method in SchemaContextUtil in yang-model-util project;

Change-Id: I144acbeec9ce547da856e2979d27b2c072174a52
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
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