Merge "When a node is going down, remove edges in both directions associated with...
authorAlessandro Boch <aboch@cisco.com>
Wed, 24 Jul 2013 00:19:33 +0000 (00:19 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 24 Jul 2013 00:19:33 +0000 (00:19 +0000)
237 files changed:
opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/internal/ArpHandler.java
opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/Activator.java
opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/internal/StaticRoutingImplementation.java
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTracker.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/IPv4.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/ObjectWriter.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/packet/IPv4Test.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/generator/impl/BindingGeneratorImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/TypeProviderImpl.java
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BitAndUnionTOEnclosingTest.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ExtendedTypedefTest.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/bit_and_union_in_leaf.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/typedef_of_typedef.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/ClassCodeGenerator.java
opendaylight/sal/yang-prototype/code-generator/binding-java-api-generator/src/main/java/org/opendaylight/controller/sal/java/api/generator/GeneratorUtil.java
opendaylight/sal/yang-prototype/code-generator/binding-model-api/pom.xml
opendaylight/sal/yang-prototype/code-generator/pom.xml
opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/typedef_of_typedef.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/sample.yang [deleted file]
opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/toaster.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/code-generator/src/site/site.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/concepts-lang/pom.xml
opendaylight/sal/yang-prototype/concepts-lang/src/site/site.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/model/ietf/ietf-inet-types/pom.xml
opendaylight/sal/yang-prototype/model/ietf/ietf-yang-types/pom.xml
opendaylight/sal/yang-prototype/model/ietf/pom.xml
opendaylight/sal/yang-prototype/model/pom.xml
opendaylight/sal/yang-prototype/model/src/site/site.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/pom.xml
opendaylight/sal/yang-prototype/src/site/markdown/readme.md [new file with mode: 0644]
opendaylight/sal/yang-prototype/src/site/resources/stylesheet.css [new file with mode: 0644]
opendaylight/sal/yang-prototype/src/site/site.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/.gitignore [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/.gitignore with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/pom.xml with 95% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/java/org/opendaylight/controller/yang2sources/plugin/it/YangToSourcesPluginTestIT.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/java/org/opendaylight/controller/yang2sources/plugin/it/YangToSourcesPluginTestIT.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/AdditionalConfig/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/AdditionalConfig/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/Correct/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/Correct/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/GenerateTest1/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest1/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/GenerateTest1/src/main/resources/testfile1.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest1/src/main/resources/testfile1.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/GenerateTest1/src/main/resources/testfile2.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest1/src/main/resources/testfile2.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/GenerateTest1/src/main/resources/testfile3.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest1/src/main/resources/testfile3.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/GenerateTest2/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest2/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/GenerateTest2/yang/private.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/GenerateTest2/yang/private.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/Generator/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/Generator/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/MissingYangInDep/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/MissingYangInDep/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/MissingYangInDep/yang/private.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/MissingYangInDep/yang/private.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/NoGenerators/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoGenerators/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/NoOutputDir/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoOutputDir/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/NoYangFiles/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/NoYangFiles/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/UnknownGenerator/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/UnknownGenerator/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/YangRootNotExist/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/YangRootNotExist/pom.xml with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/files/testfile1.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/files/testfile1.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/files/testfile2.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/files/testfile2.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin-it/src/test/resources/files/testfile3.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin-it/src/test/resources/files/testfile3.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/pom.xml with 98% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/ConfigArg.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/ConfigArg.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/Util.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/Util.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/YangToSourcesMojo.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/YangToSourcesMojo.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/YangToSourcesProcessor.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/src/main/java/org/opendaylight/controller/yang2sources/plugin/YangToSourcesProcessor.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/src/test/java/org/opendaylight/controller/yang2sources/plugin/GenerateSourcesTest.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/src/test/java/org/opendaylight/controller/yang2sources/plugin/GenerateSourcesTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/src/test/java/org/opendaylight/controller/yang2sources/plugin/UtilTest.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/src/test/java/org/opendaylight/controller/yang2sources/plugin/UtilTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang-plugin/src/test/resources/yang/mock.yang [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang-plugin/src/test/resources/yang/mock.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang/pom.xml with 94% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang/src/main/java/org/opendaylight/controller/yang2sources/spi/CodeGenerator.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang/src/main/java/org/opendaylight/controller/yang2sources/spi/CodeGenerator.java with 93% similarity]
opendaylight/sal/yang-prototype/yang/maven-yang/src/test/java/org/opendaylight/controller/yang2sources/spi/CodeGeneratorTestImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/maven-yang/src/test/java/org/opendaylight/controller/yang2sources/spi/CodeGeneratorTestImpl.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/pom.xml
opendaylight/sal/yang-prototype/yang/src/site/site.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-binding/pom.xml
opendaylight/sal/yang-prototype/yang/yang-common/pom.xml
opendaylight/sal/yang-prototype/yang/yang-data-api/pom.xml
opendaylight/sal/yang-prototype/yang/yang-data-api/src/main/java/org/opendaylight/controller/yang/data/api/CompositeNode.java
opendaylight/sal/yang-prototype/yang/yang-data-api/src/main/java/org/opendaylight/controller/yang/data/api/MutableCompositeNode.java
opendaylight/sal/yang-prototype/yang/yang-data-api/src/main/java/org/opendaylight/controller/yang/data/api/MutableSimpleNode.java
opendaylight/sal/yang-prototype/yang/yang-data-api/src/main/java/org/opendaylight/controller/yang/data/api/SimpleNode.java
opendaylight/sal/yang-prototype/yang/yang-data-impl/pom.xml [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/AbstractNodeTO.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/CompositeNodeModificationTOImpl.java
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/CompositeNodeTOImpl.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/LazyNodeToNodeMap.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/MutableCompositeNodeTOImpl.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/MutableSimpleNodeTOImpl.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/NodeFactory.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/NodeModificationBuilderImpl.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/NodeUtils.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/SimpleNodeModificationTOImpl.java
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/main/java/org/opendaylight/controller/yang/data/impl/SimpleNodeTOImpl.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/IgnoreWhiteCharsDiffListener.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/LazyNodeToNodeMapTest.java [new file with mode: 0755]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/MemoryConsumption.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/MyNodeBuilder.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/NodeFactoryTest.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/NodeHelper.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/NodeModificationBuilderImplTest.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/java/org/opendaylight/controller/yang/data/impl/NodeUtilsTest.java [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/MyXmlGenerator.groovy [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/config01.xml [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/config02.content [deleted file]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/config02.xml [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/config02g.xml [deleted file]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/controller-network.xsd [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/controller-network.yang [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/generateXml.groovy [deleted file]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/ietf-inet-types@2010-09-24.yang [changed mode: 0755->0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/log4j-test.xml [new file with mode: 0755]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/org/opendaylight/controller/yang/data/impl/config02-shadow.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/org/opendaylight/controller/yang/data/impl/config02.groovy [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/org/opendaylight/controller/yang/data/impl/config02g-shadow.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-impl/src/test/resources/org/opendaylight/controller/yang/data/impl/mutableNodesConfig.xml [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-data-util/pom.xml
opendaylight/sal/yang-prototype/yang/yang-data-util/src/main/java/org/opendaylight/controller/yang/data/util/AbstractNode.java
opendaylight/sal/yang-prototype/yang/yang-data-util/src/main/java/org/opendaylight/controller/yang/data/util/Nodes.java
opendaylight/sal/yang-prototype/yang/yang-ext/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-api/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/type/DecimalTypeDefinition.java
opendaylight/sal/yang-prototype/yang/yang-model-parser-api/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-api/pom.xml with 86% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-api/src/main/java/org/opendaylight/controller/yang/model/parser/api/YangModelParser.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-api/src/main/java/org/opendaylight/controller/yang/model/parser/api/YangModelParser.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-api/src/main/java/org/opendaylight/controller/yang/model/parser/api/package-info.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-api/src/main/java/org/opendaylight/controller/yang/model/parser/api/package-info.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/pom.xml [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/pom.xml with 89% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/antlr/YangLexer.g4 [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/antlr/YangLexer.g4 with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/antlr/YangParser.g4 [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/antlr/YangParser.g4 with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AbstractBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AbstractTypeAwareBuilder.java with 61% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AbstractDataNodeContainerBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AbstractDataNodeContainerBuilder.java with 56% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AbstractSchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AbstractSchemaNodeBuilder.java with 63% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AbstractTypeAwareBuilder.java [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AugmentationSchemaBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AugmentationSchemaBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AugmentationTargetBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/AugmentationTargetBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/Builder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/Builder.java with 85% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/DataNodeContainerBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/DataNodeContainerBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/DataSchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/DataSchemaNodeBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/GroupingBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/GroupingBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/GroupingMember.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/GroupingMember.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/SchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/SchemaNodeBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/TypeAwareBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/TypeAwareBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/TypeDefinitionBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/TypeDefinitionBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/UsesNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/api/UsesNodeBuilder.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/AnyXmlBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/AnyXmlBuilder.java with 96% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/AugmentationSchemaBuilderImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/AugmentationSchemaBuilderImpl.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ChoiceBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ChoiceBuilder.java with 87% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ChoiceCaseBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ChoiceCaseBuilder.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ConstraintsBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ConstraintsBuilder.java with 92% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ContainerSchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ContainerSchemaNodeBuilder.java with 95% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/DeviationBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/DeviationBuilder.java with 77% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ExtensionBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ExtensionBuilder.java with 98% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/FeatureBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/FeatureBuilder.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/GroupingBuilderImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/GroupingBuilderImpl.java with 80% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/IdentitySchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/IdentitySchemaNodeBuilder.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/IdentityrefTypeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/IdentityrefTypeBuilder.java with 77% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/LeafListSchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/LeafListSchemaNodeBuilder.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/LeafSchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/LeafSchemaNodeBuilder.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ListSchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ListSchemaNodeBuilder.java with 96% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ModuleBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/ModuleBuilder.java with 79% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/NotificationBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/NotificationBuilder.java with 99% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/RpcDefinitionBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/RpcDefinitionBuilder.java with 98% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/TypeDefinitionBuilderImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/TypeDefinitionBuilderImpl.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UnionTypeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UnionTypeBuilder.java with 83% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UnknownSchemaNodeBuilder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UnknownSchemaNodeBuilder.java with 96% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UsesNodeBuilderImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/builder/impl/UsesNodeBuilderImpl.java with 90% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/SchemaContextImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/SchemaContextImpl.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangErrorListener.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangErrorListener.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserImpl.java with 95% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserListenerImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/impl/YangParserListenerImpl.java with 95% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/BitImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/BitImpl.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/Comparators.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/Comparators.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ModuleDependencySort.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ModuleDependencySort.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/MustDefinitionImpl.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/MustDefinitionImpl.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ParserListenerUtils.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ParserListenerUtils.java with 95% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ParserUtils.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/ParserUtils.java with 96% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/RefineHolder.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/RefineHolder.java with 85% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/RefineUtils.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/RefineUtils.java with 82% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/TopologicalSort.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/TopologicalSort.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/TypeConstraints.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/TypeConstraints.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/UnknownBoundaryNumber.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/UnknownBoundaryNumber.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangParseException.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangParseException.java with 70% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangValidationException.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangValidationException.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/BasicValidations.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/BasicValidations.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/ValidationUtil.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/ValidationUtil.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/YangModelBasicValidationListener.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/YangModelBasicValidationListener.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/YangModelBasicValidator.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/validator/YangModelBasicValidator.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/AugmentTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/AugmentTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/GroupingTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/GroupingTest.java with 69% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/TestUtils.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/TestUtils.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/TypesResolutionTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/TypesResolutionTest.java with 98% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/YangParserNegativeTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/YangParserNegativeTest.java with 68% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/YangParserTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/YangParserTest.java with 97% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/YangParserWithContextTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/impl/YangParserWithContextTest.java with 99% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/util/ModuleDependencySortTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/util/ModuleDependencySortTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/util/TopologicalSortTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/parser/util/TopologicalSortTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationListTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationListTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationModuleTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationModuleTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationSubModuleTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationSubModuleTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationTest.java [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/java/org/opendaylight/controller/yang/validator/YangModelValidationTest.java with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-augment-test/test1.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-augment-test/test1.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-augment-test/test2.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-augment-test/test2.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-augment-test/test3.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-augment-test/test3.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-augment-test/test4.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-augment-test/test4.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-test/deviation-test.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-test/deviation-test.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-test/test1.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-test/test1.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-test/test2.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-test/test2.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/context-test/test3.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/context-test/test3.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/model/custom.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/model/custom.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/model/nodes.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/model/nodes.yang with 95% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/model/types.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/model/types.yang with 79% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/augment0.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/augment1.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/augment2.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/container-leaf.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/container-leaf.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/container-list.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/container-list.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/container.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/container.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/identity.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/identity.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/typedef.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/duplicity/typedef.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/testfile0.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/testfile0.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/testfile1.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/testfile1.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/testfile2.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/testfile2.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/testfile3.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/testfile3.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/testfile4.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/testfile4.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/testfile5.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/testfile5.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/negative-scenario/testfile6.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/negative-scenario/testfile6.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/types/custom-types-test@2012-4-4.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/types/custom-types-test@2012-4-4.yang with 72% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/types/iana-afn-safi@2012-06-04.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/types/iana-afn-safi@2012-06-04.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/types/iana-if-type@2012-06-05.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/types/iana-if-type@2012-06-05.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/types/iana-timezones@2012-07-09.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/types/iana-timezones@2012-07-09.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/types/ietf-inet-types@2010-09-24.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/types/ietf-inet-types@2010-09-24.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-parser-impl/src/test/resources/types/ietf-yang-types@2010-09-24.yang [moved from opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/test/resources/types/ietf-yang-types@2010-09-24.yang with 100% similarity]
opendaylight/sal/yang-prototype/yang/yang-model-util/pom.xml
opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/AbstractUnsignedInteger.java
opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BitsType.java
opendaylight/samples/simpleforwarding/pom.xml
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImpl.java
opendaylight/topologymanager/src/main/java/org/opendaylight/controller/topologymanager/TopologyUserLinkConfig.java
opendaylight/topologymanager/src/main/java/org/opendaylight/controller/topologymanager/internal/Activator.java
opendaylight/topologymanager/src/main/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImpl.java

index 6e625a0..811c7ac 100644 (file)
@@ -21,9 +21,7 @@ import java.util.Set;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.ConcurrentHashMap;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.concurrent.ConcurrentMap;
 
 import org.opendaylight.controller.hosttracker.IfHostListener;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
@@ -47,6 +45,8 @@ import org.opendaylight.controller.sal.utils.NetUtils;
 import org.opendaylight.controller.switchmanager.ISwitchManager;
 import org.opendaylight.controller.switchmanager.Subnet;
 import org.opendaylight.controller.topologymanager.ITopologyManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ArpHandler implements IHostFinder, IListenDataPacket {
     private static final Logger logger = LoggerFactory
@@ -57,8 +57,8 @@ public class ArpHandler implements IHostFinder, IListenDataPacket {
     private IDataPacketService dataPacketService = null;
     private Set<IfHostListener> hostListener = Collections
             .synchronizedSet(new HashSet<IfHostListener>());
-    private ConcurrentHashMap<InetAddress, Set<HostNodeConnector>> arpRequestors;
-    private ConcurrentHashMap<InetAddress, Short> countDownTimers;
+    private ConcurrentMap<InetAddress, Set<HostNodeConnector>> arpRequestors;
+    private ConcurrentMap<InetAddress, Short> countDownTimers;
     private Timer periodicTimer;
 
     void setHostListener(IfHostListener s) {
index cb96ad5..5a39e9e 100644 (file)
@@ -10,6 +10,7 @@
 package org.opendaylight.controller.clustering.services_implementation.internal;
 
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
+import org.opendaylight.controller.sal.core.IContainerAware;
 
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
@@ -30,6 +31,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * ComponentActivatorAbstractBase.
      *
      */
+    @Override
     public void init() {
     }
 
@@ -38,6 +40,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * cleanup done by ComponentActivatorAbstractBase
      *
      */
+    @Override
     public void destroy() {
     }
 
@@ -50,6 +53,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * instantiated in order to get an fully working implementation
      * Object
      */
+    @Override
     public Object[] getGlobalImplementations() {
         Object[] res = { ClusterManager.class, ClusterGlobalManager.class };
         return res;
@@ -64,6 +68,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * instantiated in order to get an fully working implementation
      * Object
      */
+    @Override
     public Object[] getImplementations() {
         Object[] res = { ClusterContainerManager.class };
         return res;
@@ -82,6 +87,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * also optional per-container different behavior if needed, usually
      * should not be the case though.
      */
+    @Override
     public void configureInstance(Component c, Object imp, String containerName) {
         if (imp.equals(ClusterContainerManager.class)) {
             c.setInterface(new String[] { IClusterContainerServices.class.getName() },
@@ -118,10 +124,11 @@ public class Activator extends ComponentActivatorAbstractBase {
      * needed as long as the same routine can configure multiple
      * implementations
      */
+    @Override
     public void configureGlobalInstance(Component c, Object imp) {
         if (imp.equals(ClusterManager.class)) {
             // export the service for Apps and Plugins
-            c.setInterface(new String[] { IClusterServices.class.getName() }, null);
+            c.setInterface(new String[] { IClusterServices.class.getName(), IContainerAware.class.getName() }, null);
         }
 
         if (imp.equals(ClusterGlobalManager.class)) {
index 0b26107..c3fd30a 100644 (file)
@@ -9,8 +9,6 @@
 
 package org.opendaylight.controller.clustering.services_implementation.internal;
 
-import java.io.PrintWriter;
-import java.io.StringWriter;
 import java.net.InetAddress;
 import java.net.NetworkInterface;
 import java.net.SocketException;
@@ -54,10 +52,11 @@ import org.opendaylight.controller.clustering.services.IClusterServices;
 import org.opendaylight.controller.clustering.services.IGetUpdates;
 import org.opendaylight.controller.clustering.services.IListenRoleChange;
 import org.opendaylight.controller.clustering.services.ListenRoleChangeAddException;
+import org.opendaylight.controller.sal.core.IContainerAware;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ClusterManager implements IClusterServices {
+public class ClusterManager implements IClusterServices, IContainerAware {
     protected static final Logger logger = LoggerFactory
             .getLogger(ClusterManager.class);
     private DefaultCacheManager cm;
@@ -99,10 +98,10 @@ public class ClusterManager implements IClusterServices {
             try {
                 Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
                 while (e.hasMoreElements()) {
-                    NetworkInterface n = (NetworkInterface) e.nextElement();
+                    NetworkInterface n = e.nextElement();
                     Enumeration<InetAddress> ee = n.getInetAddresses();
                     while (ee.hasMoreElements()) {
-                        InetAddress i = (InetAddress) ee.nextElement();
+                        InetAddress i = ee.nextElement();
                         myAddresses.add(i);
                     }
                 }
@@ -562,25 +561,29 @@ public class ClusterManager implements IClusterServices {
         return null;
     }
 
+    @Override
     public List<InetAddress> getClusteredControllers() {
         EmbeddedCacheManager manager = this.cm;
         if (manager == null) {
             return null;
         }
         List<Address> controllers = manager.getMembers();
-        if ((controllers == null) || controllers.size() == 0)
+        if ((controllers == null) || controllers.size() == 0) {
             return null;
+        }
 
         List<InetAddress> clusteredControllers = new ArrayList<InetAddress>();
         for (Address a : controllers) {
             InetAddress inetAddress = addressToInetAddress(a);
             if (inetAddress != null
-                    && !inetAddress.getHostAddress().equals(loopbackAddress))
+                    && !inetAddress.getHostAddress().equals(loopbackAddress)) {
                 clusteredControllers.add(inetAddress);
+            }
         }
         return clusteredControllers;
     }
 
+    @Override
     public InetAddress getMyAddress() {
         EmbeddedCacheManager manager = this.cm;
         if (manager == null) {
@@ -660,4 +663,21 @@ public class ClusterManager implements IClusterServices {
             }
         }
     }
+
+    private void removeContainerCaches(String containerName) {
+        logger.info("Destroying caches for container {}", containerName);
+        for (String cacheName : this.getCacheList(containerName)) {
+            this.destroyCache(containerName, cacheName);
+        }
+    }
+
+    @Override
+    public void containerCreate(String arg0) {
+        // no op
+    }
+
+    @Override
+    public void containerDestroy(String container) {
+        removeContainerCaches(container);
+    }
 }
index 98e1d1a..3321880 100644 (file)
@@ -40,6 +40,7 @@
     <virgo.version>3.6.0.RELEASE</virgo.version>
     <geminiweb.version>2.2.0.RELEASE</geminiweb.version>
     <checkstyle.version>2.10</checkstyle.version>
+    <testvm.argLine>-Xmx1024m -XX:MaxPermSize=256m</testvm.argLine>
   </properties>
 
   <pluginRepositories>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>
         <version>${failsafe.version}</version>
+        <configuration>
+          <argLine>${testvm.argLine}</argLine>
+        </configuration>
         <executions>
           <execution>
             <goals>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
+        <configuration>
+          <argLine>${testvm.argLine}</argLine>
+        </configuration>
       </plugin>
     </plugins>
     <pluginManagement>
index 6bf09bb..b99b4bf 100644 (file)
@@ -50,6 +50,8 @@ org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml
 # of.messageResponseTimer=2000
 # The switch liveness timeout value (default 60500 msec)
 # of.switchLivenessTimeout=60500
+# The size of the queue holding pending statistics requests (default 64). For large networks of n switches, it is recommended to set the queue size to n
+# of.statsQueueSize = 64
 # The flow statistics polling interval in second (default 10 sec)
 # of.flowStatsPollInterval=10
 # The port statistics polling interval in second (default 5 sec)
index 8819be3..4afd4fb 100644 (file)
@@ -44,12 +44,12 @@ import org.opendaylight.controller.forwarding.staticrouting.StaticRouteConfig;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
 import org.opendaylight.controller.hosttracker.IfNewHostNotify;
 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
-import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.IObjectReader;
 import org.opendaylight.controller.sal.utils.ObjectReader;
 import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -206,22 +206,6 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
         }
     }
 
-    @SuppressWarnings("deprecation")
-        private void destroyCaches() {
-        if (this.clusterContainerService == null) {
-            log
-                    .info("un-initialized clusterContainerService, can't destroy cache");
-            return;
-        }
-
-        clusterContainerService.destroyCache("forwarding.staticrouting.routes");
-        clusterContainerService
-                .destroyCache("forwarding.staticrouting.configs");
-        clusterContainerService
-                .destroyCache("forwarding.staticrouting.configSaveEvent");
-
-    }
-
     @Override
     public void entryCreated(Long key, String cacheName, boolean local) {
     }
@@ -488,7 +472,6 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
         log.debug("Destroy all the Static Routing Rules given we are "
                 + "shutting down");
 
-        destroyCaches();
         gatewayProbeTimer.cancel();
 
         // Clear the listener so to be ready in next life
index eea2836..2eaafb6 100644 (file)
@@ -897,10 +897,11 @@ public class ForwardingRulesManager implements IForwardingRulesManager, PortGrou
             log.warn(logMsg, groupName);
             return new Status(StatusCode.NOTACCEPTABLE, msg);
         }
-        int toBeRemoved = groupFlows.get(groupName).size();
+        int toBeRemoved = 0;
         String error = "";
         if (groupFlows.containsKey(groupName)) {
             List<FlowEntryInstall> list = new ArrayList<FlowEntryInstall>(groupFlows.get(groupName));
+            toBeRemoved = list.size();
             for (FlowEntryInstall entry : list) {
                 Status status = this.removeEntry(entry.getOriginal(), false);
                 if (status.isSuccess()) {
index 8468c5b..6b7bac0 100644 (file)
@@ -212,17 +212,6 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
         inactiveStaticHosts = new ConcurrentHashMap<NodeConnector, HostNodeConnector>();
     }
 
-    @SuppressWarnings("deprecation")
-    private void destroyCache() {
-        if (this.clusterContainerService == null) {
-            logger.error("un-initialized clusterMger, can't destroy cache");
-            return;
-        }
-        logger.debug("Destroying Cache for HostTracker");
-        this.clusterContainerService.destroyCache("hostTrackerAH");
-        this.clusterContainerService.destroyCache("hostTrackerIH");
-        nonClusterObjectCreate();
-    }
 
     public void shutDown() {
     }
@@ -1343,7 +1332,6 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
      *
      */
     void destroy() {
-        destroyCache();
     }
 
     /**
index 024549d..f0b8735 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.protocol_plugin.openflow.internal;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
@@ -16,6 +17,7 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
 
 import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimExternalListener;
 import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimInternalListener;
@@ -27,13 +29,11 @@ import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitchStateLis
 import org.opendaylight.controller.sal.core.Actions;
 import org.opendaylight.controller.sal.core.Buffers;
 import org.opendaylight.controller.sal.core.Capabilities;
-import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.core.ContainerFlow;
 import org.opendaylight.controller.sal.core.Description;
 import org.opendaylight.controller.sal.core.IContainerListener;
 import org.opendaylight.controller.sal.core.MacAddress;
 import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
 import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.controller.sal.core.Tables;
@@ -64,7 +64,10 @@ public class InventoryServiceShim implements IContainerListener,
     private IController controller = null;
     private final ConcurrentMap<String, IInventoryShimInternalListener> inventoryShimInternalListeners = new ConcurrentHashMap<String, IInventoryShimInternalListener>();
     private final List<IInventoryShimExternalListener> inventoryShimExternalListeners = new CopyOnWriteArrayList<IInventoryShimExternalListener>();
-    private final ConcurrentMap<NodeConnector, List<String>> containerMap = new ConcurrentHashMap<NodeConnector, List<String>>();
+    private final ConcurrentMap<NodeConnector, Set<String>> nodeConnectorContainerMap = new ConcurrentHashMap<NodeConnector, Set<String>>();
+    private final ConcurrentMap<Node, Set<String>> nodeContainerMap = new ConcurrentHashMap<Node, Set<String>>();
+    private final ConcurrentMap<NodeConnector, Set<Property>> nodeConnectorProps = new ConcurrentHashMap<NodeConnector, Set<Property>>();
+    private final ConcurrentMap<Node, Set<Property>> nodeProps = new ConcurrentHashMap<Node, Set<Property>>();
 
     void setController(IController s) {
         this.controller = s;
@@ -162,7 +165,8 @@ public class InventoryServiceShim implements IContainerListener,
         this.controller.removeSwitchStateListener(this);
 
         this.inventoryShimInternalListeners.clear();
-        this.containerMap.clear();
+        this.nodeConnectorContainerMap.clear();
+        this.nodeContainerMap.clear();
         this.controller = null;
     }
 
@@ -178,21 +182,24 @@ public class InventoryServiceShim implements IContainerListener,
         Node node = NodeCreator.createOFNode(sw.getId());
         NodeConnector nodeConnector = PortConverter.toNodeConnector(
             m.getDesc().getPortNumber(), node);
+        // get node connector properties
+        Set<Property> props = InventoryServiceHelper.OFPortToProps(m.getDesc());
 
         UpdateType type = null;
         if (m.getReason() == (byte) OFPortReason.OFPPR_ADD.ordinal()) {
             type = UpdateType.ADDED;
+            nodeConnectorProps.put(nodeConnector, props);
         } else if (m.getReason() == (byte) OFPortReason.OFPPR_DELETE.ordinal()) {
             type = UpdateType.REMOVED;
+            nodeConnectorProps.remove(nodeConnector);
         } else if (m.getReason() == (byte) OFPortReason.OFPPR_MODIFY.ordinal()) {
             type = UpdateType.CHANGED;
+            nodeConnectorProps.put(nodeConnector, props);
         }
 
         logger.trace("handlePortStatusMessage {} type {}", nodeConnector, type);
 
         if (type != null) {
-            // get node connector properties
-            Set<Property> props = InventoryServiceHelper.OFPortToProps(m.getDesc());
             notifyInventoryShimListener(nodeConnector, type, props);
         }
     }
@@ -207,6 +214,12 @@ public class InventoryServiceShim implements IContainerListener,
         Map<NodeConnector, Set<Property>> ncProps = InventoryServiceHelper
                 .OFSwitchToProps(sw);
         for (Map.Entry<NodeConnector, Set<Property>> entry : ncProps.entrySet()) {
+            Set<Property> props = new HashSet<Property>();
+            Set<Property> prop = entry.getValue();
+            if (prop != null) {
+                props.addAll(prop);
+            }
+            nodeConnectorProps.put(entry.getKey(), props);
             notifyInventoryShimListener(entry.getKey(), UpdateType.ADDED,
                     entry.getValue());
         }
@@ -242,48 +255,71 @@ public class InventoryServiceShim implements IContainerListener,
     }
 
     @Override
-    public void nodeConnectorUpdated(String containerName, NodeConnector p,
-            UpdateType t) {
-        logger.debug("nodeConnectorUpdated: {} type {} for container {}",
-                new Object[] { p, t, containerName });
-        if (this.containerMap == null) {
-            logger.error("containerMap is NULL");
-            return;
+    public void nodeConnectorUpdated(String containerName, NodeConnector nc, UpdateType t) {
+        logger.debug("nodeConnectorUpdated: {} type {} for container {}", new Object[] { nc, t, containerName });
+        Node node = nc.getNode();
+        Set<String> ncContainers = this.nodeConnectorContainerMap.get(nc);
+        Set<String> nodeContainers = this.nodeContainerMap.get(node);
+        if (ncContainers == null) {
+            ncContainers = new CopyOnWriteArraySet<String>();
         }
-        List<String> containers = this.containerMap.get(p);
-        if (containers == null) {
-            containers = new CopyOnWriteArrayList<String>();
+        if (nodeContainers == null) {
+            nodeContainers = new CopyOnWriteArraySet<String>();
         }
-        boolean updateMap = false;
+        boolean notifyNodeUpdate = false;
+
         switch (t) {
         case ADDED:
-            if (!containers.contains(containerName)) {
-                containers.add(containerName);
-                updateMap = true;
+            if (ncContainers.add(containerName)) {
+                this.nodeConnectorContainerMap.put(nc, ncContainers);
+            }
+            if (nodeContainers.add(containerName)) {
+                this.nodeContainerMap.put(node, nodeContainers);
+                notifyNodeUpdate = true;
             }
             break;
         case REMOVED:
-            if (containers.contains(containerName)) {
-                containers.remove(containerName);
-                updateMap = true;
+            if (ncContainers.remove(containerName)) {
+                if (ncContainers.isEmpty()) {
+                    // Do cleanup to reduce memory footprint if no
+                    // elements to be tracked
+                    this.nodeConnectorContainerMap.remove(nc);
+                } else {
+                    this.nodeConnectorContainerMap.put(nc, ncContainers);
+                }
+            }
+            boolean nodeContainerUpdate = true;
+            for (NodeConnector ncContainer : nodeConnectorContainerMap.keySet()) {
+                if ((ncContainer.getNode().equals(node)) && (nodeConnectorContainerMap.get(ncContainer).contains(containerName))) {
+                    nodeContainerUpdate = false;
+                    break;
+                }
+            }
+            if (nodeContainerUpdate) {
+                nodeContainers.remove(containerName);
+                notifyNodeUpdate = true;
+                if (nodeContainers.isEmpty()) {
+                    this.nodeContainerMap.remove(node);
+                } else {
+                    this.nodeContainerMap.put(node, nodeContainers);
+                }
             }
             break;
         case CHANGED:
             break;
         }
-        if (updateMap) {
-            if (containers.isEmpty()) {
-                // Do cleanup to reduce memory footprint if no
-                // elements to be tracked
-                this.containerMap.remove(p);
-            } else {
-                this.containerMap.put(p, containers);
-            }
-        }
 
+        Set<Property> nodeProp = nodeProps.get(node);
+        if (nodeProp == null) {
+            return;
+        }
+        Set<Property> ncProp = nodeConnectorProps.get(nc);
         // notify InventoryService
-        notifyInventoryShimInternalListener(containerName, p, t, null);
-        notifyInventoryShimInternalListener(containerName, p.getNode(), t, null);
+        notifyInventoryShimInternalListener(containerName, nc, t, ncProp);
+
+        if (notifyNodeUpdate) {
+            notifyInventoryShimInternalListener(containerName, node, t, nodeProp);
+        }
     }
 
     private void notifyInventoryShimExternalListener(Node node,
@@ -316,21 +352,13 @@ public class InventoryServiceShim implements IContainerListener,
     /*
      * Notify all internal and external listeners
      */
-    private void notifyInventoryShimListener(NodeConnector nodeConnector,
-            UpdateType type, Set<Property> props) {
-        // Always notify default InventoryService. Store properties in default
-        // one.
-        notifyInventoryShimInternalListener(GlobalConstants.DEFAULT.toString(),
-                nodeConnector, type, props);
-
-        // Now notify other containers
-        List<String> containers = containerMap.get(nodeConnector);
-        if (containers != null) {
-            for (String container : containers) {
-                // no property stored in container components.
-                notifyInventoryShimInternalListener(container, nodeConnector,
-                        type, null);
-            }
+    private void notifyInventoryShimListener(NodeConnector nodeConnector, UpdateType type, Set<Property> props) {
+        // notify other containers
+        Set<String> containers = (nodeConnectorContainerMap.get(nodeConnector) == null) ? new HashSet<String>()
+                : new HashSet<String>(nodeConnectorContainerMap.get(nodeConnector));
+        containers.add(GlobalConstants.DEFAULT.toString());
+        for (String container : containers) {
+            notifyInventoryShimInternalListener(container, nodeConnector, type, props);
         }
 
         // Notify DiscoveryService
@@ -340,34 +368,13 @@ public class InventoryServiceShim implements IContainerListener,
     /*
      * Notify all internal and external listeners
      */
-    private void notifyInventoryShimListener(Node node, UpdateType type,
-            Set<Property> props) {
-        switch (type) {
-        case ADDED:
-            // Notify only the default Inventory Service
-            IInventoryShimInternalListener inventoryShimDefaultListener = inventoryShimInternalListeners
-                    .get(GlobalConstants.DEFAULT.toString());
-            if (inventoryShimDefaultListener != null) {
-                inventoryShimDefaultListener.updateNode(node, type, props);
-            }
-            break;
-        case REMOVED:
-            // Notify all Inventory Service containers
-            for (IInventoryShimInternalListener inventoryShimInternalListener : inventoryShimInternalListeners
-                    .values()) {
-                inventoryShimInternalListener.updateNode(node, type, null);
-            }
-            break;
-        case CHANGED:
-            // Notify only the default Inventory Service
-            inventoryShimDefaultListener = inventoryShimInternalListeners
-                    .get(GlobalConstants.DEFAULT.toString());
-            if (inventoryShimDefaultListener != null) {
-                inventoryShimDefaultListener.updateNode(node, type, props);
-            }
-            break;
-        default:
-            break;
+    private void notifyInventoryShimListener(Node node, UpdateType type, Set<Property> props) {
+        // Now notify other containers
+        Set<String> containers = (nodeContainerMap.get(node) == null) ? new HashSet<String>() : new HashSet<String>(
+                nodeContainerMap.get(node));
+        containers.add(GlobalConstants.DEFAULT.toString());
+        for (String container : containers) {
+            notifyInventoryShimInternalListener(container, node, type, props);
         }
 
         // Notify external listener
@@ -421,21 +428,19 @@ public class InventoryServiceShim implements IContainerListener,
             props.add(b);
         }
 
+        nodeProps.put(node, props);
         // Notify all internal and external listeners
         notifyInventoryShimListener(node, type, props);
     }
 
     private void removeNode(ISwitch sw) {
-        Node node;
-        try {
-            node = new Node(NodeIDType.OPENFLOW, sw.getId());
-        } catch (ConstructionException e) {
-            logger.error("{}", e.getMessage());
+        Node node = NodeCreator.createOFNode(sw.getId());
+        if(node == null) {
             return;
         }
-
+        removeNodeConnectorProps(node);
+        nodeProps.remove(node);
         UpdateType type = UpdateType.REMOVED;
-
         // Notify all internal and external listeners
         notifyInventoryShimListener(node, type, null);
     }
@@ -448,6 +453,18 @@ public class InventoryServiceShim implements IContainerListener,
         }
     }
 
+    private void removeNodeConnectorProps(Node node) {
+        List<NodeConnector> ncList = new ArrayList<NodeConnector>();
+        for (NodeConnector nc : nodeConnectorProps.keySet()) {
+            if (nc.getNode().equals(node)) {
+                ncList.add(nc);
+            }
+        }
+        for (NodeConnector nc : ncList) {
+            nodeConnectorProps.remove(nc);
+        }
+    }
+
     @Override
     public void descriptionStatisticsRefreshed(Long switchId, List<OFStatistics> descriptionStats) {
         Node node = NodeCreator.createOFNode(switchId);
index 3c02c17..bae49d5 100644 (file)
@@ -155,6 +155,20 @@ IInventoryShimExternalListener, CommandProvider {
         }
     }
 
+    private short getStatsQueueSize() {
+        String statsQueueSizeStr = System.getProperty("of.statsQueueSize");
+        short statsQueueSize = INITIAL_SIZE;
+        if (statsQueueSizeStr != null) {
+            try {
+                statsQueueSize = Short.parseShort(statsQueueSizeStr);
+                if (statsQueueSize <= 0) {
+                    statsQueueSize = INITIAL_SIZE;
+                }
+            } catch (Exception e) {
+            }
+        }
+        return statsQueueSize;
+    }
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
@@ -166,8 +180,8 @@ IInventoryShimExternalListener, CommandProvider {
         portStatistics = new ConcurrentHashMap<Long, List<OFStatistics>>();
         tableStatistics = new ConcurrentHashMap<Long, List<OFStatistics>>();
         dummyList = new ArrayList<OFStatistics>(1);
+        pendingStatsRequests = new LinkedBlockingQueue<StatsRequest>(getStatsQueueSize());
         statisticsTimerTicks = new ConcurrentHashMap<Long, StatisticsTicks>(INITIAL_SIZE);
-        pendingStatsRequests = new LinkedBlockingQueue<StatsRequest>(INITIAL_SIZE);
         switchPortStatsUpdated = new LinkedBlockingQueue<Long>(INITIAL_SIZE);
         switchSupportsVendorExtStats = new ConcurrentHashMap<Long, Boolean>(INITIAL_SIZE);
         txRates = new HashMap<Long, Map<Short, TxRates>>(INITIAL_SIZE);
index 1e2f427..a0ea67a 100644 (file)
@@ -47,6 +47,10 @@ public class IPv4 extends Packet {
     private static final String DIP = "DestinationIPAddress";
     private static final String OPTIONS = "Options";
 
+    private static final int UNIT_SIZE_SHIFT = 2;
+    private static final int UNIT_SIZE = (1 << UNIT_SIZE_SHIFT);
+    private static final int MIN_HEADER_SIZE = 20;
+
     public static final Map<Byte, Class<? extends Packet>> protocolClassMap;
     static {
         protocolClassMap = new HashMap<Byte, Class<? extends Packet>>();
@@ -145,12 +149,7 @@ public class IPv4 extends Packet {
     public int getHeaderSize() {
         int headerLen = this.getHeaderLen();
         if (headerLen == 0) {
-            headerLen = 20;
-        }
-
-        byte[] options = hdrFieldsMap.get(OPTIONS);
-        if (options != null) {
-            headerLen += options.length;
+            headerLen = MIN_HEADER_SIZE;
         }
 
         return headerLen * NetUtils.NumBitsInAByte;
@@ -260,6 +259,10 @@ public class IPv4 extends Packet {
     public void setHeaderField(String headerField, byte[] readValue) {
         if (headerField.equals(PROTOCOL)) {
             payloadClass = protocolClassMap.get(readValue[0]);
+        } else if (headerField.equals(OPTIONS) &&
+                   (readValue == null || readValue.length == 0)) {
+            hdrFieldsMap.remove(headerField);
+            return;
         }
         hdrFieldsMap.put(headerField, readValue);
     }
@@ -434,8 +437,23 @@ public class IPv4 extends Packet {
      * @return IPv4
      */
     public IPv4 setOptions(byte[] options) {
-        fieldValues.put(OPTIONS, options);
-        byte newIHL = (byte) (5 + options.length);
+        byte newIHL = (byte)(MIN_HEADER_SIZE >>> UNIT_SIZE_SHIFT);
+        if (options == null || options.length == 0) {
+            fieldValues.remove(OPTIONS);
+        } else {
+            int len = options.length;
+            int rlen = (len + (UNIT_SIZE - 1)) & ~(UNIT_SIZE - 1);
+            if (rlen > len) {
+                // Padding is required.
+                byte[] newopt = new byte[rlen];
+                System.arraycopy(options, 0, newopt, 0, len);
+                options = newopt;
+                len = rlen;
+            }
+            fieldValues.put(OPTIONS, options);
+            newIHL += (len >>> UNIT_SIZE_SHIFT);
+        }
+
         setHeaderLength(newIHL);
 
         return this;
@@ -477,15 +495,13 @@ public class IPv4 extends Packet {
     @Override
     /**
      * Gets the number of bits for the fieldname specified
-     * If the fieldname has variable length like "Options", then this value is computed using the
-     * options length and the header length
+     * If the fieldname has variable length like "Options", then this value is computed using the header length
      * @param fieldname - String
      * @return number of bits for fieldname - int
      */
     public int getfieldnumBits(String fieldName) {
         if (fieldName.equals(OPTIONS)) {
-            byte[] options = getOptions();
-            return ((options == null) ? 0 : (options.length - getHeaderLen()));
+            return (getHeaderLen() - MIN_HEADER_SIZE) * NetUtils.NumBitsInAByte;
         }
         return hdrFieldCoordMap.get(fieldName).getRight();
     }
index 730a9b0..8e1dcd6 100644 (file)
@@ -61,6 +61,6 @@ public class ObjectWriter {
                 }
             }
         }
-        return new Status(StatusCode.SUCCESS, null);
+        return new Status(StatusCode.SUCCESS);
     }
 }
index 429272f..5afcd8b 100644 (file)
@@ -224,6 +224,126 @@ public class IPv4Test {
         Assert.assertTrue(destinationAddress[3] == 110);
     }
 
+    @Test
+    public void testOptions() throws Exception {
+        IPv4 ip = new IPv4();
+        Assert.assertEquals(20, ip.getHeaderLen());
+        Assert.assertEquals(160, ip.getHeaderSize());
+        Assert.assertEquals(0, ip.getfieldnumBits("Options"));
+
+        byte[][] options = {
+            new byte[] {
+                (byte)0x01,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+            },
+            null,
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05, (byte)0x06,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05, (byte)0x06, (byte)0x07,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05, (byte)0x06, (byte)0x07, (byte)0x08,
+            },
+            new byte[0],
+        };
+
+        byte[][] expected = {
+            new byte[] {
+                (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x00, (byte)0x00,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x00,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+            },
+            null,
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05, (byte)0x06, (byte)0x00, (byte)0x00,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05, (byte)0x06, (byte)0x07, (byte)0x00,
+            },
+            new byte[] {
+                (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04,
+                (byte)0x05, (byte)0x06, (byte)0x07, (byte)0x08,
+            },
+            null,
+        };
+
+        byte[] echo = {
+            (byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44,
+            (byte)0x55, (byte)0x66, (byte)0x77, (byte)0x88,
+            (byte)0x99, (byte)0xaa,
+        };
+        ICMP icmp = new ICMP();
+        icmp.setType((byte)8);
+        icmp.setCode((byte)0);
+        icmp.setIdentifier((short)0xabcd);
+        icmp.setSequenceNumber((short)7777);
+        icmp.setRawPayload(echo);
+
+        ip.setSourceAddress(InetAddress.getByName("192.168.10.20"));
+        ip.setDestinationAddress(InetAddress.getByName("192.168.30.40"));
+        ip.setProtocol(IPProtocols.ICMP.byteValue());
+
+        for (int i = 0; i < options.length; i++) {
+            byte[] opts = options[i];
+            byte[] exp = expected[i];
+
+            // Set IPv4 options.
+            int hlen = 20;
+            int optlen;
+            if (exp != null) {
+                optlen = exp.length;
+                hlen += optlen;
+            } else {
+                optlen = 0;
+            }
+            ip.setOptions(opts);
+            Assert.assertTrue(Arrays.equals(exp, ip.getOptions()));
+            Assert.assertEquals(hlen, ip.getHeaderLen());
+            Assert.assertEquals(hlen * 8, ip.getHeaderSize());
+            Assert.assertEquals(optlen * 8, ip.getfieldnumBits("Options"));
+
+            // Serialize/Deserialize test.
+            ip.setPayload(icmp);
+
+            byte[] raw = ip.serialize();
+            IPv4 newip = new IPv4();
+            newip.deserialize(raw, 0, raw.length * 8);
+            Assert.assertEquals(ip, newip);
+            Assert.assertEquals(icmp, newip.getPayload());
+            Assert.assertTrue(Arrays.equals(exp, newip.getOptions()));
+        }
+    }
+
     @Test
     public void testChecksum() {
         byte header[] = { (byte) 0x45, 00, 00, (byte) 0x3c, (byte) 0x1c,
index bcaf3a0..6700b47 100644 (file)
@@ -11,7 +11,6 @@ import static org.opendaylight.controller.binding.generator.util.BindingGenerato
 import static org.opendaylight.controller.yang.model.util.SchemaContextUtil.findDataSchemaNode;
 import static org.opendaylight.controller.yang.model.util.SchemaContextUtil.findParentModule;
 
-import java.util.*;
 import java.util.concurrent.Future;
 
 import java.util.ArrayList;
@@ -21,9 +20,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.Future;
 
-import org.opendaylight.controller.binding.generator.util.BindingGeneratorUtil;
 import org.opendaylight.controller.binding.generator.util.ReferencedTypeImpl;
 import org.opendaylight.controller.binding.generator.util.Types;
 import org.opendaylight.controller.binding.generator.util.generated.type.builder.GeneratedTOBuilderImpl;
@@ -856,11 +853,11 @@ public final class BindingGeneratorImpl implements BindingGenerator {
                     if (genTOBuilder != null) {
                         returnType = new ReferencedTypeImpl(genTOBuilder.getPackageName(), genTOBuilder.getName());
                     }
-                } else if(typeDef instanceof BitsTypeDefinition) {
+                } else if (typeDef instanceof BitsTypeDefinition) {
                     GeneratedTOBuilder genTOBuilder = addEnclosedTOToTypeBuilder(typeDef, typeBuilder, leafName);
                     if (genTOBuilder != null) {
                         returnType = new ReferencedTypeImpl(genTOBuilder.getPackageName(), genTOBuilder.getName());
-                    }                    
+                    }
                 } else {
                     returnType = typeProvider.javaTypeForSchemaDefinitionType(typeDef);
                 }
@@ -1184,23 +1181,23 @@ public final class BindingGeneratorImpl implements BindingGenerator {
         return genTOBuilder;
     }
 
-    
-    private GeneratedTOBuilder addEnclosedTOToTypeBuilder( TypeDefinition<?> typeDef, GeneratedTypeBuilder typeBuilder, String leafName) { 
+    private GeneratedTOBuilder addEnclosedTOToTypeBuilder(TypeDefinition<?> typeDef, GeneratedTypeBuilder typeBuilder,
+            String leafName) {
         String className = parseToClassName(leafName);
         GeneratedTOBuilder genTOBuilder = null;
         if (typeDef instanceof UnionType) {
             genTOBuilder = ((TypeProviderImpl) typeProvider).addUnionGeneratedTypeDefinition(
-                    typeBuilder.getPackageName(), typeDef, className);
+                    typeBuilder.getFullyQualifiedName(), typeDef, className);
         } else if (typeDef instanceof BitsTypeDefinition) {
             genTOBuilder = ((TypeProviderImpl) typeProvider).bitsTypedefToTransferObject(
-                    typeBuilder.getPackageName(), typeDef, className);
+                    typeBuilder.getFullyQualifiedName(), typeDef, className);
         }
         if (genTOBuilder != null) {
             typeBuilder.addEnclosingTransferObject(genTOBuilder);
             return genTOBuilder;
         }
         return null;
-        
+
     }
-    
+
 }
index 4824fa7..b6d8de6 100644 (file)
@@ -27,13 +27,16 @@ import org.opendaylight.controller.yang.model.api.type.*;
 import org.opendaylight.controller.yang.model.api.type.BitsTypeDefinition.Bit;
 import org.opendaylight.controller.yang.model.api.type.EnumTypeDefinition.EnumPair;
 import org.opendaylight.controller.yang.model.util.ExtendedType;
+
 import org.opendaylight.controller.yang.model.util.StringType;
+import org.opendaylight.controller.yang.model.util.UnionType;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeMap;
 
 import static org.opendaylight.controller.binding.generator.util.BindingGeneratorUtil.*;
 import static org.opendaylight.controller.yang.model.util.SchemaContextUtil.*;
@@ -361,18 +364,15 @@ public final class TypeProviderImpl implements TypeProvider {
             final String basePackageName = moduleNamespaceToPackageName(module);
 
             final Set<TypeDefinition<?>> typeDefinitions = module.getTypeDefinitions();
+            final List<TypeDefinition<?>> listTypeDefinitions = sortTypeDefinitionAccordingDepth(typeDefinitions);
 
             final Map<String, Type> typeMap = new HashMap<>();
             genTypeDefsContextMap.put(moduleName, typeMap);
 
-            if ((typeDefinitions != null) && (basePackageName != null)) {
-                for (final TypeDefinition<?> typedef : typeDefinitions) {
+            if ((listTypeDefinitions != null) && (basePackageName != null)) {
+                for (final TypeDefinition<?> typedef : listTypeDefinitions) {
                     typedefToGeneratedType(basePackageName, moduleName, typedef);
                 }
-                final List<ExtendedType> extUnions = UnionDependencySort.sort(typeDefinitions);
-                for (final ExtendedType extUnionType : extUnions) {
-                    addUnionGeneratedTypeDefinition(basePackageName, extUnionType, null);
-                }
             }
         }
     }
@@ -382,23 +382,31 @@ public final class TypeProviderImpl implements TypeProvider {
         if ((basePackageName != null) && (moduleName != null) && (typedef != null) && (typedef.getQName() != null)) {
 
             final String typedefName = typedef.getQName().getLocalName();
-            final TypeDefinition<?> baseTypeDefinition = baseTypeDefForExtendedType(typedef);
-            if (!(baseTypeDefinition instanceof LeafrefTypeDefinition)
-                    && !(baseTypeDefinition instanceof IdentityrefTypeDefinition)) {
-                Type returnType;
-                if (baseTypeDefinition instanceof EnumTypeDefinition) {
-                    final EnumTypeDefinition enumTypeDef = (EnumTypeDefinition) baseTypeDefinition;
+            final TypeDefinition<?> innerTypeDefinition = typedef.getBaseType();
+            if (!(innerTypeDefinition instanceof LeafrefTypeDefinition)
+                    && !(innerTypeDefinition instanceof IdentityrefTypeDefinition)) {
+                Type returnType = null;
+                if (innerTypeDefinition instanceof ExtendedType) {
+                    ExtendedType extendedTypeDef = (ExtendedType) innerTypeDefinition;
+                    returnType = resolveExtendedTypeFromTypeDef(extendedTypeDef, basePackageName, typedefName,
+                            moduleName);
+                } else if (innerTypeDefinition instanceof UnionTypeDefinition) {
+                    final GeneratedTOBuilder genTOBuilder = addUnionGeneratedTypeDefinition(basePackageName, typedef,
+                            typedefName);
+                    returnType = genTOBuilder.toInstance();
+                } else if (innerTypeDefinition instanceof EnumTypeDefinition) {
+                    final EnumTypeDefinition enumTypeDef = (EnumTypeDefinition) innerTypeDefinition;
                     returnType = resolveEnumFromTypeDefinition(enumTypeDef, typedefName);
 
-                } else if (baseTypeDefinition instanceof BitsTypeDefinition) {
-                    final BitsTypeDefinition bitsTypeDefinition = (BitsTypeDefinition) baseTypeDefinition;
-                    GeneratedTOBuilder genTOBuilder = bitsTypedefToTransferObject(basePackageName, bitsTypeDefinition,
-                            typedefName);
+                } else if (innerTypeDefinition instanceof BitsTypeDefinition) {
+                    final BitsTypeDefinition bitsTypeDefinition = (BitsTypeDefinition) innerTypeDefinition;
+                    final GeneratedTOBuilder genTOBuilder = bitsTypedefToTransferObject(basePackageName,
+                            bitsTypeDefinition, typedefName);
                     returnType = genTOBuilder.toInstance();
 
                 } else {
                     final Type javaType = BaseYangTypes.BASE_YANG_TYPES_PROVIDER
-                            .javaTypeForSchemaDefinitionType(baseTypeDefinition);
+                            .javaTypeForSchemaDefinitionType(innerTypeDefinition);
 
                     returnType = wrapJavaTypeIntoTO(basePackageName, typedef, javaType);
                 }
@@ -428,12 +436,12 @@ public final class TypeProviderImpl implements TypeProvider {
             genTOBuilder.addEqualsIdentity(genPropBuilder);
             genTOBuilder.addHashIdentity(genPropBuilder);
             genTOBuilder.addToStringProperty(genPropBuilder);
-
-            if (typedef instanceof ExtendedType) {
-                final List<String> regExps = resolveRegExpressionsFromTypedef((ExtendedType) typedef);
-                addStringRegExAsConstant(genTOBuilder, regExps);
+            if (javaType == BaseYangTypes.STRING_TYPE) {
+                if (typedef instanceof ExtendedType) {
+                    final List<String> regExps = resolveRegExpressionsFromTypedef((ExtendedType) typedef);
+                    addStringRegExAsConstant(genTOBuilder, regExps);
+                }
             }
-
             return genTOBuilder.toInstance();
         }
         return null;
@@ -479,9 +487,10 @@ public final class TypeProviderImpl implements TypeProvider {
                     final Module unionTypeModule = findParentModuleForTypeDefinition(schemaContext, unionType);
                     if (unionTypeModule != null && unionTypeModule.getName() != null) {
                         final Map<String, Type> innerGenTOs = genTypeDefsContextMap.get(unionTypeModule.getName());
-
-                        final GeneratedTransferObject genTransferObject = (GeneratedTransferObject) innerGenTOs
-                                .get(typeName);
+                        Type genTransferObject = null;
+                        if (innerGenTOs != null) {
+                            genTransferObject = innerGenTOs.get(typeName);
+                        }
                         if (genTransferObject != null) {
                             updateUnionTypeAsProperty(unionGenTransObject, genTransferObject,
                                     genTransferObject.getName());
@@ -620,4 +629,103 @@ public final class TypeProviderImpl implements TypeProvider {
         }
     }
 
+    private GeneratedTransferObject resolveExtendedTypeFromTypeDef(final ExtendedType extendedType,
+            final String basePackageName, final String typedefName, final String moduleName) {
+
+        if (extendedType == null) {
+            throw new IllegalArgumentException("Extended type cannot be NULL!");
+        }
+        if (basePackageName == null) {
+            throw new IllegalArgumentException("String with base package name cannot be NULL!");
+        }
+        if (typedefName == null) {
+            throw new IllegalArgumentException("String with type definition name cannot be NULL!");
+        }
+
+        final String typeDefName = parseToClassName(typedefName);
+        final String lowTypeDef = extendedType.getQName().getLocalName();
+        final GeneratedTOBuilder genTOBuilder = new GeneratedTOBuilderImpl(basePackageName, typeDefName);
+
+        final Map<String, Type> typeMap = genTypeDefsContextMap.get(moduleName);
+        if (typeMap != null) {
+            Type type = typeMap.get(lowTypeDef);
+            if (type instanceof GeneratedTransferObject) {
+                genTOBuilder.setExtendsType((GeneratedTransferObject) type);
+            }
+        }
+
+        return genTOBuilder.toInstance();
+    }
+
+    /**
+     * The method find out for each type definition how many immersion (depth)
+     * is necessary to get to the base type. Every type definition is inserted
+     * to the map which key is depth and value is list of type definitions with
+     * equal depth. In next step are lists from this map concatenated to one
+     * list in ascending order according to their depth. All type definitions
+     * are in the list behind all type definitions on which depends.
+     * 
+     * @param unsortedTypeDefinitions
+     *            represents list of type definitions
+     * @return list of type definitions sorted according their each other
+     *         dependencies (type definitions which are depend on other type
+     *         definitions are in list behind them).
+     */
+    private List<TypeDefinition<?>> sortTypeDefinitionAccordingDepth(
+            final Set<TypeDefinition<?>> unsortedTypeDefinitions) {
+        List<TypeDefinition<?>> sortedTypeDefinition = new ArrayList<>();
+
+        Map<Integer, List<TypeDefinition<?>>> typeDefinitionsDepths = new TreeMap<>();
+        for (TypeDefinition<?> unsortedTypeDefinition : unsortedTypeDefinitions) {
+            final int depth = getTypeDefinitionDepth(unsortedTypeDefinition);
+            List<TypeDefinition<?>> typeDefinitionsConcreteDepth = typeDefinitionsDepths.get(depth);
+            if (typeDefinitionsConcreteDepth == null) {
+                typeDefinitionsConcreteDepth = new ArrayList<TypeDefinition<?>>();
+                typeDefinitionsDepths.put(depth, typeDefinitionsConcreteDepth);
+            }
+            typeDefinitionsConcreteDepth.add(unsortedTypeDefinition);
+        }
+
+        Set<Integer> depths = typeDefinitionsDepths.keySet(); // keys are in
+                                                              // ascending order
+        for (Integer depth : depths) {
+            sortedTypeDefinition.addAll(typeDefinitionsDepths.get(depth));
+        }
+
+        return sortedTypeDefinition;
+    }
+
+    /**
+     * The method return how many immersion is necessary to get from type
+     * definition to base type.
+     * 
+     * @param typeDefinition
+     *            is type definition for which is depth looked for.
+     * @return how many immersion is necessary to get from type definition to
+     *         base type
+     */
+    private int getTypeDefinitionDepth(final TypeDefinition<?> typeDefinition) {
+        if (typeDefinition == null) {
+            throw new IllegalArgumentException("Type definition can't be null");
+        }
+        int depth = 1;
+        TypeDefinition<?> baseType = typeDefinition.getBaseType();
+
+        if (baseType instanceof ExtendedType) {
+            depth = depth + getTypeDefinitionDepth(typeDefinition.getBaseType());
+        } else if (baseType instanceof UnionType) {
+            List<TypeDefinition<?>> childTypeDefinitions = ((UnionType) baseType).getTypes();
+            int maxChildDepth = 0;
+            int childDepth = 1;
+            for (TypeDefinition<?> childTypeDefinition : childTypeDefinitions) {
+                childDepth = childDepth + getTypeDefinitionDepth(childTypeDefinition.getBaseType());
+                if (childDepth > maxChildDepth) {
+                    maxChildDepth = childDepth;
+                }
+            }
+            return maxChildDepth;
+        }
+        return depth;
+    }
+
 }
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BitAndUnionTOEnclosingTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/BitAndUnionTOEnclosingTest.java
new file mode 100644 (file)
index 0000000..3ca4f3e
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.sal.binding.generator.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
+import org.opendaylight.controller.sal.binding.model.api.Type;
+import org.opendaylight.controller.yang.model.api.Module;
+import org.opendaylight.controller.yang.model.api.SchemaContext;
+import org.opendaylight.controller.yang.model.parser.api.YangModelParser;
+import org.opendaylight.controller.yang.parser.impl.YangParserImpl;
+
+public class BitAndUnionTOEnclosingTest {
+
+    private final static List<File> testModels = new ArrayList<File>();
+
+    @BeforeClass
+    public static void loadTestResources() {
+        final File listModelFile = new File(ExtendedTypedefTest.class.getResource("/bit_and_union_in_leaf.yang")
+                .getPath());
+        testModels.add(listModelFile);
+    }
+
+    @Test
+    public void bitAndUnionEnclosingTest() {
+        final YangModelParser parser = new YangParserImpl();
+        final Set<Module> modules = parser.parseYangModels(testModels);
+        final SchemaContext context = parser.resolveSchemaContext(modules);
+
+        assertNotNull(context);
+        final BindingGenerator bindingGen = new BindingGeneratorImpl();
+        final List<Type> genTypes = bindingGen.generateTypes(context);
+
+        GeneratedType parentContainer = null;
+
+        for (Type type : genTypes) {
+            if ((type instanceof GeneratedType) && !(type instanceof GeneratedTransferObject)) {
+                GeneratedType genTO = (GeneratedType) type;
+                if (genTO.getName().equals("ParentContainer")) {
+                    parentContainer = genTO;
+                    break;
+                }
+            }
+        }
+
+        assertNotNull("Parent container object wasn't found.", parentContainer);
+
+        GeneratedTransferObject bitLeaf = null;
+        GeneratedTransferObject unionLeaf = null;
+        List<GeneratedType> enclosedTypes = parentContainer.getEnclosedTypes();
+        for (GeneratedType genType : enclosedTypes) {
+            if (genType instanceof GeneratedTransferObject) {
+                if (genType.getName().equals("BitLeaf")) {
+                    bitLeaf = (GeneratedTransferObject) genType;
+                } else if (genType.getName().equals("UnionLeaf")) {
+                    unionLeaf = (GeneratedTransferObject) genType;
+                }
+            }
+        }
+
+        assertNotNull("BitLeaf TO builder wasn't found.", bitLeaf);
+        assertNotNull("UnionLeaf TO builder wasn't found.", unionLeaf);
+
+        assertEquals("BitLeaf has incorrect package name.",
+                "org.opendaylight.yang.gen.v1.urn.bit.union.in.leaf.rev2013626.ParentContainer",
+                bitLeaf.getPackageName());
+        assertEquals("UnionLeaf has incorrect package name.",
+                "org.opendaylight.yang.gen.v1.urn.bit.union.in.leaf.rev2013626.ParentContainer",
+                bitLeaf.getPackageName());
+
+        List<GeneratedProperty> propertiesBitLeaf = bitLeaf.getProperties();
+        GeneratedProperty firstBitProperty = null;
+        GeneratedProperty secondBitProperty = null;
+        GeneratedProperty thirdBitProperty = null;
+        for (GeneratedProperty genProperty : propertiesBitLeaf) {
+            if (genProperty.getName().equals("firstBit")) {
+                firstBitProperty = genProperty;
+            } else if (genProperty.getName().equals("secondBit")) {
+                secondBitProperty = genProperty;
+            } else if (genProperty.getName().equals("thirdBit")) {
+                thirdBitProperty = genProperty;
+            }
+        }
+
+        assertNotNull("firstBit property wasn't found", firstBitProperty);
+        assertNotNull("secondBit property wasn't found", secondBitProperty);
+        assertNotNull("thirdBit property wasn't found", thirdBitProperty);
+
+        assertEquals("firstBit property has incorrect type", "Boolean", firstBitProperty.getReturnType().getName());
+        assertEquals("secondBit property has incorrect type", "Boolean", secondBitProperty.getReturnType().getName());
+        assertEquals("thirdBit property has incorrect type", "Boolean", thirdBitProperty.getReturnType().getName());
+
+        GeneratedProperty uint32Property = null;
+        GeneratedProperty stringProperty = null;
+        GeneratedProperty uint8Property = null;
+        List<GeneratedProperty> propertiesUnionLeaf = unionLeaf.getProperties();
+        for (GeneratedProperty genProperty : propertiesUnionLeaf) {
+            if (genProperty.getName().equals("int32")) {
+                uint32Property = genProperty;
+            } else if (genProperty.getName().equals("string")) {
+                stringProperty = genProperty;
+            } else if (genProperty.getName().equals("uint8")) {
+                uint8Property = genProperty;
+            }
+        }
+
+        assertNotNull("uint32 property wasn't found", uint32Property);
+        assertNotNull("string property wasn't found", stringProperty);
+        assertNotNull("uint8 property wasn't found", uint8Property);
+
+        assertEquals("uint32 property has incorrect type", "Integer", uint32Property.getReturnType().getName());
+        assertEquals("string property has incorrect type", "String", stringProperty.getReturnType().getName());
+        assertEquals("uint8 property has incorrect type", "Short", uint8Property.getReturnType().getName());
+
+    }
+}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ExtendedTypedefTest.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/java/org/opendaylight/controller/sal/binding/generator/impl/ExtendedTypedefTest.java
new file mode 100644 (file)
index 0000000..bbbf469
--- /dev/null
@@ -0,0 +1,137 @@
+package org.opendaylight.controller.sal.binding.generator.impl;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertFalse;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
+import org.opendaylight.controller.sal.binding.generator.impl.BindingGeneratorImpl;
+import org.opendaylight.controller.sal.binding.model.api.Constant;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedProperty;
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
+import org.opendaylight.controller.sal.binding.model.api.ParameterizedType;
+import org.opendaylight.controller.sal.binding.model.api.Type;
+import org.opendaylight.controller.sal.binding.yang.types.BaseYangTypes;
+import org.opendaylight.controller.yang.model.api.Module;
+import org.opendaylight.controller.yang.model.api.SchemaContext;
+import org.opendaylight.controller.yang.model.parser.api.YangModelParser;
+import org.opendaylight.controller.yang.parser.impl.YangParserImpl;
+
+public class ExtendedTypedefTest {
+
+    private final static List<File> testModels = new ArrayList<File>();
+
+    @BeforeClass
+    public static void loadTestResources() {
+        final File listModelFile = new File(ExtendedTypedefTest.class.getResource("/typedef_of_typedef.yang").getPath());
+        testModels.add(listModelFile);
+    }
+
+    @Test    
+    public void constantGenerationTest() {
+        final YangModelParser parser = new YangParserImpl();
+        final Set<Module> modules = parser.parseYangModels(testModels);
+        final SchemaContext context = parser.resolveSchemaContext(modules);
+
+        assertNotNull(context);
+        final BindingGenerator bindingGen = new BindingGeneratorImpl();
+        final List<Type> genTypes = bindingGen.generateTypes(context);
+
+        GeneratedTransferObject simpleTypedef4 = null;
+        GeneratedTransferObject extendedTypedefUnion = null;
+        GeneratedTransferObject unionTypedef = null;
+        for (final Type type : genTypes) {
+            if (type instanceof GeneratedTransferObject) {
+                if (type.getName().equals("SimpleTypedef4")) {
+                    simpleTypedef4 = (GeneratedTransferObject) type;
+                } else if (type.getName().equals("ExtendedTypedefUnion")) {
+                    extendedTypedefUnion = (GeneratedTransferObject) type;
+                } else if (type.getName().equals("UnionTypedef")) {
+                    unionTypedef = (GeneratedTransferObject) type;
+                }
+            }
+        }
+
+        // simple-typedef4
+        assertNotNull("SimpleTypedef4 not found", simpleTypedef4);
+        assertNotNull("ExtendedTypedefUnion not found", extendedTypedefUnion);
+        assertNotNull("UnionTypedef", unionTypedef);
+
+        List<GeneratedProperty> properties = simpleTypedef4.getProperties();
+        assertTrue("SimpleTypedef4 shouldn't have properties.", properties.isEmpty());
+
+        GeneratedTransferObject extendTO = simpleTypedef4.getExtends();
+        assertNotNull("SimpleTypedef4 should have extend.", extendTO);
+        assertEquals("Incorrect extension for SimpleTypedef4.", "SimpleTypedef3", extendTO.getName());
+        properties = extendTO.getProperties();
+        assertTrue("SimpleTypedef3 shouldn't have properties.", properties.isEmpty());
+
+        extendTO = extendTO.getExtends();
+        assertNotNull("SimpleTypedef3 should have extend.", extendTO);
+        assertEquals("Incorrect extension for SimpleTypedef3.", "SimpleTypedef2", extendTO.getName());
+        properties = extendTO.getProperties();
+        assertTrue("SimpleTypedef2 shouldn't have properties.", properties.isEmpty());
+
+        extendTO = extendTO.getExtends();
+        assertNotNull("SimpleTypedef2 should have extend.", extendTO);
+        assertEquals("SimpleTypedef2 should be extended with SimpleTypedef1.", "SimpleTypedef1", extendTO.getName());
+        properties = extendTO.getProperties();
+        assertEquals("Incorrect number of properties in class SimpleTypedef1.", 1, properties.size());
+
+        assertEquals("Incorrect property's name", "simpleTypedef1", properties.get(0).getName());
+        assertEquals("Property's incorrect type", BaseYangTypes.UINT8_TYPE, properties.get(0).getReturnType());
+
+        extendTO = extendTO.getExtends();
+        assertNull("SimpleTypedef1 shouldn't have extend.", extendTO);
+
+        // extended-typedef-union
+        assertNotNull("ExtendedTypedefUnion object not found", extendedTypedefUnion);
+        properties = extendedTypedefUnion.getProperties();
+        assertTrue("ExtendedTypedefUnion shouldn't have any property", properties.isEmpty());
+
+        extendTO = extendedTypedefUnion.getExtends();
+        assertEquals("Incorrect extension fo ExtendedTypedefUnion.", "UnionTypedef", extendTO.getName());
+        assertNull("UnionTypedef shouldn't be extended", extendTO.getExtends());
+        assertEquals("Incorrect number of properties for UnionTypedef.", 4, extendTO.getProperties().size());
+
+        GeneratedProperty simpleTypedef4Property = null;
+        GeneratedProperty simpleTypedef1Property = null;
+        GeneratedProperty byteTypeProperty = null;
+        GeneratedProperty typedefEnumFruitProperty = null;
+        for (GeneratedProperty genProperty : extendTO.getProperties()) {
+            if (genProperty.getName().equals("simpleTypedef1")) {
+                simpleTypedef1Property = genProperty;
+            } else if (genProperty.getName().equals("simpleTypedef4")) {
+                simpleTypedef4Property = genProperty;
+            } else if (genProperty.getName().equals("byteType")) {
+                byteTypeProperty = genProperty;
+            } else if (genProperty.getName().equals("typedefEnumFruit")) {
+                typedefEnumFruitProperty = genProperty;
+            }
+        }
+
+        assertNotNull("simpleTypedef4 property not found in UnionTypedef", simpleTypedef4Property);
+        assertNotNull("simpleTypedef1 property not found in UnionTypedef", simpleTypedef1Property);
+        assertNotNull("byteType property not found in UnionTypedef", byteTypeProperty);
+        assertNotNull("typedefEnumFruit property not found in UnionTypedef", typedefEnumFruitProperty);
+
+        assertEquals("Incorrect type for property simpleTypedef4.", "SimpleTypedef4", simpleTypedef4Property
+                .getReturnType().getName());
+        assertEquals("Incorrect type for property simpleTypedef1.", "SimpleTypedef1", simpleTypedef1Property
+                .getReturnType().getName());
+        assertEquals("Incorrect type for property byteType.", "ByteType", byteTypeProperty
+                .getReturnType().getName());
+        assertEquals("Incorrect type for property typedefEnumFruit.", "TypedefEnumFruit", typedefEnumFruitProperty
+                .getReturnType().getName());
+    }
+
+}
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/bit_and_union_in_leaf.yang b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/bit_and_union_in_leaf.yang
new file mode 100644 (file)
index 0000000..e254dd2
--- /dev/null
@@ -0,0 +1,55 @@
+module bit-and-union-in-leaf {
+    
+    namespace "urn:bit:union:in:leaf";
+    prefix "sbd";
+
+    organization "OPEN DAYLIGHT";
+    contact "http://www.opendaylight.org/";
+
+    revision 2013-06-26 {
+        
+    }
+    
+    typedef union-typedef {
+        type union {
+            type string {
+                pattern "[a-g]";
+            };
+            type int16;
+        }
+    }
+    
+    typedef union-typedef2 {
+        type union {
+            type string; 
+            type int16;
+        }
+    }    
+    
+    container parent-container {
+        leaf bit-leaf {
+            type bits {
+                bit first-bit;
+                bit second-bit;
+                bit third-bit;
+            }
+        }
+        
+        leaf union-leaf {
+            type union {
+                type int32;
+                type string {
+                    pattern "[a-z]";
+                };
+                type string {
+                    pattern "[0-9]*"
+                };
+                type string {
+                    pattern "[a-d]*";
+                    pattern "[0-5]*";
+                };
+                type uint8;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/typedef_of_typedef.yang b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/test/resources/typedef_of_typedef.yang
new file mode 100644 (file)
index 0000000..fc0bab9
--- /dev/null
@@ -0,0 +1,79 @@
+module typedef_typedef {
+    
+    namespace "urn:typedef:typedef";
+    prefix "sbd";
+
+    organization "OPEN DAYLIGHT";
+    contact "http://www.opendaylight.org/";
+
+    revision 2013-07-09 {
+        
+    }
+
+   typedef byte-type {
+        type bits {
+            bit first-bit {
+                position 10;
+            }
+            bit second-bit {
+                position 20;
+            }
+         }
+    }    
+    
+    
+  typedef typedef-enum-fruit {
+    type enumeration {
+      enum "apple" {
+        value 1;
+        description "gold";
+      }
+      enum "pear" {
+        value 2;
+      }
+    }
+  }    
+    
+    typedef simple-typedef1 {
+        type uint8;
+    }
+    
+    typedef simple-typedef2 {
+        type simple-typedef1;
+    }
+    
+    typedef simple-typedef3 {
+        type simple-typedef2;
+    }
+    
+    typedef simple-typedef4 {
+        type simple-typedef3;
+    }
+    
+    typedef simple-typedef1-1 {
+        type uint16;
+    }
+
+    
+    typedef union-typedef {
+        type union {
+            type simple-typedef1;
+            type simple-typedef4;
+            type byte-type;
+            type typedef-enum-fruit;
+        }
+    }
+    
+    typedef extended-typedef-union {
+        type union-typedef;
+    }
+    
+    
+    typedef extended-typedef-simple {
+        type simple-typedef1;
+    }
+    
+    typedef extended-typedef-enum {
+        type typedef-enum-fruit;
+    }
+}
\ No newline at end of file
index 717988a..31b94a6 100644 (file)
@@ -67,11 +67,14 @@ public final class ClassCodeGenerator implements CodeGenerator {
             }
 
             writer.write(NL);
+            final boolean oneConstructor;
             if (genTO.isUnionType()) {
-                writer.write(GeneratorUtil.createConstructors(genTO, indent + TAB, imports, genTO.isAbstract()));
+                oneConstructor = false;
             } else {
-                writer.write(GeneratorUtil.createConstructor(genTO, indent + TAB, imports, genTO.isAbstract()) + NL);
+                oneConstructor = true;
             }
+            writer.write(GeneratorUtil.createConstructor(genTO, indent + TAB, imports, genTO.isAbstract(),
+                    oneConstructor));
             writer.write(NL);
 
             for (GeneratedProperty field : fields) {
index dfae4a2..0e2da81 100644 (file)
@@ -17,9 +17,9 @@ import java.util.Map;
 
 import org.opendaylight.controller.binding.generator.util.TypeConstants;
 import org.opendaylight.controller.sal.binding.model.api.*;
+import org.opendaylight.controller.binding.generator.util.Types;
 import org.opendaylight.controller.sal.binding.model.api.Enumeration.Pair;
 import org.opendaylight.controller.sal.binding.model.api.MethodSignature.Parameter;
-import org.opendaylight.controller.binding.generator.util.Types;
 
 public final class GeneratorUtil {
 
@@ -232,90 +232,244 @@ public final class GeneratorUtil {
         return builder.toString();
     }
 
-    public static String createConstructor(GeneratedTransferObject genTransferObject, final String indent,
-            final Map<String, String> availableImports, boolean isIdentity) {
-        StringBuilder builder = new StringBuilder();
+    public static String createConstructor(final GeneratedTransferObject genTransferObject, final String indent,
+            final Map<String, String> availableImports, final boolean isIdentity, final boolean oneConstructor) {
+        if (genTransferObject == null) {
+            throw new IllegalArgumentException("Generated transfer object can't be null");
+        }
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
+        if (availableImports == null) {
+            throw new IllegalArgumentException("Map of available imports can't be null");
+        }
+        GeneratedTransferObject genTOTopParent = getTopParrentTransportObject(genTransferObject);
+        final List<GeneratedProperty> ctorProperties = resolveReadOnlyPropertiesFromTO(genTransferObject
+                .getProperties());
+        final List<GeneratedProperty> ctorPropertiesAllParents = getPropertiesOfAllParents(genTransferObject
+                .getExtends());
 
         final String currentPkg = genTransferObject.getPackageName();
-        final List<GeneratedProperty> properties = genTransferObject.getProperties();
-        final List<GeneratedProperty> ctorParams = new ArrayList<GeneratedProperty>();
-        if (properties != null) {
-            for (final GeneratedProperty property : properties) {
-                if (property.isReadOnly()) {
-                    ctorParams.add(property);
-                }
+        final String className = genTransferObject.getName();
+
+        String constructorPart = "";
+        if (oneConstructor) {
+            if (genTOTopParent != genTransferObject && genTOTopParent.isUnionType()) {
+                constructorPart = createConstructorForEveryParentProperty(indent, isIdentity, ctorProperties,
+                        ctorPropertiesAllParents, availableImports, currentPkg, className);
+
+            } else {
+                constructorPart = createOneConstructor(indent, isIdentity, ctorProperties, ctorPropertiesAllParents,
+                        availableImports, currentPkg, className);
             }
+
+        } else { // union won't be extended
+            constructorPart = createConstructorForEveryProperty(indent, isIdentity, ctorProperties,
+                    ctorPropertiesAllParents, availableImports, currentPkg, className);
         }
 
-        builder.append(createConstructorDeclarationToLeftParenthesis(genTransferObject, indent, isIdentity));
+        return constructorPart;
+    }
 
-        final String parameterSeparator = COMMA + GAP;
-        for (final GeneratedProperty ctorParam : ctorParams) {
-            builder.append(createMethodParamDeclaration(ctorParam, availableImports, currentPkg));
-            builder.append(parameterSeparator);
+    private static String createOneConstructor(final String indent, boolean isIdentity,
+            final List<GeneratedProperty> properties, final List<GeneratedProperty> propertiesAllParents,
+            final Map<String, String> availableImports, final String currentPkg, final String className) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
         }
-        if (!ctorParams.isEmpty()) {
-            builder = builder.delete(builder.length() - parameterSeparator.length(), builder.length());
+        if (properties == null) {
+            throw new IllegalArgumentException("List of generated properties can't be null");
         }
-        builder.append(createConstructorDeclarationFromRightParenthesis());
-        builder.append(createConstructorSuperCalling(indent));
-
-        for (final GeneratedProperty ctorParam : ctorParams) {
-            builder.append(createClassAttributeInitialization(indent, ctorParam));
+        if (propertiesAllParents == null) {
+            throw new IllegalArgumentException(
+                    "List of generated properties of all parent transport objects can't be null");
+        }
+        if (availableImports == null) {
+            throw new IllegalArgumentException("Map of available imports can't be null");
         }
+        if (currentPkg == null) {
+            throw new IllegalArgumentException("String with current package can't be null");
+        }
+        if (className == null) {
+            throw new IllegalArgumentException("String with class name can't be null");
+        }
+
+        final StringBuilder builder = new StringBuilder();
 
+        List<GeneratedProperty> propertiesAll = new ArrayList<GeneratedProperty>(properties);
+        propertiesAll.addAll(propertiesAllParents);
+
+        builder.append(createConstructorDeclarationToLeftParenthesis(className, indent, isIdentity));
+        builder.append(createMethodPropertiesDeclaration(propertiesAll, availableImports, currentPkg, COMMA + GAP));
+        builder.append(createConstructorDeclarationFromRightParenthesis());
+        builder.append(createConstructorSuper(propertiesAllParents, indent));
+        builder.append(createClassPropertiesInitialization(propertiesAll, indent));
         builder.append(createConstructorClosingPart(indent));
         return builder.toString();
     }
 
-    public static String createConstructors(GeneratedTransferObject genTransferObject, final String indent,
-            final Map<String, String> availableImports, boolean isIdentity) {
+    private static String createConstructorForEveryParentProperty(final String indent, final boolean isIdentity,
+            final List<GeneratedProperty> properties, final List<GeneratedProperty> propertiesAllParents,
+            final Map<String, String> availableImports, final String currentPkg, final String className) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
+        if (properties == null) {
+            throw new IllegalArgumentException("List of generated properties can't be null");
+        }
+        if (propertiesAllParents == null) {
+            throw new IllegalArgumentException(
+                    "List of generated properties of all parent transport objects can't be null");
+        }
+        if (availableImports == null) {
+            throw new IllegalArgumentException("Map of available imports can't be null");
+        }
+        if (currentPkg == null) {
+            throw new IllegalArgumentException("String with current package can't be null");
+        }
+        if (className == null) {
+            throw new IllegalArgumentException("String with class name can't be null");
+        }
         final StringBuilder builder = new StringBuilder();
+        GeneratedProperty parentProperty;
+        Iterator<GeneratedProperty> parentPropertyIterator = propertiesAllParents.iterator();
 
-        final String currentPkg = genTransferObject.getPackageName();
-        final List<GeneratedProperty> properties = genTransferObject.getProperties();
-        final List<GeneratedProperty> ctorParams = new ArrayList<GeneratedProperty>();
-        if (properties != null) {
-            for (final GeneratedProperty property : properties) {
-                if (property.isReadOnly()) {
-                    ctorParams.add(property);
-                }
+        do {
+            parentProperty = null;
+            if (parentPropertyIterator.hasNext()) {
+                parentProperty = parentPropertyIterator.next();
+            }
+
+            List<GeneratedProperty> propertiesAndParentProperties = new ArrayList<GeneratedProperty>();
+            if (parentProperty != null) {
+                propertiesAndParentProperties.add(parentProperty);
             }
+            propertiesAndParentProperties.addAll(properties);
+
+            builder.append(createConstructorDeclarationToLeftParenthesis(className, indent, isIdentity));
+            builder.append(createMethodPropertiesDeclaration(propertiesAndParentProperties, availableImports,
+                    currentPkg, COMMA + GAP));
+            builder.append(createConstructorDeclarationFromRightParenthesis());
+            builder.append(createConstructorSuper(parentProperty, indent));
+            builder.append(createClassPropertiesInitialization(properties, indent));
+            builder.append(createConstructorClosingPart(indent));
+        } while (parentPropertyIterator.hasNext());
+
+        return builder.toString();
+    }
+
+    private static String createConstructorForEveryProperty(final String indent, final boolean isIdentity,
+            final List<GeneratedProperty> properties, final List<GeneratedProperty> propertiesAllParents,
+            final Map<String, String> availableImports, final String currentPkg, final String className) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
+        if (properties == null) {
+            throw new IllegalArgumentException("List of generated properties can't be null");
+        }
+        if (propertiesAllParents == null) {
+            throw new IllegalArgumentException(
+                    "List of generated properties of all parent transport objects can't be null");
+        }
+        if (availableImports == null) {
+            throw new IllegalArgumentException("Map of available imports can't be null");
+        }
+        if (currentPkg == null) {
+            throw new IllegalArgumentException("String with current package can't be null");
+        }
+        if (className == null) {
+            throw new IllegalArgumentException("String with class name can't be null");
         }
 
-        GeneratedProperty ctorParam;
-        Iterator<GeneratedProperty> iteratorCtorParams = ctorParams.iterator();
+        final StringBuilder builder = new StringBuilder();
+
+        GeneratedProperty property;
+        Iterator<GeneratedProperty> propertyIterator = properties.iterator();
 
         do {
-            ctorParam = null;
-            if (iteratorCtorParams.hasNext()) {
-                ctorParam = iteratorCtorParams.next();
+            property = null;
+            if (propertyIterator.hasNext()) {
+                property = propertyIterator.next();
             }
-            builder.append(createConstructorDeclarationToLeftParenthesis(genTransferObject, indent, isIdentity));
 
-            if (ctorParam != null) {
-                builder.append(createMethodParamDeclaration(ctorParam, availableImports, currentPkg));
+            List<GeneratedProperty> propertyAndTopParentProperties = new ArrayList<GeneratedProperty>();
+            if (property != null) {
+                propertyAndTopParentProperties.add(property);
             }
+            propertyAndTopParentProperties.addAll(propertiesAllParents);
+
+            builder.append(createConstructorDeclarationToLeftParenthesis(className, indent, isIdentity));
+            builder.append(createMethodPropertiesDeclaration(propertyAndTopParentProperties, availableImports,
+                    currentPkg, COMMA + GAP));
             builder.append(createConstructorDeclarationFromRightParenthesis());
-            builder.append(createConstructorSuperCalling(indent));
+            builder.append(createConstructorSuper(propertiesAllParents, indent));
+            builder.append(createClassPropertyInitialization(property, indent));
+            builder.append(createConstructorClosingPart(indent));
+        } while (propertyIterator.hasNext());
 
-            if (ctorParam != null) {
-                builder.append(createClassAttributeInitialization(indent, ctorParam));
+        return builder.toString();
+    }
+
+    /**
+     * The method selects from input list of properties only those which have
+     * read only attribute set to true.
+     * 
+     * @param properties
+     *            contains list of properties of generated transfer object
+     * @return subset of <code>properties</code> which have read only attribute
+     *         set to true
+     */
+    private static List<GeneratedProperty> resolveReadOnlyPropertiesFromTO(List<GeneratedProperty> properties) {
+        List<GeneratedProperty> readOnlyProperties = new ArrayList<GeneratedProperty>();
+        if (properties != null) {
+            for (final GeneratedProperty property : properties) {
+                if (property.isReadOnly()) {
+                    readOnlyProperties.add(property);
+                }
             }
+        }
+        return readOnlyProperties;
+    }
 
-            builder.append(createConstructorClosingPart(indent));
-        } while (iteratorCtorParams.hasNext());
+    private static String createMethodPropertiesDeclaration(final List<GeneratedProperty> parameters,
+            final Map<String, String> availableImports, final String currentPkg, final String parameterSeparator) {
+        StringBuilder builder = new StringBuilder();
+        if (parameters == null) {
+            throw new IllegalArgumentException("List of generated properties can't be null");
+        }
+        if (availableImports == null) {
+            throw new IllegalArgumentException("Map of available imports can't be null");
+        }
+        if (currentPkg == null) {
+            throw new IllegalArgumentException("String with current package can't be null");
+        }
+        if (parameterSeparator == null) {
+            throw new IllegalArgumentException("String with separator of parameters can't be null");
+        }
 
+        for (final GeneratedProperty parameter : parameters) {
+            builder.append(createMethodPropertyDeclaration(parameter, availableImports, currentPkg));
+            builder.append(parameterSeparator);
+        }
+        if (!parameters.isEmpty()) {
+            builder = builder.delete(builder.length() - parameterSeparator.length(), builder.length());
+        }
         return builder.toString();
     }
 
-    private static String createConstructorDeclarationToLeftParenthesis(GeneratedTransferObject genTransferObject,
-            final String indent, boolean isIdentity) {
+    private static String createConstructorDeclarationToLeftParenthesis(final String className, final String indent,
+            final boolean isIdentity) {
+        if (className == null) {
+            throw new IllegalArgumentException("String with class name can't be null");
+        }
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
         final StringBuilder builder = new StringBuilder();
         builder.append(indent);
         builder.append(isIdentity ? PROTECTED : PUBLIC);
         builder.append(GAP);
-        builder.append(genTransferObject.getName());
+        builder.append(className);
         builder.append(LB);
         return builder.toString();
     }
@@ -326,13 +480,48 @@ public final class GeneratorUtil {
         return builder.toString();
     }
 
-    private static String createConstructorSuperCalling(String indent) {
-        final StringBuilder builder = new StringBuilder();
-        builder.append(indent + TAB + "super();" + NL);
+    private static String createConstructorSuper(final List<GeneratedProperty> propertiesAllParents, final String indent) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
+        if (propertiesAllParents == null) {
+            throw new IllegalArgumentException("List of all parent's properties can't be null");
+        }
+        StringBuilder builder = new StringBuilder();
+        builder.append(indent + TAB + "super(");
+        String propertySeparator = COMMA + GAP;
+        for (GeneratedProperty superProperty : propertiesAllParents) {
+            builder.append(superProperty.getName());
+            builder.append(propertySeparator);
+        }
+        if (!propertiesAllParents.isEmpty()) {
+            builder = builder.delete(builder.length() - propertySeparator.length(), builder.length());
+        }
+
+        builder.append(");" + NL);
         return builder.toString();
     }
 
-    private static String createConstructorClosingPart(String indent) {
+    private static String createConstructorSuper(final GeneratedProperty parentProperty, final String indent) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
+        if (parentProperty == null) {
+            throw new IllegalArgumentException("Parent property can't be null");
+        }
+        StringBuilder builder = new StringBuilder();
+        if (parentProperty != null) {
+            builder.append(indent + TAB + "super(");
+            builder.append(parentProperty.getName());
+            builder.append(");" + NL);
+        }
+        return builder.toString();
+    }
+
+    private static String createConstructorClosingPart(final String indent) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
         final StringBuilder builder = new StringBuilder();
         builder.append(indent);
         builder.append(RCB);
@@ -340,25 +529,55 @@ public final class GeneratorUtil {
         return builder.toString();
     }
 
-    private static String createClassAttributeInitialization(String indent, GeneratedProperty methodParameter) {
+    private static String createClassPropertiesInitialization(final List<GeneratedProperty> properties,
+            final String indent) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
+        if (properties == null) {
+            throw new IllegalArgumentException("List of generated class properties can't be null");
+        }
+        final StringBuilder builder = new StringBuilder();
+        for (final GeneratedProperty property : properties) {
+            createClassPropertyInitialization(property, indent);
+        }
+        return builder.toString();
+    }
+
+    private static String createClassPropertyInitialization(final GeneratedProperty property, final String indent) {
+        if (indent == null) {
+            throw new IllegalArgumentException("String with indent can't be null");
+        }
+        if (property == null) {
+            throw new IllegalArgumentException("List of generated class properties can't be null");
+        }
         final StringBuilder builder = new StringBuilder();
         builder.append(indent);
         builder.append(TAB);
         builder.append("this.");
-        builder.append(methodParameter.getName());
+        builder.append(property.getName());
         builder.append(" = ");
-        builder.append(methodParameter.getName());
+        builder.append(property.getName());
         builder.append(SC);
         builder.append(NL);
         return builder.toString();
     }
 
-    private static String createMethodParamDeclaration(GeneratedProperty methodParameter,
-            final Map<String, String> availableImports, String currentPkg) {
+    private static String createMethodPropertyDeclaration(final GeneratedProperty property,
+            final Map<String, String> availableImports, final String currentPkg) {
+        if (property == null) {
+            throw new IllegalArgumentException("Generated property can't be null");
+        }
+        if (availableImports == null) {
+            throw new IllegalArgumentException("Map of available imports can't be null");
+        }
+        if (currentPkg == null) {
+            throw new IllegalArgumentException("String with current package can't be null");
+        }
         final StringBuilder builder = new StringBuilder();
-        builder.append(getExplicitType(methodParameter.getReturnType(), availableImports, currentPkg));
+        builder.append(getExplicitType(property.getReturnType(), availableImports, currentPkg));
         builder.append(GAP);
-        builder.append(methodParameter.getName());
+        builder.append(property.getName());
         return builder.toString();
     }
 
@@ -784,6 +1003,51 @@ public final class GeneratorUtil {
         return false;
     }
 
+    /**
+     * The method returns reference to highest (top parent) Generated Transfer
+     * Object.
+     * 
+     * @param childTransportObject
+     *            is generated transfer object which can be extended by other
+     *            generated transfer object
+     * @return in first case that <code>childTransportObject</code> isn't
+     *         extended then <code>childTransportObject</code> is returned. In
+     *         second case the method is recursive called until first case.
+     */
+    private static GeneratedTransferObject getTopParrentTransportObject(GeneratedTransferObject childTransportObject) {
+        if (childTransportObject == null) {
+            throw new IllegalArgumentException("Parameter childTransportObject can't be null.");
+        }
+        if (childTransportObject.getExtends() == null) {
+            return childTransportObject;
+        } else {
+            return getTopParrentTransportObject(childTransportObject.getExtends());
+        }
+    }
+
+    /**
+     * The method returns the list of the properties of all extending generated
+     * transfer object from <code>genTO</code> to highest parent generated
+     * transfer object
+     * 
+     * @param genTO
+     * @return the list of all properties from actual to highest parent
+     *         generated transfer object. In case when extension exists the
+     *         method is recursive called.
+     */
+    private static List<GeneratedProperty> getPropertiesOfAllParents(GeneratedTransferObject genTO) {
+        List<GeneratedProperty> propertiesOfAllParents = new ArrayList<GeneratedProperty>();
+        if (genTO != null) {
+            final List<GeneratedProperty> allPropertiesOfTO = genTO.getProperties();
+            List<GeneratedProperty> readOnlyPropertiesOfTO = resolveReadOnlyPropertiesFromTO(allPropertiesOfTO);
+            propertiesOfAllParents.addAll(readOnlyPropertiesOfTO);
+            if (genTO.getExtends() != null) {
+                propertiesOfAllParents.addAll(getPropertiesOfAllParents(genTO.getExtends()));
+            }
+        }
+        return propertiesOfAllParents;
+    }
+
     public static String createStaticInicializationBlock(GeneratedTransferObject genTransferObject, String indent) {
 
         final StringBuilder builder = new StringBuilder();
index f9f4c83..972b60c 100644 (file)
@@ -1,9 +1,15 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-  <modelVersion>4.0.0</modelVersion>\r
-  <parent>\r
-    <groupId>org.opendaylight.controller</groupId>\r
-    <artifactId>binding-generator</artifactId>\r
-    <version>0.5.4-SNAPSHOT</version>\r
-  </parent>\r
-  <artifactId>binding-model-api</artifactId>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+\r
+    <parent>\r
+        <groupId>org.opendaylight.controller</groupId>\r
+        <artifactId>binding-generator</artifactId>\r
+        <version>0.5.4-SNAPSHOT</version>\r
+    </parent>\r
+\r
+    <modelVersion>4.0.0</modelVersion>\r
+    <artifactId>binding-model-api</artifactId>\r
+    <name>${project.artifactId}</name>\r
+    <description>${project.artifactId}</description>\r
+\r
 </project>\r
index 8776bd9..3776cf8 100644 (file)
@@ -1,18 +1,18 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <parent>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>yang-prototype</artifactId>
         <version>0.5-SNAPSHOT</version>
     </parent>
-    <version>0.5.4-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
+    <version>0.5.4-SNAPSHOT</version>
     <artifactId>binding-generator</artifactId>
     <packaging>pom</packaging>
-    <name>binding-generator</name>
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                     <target>1.7</target>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.8.1</version>
-                <configuration>
-                    <stylesheet>maven</stylesheet>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>aggregate</goal>
-                        </goals>
-                        <phase>site</phase>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
+
 </project>
diff --git a/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/typedef_of_typedef.yang b/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/typedef_of_typedef.yang
new file mode 100644 (file)
index 0000000..3aa6770
--- /dev/null
@@ -0,0 +1,79 @@
+module typedef_typedef {
+    
+    namespace "urn:typedef:typedef";
+    prefix "sbd";
+
+    organization "OPEN DAYLIGHT";
+    contact "http://www.opendaylight.org/";
+
+    revision 2013-07-09 {
+        
+    }
+
+   typedef byte-type {
+        type bits {
+            bit first-bit {
+                position 10;
+            }
+            bit second-bit {
+                position 20;
+            }
+         }
+    }    
+    
+    
+  typedef typedef-enum-fruit {
+    type enumeration {
+      enum "apple" {
+        value 1;
+        description "gold";
+      }
+      enum "pear" {
+        value 2;
+      }
+    }
+  }    
+    
+    typedef simple-typedef1 {
+       type uint8;
+    }
+    
+    typedef simple-typedef2 {
+        type simple-typedef1;
+    }
+    
+    typedef simple-typedef3 {
+        type simple-typedef2;
+    }
+    
+    typedef simple-typedef4 {
+        type simple-typedef3;
+    }
+    
+    typedef simple-typedef1-1 {
+        type uint16;
+    }    
+
+    
+    typedef union-typedef {
+        type union {
+            type simple-typedef1;
+            type simple-typedef4;
+            type byte-type;
+            type typedef-enum-fruit;
+        }
+    }    
+    
+    typedef extended-typedef-union {
+        type union-typedef;
+    }
+    
+    
+    typedef extended-typedef-simple {
+        type simple-typedef1;
+    }
+    
+    typedef extended-typedef-enum {
+        type typedef-enum-fruit;
+    }
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/sample.yang b/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/sample.yang
deleted file mode 100644 (file)
index 3ecdc0a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-module sample {
-    yang-version 1;
-    namespace "sample";
-    prefix "s";
-
-    revision 2013-06-13 {
-       description "Initial demo";
-    }
-    
-
-
-    // Simple Type definition
-    
-    typedef foo-name {
-        type string;
-    }
-    
-    // Storage / data structure
-    
-    container topologies {
-        list topology {
-            leaf foo-name {
-                type string;
-            }
-        }
-    }
-    
-    
-    // Notification / Event
-    
-    notification packet-in {
-        leaf node {
-            type string;
-        }
-        leaf port {
-            type uint16;
-        }
-        leaf content {
-            type binary;
-        }
-    }
-    
-    // RPC
-    
-    rpc packet-out {
-        input {
-            leaf node {
-                type string;
-            }
-            leaf port {
-                type uint16;
-            }
-            leaf content {
-                type binary;
-            }
-        }
-        output {
-            
-        }
-    }    
-
-}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/toaster.yang b/opendaylight/sal/yang-prototype/code-generator/samples/modeling-sample/src/main/yang/toaster.yang
new file mode 100644 (file)
index 0000000..fc9b665
--- /dev/null
@@ -0,0 +1,187 @@
+module toaster {
+
+    yang-version 1;
+
+    namespace
+      "http://netconfcentral.org/ns/toaster";
+
+    prefix toast;
+
+    organization "Netconf Central";
+
+    contact
+      "Andy Bierman <andy@netconfcentral.org>";
+
+    description
+      "YANG version of the TOASTER-MIB.";
+
+    revision "2009-11-20" {
+      description
+        "Toaster module in progress.";
+    }
+
+
+    identity toast-type {
+      description
+          "Base for all bread types supported by the toaster.
+           New bread types not listed here nay be added in the 
+           future.";
+    }
+
+    identity white-bread {
+      base toast:toast-type;
+      description "White bread.";
+    }
+
+    identity wheat-bread {
+      base toast-type;
+      description "Wheat bread.";
+    }
+
+    identity wonder-bread {
+      base toast-type;
+      description "Wonder bread.";
+    }
+
+    identity frozen-waffle {
+      base toast-type;
+      description "Frozen waffle.";
+    }
+
+    identity frozen-bagel {
+      base toast-type;
+      description "Frozen bagel.";
+    }
+
+    identity hash-brown {
+      base toast-type;
+      description "Hash browned potatos.";
+    }
+
+    typedef DisplayString {
+      type string;
+      description
+        "YANG version of the SMIv2 DisplayString TEXTUAL-CONVENTION.";
+      reference
+        "RFC 2579, section 2.";
+
+    }
+
+    container toaster {
+      presence
+        "Indicates the toaster service is available";
+      description
+        "Top-level container for all toaster database objects.";
+      leaf toasterManufacturer {
+        type DisplayString;
+        config false;
+        mandatory true;
+        description
+          "The name of the toaster's manufacturer. For instance, 
+                Microsoft Toaster.";
+      }
+
+      leaf toasterModelNumber {
+        type DisplayString;
+        config false;
+        mandatory true;
+        description
+          "The name of the toaster's model. For instance,
+               Radiant Automatic.";
+      }
+
+      leaf toasterStatus {
+        type enumeration {
+          enum "up" {
+            value 1;
+            description
+              "The toaster knob position is up.
+                      No toast is being made now.";
+          }
+          enum "down" {
+            value 2;
+            description
+              "The toaster knob position is down.
+                      Toast is being made now.";
+          }
+        }
+        config false;
+        mandatory true;
+        description
+          "This variable indicates the current state of 
+               the toaster.";
+      }
+    }  // container toaster
+
+    rpc make-toast {
+      description
+        "Make some toast.
+           The toastDone notification will be sent when 
+           the toast is finished.
+           An 'in-use' error will be returned if toast
+           is already being made.
+           A 'resource-denied' error will be returned 
+           if the toaster service is disabled.";
+      input {
+        leaf toasterDoneness {
+          type uint32 {
+            range "1 .. 10";
+          }
+          default '5';
+          description
+            "This variable controls how well-done is the 
+                   ensuing toast. It should be on a scale of 1 to 10.
+                   Toast made at 10 generally is considered unfit 
+                   for human consumption; toast made at 1 is warmed 
+                   lightly.";
+        }
+
+        leaf toasterToastType {
+          type identityref {
+            base toast:toast-type;
+          }
+          default 'wheat-bread';
+          description
+            "This variable informs the toaster of the type of 
+                   material that is being toasted. The toaster 
+                   uses this information, combined with 
+                   toasterDoneness, to compute for how 
+                   long the material must be toasted to achieve 
+                   the required doneness.";
+        }
+      }
+    }  // rpc make-toast
+
+    rpc cancel-toast {
+      description
+        "Stop making toast, if any is being made.
+           A 'resource-denied' error will be returned 
+           if the toaster service is disabled.";
+    }  // rpc cancel-toast
+
+    notification toastDone {
+      description
+        "Indicates that the toast in progress has completed.";
+      leaf toastStatus {
+        type enumeration {
+          enum "done" {
+            value 0;
+            description "The toast is done.";
+          }
+          enum "cancelled" {
+            value 1;
+            description
+              "The toast was cancelled.";
+          }
+          enum "error" {
+            value 2;
+            description
+              "The toaster service was disabled or
+                     the toaster is broken.";
+          }
+        }
+        description
+          "Indicates the final toast status";
+      }
+    }  // notification toastDone
+  }  // module toaster
diff --git a/opendaylight/sal/yang-prototype/code-generator/src/site/site.xml b/opendaylight/sal/yang-prototype/code-generator/src/site/site.xml
new file mode 100644 (file)
index 0000000..80ff3a4
--- /dev/null
@@ -0,0 +1,16 @@
+<project name="${project.name}">
+
+    <skin>
+        <groupId>org.apache.maven.skins</groupId>
+        <artifactId>maven-fluido-skin</artifactId>
+        <version>1.3.0</version>
+    </skin>
+
+    <body>
+        <menu ref="parent"/>
+        <menu ref="modules"/>
+        <menu ref="reports"/>
+    </body>
+
+</project>
+
index 68fe50d..e6ed882 100644 (file)
@@ -1,11 +1,16 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
     <parent>
         <artifactId>yang-prototype</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5-SNAPSHOT</version>
     </parent>
+
+    <modelVersion>4.0.0</modelVersion>
     <artifactId>concepts-lang</artifactId>
     <packaging>jar</packaging>
-</project>
\ No newline at end of file
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+
+</project>
diff --git a/opendaylight/sal/yang-prototype/concepts-lang/src/site/site.xml b/opendaylight/sal/yang-prototype/concepts-lang/src/site/site.xml
new file mode 100644 (file)
index 0000000..80ff3a4
--- /dev/null
@@ -0,0 +1,16 @@
+<project name="${project.name}">
+
+    <skin>
+        <groupId>org.apache.maven.skins</groupId>
+        <artifactId>maven-fluido-skin</artifactId>
+        <version>1.3.0</version>
+    </skin>
+
+    <body>
+        <menu ref="parent"/>
+        <menu ref="modules"/>
+        <menu ref="reports"/>
+    </body>
+
+</project>
+
index e9fa751..06d1189 100644 (file)
@@ -1,11 +1,16 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5-SNAPSHOT</version>
     </parent>
+
+    <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-inet-types</artifactId>
     <version>2010.09.24-SNAPSHOT</version>
-</project>
\ No newline at end of file
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+
+</project>
index 4831cf1..1ad4e4a 100644 (file)
@@ -1,11 +1,16 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+
     <parent>
         <artifactId>model-ietf</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5-SNAPSHOT</version>
     </parent>
+
+    <modelVersion>4.0.0</modelVersion>
     <artifactId>ietf-yang-types</artifactId>
     <version>2010.09.24-SNAPSHOT</version>
-</project>
\ No newline at end of file
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+
+</project>
index aadde16..a5b87b0 100644 (file)
@@ -1,15 +1,21 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+
     <parent>
         <artifactId>model-parent</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5-SNAPSHOT</version>
     </parent>
+
+    <modelVersion>4.0.0</modelVersion>
     <artifactId>model-ietf</artifactId>
     <packaging>pom</packaging>
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+
     <modules>
-       <module>ietf-inet-types</module>
-       <module>ietf-yang-types</module>
+        <module>ietf-inet-types</module>
+        <module>ietf-yang-types</module>
     </modules>
-</project>
\ No newline at end of file
+
+</project>
index 44f59bc..2c14ea6 100644 (file)
@@ -1,18 +1,23 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
     <parent>
         <artifactId>yang-prototype</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5-SNAPSHOT</version>
     </parent>
+
+    <modelVersion>4.0.0</modelVersion>
     <artifactId>model-parent</artifactId>
     <packaging>pom</packaging>
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+
     <modules>
         <module>ietf</module>
         <module>model-topology</module>
         <module>model-openflow</module>
-        <!--module>model-topology-bgp</module-->
+        <!-- <module>model-topology-bgp</module> -->
     </modules>
 
     <build>
@@ -72,7 +77,8 @@
         </plugins>
         <pluginManagement>
             <plugins>
-                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+                <!--This plugin's configuration is used to store Eclipse 
+                    m2e settings only. It has no influence on the Maven build itself. -->
                 <plugin>
                     <groupId>org.eclipse.m2e</groupId>
                     <artifactId>lifecycle-mapping</artifactId>
             </plugins>
         </pluginManagement>
     </build>
+
     <dependencies>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <version>0.5.4-SNAPSHOT</version>
         </dependency>
     </dependencies>
+
 </project>
diff --git a/opendaylight/sal/yang-prototype/model/src/site/site.xml b/opendaylight/sal/yang-prototype/model/src/site/site.xml
new file mode 100644 (file)
index 0000000..80ff3a4
--- /dev/null
@@ -0,0 +1,16 @@
+<project name="${project.name}">
+
+    <skin>
+        <groupId>org.apache.maven.skins</groupId>
+        <artifactId>maven-fluido-skin</artifactId>
+        <version>1.3.0</version>
+    </skin>
+
+    <body>
+        <menu ref="parent"/>
+        <menu ref="modules"/>
+        <menu ref="reports"/>
+    </body>
+
+</project>
+
index 741e217..2f2df0a 100644 (file)
@@ -1,10 +1,63 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.opendaylight.controller</groupId>
     <artifactId>yang-prototype</artifactId>
     <version>0.5-SNAPSHOT</version>
     <packaging>pom</packaging>
+    <name>${project.artifactId}</name>
+    <description>
+        YANG Tools is a infrastructure project aiming to develop necessary tooling and libraries providing support of
+        NETCONF and YANG for Java (JVM-language based) projects and applications, such as Model Driven SAL for 
+        Controller (which uses YANG as it's modeling language) and Netconf / OFConfig plugins. 
+    </description>
+
+    <developers>
+        <developer>
+            <id>ttkacik</id>
+            <name>Tony Tkacik</name>
+            <email>ttkacik@cisco.com</email>
+            <organization>OpenDaylight</organization>
+        </developer>
+        <developer>
+            <id>rovarga</id>
+            <name>Robert Varga</name>
+            <email>rovarga@cisco.com</email>
+            <organization>OpenDaylight</organization>
+        </developer>
+        <developer>
+            <id>lsedlak</id>
+            <name>Lukas Sedlak</name>
+            <email>lsedlak@cisco.com</email>
+            <organization>OpenDaylight</organization>
+        </developer>
+        <developer>
+            <id>mvitez</id>
+            <name>Martin Vitez</name>
+            <email>mvitez@cisco.com</email>
+            <organization>OpenDaylight</organization>
+        </developer>
+        <developer>
+            <id>jmedved</id>
+            <name>Jan Medved</name>
+            <email>jmedved@cisco.com</email>
+            <organization>OpenDaylight</organization>
+        </developer>
+        <developer>
+            <id>jgloncak</id>
+            <name>Jozef Gloncak</name>
+            <email>jgloncak@cisco.com</email>
+            <organization>OpenDaylight</organization>
+        </developer>
+        <developer>
+            <id>mirehak</id>
+            <name>Michal Rehak</name>
+            <email>mirehak@cisco.com</email>
+            <organization>OpenDaylight</organization>
+        </developer>
+    </developers>
+
     <modules>
         <module>concepts-lang</module>
         <module>yang</module>
@@ -17,6 +70,7 @@
         <nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
         <sitedeploy>dav:http://nexus.opendaylight.org/content/sites/site</sitedeploy>
         <siteplugin>3.2</siteplugin>
+        <defaultStylesheet>${project.basedir}/src/site/resources/stylesheet.css</defaultStylesheet>
         <projectinfo>2.6</projectinfo>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <compiler.version>2.3.2</compiler.version>
             <name>ops4j-releases</name>
             <url>${nexusproxy}/repositories/ops4j-releases/</url>
         </repository>
-        <!-- Third Packages hosted in local maven because not available in other 
-            places -->
+        <!-- Third Packages hosted in local maven because not available in 
+            other places -->
         <repository>
             <id>thirdparty</id>
             <name>thirdparty</name>
             <id>opendaylight-snapshot</id>
             <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
         </snapshotRepository>
-        <!-- Site deployment -->
-        <!-- site>
-            <id>website</id>
-            <url>${sitedeploy}</url>
-        </site -->
+        <site>
+            <id>${project.artifactId}-site</id>
+            <url>./</url>
+        </site>
     </distributionManagement>
 
-
     <dependencyManagement>
         <dependencies>
             <dependency>
             </dependency>
         </dependencies>
     </dependencyManagement>
+
     <build>
         <plugins>
             <plugin>
                     <target>1.7</target>
                 </configuration>
             </plugin>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>jar-no-fork</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- explicitly define maven-deploy-plugin after other to 
+                    force exec order -->
+                <artifactId>maven-deploy-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>deploy</id>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>deploy</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.8.1</version>
                 <configuration>
-                    <stylesheet>maven</stylesheet>
+                    <stylesheetfile>${defaultStylesheet}</stylesheetfile>
+                    <excludePackageNames>
+                        *.opendaylight.controller.antlrv4.code.gen
+                    </excludePackageNames>
                 </configuration>
                 <executions>
                     <execution>
+                        <id>aggregate</id>
                         <goals>
                             <goal>aggregate</goal>
                         </goals>
                         <phase>site</phase>
-                    </execution> 
-                    <execution> 
-                          <id>attach-javadocs</id>
-                          <phase>deploy</phase>
-                          <goals><goal>jar</goal></goals> 
-                    </execution> 
-                </executions> 
-            </plugin>
-            <plugin>
-            <artifactId>maven-source-plugin</artifactId>
-                <executions>
+                    </execution>
                     <execution>
-                        <id>attach-sources</id>
+                        <id>attach-javadocs</id>
                         <phase>deploy</phase>
-                        <goals><goal>jar-no-fork</goal></goals> 
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
                     </execution>
-                 </executions>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <inherited>false</inherited>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.maven.doxia</groupId>
+                        <artifactId>doxia-module-markdown</artifactId>
+                        <version>1.3</version>
+                    </dependency>
+                </dependencies>
+                <configuration>
+                    <siteDirectory>${project.basedir}/src/site</siteDirectory>
+                    <inputEncoding>UTF-8</inputEncoding>
+                    <outputEncoding>UTF-8</outputEncoding>
+                </configuration>
             </plugin>
-            <plugin> 
-                <!-- explicitly define maven-deploy-plugin after other to force exec order -->
-                <artifactId>maven-deploy-plugin</artifactId> 
-                <executions> 
-                    <execution> 
-                        <id>deploy</id>
-                        <phase>deploy</phase>
-                        <goals><goal>deploy</goal></goals> 
-                    </execution> 
-                </executions> 
-            </plugin> 
         </plugins>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-source-plugin</artifactId>
+                    <version>2.2.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-deploy-plugin</artifactId>
+                    <version>2.7</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.15</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-site-plugin</artifactId>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.apache.maven.doxia</groupId>
+                            <artifactId>doxia-module-markdown</artifactId>
+                            <version>1.3</version>
+                        </dependency>
+                    </dependencies>
+                    <configuration>
+                        <siteDirectory>${project.parent.basedir}/src/site</siteDirectory>
+                        <inputEncoding>UTF-8</inputEncoding>
+                        <outputEncoding>UTF-8</outputEncoding>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>2.9.1</version>
+                    <configuration>
+                        <stylesheetfile>${defaultStylesheet}</stylesheetfile>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <id>aggregate</id>
+                            <goals>
+                                <goal>aggregate</goal>
+                            </goals>
+                            <phase>site</phase>
+                        </execution>
+                        <execution>
+                            <id>attach-javadocs</id>
+                            <phase>deploy</phase>
+                            <goals>
+                                <goal>jar</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
     </build>
+
     <reporting>
         <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>2.9.1</version>
+                <reportSets>
+                    <reportSet>
+                        <reports>
+                            <report>javadoc</report>
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>findbugs-maven-plugin</artifactId>
             </plugin>
         </plugins>
     </reporting>
+
     <profiles>
         <profile>
             <id>viewbuild</id>
diff --git a/opendaylight/sal/yang-prototype/src/site/markdown/readme.md b/opendaylight/sal/yang-prototype/src/site/markdown/readme.md
new file mode 100644 (file)
index 0000000..1faff04
--- /dev/null
@@ -0,0 +1,24 @@
+YANG tools
+====================
+
+Project documentation
+---------------------
+
+### Description
+
+YANG Tools is a infrastructure project aiming to develop necessary tooling and libraries providing support of NETCONF and YANG for Java (JVM-language based) projects and applications, such as Model Driven SAL for Controller (which uses YANG as it's modeling language) and Netconf / OFConfig plugins. 
+
+### Scope
+
+The scope of YANG Tools includes:
+
+* Parser of YANG files
+* Java meta-model for YANG
+* Java binding for YANG
+* Maven plugin for processing YANG files
+* Infrastructure for code generators based on YANG
+* Validation of instance data (XML) based on YANG to RelaxNG mapping - RFC6110
+* Proof-of-concept, research and support for new YANG extensions, which are meant to be reused by other projects.
+* IDE related tools to assist in writing, using and developing YANG models
+* Libraries and supporting functionality for YANG API (REST APIs defined by the YANG model).
diff --git a/opendaylight/sal/yang-prototype/src/site/resources/stylesheet.css b/opendaylight/sal/yang-prototype/src/site/resources/stylesheet.css
new file mode 100644 (file)
index 0000000..1936586
--- /dev/null
@@ -0,0 +1,522 @@
+/* Javadoc style sheet */
+/*
+Overall document style
+*/
+body {
+    background-color:#ffffff;
+    color:#353833;
+    font-family:Arial, Helvetica, sans-serif;
+    font-size:76%;
+    margin:0;
+}
+a:link, a:visited {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a:hover, a:focus {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+a:active {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a[name] {
+    color:#353833;
+}
+a[name]:hover {
+    text-decoration:none;
+    color:#353833;
+}
+pre {
+    font-size:1.3em;
+}
+h1 {
+    font-size:1.8em;
+}
+h2 {
+    font-size:1.5em;
+}
+h3 {
+    font-size:1.4em;
+}
+h4 {
+    font-size:1.3em;
+}
+h5 {
+    font-size:1.2em;
+}
+h6 {
+    font-size:1.1em;
+}
+ul {
+    list-style-type:disc;
+}
+code, tt {
+    font-size:1.2em;
+}
+dt code {
+    font-size:1.2em;
+}
+table tr td dt code {
+    font-size:1.2em;
+    vertical-align:top;
+}
+sup {
+    font-size:.6em;
+}
+/*
+Document title and Copyright styles
+*/
+.clear {
+    clear:both;
+    height:0px;
+    overflow:hidden;
+}
+.aboutLanguage {
+    float:right;
+    padding:0px 21px;
+    font-size:.8em;
+    z-index:200;
+    margin-top:-7px;
+}
+.legalCopy {
+    margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+    color:#bb7a2a;
+}
+.tab {
+    background-color:#0066FF;
+    background-image:url(resources/titlebar.gif);
+    background-position:left top;
+    background-repeat:no-repeat;
+    color:#ffffff;
+    padding:8px;
+    width:5em;
+    font-weight:bold;
+}
+/*
+Navigation bar styles
+*/
+.bar {
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    padding:.8em .5em .4em .8em;
+    height:auto;/*height:1.8em;*/
+    font-size:1em;
+    margin:0;
+}
+.topNav {
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+}
+.bottomNav {
+    margin-top:10px;
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+}
+.subNav {
+    background-color:#dee3e9;
+    border-bottom:1px solid #9eadc0;
+    float:left;
+    width:100%;
+    overflow:hidden;
+}
+.subNav div {
+    clear:left;
+    float:left;
+    padding:0 0 5px 6px;
+}
+ul.navList, ul.subNavList {
+    float:left;
+    margin:0 25px 0 0;
+    padding:0;
+}
+ul.navList li{
+    list-style:none;
+    float:left;
+    padding:3px 6px;
+}
+ul.subNavList li{
+    list-style:none;
+    float:left;
+    font-size:90%;
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.topNav a:hover, .bottomNav a:hover {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+.navBarCell1Rev {
+    background-image:url(resources/tab.gif);
+    background-color:#a88834;
+    color:#FFFFFF;
+    margin: auto 5px;
+    border:1px solid #c9aa44;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+    clear:both;
+    margin:0 20px;
+    padding:5px 0 0 0;
+}
+.indexHeader {
+    margin:10px;
+    position:relative;
+}
+.indexHeader span{
+    margin-right:15px;
+}
+.indexHeader h1 {
+    font-size:1.3em;
+}
+.title {
+    color:#2c4557;
+    margin:10px 0;
+}
+.subTitle {
+    margin:5px 0 0 0;
+}
+.header ul {
+    margin:0 0 25px 0;
+    padding:0;
+}
+.footer ul {
+    margin:20px 0 5px 0;
+}
+.header ul li, .footer ul li {
+    list-style:none;
+    font-size:1.2em;
+}
+/*
+Heading styles
+*/
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+    padding:0;
+    margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+    padding:0px 0 20px 0;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+    clear:both;
+    padding:10px 20px;
+    position:relative;
+}
+.indexContainer {
+    margin:10px;
+    position:relative;
+    font-size:1.0em;
+}
+.indexContainer h2 {
+    font-size:1.1em;
+    padding:0 0 3px 0;
+}
+.indexContainer ul {
+    margin:0;
+    padding:0;
+}
+.indexContainer ul li {
+    list-style:none;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+    font-size:1.1em;
+    font-weight:bold;
+    margin:10px 0 0 0;
+    color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+    margin:10px 0 10px 20px;
+}
+.serializedFormContainer dl.nameValue dt {
+    margin-left:1px;
+    font-size:1.1em;
+    display:inline;
+    font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+    margin:0 0 0 1px;
+    font-size:1.1em;
+    display:inline;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+    display:inline;
+    font-size:0.9em;
+}
+ul.inheritance {
+    margin:0;
+    padding:0;
+}
+ul.inheritance li {
+    display:inline;
+    list-style:none;
+}
+ul.inheritance li ul.inheritance {
+    margin-left:15px;
+    padding-left:15px;
+    padding-top:1px;
+}
+ul.blockList, ul.blockListLast {
+    margin:10px 0 10px 0;
+    padding:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+    list-style:none;
+    margin-bottom:25px;
+}
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+    padding:0px 20px 5px 10px;
+    border:1px solid #9eadc0;
+    background-color:#f9f9f9;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+    padding:0 0 5px 8px;
+    background-color:#ffffff;
+    border:1px solid #9eadc0;
+    border-top:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+    margin-left:0;
+    padding-left:0;
+    padding-bottom:15px;
+    border:none;
+    border-bottom:1px solid #9eadc0;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+    list-style:none;
+    border-bottom:none;
+    padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+    margin-top:0;
+    margin-bottom:1px;
+}
+/*
+Table styles
+*/
+.contentContainer table, .classUseContainer table, .constantValuesContainer table {
+    border-bottom:1px solid #9eadc0;
+    width:100%;
+}
+.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
+    width:100%;
+}
+.contentContainer .description table, .contentContainer .details table {
+    border-bottom:none;
+}
+.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
+    vertical-align:top;
+    padding-right:20px;
+}
+.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
+.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
+.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
+.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
+    padding-right:3px;
+}
+.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
+    position:relative;
+    text-align:left;
+    background-repeat:no-repeat;
+    color:#FFFFFF;
+    font-weight:bold;
+    clear:none;
+    overflow:hidden;
+    padding:0px;
+    margin:0px;
+    white-space:pre;
+}
+caption a:link, caption a:hover, caption a:active, caption a:visited {
+    color:#FFFFFF;
+}
+.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
+    white-space:nowrap;
+    padding-top:8px;
+    padding-left:8px;
+    display:block;
+    float:left;
+    background-image:url(resources/titlebar.gif);
+    height:18px;
+}
+.contentContainer ul.blockList li.blockList caption span.activeTableTab span {
+    white-space:nowrap;
+    padding-top:8px;
+    padding-left:8px;
+    display:block;
+    float:left;
+    background-image:url(resources/activetitlebar.gif);
+    height:18px;
+}
+.contentContainer ul.blockList li.blockList caption span.tableTab span {
+    white-space:nowrap;
+    padding-top:8px;
+    padding-left:8px;
+    display:block;
+    float:left;
+    background-image:url(resources/titlebar.gif);
+    height:18px;
+}
+.contentContainer ul.blockList li.blockList caption span.tableTab, .contentContainer ul.blockList li.blockList caption span.activeTableTab {
+    padding-top:0px;
+    padding-left:0px;
+    background-image:none;
+    float:none;
+    display:inline;
+}
+.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
+    width:10px;
+    background-image:url(resources/titlebar_end.gif);
+    background-repeat:no-repeat;
+    background-position:top right;
+    position:relative;
+    float:left;
+}
+.contentContainer ul.blockList li.blockList .activeTableTab .tabEnd {
+    width:10px;
+    margin-right:5px;
+    background-image:url(resources/activetitlebar_end.gif);
+    background-repeat:no-repeat;
+    background-position:top right;
+    position:relative;
+    float:left;
+}
+.contentContainer ul.blockList li.blockList .tableTab .tabEnd {
+    width:10px;
+    margin-right:5px;
+    background-image:url(resources/titlebar_end.gif);
+    background-repeat:no-repeat;
+    background-position:top right;
+    position:relative;
+    float:left;
+}
+ul.blockList ul.blockList li.blockList table {
+    margin:0 0 12px 0px;
+    width:100%;
+}
+.tableSubHeadingColor {
+    background-color: #EEEEFF;
+}
+.altColor {
+    background-color:#eeeeef;
+}
+.rowColor {
+    background-color:#ffffff;
+}
+.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
+    text-align:left;
+    padding:3px 3px 3px 7px;
+}
+th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
+    background:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    text-align:left;
+    padding:3px 3px 3px 7px;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+    font-weight:bold;
+}
+td.colFirst, th.colFirst {
+    border-left:1px solid #9eadc0;
+    white-space:nowrap;
+}
+td.colLast, th.colLast {
+    border-right:1px solid #9eadc0;
+}
+td.colOne, th.colOne {
+    border-right:1px solid #9eadc0;
+    border-left:1px solid #9eadc0;
+}
+table.overviewSummary  {
+    padding:0px;
+    margin-left:0px;
+}
+table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
+table.overviewSummary td.colOne, table.overviewSummary th.colOne {
+    width:25%;
+    vertical-align:middle;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+    width:25%;
+    vertical-align:middle;
+}
+/*
+Content styles
+*/
+.description pre {
+    margin-top:0;
+}
+.deprecatedContent {
+    margin:0;
+    padding:10px 0;
+}
+.docSummary {
+    padding:0;
+}
+/*
+Formatting effect styles
+*/
+.sourceLineNo {
+    color:green;
+    padding:0 30px 0 0;
+}
+h1.hidden {
+    visibility:hidden;
+    overflow:hidden;
+    font-size:.9em;
+}
+.block {
+    display:block;
+    margin:3px 0 0 0;
+}
+.strong {
+    font-weight:bold;
+}
+
diff --git a/opendaylight/sal/yang-prototype/src/site/site.xml b/opendaylight/sal/yang-prototype/src/site/site.xml
new file mode 100644 (file)
index 0000000..6957e2e
--- /dev/null
@@ -0,0 +1,18 @@
+<project name="${project.name}">
+
+    <skin>
+        <groupId>org.apache.maven.skins</groupId>
+        <artifactId>maven-fluido-skin</artifactId>
+        <version>1.3.0</version>
+    </skin>
+
+    <body>
+        <menu ref="parent"/>
+        <menu ref="modules"/>
+        <menu ref="reports"/>
+        <menu name="Overview">
+            <item name="Readme" href="readme.html" />
+        </menu>
+    </body>
+
+</project>
@@ -5,7 +5,6 @@
         <artifactId>yang</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5.4-SNAPSHOT</version>
-        <relativePath>../../yang/pom.xml</relativePath>
     </parent>
     <artifactId>yang-maven-plugin-it</artifactId>
 
@@ -5,7 +5,6 @@
         <artifactId>yang</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5.4-SNAPSHOT</version>
-        <relativePath>../../yang/pom.xml</relativePath>
     </parent>
 
     <artifactId>yang-maven-plugin</artifactId>
@@ -1,13 +1,17 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+
     <parent>
         <artifactId>yang</artifactId>
         <groupId>org.opendaylight.controller</groupId>
         <version>0.5.4-SNAPSHOT</version>
-        <relativePath>../../yang/pom.xml</relativePath>
     </parent>
+
+    <modelVersion>4.0.0</modelVersion>
     <artifactId>yang-maven-plugin-spi</artifactId>
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+
     <dependencies>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
@@ -43,4 +47,5 @@
             </plugin>
         </plugins>
     </build>
+
 </project>
@@ -34,13 +34,11 @@ public interface CodeGenerator {
      *            user
      * @param currentModules
      *            yang modules parsed from yangFilesRootDir
-     * @param log
-     *            maven logger
      * @return collection of files that were generated from schema context
      * @throws IOException
      */
-    Collection<File> generateSources(SchemaContext context, File outputBaseDir,
-            Set<Module> currentModules) throws IOException;
+    Collection<File> generateSources(SchemaContext context, File outputBaseDir, Set<Module> currentModules)
+            throws IOException;
 
     /**
      * Utilize maven logging if necessary
@@ -69,7 +67,7 @@ public interface CodeGenerator {
      * Provided maven project object. Any additional information about current
      * maven project can be accessed from it.
      *
-     * @param resourceBaseDir
+     * @param project
      */
     void setMavenProject(MavenProject project);
 }
index fc50604..5c3617c 100644 (file)
         <module>yang-common</module>
         <module>yang-data-api</module>
         <module>yang-data-util</module>
-               <module>yang-data-impl</module>
+        <module>yang-data-impl</module>
         <module>yang-model-api</module>
         <module>yang-model-util</module>
         <module>yang-binding</module>
         <module>yang-ext</module>
-        <module>../code-generator/yang-model-parser-api</module>
-        <module>../code-generator/yang-model-parser-impl</module>
-        <module>../code-generator/maven-yang</module>
-        <module>../code-generator/maven-yang-plugin</module>
-        <module>../code-generator/maven-yang-plugin-it</module>
+        <module>yang-model-parser-api</module>
+        <module>yang-model-parser-impl</module>
+        <module>maven-yang</module>
+        <module>maven-yang-plugin</module>
+        <module>maven-yang-plugin-it</module>
     </modules>
 
     <dependencyManagement>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.8.1</version>
                 <configuration>
                     <stylesheet>maven</stylesheet>
                 </configuration>
             </plugin>
         </plugins>
     </build>
+
     <reporting>
         <plugins>
             <plugin>
             </plugin>
         </plugins>
     </reporting>
+
 </project>
diff --git a/opendaylight/sal/yang-prototype/yang/src/site/site.xml b/opendaylight/sal/yang-prototype/yang/src/site/site.xml
new file mode 100644 (file)
index 0000000..80ff3a4
--- /dev/null
@@ -0,0 +1,16 @@
+<project name="${project.name}">
+
+    <skin>
+        <groupId>org.apache.maven.skins</groupId>
+        <artifactId>maven-fluido-skin</artifactId>
+        <version>1.3.0</version>
+    </skin>
+
+    <body>
+        <menu ref="parent"/>
+        <menu ref="modules"/>
+        <menu ref="reports"/>
+    </body>
+
+</project>
+
index 79add78..70b7a5a 100644 (file)
@@ -1,9 +1,15 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-  <modelVersion>4.0.0</modelVersion>\r
-  <parent>\r
-    <groupId>org.opendaylight.controller</groupId>\r
-    <artifactId>yang</artifactId>\r
-    <version>0.5.4-SNAPSHOT</version>\r
-  </parent>\r
-  <artifactId>yang-binding</artifactId>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+\r
+    <parent>\r
+        <groupId>org.opendaylight.controller</groupId>\r
+        <artifactId>yang</artifactId>\r
+        <version>0.5.4-SNAPSHOT</version>\r
+    </parent>\r
+\r
+    <modelVersion>4.0.0</modelVersion>\r
+    <artifactId>yang-binding</artifactId>\r
+    <name>${project.artifactId}</name>\r
+    <description>Java binding for YANG</description>\r
+\r
 </project>\r
index a94013b..445e310 100644 (file)
@@ -1,16 +1,23 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-  <modelVersion>4.0.0</modelVersion>\r
-  <parent>\r
-    <groupId>org.opendaylight.controller</groupId>\r
-    <artifactId>yang</artifactId>\r
-    <version>0.5.4-SNAPSHOT</version>\r
-  </parent>\r
-  <artifactId>yang-common</artifactId>\r
-  <dependencies>\r
-      <dependency>\r
-          <groupId>org.slf4j</groupId>\r
-          <artifactId>slf4j-api</artifactId>\r
-          <version>${slf4j.version}</version>\r
-      </dependency>\r
-  </dependencies>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+\r
+    <parent>\r
+        <groupId>org.opendaylight.controller</groupId>\r
+        <artifactId>yang</artifactId>\r
+        <version>0.5.4-SNAPSHOT</version>\r
+    </parent>\r
+\r
+    <modelVersion>4.0.0</modelVersion>\r
+    <artifactId>yang-common</artifactId>\r
+    <name>${project.artifactId}</name>\r
+    <description>${project.artifactId}</description>\r
+\r
+    <dependencies>\r
+        <dependency>\r
+            <groupId>org.slf4j</groupId>\r
+            <artifactId>slf4j-api</artifactId>\r
+        </dependency>\r
+    </dependencies>\r
+\r
 </project>\r
+\r
index 28f2594..145daf9 100644 (file)
@@ -1,12 +1,16 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-    <modelVersion>4.0.0</modelVersion>\r
+\r
     <parent>\r
         <groupId>org.opendaylight.controller</groupId>\r
         <artifactId>yang</artifactId>\r
         <version>0.5.4-SNAPSHOT</version>\r
     </parent>\r
+\r
+    <modelVersion>4.0.0</modelVersion>\r
     <artifactId>yang-data-api</artifactId>\r
+    <name>${project.artifactId}</name>\r
+    <description>${project.artifactId}</description>\r
 \r
     <dependencies>\r
         <dependency>\r
@@ -14,4 +18,5 @@
             <artifactId>yang-common</artifactId>\r
         </dependency>\r
     </dependencies>\r
-</project>
\ No newline at end of file
+\r
+</project>\r
index dfc790e..e8ef406 100644 (file)
@@ -29,7 +29,7 @@ import org.opendaylight.controller.yang.common.QName;
  * \r
  * \r
  */\r
-public interface CompositeNode extends Node<List<Node<?>>> {\r
+public interface CompositeNode extends Node<List<Node<?>>>, NodeModification {\r
 \r
     List<Node<?>> getChildren();\r
 \r
@@ -45,4 +45,8 @@ public interface CompositeNode extends Node<List<Node<?>>> {
 \r
     SimpleNode<?> getFirstSimpleByName(QName leaf);\r
 \r
+    /**\r
+     * @return cast self to mutable, if possible \r
+     */\r
+    MutableCompositeNode asMutable();\r
 }\r
index b1baf30..4f11adb 100755 (executable)
@@ -20,4 +20,9 @@ public interface MutableCompositeNode extends MutableNode<List<Node<?>>>, Compos
      * update internal map\r
      */\r
     public void init();\r
+    \r
+    /**\r
+     * @return original node, if available\r
+     */\r
+    CompositeNode getOriginal();\r
 }\r
index 9519fac..ad25f8f 100755 (executable)
@@ -15,6 +15,9 @@ package org.opendaylight.controller.yang.data.api;
  */\r
 public interface MutableSimpleNode<T> extends MutableNode<T>, SimpleNode<T> {\r
     \r
-   // nothing\r
+    /**\r
+     * @return original node, if available\r
+     */\r
+    SimpleNode<T> getOriginal();\r
     \r
 }\r
index 717c722..3f75da5 100644 (file)
@@ -21,6 +21,10 @@ package org.opendaylight.controller.yang.data.api;
  * \r
  * @param <T>\r
  */\r
-public interface SimpleNode<T> extends Node<T> {\r
+public interface SimpleNode<T> extends Node<T>, NodeModification {\r
 \r
+    /**\r
+     * @return cast self to mutable, if possible \r
+     */\r
+    MutableSimpleNode<T> asMutable();\r
 }\r
old mode 100755 (executable)
new mode 100644 (file)
index 41fd113..ca5bd5c
@@ -1,32 +1,33 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"\r
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-    <modelVersion>4.0.0</modelVersion>\r
+\r
     <parent>\r
         <groupId>org.opendaylight.controller</groupId>\r
         <artifactId>yang</artifactId>\r
         <version>0.5.4-SNAPSHOT</version>\r
     </parent>\r
+\r
+    <modelVersion>4.0.0</modelVersion>\r
     <artifactId>yang-data-impl</artifactId>\r
+    <name>${project.artifactId}</name>\r
+    <description>${project.artifactId}</description>\r
 \r
     <properties>\r
-        <groovy.version>2.1.5</groovy.version>\r
+        <groovy.version>2.1.6</groovy.version>\r
     </properties>\r
-\r
     <build>\r
         <plugins>\r
             <plugin>\r
                 <groupId>org.apache.maven.plugins</groupId>\r
                 <artifactId>maven-surefire-plugin</artifactId>\r
                 <configuration>\r
-                    <argLine>-Dlog4j.configuration=log4j-test.xml</argLine>\r
+                    <argLine>-Dlog4j.configuration=log4j-test.xml -Xmx1500m</argLine>\r
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>\r
                 </configuration>\r
             </plugin>\r
         </plugins>\r
     </build>\r
 \r
-\r
     <dependencies>\r
         <dependency>\r
             <groupId>org.opendaylight.controller</groupId>\r
         <dependency>\r
             <groupId>org.opendaylight.controller</groupId>\r
             <artifactId>yang-model-parser-impl</artifactId>\r
+            <exclusions>\r
+                <exclusion>\r
+                    <groupId>org.slf4j</groupId>\r
+                    <artifactId>slf4j-simple</artifactId>\r
+                </exclusion>\r
+            </exclusions>\r
         </dependency>\r
         <dependency>\r
             <groupId>com.google.guava</groupId>\r
             <artifactId>guava</artifactId>\r
             <version>14.0.1</version>\r
         </dependency>\r
+        \r
         <dependency>\r
             <groupId>junit</groupId>\r
             <artifactId>junit</artifactId>\r
             <version>${groovy.version}</version>\r
             <scope>test</scope>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>xmlunit</groupId>\r
+            <artifactId>xmlunit</artifactId>\r
+            <version>1.4</version>\r
+            <scope>test</scope>\r
+        </dependency>\r
     </dependencies>\r
+\r
 </project>\r
old mode 100755 (executable)
new mode 100644 (file)
index cc4dfee..3385700
@@ -9,7 +9,9 @@ package org.opendaylight.controller.yang.data.impl;
 \r
 import org.opendaylight.controller.yang.common.QName;\r
 import org.opendaylight.controller.yang.data.api.CompositeNode;\r
+import org.opendaylight.controller.yang.data.api.ModifyAction;\r
 import org.opendaylight.controller.yang.data.api.Node;\r
+import org.opendaylight.controller.yang.data.api.NodeModification;\r
 \r
 /**\r
  * @author michal.rehak\r
@@ -17,12 +19,13 @@ import org.opendaylight.controller.yang.data.api.Node;
  *            type of node value\r
  * \r
  */\r
-public abstract class AbstractNodeTO<T> implements Node<T> {\r
+public abstract class AbstractNodeTO<T> implements Node<T>, NodeModification {\r
 \r
     private QName qName;\r
     private CompositeNode parent;\r
     private T value;\r
-\r
+    private ModifyAction modifyAction;\r
+    \r
     /**\r
      * @param qname\r
      * @param parent\r
@@ -33,6 +36,19 @@ public abstract class AbstractNodeTO<T> implements Node<T> {
         this.parent = parent;\r
         this.value = value;\r
     }\r
+    \r
+    /**\r
+     * @param qname\r
+     * @param parent\r
+     * @param value\r
+     * @param modifyAction \r
+     */\r
+    public AbstractNodeTO(QName qname, CompositeNode parent, T value, ModifyAction modifyAction) {\r
+        this.qName = qname;\r
+        this.parent = parent;\r
+        this.value = value;\r
+        this.modifyAction = modifyAction;\r
+    }\r
 \r
     @Override\r
     public QName getNodeType() {\r
@@ -42,7 +58,7 @@ public abstract class AbstractNodeTO<T> implements Node<T> {
     /**\r
      * @return the qName\r
      */\r
-    protected QName getQName() {\r
+    public QName getQName() {\r
         return qName;\r
     }\r
 \r
@@ -69,4 +85,76 @@ public abstract class AbstractNodeTO<T> implements Node<T> {
     public T getValue() {\r
         return value;\r
     }\r
+\r
+    /**\r
+     * @return modification action\r
+     * @see org.opendaylight.controller.yang.data.impl.NodeModificationSupport#getModificationAction()\r
+     */\r
+    @Override\r
+    public ModifyAction getModificationAction() {\r
+        return modifyAction;\r
+    }\r
+\r
+    /**\r
+     * @param modifyAction\r
+     *            the modifyAction to set\r
+     */\r
+    protected void setModificationAction(ModifyAction modifyAction) {\r
+        this.modifyAction = modifyAction;\r
+    }\r
+    \r
+    @Override\r
+    public String toString() {\r
+        StringBuffer out = new StringBuffer();\r
+        out.append(String.format("Node[%s], qName[%s], modify[%s]", \r
+                getClass().getSimpleName(), getQName().getLocalName(),\r
+                getModificationAction() == null ? "n/a" : getModificationAction()));\r
+        return out.toString();\r
+    }\r
+\r
+    /* */\r
+    @Override\r
+    public int hashCode() {\r
+        final int prime = 31;\r
+        int result = 1;\r
+        result = prime * result\r
+                + ((modifyAction == null) ? 0 : modifyAction.hashCode());\r
+//        result = prime * result + ((parent == null) ? 0 : parent.hashCode());\r
+        result = prime * result + ((qName == null) ? 0 : qName.hashCode());\r
+        result = prime * result + ((value == null) ? 0 : value.hashCode());\r
+        return result % 2;\r
+    }\r
+\r
+    @Override\r
+    public boolean equals(Object obj) {\r
+        if (this == obj)\r
+            return true;\r
+        if (obj == null)\r
+            return false;\r
+        if (getClass() != obj.getClass())\r
+            return false;\r
+        @SuppressWarnings("unchecked")\r
+        AbstractNodeTO<T> other = (AbstractNodeTO<T>) obj;\r
+        if (modifyAction != other.modifyAction)\r
+            return false;\r
+        if (parent == null) {\r
+            if (other.parent != null)\r
+                return false;\r
+        } else if (other.parent == null) {\r
+            return false;\r
+        } \r
+        if (qName == null) {\r
+            if (other.qName != null)\r
+                return false;\r
+        } else if (!qName.equals(other.qName))\r
+            return false;\r
+        if (value == null) {\r
+            if (other.value != null)\r
+                return false;\r
+        } else if (!value.equals(other.value))\r
+            return false;\r
+        return true;\r
+    }\r
+    /* */\r
+    \r
 }\r
index 7981df2..44c8c85 100755 (executable)
@@ -1,5 +1,9 @@
-/**\r
- * \r
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
  */\r
 package org.opendaylight.controller.yang.data.impl;\r
 \r
@@ -9,16 +13,12 @@ import org.opendaylight.controller.yang.common.QName;
 import org.opendaylight.controller.yang.data.api.CompositeNode;\r
 import org.opendaylight.controller.yang.data.api.ModifyAction;\r
 import org.opendaylight.controller.yang.data.api.Node;\r
-import org.opendaylight.controller.yang.data.api.NodeModification;\r
 \r
 /**\r
  * @author michal.rehak\r
  * \r
  */\r
-public class CompositeNodeModificationTOImpl extends CompositeNodeTOImpl\r
-        implements NodeModification {\r
-\r
-    private ModifyAction modifyAction;\r
+public class CompositeNodeModificationTOImpl extends CompositeNodeTOImpl {\r
 \r
     /**\r
      * @param qname\r
@@ -29,24 +29,6 @@ public class CompositeNodeModificationTOImpl extends CompositeNodeTOImpl
     public CompositeNodeModificationTOImpl(QName qname, CompositeNode parent,\r
             List<Node<?>> value, ModifyAction modifyAction) {\r
         super(qname, parent, value);\r
-        this.modifyAction = modifyAction;\r
-    }\r
-\r
-    /**\r
-     * @return modification action\r
-     * @see org.opendaylight.controller.yang.data.impl.NodeModificationSupport#getModificationAction()\r
-     */\r
-    @Override\r
-    public ModifyAction getModificationAction() {\r
-        return modifyAction;\r
+        super.setModificationAction(modifyAction);\r
     }\r
-\r
-    /**\r
-     * @param modifyAction\r
-     *            the modifyAction to set\r
-     */\r
-    protected void setModificationAction(ModifyAction modifyAction) {\r
-        this.modifyAction = modifyAction;\r
-    }\r
-\r
 }\r
old mode 100755 (executable)
new mode 100644 (file)
index f94163a..605b99c
@@ -13,6 +13,8 @@ import java.util.Map;
 \r
 import org.opendaylight.controller.yang.common.QName;\r
 import org.opendaylight.controller.yang.data.api.CompositeNode;\r
+import org.opendaylight.controller.yang.data.api.ModifyAction;\r
+import org.opendaylight.controller.yang.data.api.MutableCompositeNode;\r
 import org.opendaylight.controller.yang.data.api.Node;\r
 import org.opendaylight.controller.yang.data.api.SimpleNode;\r
 \r
@@ -36,6 +38,19 @@ public class CompositeNodeTOImpl extends AbstractNodeTO<List<Node<?>>>
         if (value != null) {\r
             nodeMap = NodeUtils.buildNodeMap(getValue());\r
         }\r
+        init();\r
+    }\r
+\r
+    /**\r
+     * @param qname\r
+     * @param parent use null to create top composite node (without parent)\r
+     * @param value\r
+     * @param modifyAction \r
+     */\r
+    public CompositeNodeTOImpl(QName qname, CompositeNode parent,\r
+            List<Node<?>> value, ModifyAction modifyAction) {\r
+        super(qname, parent, value, modifyAction);\r
+        init();\r
     }\r
     \r
 \r
@@ -105,16 +120,34 @@ public class CompositeNodeTOImpl extends AbstractNodeTO<List<Node<?>>>
 \r
     @Override\r
     public List<CompositeNode> getCompositesByName(String children) {\r
-        return getCompositesByName(localQName(children));\r
+        return getCompositesByName(new QName(getNodeType(), children));\r
     }\r
     \r
     @Override\r
     public List<SimpleNode<?>> getSimpleNodesByName(String children) {\r
-        return getSimpleNodesByName(localQName(children));\r
+        return getSimpleNodesByName(new QName(getNodeType(), children));\r
     }\r
 \r
-    private QName localQName(String str) {\r
-        return new QName(getNodeType(), str);\r
+    /**\r
+     * @param value\r
+     */\r
+    protected void init() {\r
+        if (getValue() != null) {\r
+            nodeMap = NodeUtils.buildNodeMap(getValue());\r
+        }\r
+    }\r
+    \r
+    @Override\r
+ &nbs