Merge "Add lispflowmapping specific configuration options"
authorGiovanni Meo <gmeo@cisco.com>
Fri, 16 May 2014 08:24:09 +0000 (08:24 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 16 May 2014 08:24:09 +0000 (08:24 +0000)
308 files changed:
opendaylight/appauth/pom.xml
opendaylight/arphandler/pom.xml
opendaylight/clustering/services/pom.xml
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/CacheConfigException.java
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/CacheExistException.java
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/CacheListenerAddException.java
opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/ListenRoleChangeAddException.java
opendaylight/clustering/services_implementation/pom.xml
opendaylight/clustering/stub/pom.xml
opendaylight/clustering/test/pom.xml
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/ComplexClass.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/ComplexClass1.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/ComplexContainer.java
opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/StringContainer.java
opendaylight/commons/concepts/pom.xml
opendaylight/commons/httpclient/pom.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/config/feature/pom.xml [new file with mode: 0644]
opendaylight/config/feature/src/main/resources/features.xml [new file with mode: 0644]
opendaylight/config/pom.xml
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java
opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt [deleted file]
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java
opendaylight/configuration/api/pom.xml
opendaylight/configuration/implementation/pom.xml
opendaylight/connectionmanager/api/pom.xml
opendaylight/connectionmanager/implementation/pom.xml
opendaylight/containermanager/api/pom.xml
opendaylight/containermanager/implementation/pom.xml
opendaylight/containermanager/it.implementation/pom.xml
opendaylight/distribution/opendaylight-karaf/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/distribution/opendaylight/src/main/resources/configuration/initial/03-toaster-sample.xml
opendaylight/distribution/opendaylight/src/main/resources/run.sh
opendaylight/distribution/sanitytest/pom.xml
opendaylight/dummy-console/README [new file with mode: 0644]
opendaylight/dummy-console/pom.xml [new file with mode: 0644]
opendaylight/dummy-console/src/main/java/org/eclipse/osgi/framework/console/CommandInterpreter.java [new file with mode: 0644]
opendaylight/dummy-console/src/main/java/org/eclipse/osgi/framework/console/CommandProvider.java [new file with mode: 0644]
opendaylight/forwarding/staticrouting/pom.xml
opendaylight/forwardingrulesmanager/api/pom.xml
opendaylight/forwardingrulesmanager/implementation/pom.xml
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/hosttracker/api/pom.xml
opendaylight/hosttracker/implementation/pom.xml
opendaylight/hosttracker_new/api/pom.xml
opendaylight/hosttracker_new/implementation/pom.xml
opendaylight/logging/bridge/pom.xml
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyCommitHandler.java
opendaylight/md-sal/feature/pom.xml [new file with mode: 0644]
opendaylight/md-sal/feature/src/main/resources/features.xml [new file with mode: 0644]
opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/NodeChangeCommiter.java
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareConsumer.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/RuntimeMappingModule.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedDataBroker.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/AbstractForwardedTransaction.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingToNormalizedNodeCodec.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/BindingIndependentConnector.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/MultipleAugmentationPuts.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/ConcurrentImplicitCreateTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/ListProcessingAndOrderingTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug03Test.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DeleteNestedAugmentationListenParentTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/FlagsSerializationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/PutAugmentationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/WriteParentReadChildTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/ChangeOriginatedInDomBrokerTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerMountPointTest.java
opendaylight/md-sal/sal-binding-it/pom.xml
opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/routing/RoutedRegistration.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/AbstractDataBroker.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataNormalizationOperation.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataSchemaContainerProxy.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Consumer.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Provider.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ChangeListenerNotifyTask.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DOMImmutableDataChangeEvent.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataAndMetadataSnapshot.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataChangeListenerRegistration.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataPreconditionFailedException.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ModificationApplyOperation.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/OperationWithModification.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaAwareApplyOperation.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaAwareApplyOperationRoot.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/StoreUtils.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/StoreMetadataNode.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/StoreNodeCompositeBuilder.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaAwareRpcBroker.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DataNormalizerTest.java
opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java
opendaylight/md-sal/sal-netconf-connector/pom.xml
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/config/yang/md/sal/connector/netconf/NetconfConnectorModule.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDevice.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfMapping.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/dto/Message.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/dto/RouteIdentifierImpl.java
opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientRequestHandlerTest.java
opendaylight/md-sal/sal-rest-connector/pom.xml
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/BrokerFacade.xtend [deleted file]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend [deleted file]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ResponseException.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.xtend [deleted file]
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/BrokerFacadeTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java
opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/client/SalRemoteClientImpl.java
opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/flow/FlowWriterServiceImpl.java
opendaylight/md-sal/samples/toaster-consumer/pom.xml
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/config/yang/config/kitchen_service/impl/KitchenServiceModule.java [new file with mode: 0644]
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/config/yang/config/kitchen_service/impl/KitchenServiceModuleFactory.java [moved from opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/config/yang/config/toaster_consumer/impl/ToasterConsumerModuleFactory.java with 56% similarity]
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/config/yang/config/toaster_consumer/impl/ToasterConsumerModule.java [deleted file]
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/kitchen/api/EggsType.java [new file with mode: 0644]
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/kitchen/api/KitchenService.java [new file with mode: 0644]
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/kitchen/impl/KitchenServiceImpl.java [new file with mode: 0644]
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/toaster/provider/api/ToastConsumer.java [deleted file]
opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/toaster/provider/impl/ToastConsumerImpl.java [deleted file]
opendaylight/md-sal/samples/toaster-consumer/src/main/yang/kitchen-service-impl.yang [moved from opendaylight/md-sal/samples/toaster-consumer/src/main/yang/toaster-consumer-impl.yang with 55% similarity]
opendaylight/md-sal/samples/toaster-consumer/src/main/yang/toaster-consumer.yang [deleted file]
opendaylight/md-sal/samples/toaster-it/pom.xml
opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java
opendaylight/md-sal/samples/toaster-it/src/test/resources/controller.xml
opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/config/yang/config/toaster_provider/impl/ToasterProviderModule.java
opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/OpendaylightToaster.java
opendaylight/md-sal/samples/toaster-provider/src/main/yang/toaster-provider-impl.yang
opendaylight/md-sal/samples/toaster-provider/src/main/yang/toaster-provider.yang [deleted file]
opendaylight/md-sal/samples/toaster/src/main/yang/toaster.yang
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/AbstractStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/FlowStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/GroupDescStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/GroupStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/MeterConfigStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/MeterStatsTracker.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/QueueStatsTracker.java
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/exception/NetconfConfigHandlingException.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/exception/NoTransactionFoundException.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/exception/OperationNotPermittedException.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusher.java
opendaylight/netconf/netconf-it/pom.xml
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/pax/IdentityRefNetconfTest.java [deleted file]
opendaylight/netconf/netconf-it/src/test/resources/RSA.pk [deleted file]
opendaylight/netconf/netconf-it/src/test/resources/controller.xml [deleted file]
opendaylight/netconf/netconf-it/src/test/resources/keystore.jks [deleted file]
opendaylight/netconf/netconf-it/src/test/resources/netconfMessages/commit.xml [deleted file]
opendaylight/netconf/netconf-it/src/test/resources/netconfMessages/getConfig.xml [deleted file]
opendaylight/netconf/netconf-util/pom.xml
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/exception/MissingNameSpaceException.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/exception/UnexpectedElementException.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/exception/UnexpectedNamespaceException.java
opendaylight/netconf/pom.xml
opendaylight/networkconfiguration/neutron/implementation/pom.xml
opendaylight/networkconfiguration/neutron/pom.xml
opendaylight/northbound/bundlescanner/api/pom.xml
opendaylight/northbound/bundlescanner/implementation/pom.xml
opendaylight/northbound/commons/pom.xml
opendaylight/northbound/connectionmanager/enunciate.xml
opendaylight/northbound/connectionmanager/pom.xml
opendaylight/northbound/containermanager/enunciate.xml
opendaylight/northbound/containermanager/pom.xml
opendaylight/northbound/controllermanager/enunciate.xml
opendaylight/northbound/controllermanager/pom.xml
opendaylight/northbound/controllermanager/src/main/java/org/opendaylight/controller/controllermanager/northbound/ControllerProperties.java
opendaylight/northbound/flowprogrammer/enunciate.xml
opendaylight/northbound/flowprogrammer/pom.xml
opendaylight/northbound/hosttracker/enunciate.xml
opendaylight/northbound/hosttracker/pom.xml
opendaylight/northbound/httpservice-bridge/pom.xml
opendaylight/northbound/java-client/enunciate.xml
opendaylight/northbound/java-client/pom.xml
opendaylight/northbound/jolokia/pom.xml
opendaylight/northbound/networkconfiguration/bridgedomain/enunciate.xml
opendaylight/northbound/networkconfiguration/bridgedomain/pom.xml
opendaylight/northbound/networkconfiguration/neutron/enunciate.xml
opendaylight/northbound/networkconfiguration/neutron/pom.xml
opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java
opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPageLink.java [new file with mode: 0644]
opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/PaginatedNeutronNetworkRequest.java [new file with mode: 0644]
opendaylight/northbound/staticrouting/enunciate.xml
opendaylight/northbound/staticrouting/pom.xml
opendaylight/northbound/statistics/enunciate.xml
opendaylight/northbound/statistics/pom.xml
opendaylight/northbound/subnets/enunciate.xml
opendaylight/northbound/subnets/pom.xml
opendaylight/northbound/switchmanager/enunciate.xml
opendaylight/northbound/switchmanager/pom.xml
opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/NodeConnectorProperties.java
opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/NodeProperties.java
opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java
opendaylight/northbound/topology/enunciate.xml
opendaylight/northbound/topology/pom.xml
opendaylight/northbound/topology/src/main/java/org/opendaylight/controller/topology/northbound/EdgeProperties.java
opendaylight/northbound/usermanager/enunciate.xml
opendaylight/northbound/usermanager/pom.xml
opendaylight/protocol_plugins/openflow/pom.xml
opendaylight/protocol_plugins/stub/pom.xml
opendaylight/routing/dijkstra_implementation/pom.xml
opendaylight/sal/api/pom.xml
opendaylight/sal/connection/api/pom.xml
opendaylight/sal/connection/implementation/pom.xml
opendaylight/sal/implementation/pom.xml
opendaylight/sal/networkconfiguration/api/pom.xml
opendaylight/sal/networkconfiguration/implementation/pom.xml
opendaylight/samples/loadbalancer/pom.xml
opendaylight/samples/northbound/loadbalancer/pom.xml
opendaylight/samples/simpleforwarding/pom.xml
opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java
opendaylight/security/pom.xml
opendaylight/statisticsmanager/api/pom.xml
opendaylight/statisticsmanager/implementation/pom.xml
opendaylight/switchmanager/api/pom.xml
opendaylight/switchmanager/implementation/pom.xml
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
opendaylight/topologymanager/implementation/pom.xml
opendaylight/usermanager/api/pom.xml
opendaylight/usermanager/implementation/pom.xml
opendaylight/web/devices/pom.xml
opendaylight/web/flows/pom.xml
opendaylight/web/osgi-brandfragment/pom.xml
opendaylight/web/osgi-brandfragment/src/main/resources/META-INF/webconsole.properties
opendaylight/web/root/pom.xml
opendaylight/web/topology/pom.xml
opendaylight/web/troubleshoot/pom.xml
pom.xml
third-party/org.openexi/nagasena-rta/nagasena-rta-0000.0002.0038.0.jar [deleted file]
third-party/org.openexi/nagasena-rta/pom.xml [deleted file]
third-party/org.openexi/nagasena/nagasena-0000.0002.0038.0.jar [deleted file]
third-party/org.openexi/nagasena/pom.xml [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/allclasses-noframe.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/constant-values.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/deprecated-list.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/help-doc.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/index-all.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/index.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXIDecoder.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/EXISchemaResolver.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/HeaderOptionsOutputType.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/AlignmentType.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/BinaryDataSource.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EXIOptions.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventDescription.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/EventType.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/GrammarOptions.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/QName.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/common/package-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/GrammarCache.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/grammars/package-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/BinaryDataSink.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/CharacterBuffer.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/Scanner.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/io/package-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/proc/package-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/BinaryDataHandler.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/EXIReader.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/ReaderSupport.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/SAXTransmogrifier.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/Transmogrifier.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/TransmogrifierException.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/sax/package-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/Characters.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EXISchema.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/EmptySchema.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/schema/package-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactory.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryErrorHandler.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaFactoryException.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EXISchemaReader.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/EntityResolverEx.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/org/openexi/scomp/package-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/overview-frame.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/overview-summary.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/overview-tree.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/package-list [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/resources/inherit.gif [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/serialized-form.html [deleted file]
third-party/org.openexi/nagasena/src/main/resources/doc/stylesheet.css [deleted file]
third-party/org.openexi/pom.xml [deleted file]

index f07c855..e74e3cb 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
@@ -48,7 +47,6 @@
                             org.apache.felix.dm,</Import-Package>
             <Export-Package>org.opendaylight.controller.appauth,
                             org.opendaylight.controller.appauth.authorization</Export-Package>
-            <Bundle-Activator></Bundle-Activator>
           </instructions>
         </configuration>
       </plugin>
index 8d62c1d..064d04c 100644 (file)
@@ -50,7 +50,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 3806421..3ff6bac 100644 (file)
@@ -24,7 +24,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 32c3d08..e030142 100644 (file)
@@ -24,6 +24,7 @@ package org.opendaylight.controller.clustering.services;
  * passed and so on.
  */
 public class CacheConfigException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new cache config exception.
index 583de7c..70165cc 100644 (file)
@@ -23,6 +23,7 @@ package org.opendaylight.controller.clustering.services;
  * allocated already exists
  */
 public class CacheExistException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new cache exist exception.
index 34ba41c..996e0a0 100644 (file)
@@ -21,6 +21,7 @@ package org.opendaylight.controller.clustering.services;
  * Listener being added fails for any reason
  */
 public class CacheListenerAddException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new cache listener add exception.
index 523a134..dd2585b 100644 (file)
@@ -20,7 +20,9 @@ package org.opendaylight.controller.clustering.services;
  * @deprecated for internal use
  * The Class ListenRoleChangeAddException.
  */
+@Deprecated
 public class ListenRoleChangeAddException extends Exception {
+    private static final long serialVersionUID = 1L;
 
     /**
      * Instantiates a new listen role change add exception.
index 4acfae0..8d3f53b 100644 (file)
@@ -63,7 +63,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
@@ -75,9 +74,8 @@
               !org.hornetq.*,
               !org.jboss.*,
               javax.transaction,
-              *,
               org.opendaylight.controller.clustering.services,
-              org.opendaylight.controller.sal.core</Import-Package>
+              org.opendaylight.controller.sal.core,*</Import-Package>
             <Bundle-Activator>org.opendaylight.controller.clustering.services_implementation.internal.Activator</Bundle-Activator>
             <!-- Add in the DynamicImport-Package ONLY the packages that -->
             <!-- contains types that MUST be unmarshalled by the -->
index 7a0c137..6a0b308 100644 (file)
@@ -31,7 +31,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 02a231b..9021c94 100644 (file)
@@ -60,7 +60,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 076ec05..51f8128 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class ComplexClass implements IComplex, Serializable {
+    private static final long serialVersionUID = 1L;
     private String identity;
 
     public ComplexClass(String i) {
index fda2ff1..876fb65 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class ComplexClass1 implements IComplex, Serializable {
+    private static final long serialVersionUID = 1L;
     private String identity;
 
     public ComplexClass1(String i) {
index adc062d..d07c192 100644 (file)
@@ -12,9 +12,10 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class ComplexContainer implements Serializable {
-    private IComplex f;
-    private IComplex f1;
-    private Integer state;
+    private static final long serialVersionUID = 1L;
+    private final IComplex f;
+    private final IComplex f1;
+    private final Integer state;
 
     public ComplexContainer(String i, Integer s) {
         this.state = s;
index 39ef1b0..7cdb032 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.clustering.test.internal;
 import java.io.Serializable;
 
 public class StringContainer implements Serializable {
+    private static final long serialVersionUID = 1L;
     private String mystring;
 
     public StringContainer() {
index de263cb..01dd61a 100644 (file)
@@ -23,7 +23,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index f068fde..07d3cdd 100644 (file)
@@ -38,7 +38,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index c0fc402..aaab66d 100644 (file)
@@ -22,7 +22,7 @@
     <asm.version>4.1</asm.version>
     <!-- Plugin Versions -->
     <bouncycastle.version>1.50</bouncycastle.version>
-    <bundle.plugin.version>2.3.7</bundle.plugin.version>
+    <bundle.plugin.version>2.4.0</bundle.plugin.version>
     <bundlescanner.version>0.4.2-SNAPSHOT</bundlescanner.version>
     <checkstyle.version>2.10</checkstyle.version>
     <clustering.services.version>0.5.1-SNAPSHOT</clustering.services.version>
     <eclipse.persistence.version>2.5.0</eclipse.persistence.version>
     <!-- enforcer version -->
     <enforcer.version>1.3.1</enforcer.version>
-    <enunciate.version>1.26.2</enunciate.version>
+    <enunciate.version>1.28</enunciate.version>
     <exam.version>3.0.0</exam.version>
 
     <!-- OpenEXI third party lib for netconf-->
-    <exi.nagasena.version>0000.0002.0038.0-SNAPSHOT</exi.nagasena.version>
+    <exi.nagasena.version>0000.0002.0038.0</exi.nagasena.version>
     <failsafe.version>2.15</failsafe.version>
     <feature.transaction.version>1.0.1</feature.transaction.version>
     <felix.dependencymanager.shell.version>3.0.1</felix.dependencymanager.shell.version>
         <artifactId>ganymed</artifactId>
         <version>1.1-SNAPSHOT</version>
       </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller.thirdparty</groupId>
-        <artifactId>nagasena</artifactId>
-        <version>${exi.nagasena.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller.thirdparty</groupId>
-        <artifactId>nagasena-rta</artifactId>
-        <version>${exi.nagasena.version}</version>
-      </dependency>
       <!-- Third parties from opendaylight released -->
       <dependency>
         <groupId>org.opendaylight.controller.thirdparty</groupId>
         <artifactId>yang-ext</artifactId>
         <version>${yang-ext.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.openexi</groupId>
+        <artifactId>nagasena</artifactId>
+        <version>${exi.nagasena.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.openexi</groupId>
+        <artifactId>nagasena-rta</artifactId>
+        <version>${exi.nagasena.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.osgi</groupId>
         <artifactId>org.osgi.compendium</artifactId>
             <configFile>enunciate.xml</configFile>
           </configuration>
           <dependencies>
+            <dependency>
+              <groupId>org.codehaus.enunciate</groupId>
+              <artifactId>enunciate-swagger</artifactId>
+              <version>${enunciate.version}</version>
+            </dependency>
             <dependency>
               <groupId>org.opendaylight.controller</groupId>
               <artifactId>commons.logback_settings</artifactId>
diff --git a/opendaylight/config/feature/pom.xml b/opendaylight/config/feature/pom.xml
new file mode 100644 (file)
index 0000000..aaf33cc
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-subsystem</artifactId>
+    <version>0.2.5-SNAPSHOT</version>
+  </parent>
+  <artifactId>config-features</artifactId>
+
+  <packaging>pom</packaging>
+
+  <properties>
+    <features.file>features.xml</features.file>
+  </properties>
+
+  <dependencies></dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>filter</id>
+            <goals>
+              <goal>resources</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <phase>package</phase>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>${project.build.directory}/classes/${features.file}</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+  </scm>
+</project>
diff --git a/opendaylight/config/feature/src/main/resources/features.xml b/opendaylight/config/feature/src/main/resources/features.xml
new file mode 100644 (file)
index 0000000..81972c3
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<features name="config-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+    <feature name='config-all' version='${project.version}'>
+        <feature version='${project.version}'>odl-config-subsystem</feature>
+    </feature>
+
+    <feature name='odl-config-subsystem' version='${project.version}'>
+        <feature version='${yangtools.version}'>yangtools-concepts</feature>
+        <feature version='${yangtools.version}'>yangtools-binding</feature>
+        <feature version='${yangtools.version}'>yangtools-binding-generator</feature>
+        <feature version='${mdsal.version}'>odl-mdsal-commons</feature>
+        <bundle>mvn:org.opendaylight.controller/config-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-manager/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/yang-jmx-generator/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-persister-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-persister-file-xml-adapter/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/config-persister-directory-xml-adapter/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/shutdown-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/shutdown-impl/${project.version}</bundle>
+        <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
+        <bundle>wrap:mvn:com.google.guava/guava/${guava.version}</bundle>
+        <bundle>mvn:org.javassist/javassist/${javassist.version}</bundle>
+    </feature>
+</features>
\ No newline at end of file
index 20b1b41..6139401 100644 (file)
@@ -40,6 +40,7 @@
     <module>shutdown-impl</module>
     <module>netconf-config-dispatcher</module>
     <module>config-module-archetype</module>
+    <module>feature</module>
   </modules>
 
   <dependencies>
       <plugin>
         <groupId>org.jacoco</groupId>
         <artifactId>jacoco-maven-plugin</artifactId>
-        <version>${jacoco.version}</version>
         <executions>
           <execution>
             <goals>
index fbc507d..051b1a7 100644 (file)
@@ -1,7 +1,7 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory;
 
-import com.google.common.base.Joiner;
-import com.google.common.base.Optional;
+import java.util.LinkedHashMap;
+
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
@@ -11,7 +11,8 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.Generated
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
 
-import java.util.LinkedHashMap;
+import com.google.common.base.Joiner;
+import com.google.common.base.Optional;
 
 public class ConcreteModuleGeneratedObjectFactory {
 
@@ -46,12 +47,10 @@ public class ConcreteModuleGeneratedObjectFactory {
     }
 
     private static String getNewCtor(FullyQualifiedName fqn) {
-        LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>(){
-            {
-                put(ModuleIdentifier.class.getCanonicalName(), "identifier");
-                put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
-            }
-        };
+        LinkedHashMap<String, String> parameters = new LinkedHashMap<>();
+        parameters.put(ModuleIdentifier.class.getCanonicalName(), "identifier");
+        parameters.put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
+
         StringBuilder stringBuilder = getCtor(fqn, parameters);
         return stringBuilder.toString();
     }
@@ -72,14 +71,11 @@ public class ConcreteModuleGeneratedObjectFactory {
     }
 
     private static String getCopyCtor(final FullyQualifiedName fqn) {
-        LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>(){
-            {
-                put(ModuleIdentifier.class.getCanonicalName(), "identifier");
-                put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
-                put(fqn.toString(), "oldModule");
-                put(AutoCloseable.class.getCanonicalName(), "oldInstance");
-            }
-        };
+        LinkedHashMap<String, String> parameters = new LinkedHashMap<>();
+        parameters.put(ModuleIdentifier.class.getCanonicalName(), "identifier");
+        parameters.put(DependencyResolver.class.getCanonicalName(), "dependencyResolver");
+        parameters.put(fqn.toString(), "oldModule");
+        parameters.put(AutoCloseable.class.getCanonicalName(), "oldInstance");
         StringBuilder stringBuilder = getCtor(fqn, parameters);
         return stringBuilder.toString();
     }
index 265aea1..bcc55a2 100644 (file)
@@ -4,14 +4,11 @@ import com.google.common.base.Joiner;
 import com.google.common.base.Optional;
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.List;
 import java.util.regex.Pattern;
 
@@ -61,13 +58,18 @@ public class StringUtil {
 
 
     public static Optional<String> loadCopyright() {
-        try (InputStream in = StringUtil.class.getResourceAsStream("/copyright.txt")) {
-            if (in != null) {
-                return Optional.of(IOUtils.toString(in));
+        /*
+         * FIXME: BUG-980: this is a nice feature, but the copyright needs to come
+         *        from the project being processed, not this one.
+            try (InputStream in = StringUtil.class.getResourceAsStream("/copyright.txt")) {
+                if (in != null) {
+                    return Optional.of(IOUtils.toString(in));
+                }
+            } catch (IOException e) {
+                logger.warn("Cannot load copyright.txt", e);
             }
-        } catch (IOException e) {
-            logger.warn("Cannot load copyright.txt", e);
-        }
+
+        */
         return Optional.absent();
     }
 
diff --git a/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt b/opendaylight/config/yang-jmx-generator-plugin/src/main/resources/copyright.txt
deleted file mode 100644 (file)
index 4a0c355..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-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
index b0217a4..1ad0207 100644 (file)
@@ -1,5 +1,6 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.util;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
 
@@ -24,6 +25,7 @@ public class StringUtilTest {
     }
 
     @Test
+    @Ignore
     public void testCopyright() throws IOException {
         assertTrue(StringUtil.loadCopyright().isPresent());
     }
index 992e4b0..ef27bfd 100644 (file)
@@ -23,7 +23,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index b6d2229..a4a7ba6 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index b3a427a..c4ced04 100644 (file)
@@ -27,7 +27,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 5adcc89..8be119d 100644 (file)
@@ -39,7 +39,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 5bfeded..a19e271 100644 (file)
@@ -27,7 +27,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index b7b9e0a..3ead8be 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 2727f77..a3f140d 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 60f660a..1414fac 100644 (file)
       <version>${karaf.version}</version>
       <type>kar</type>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>config-features</artifactId>
+      <version>${config.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
     <!-- scope is runtime so the feature repo is listed in the features
       service config file, and features may be installed using the
       karaf-maven-plugin configuration -->
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+  -->
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>mdsal-features</artifactId>
+      <version>${mdsal.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>features-file</artifactId>
@@ -50,7 +67,6 @@
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
-  -->
   </dependencies>
 
   <build>
           <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/</excludes>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.6</version>
+        <executions>
+          <execution>
+            <id>copy-resources</id>
+            <goals>
+              <goal>copy-resources</goal>
+            </goals>
+            <!-- here the phase you need -->
+            <phase>process-resources</phase>
+            <configuration>
+              <outputDirectory>${basedir}/target/assembly</outputDirectory>
+              <overwrite>true</overwrite>
+              <resources>
+                <resource>
+                  <directory>${basedir}/src/main/resources</directory>
+                </resource>
+              </resources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <scm>
index 615668f..72ce89d 100644 (file)
           <groupId>org.opendaylight.controller.thirdparty</groupId>
           <artifactId>ganymed</artifactId>
         </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.thirdparty</groupId>
-          <artifactId>nagasena</artifactId>
-        </dependency>
-        <dependency>
-          <groupId>org.opendaylight.controller.thirdparty</groupId>
-          <artifactId>nagasena-rta</artifactId>
-        </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-generator-api</artifactId>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-generator-impl</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-generator-spi</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-generator-util</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>binding-type-provider</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>yang-parser-api</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <dependency>
           <groupId>org.opendaylight.yangtools</groupId>
           <artifactId>yang-parser-impl</artifactId>
-          <version>${yangtools.version}</version>
         </dependency>
         <!-- yang model dependencies -->
         <dependency>
           <artifactId>xtend-lib-osgi</artifactId>
           <version>2.4.3</version>
         </dependency>
+        <dependency>
+          <groupId>org.openexi</groupId>
+          <artifactId>nagasena</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.openexi</groupId>
+          <artifactId>nagasena-rta</artifactId>
+        </dependency>
         <dependency>
           <groupId>org.zeromq</groupId>
           <artifactId>jeromq</artifactId>
index 6d5d0eb..502bdeb 100644 (file)
@@ -12,8 +12,8 @@
         <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
             <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
                 <module>
-                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
-                        prefix:toaster-provider-impl
+                    <type xmlns:toaster="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl">
+                        toaster:toaster-provider-impl
                     </type>
                     <name>toaster-provider-impl</name>
 
                         <name>binding-rpc-broker</name>
                     </rpc-registry>
 
+                    <data-broker>
+                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
+                        <name>binding-data-broker</name>
+                    </data-broker>
+                    
                     <notification-service>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
                             binding:binding-notification-service
                 </module>
 
                 <module>
-                    <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-consumer:impl">
-                        prefix:toaster-consumer-impl
+                    <type xmlns:kitchen="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+                        kitchen:kitchen-service-impl
                     </type>
-                    <name>toaster-consumer-impl</name>
+                    <name>kitchen-service-impl</name>
 
                     <rpc-registry>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
                     </notification-service>
                 </module>
             </modules>
-
+            
             <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
                 <service>
-                    <type xmlns:toaster="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider">toaster:toaster-provider</type>
-                    <instance>
-                        <name>toaster-provider</name>
-                        <provider>/modules/module[type='toaster-provider-impl'][name='toaster-provider-impl']</provider>
-                    </instance>
-                </service>
-                <service>
-                    <type xmlns:toaster="urn:opendaylight:params:xml:ns:yang:controller:config:toaster-consumer">toaster:toaster-consumer</type>
+                    <type xmlns:kitchen="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
+                        kitchen:kitchen-service
+                    </type>
                     <instance>
-                        <name>toaster-consumer</name>
-                        <provider>/modules/module[type='toaster-consumer-impl'][name='toaster-consumer-impl']</provider>
+                        <name>kitchen-service</name>
+                        <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
                     </instance>
                 </service>
             </services>
     </configuration>
 
     <required-capabilities>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:toaster-consumer?module=toaster-consumer&amp;revision=2014-01-31</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:toaster-consumer:impl?module=toaster-consumer-impl&amp;revision=2014-01-31</capability>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider?module=toaster-provider&amp;revision=2014-01-31</capability>
+        <capability>urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl?module=kitchen-service-impl&amp;revision=2014-01-31</capability>
         <capability>urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl?module=toaster-provider-impl&amp;revision=2014-01-31</capability>
     </required-capabilities>
 
index 21245a0..dba996a 100755 (executable)
@@ -161,7 +161,7 @@ fi
 ########################################
 # Now add to classpath the OSGi JAR
 ########################################
-CLASSPATH="${basedir}"/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar
+CLASSPATH=${CLASSPATH}:${basedir}/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar
 FWCLASSPATH=file:"${basedir}"/lib/org.eclipse.osgi-3.8.1.v20120830-144521.jar
 
 ########################################
index 893776c..793e835 100644 (file)
@@ -23,7 +23,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
diff --git a/opendaylight/dummy-console/README b/opendaylight/dummy-console/README
new file mode 100644 (file)
index 0000000..09974d5
--- /dev/null
@@ -0,0 +1,2 @@
+This bundle is temporary only and should be removed as soon as possible
+it is only for compatibility layer in Karaf.
diff --git a/opendaylight/dummy-console/pom.xml b/opendaylight/dummy-console/pom.xml
new file mode 100644 (file)
index 0000000..6d90eb3
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.2-SNAPSHOT</version>
+    <relativePath>../commons/opendaylight</relativePath>
+  </parent>
+  <artifactId>dummy-console</artifactId>
+  <version>1.1.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+  <description>Dummy Console Interfaces for Equinox-specific CLI</description>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>${bundle.plugin.version}</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Import-Package>*</Import-Package>
+            <Export-Package>org.eclipse.osgi.framework.console</Export-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+  </scm>
+</project>
diff --git a/opendaylight/dummy-console/src/main/java/org/eclipse/osgi/framework/console/CommandInterpreter.java b/opendaylight/dummy-console/src/main/java/org/eclipse/osgi/framework/console/CommandInterpreter.java
new file mode 100644 (file)
index 0000000..29e9fc9
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Copyright(c)2014 Inocybe Technologies, 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.eclipse.osgi.framework.console;
+
+/** Empty tag interface for Command Interpreter **/
+public interface CommandInterpreter {}
diff --git a/opendaylight/dummy-console/src/main/java/org/eclipse/osgi/framework/console/CommandProvider.java b/opendaylight/dummy-console/src/main/java/org/eclipse/osgi/framework/console/CommandProvider.java
new file mode 100644 (file)
index 0000000..a781f6f
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Copyright(c)2014 Inocybe Technologies, 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.eclipse.osgi.framework.console;
+
+/** Empty tag interface for Command Provider **/
+public interface CommandProvider {}
index 6a73a21..37c0a3a 100644 (file)
@@ -39,7 +39,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 82f5f9b..b6e1dd6 100644 (file)
@@ -35,7 +35,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index a5a15f6..f87bed8 100644 (file)
@@ -55,7 +55,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index f7b647d..46008b2 100644 (file)
@@ -2342,7 +2342,7 @@ public class ForwardingRulesManager implements
         for (FlowConfig flowConfig : flowConfigForNode) {
             if (doesFlowContainNodeConnector(flowConfig.getFlow(), nodeConnector)) {
                 if (flowConfig.installInHw() && !flowConfig.getStatus().equals(StatusCode.SUCCESS.toString())) {
-                    Status status = this.installFlowEntry(flowConfig.getFlowEntry());
+                    Status status = this.installFlowEntryAsync(flowConfig.getFlowEntry());
                     if (!status.isSuccess()) {
                         flowConfig.setStatus(status.getDescription());
                     } else {
index d8f31ca..b48d7ab 100644 (file)
@@ -26,7 +26,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 9da62bd..cb09322 100644 (file)
@@ -58,7 +58,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 1dec4e5..240976b 100644 (file)
@@ -38,7 +38,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index aaaf3ab..036dd5d 100644 (file)
@@ -62,7 +62,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index 26fd11c..82bc6cd 100644 (file)
@@ -43,7 +43,6 @@
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
-        <version>${bundle.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
           <instructions>
index fad37ae..c4c1ee9 100644 (file)
@@ -1,15 +1,16 @@
 /**
  * Copyright (c) 2014 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.compatibility;
 
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-import org.eclipse.xtext.xbase.lib.Exceptions;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+
 import org.opendaylight.controller.sal.common.util.Arguments;
 import org.opendaylight.controller.sal.core.AdvertisedBandwidth;
 import org.opendaylight.controller.sal.core.Bandwidth;
@@ -58,36 +59,30 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
 
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
+import com.google.common.base.Objects;
+import com.google.common.base.Preconditions;
 
-@SuppressWarnings("all")
-public class NodeMapping {
+public final class NodeMapping {
   public final static String MD_SAL_TYPE = "MD_SAL";
-  
+
   private final static Class<Node> NODE_CLASS = Node.class;
-  
+
   private final static Class<NodeConnector> NODECONNECTOR_CLASS = NodeConnector.class;
-  
+
   private NodeMapping() {
     throw new UnsupportedOperationException("Utility class. Instantiation is not allowed.");
   }
-  
+
   public static org.opendaylight.controller.sal.core.Node toADNode(final InstanceIdentifier<? extends Object> node) throws ConstructionException {
     NodeId nodeId = NodeMapping.toNodeId(node);
     return NodeMapping.toADNode(nodeId);
   }
-  
-  public static org.opendaylight.controller.sal.core.Node toADNode(final NodeId id) {
-    try {
+
+  public static org.opendaylight.controller.sal.core.Node toADNode(final NodeId id) throws ConstructionException {
       String aDNodeId = NodeMapping.toADNodeId(id);
       return  new org.opendaylight.controller.sal.core.Node(NodeMapping.MD_SAL_TYPE, aDNodeId);
-    } catch (Throwable e) {
-      throw Exceptions.sneakyThrow(e);
-    }
   }
-  
+
   public static NodeId toNodeId(final InstanceIdentifier<? extends Object> node) {
     Preconditions.<InstanceIdentifier<? extends Object>>checkNotNull(node);
     List<PathArgument> path = node.getPath();
@@ -96,16 +91,16 @@ public class NodeMapping {
     Preconditions.checkArgument(size >= 2);
     final PathArgument arg = path.get(1);
     final IdentifiableItem item = Arguments.<IdentifiableItem>checkInstanceOf(arg, IdentifiableItem.class);
-    Identifier key = item.getKey();
+    Identifier<?> key = item.getKey();
     final NodeKey nodeKey = Arguments.<NodeKey>checkInstanceOf(key, NodeKey.class);
     return nodeKey.getId();
   }
-  
+
   public static String toADNodeId(final NodeId nodeId) {
     Preconditions.<NodeId>checkNotNull(nodeId);
     return nodeId.getValue();
   }
-  
+
   public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorRef source) throws ConstructionException {
     Preconditions.<NodeConnectorRef>checkNotNull(source);
     final InstanceIdentifier<?> path = Preconditions.<InstanceIdentifier<? extends Object>>checkNotNull(source.getValue());
@@ -115,18 +110,14 @@ public class NodeMapping {
     final NodeConnectorKey connectorKey = Arguments.<NodeConnectorKey>checkInstanceOf(item.getKey(), NodeConnectorKey.class);
     return NodeMapping.toADNodeConnector(connectorKey.getId(), NodeMapping.toNodeId(path));
   }
-  
-  public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorId ncid, final NodeId nid) {
-    try {
-      String nodeConnectorType = NodeMapping.toNodeConnectorType(ncid, nid);
-      Object aDNodeConnectorId = NodeMapping.toADNodeConnectorId(ncid, nid);
-      org.opendaylight.controller.sal.core.Node aDNode = NodeMapping.toADNode(nid);
-      return new org.opendaylight.controller.sal.core.NodeConnector(nodeConnectorType, aDNodeConnectorId, aDNode);
-    } catch (Throwable e) {
-      throw Exceptions.sneakyThrow(e);
-    }
+
+  public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorId ncid, final NodeId nid) throws ConstructionException {
+    String nodeConnectorType = NodeMapping.toNodeConnectorType(ncid, nid);
+    Object aDNodeConnectorId = NodeMapping.toADNodeConnectorId(ncid, nid);
+    org.opendaylight.controller.sal.core.Node aDNode = NodeMapping.toADNode(nid);
+    return new org.opendaylight.controller.sal.core.NodeConnector(nodeConnectorType, aDNodeConnectorId, aDNode);
   }
-  
+
   public static String toNodeConnectorType(final NodeConnectorId ncId, final NodeId nodeId) {
     if (ncId.equals(toLocalNodeConnectorId(nodeId))) {
         return NodeConnectorIDType.SWSTACK;
@@ -146,19 +137,19 @@ public class NodeMapping {
     }
     return nodeConnectorId.getValue();
   }
-  
+
   public static NodeConnectorId toControllerNodeConnectorId(final NodeId node) {
     return new NodeConnectorId(node.getValue() + ":" + 4294967293L);
   }
-  
+
   public static NodeConnectorId toLocalNodeConnectorId(final NodeId node) {
     return new NodeConnectorId(node.getValue() + ":" + 4294967294L);
   }
-  
+
   public static NodeConnectorId toNormalNodeConnectorId(final NodeId node) {
     return new NodeConnectorId(node.getValue() + ":" + 4294967290L);
   }
-  
+
   public static NodeRef toNodeRef(final org.opendaylight.controller.sal.core.Node node) {
     Preconditions.checkArgument(MD_SAL_TYPE.equals(node.getType()));
     final String nodeId = Arguments.<String>checkInstanceOf(node.getID(), String.class);
@@ -166,7 +157,7 @@ public class NodeMapping {
     final InstanceIdentifier<Node> nodePath = InstanceIdentifier.builder(Nodes.class).child(NODE_CLASS, nodeKey).toInstance();
     return new NodeRef(nodePath);
   }
-  
+
   public static NodeConnectorRef toNodeConnectorRef(final org.opendaylight.controller.sal.core.NodeConnector nodeConnector) {
 
     final NodeRef node = NodeMapping.toNodeRef(nodeConnector.getNode());
@@ -187,14 +178,14 @@ public class NodeMapping {
         nodeConnectorId = new NodeConnectorId(Arguments.<String>checkInstanceOf(nodeConnector.getID(), String.class));
     }
     final NodeConnectorKey connectorKey = new NodeConnectorKey(nodeConnectorId);
-    final InstanceIdentifier<NodeConnector> path = InstanceIdentifier.builder(nodePath).child(NODECONNECTOR_CLASS, connectorKey).toInstance();
+    final InstanceIdentifier<NodeConnector> path = nodePath.child(NODECONNECTOR_CLASS, connectorKey);
     return new NodeConnectorRef(path);
   }
-  
+
   public static org.opendaylight.controller.sal.core.Node toADNode(final NodeRef node) throws ConstructionException {
     return NodeMapping.toADNode(node.getValue());
   }
-  
+
   public static HashSet<Property> toADNodeConnectorProperties(final NodeConnectorUpdated nc) {
     final FlowCapableNodeConnectorUpdated fcncu = nc.<FlowCapableNodeConnectorUpdated>getAugmentation(FlowCapableNodeConnectorUpdated.class);
     if (!Objects.equal(fcncu, null)) {
@@ -202,7 +193,7 @@ public class NodeMapping {
     }
     return new HashSet<Property>();
   }
-  
+
   public static HashSet<Property> toADNodeConnectorProperties(final NodeConnector nc) {
     final FlowCapableNodeConnector fcnc = nc.<FlowCapableNodeConnector>getAugmentation(FlowCapableNodeConnector.class);
     if (!Objects.equal(fcnc, null)) {
@@ -210,7 +201,7 @@ public class NodeMapping {
     }
     return new HashSet<Property>();
   }
-  
+
   public static HashSet<Property> toADNodeConnectorProperties(final FlowNodeConnector fcncu) {
 
     final HashSet<org.opendaylight.controller.sal.core.Property> props = new HashSet<>();
@@ -239,11 +230,11 @@ public class NodeMapping {
     }
     return props;
   }
-  
+
   public static Name toAdName(final String name) {
     return new Name(name);
   }
-  
+
   public static Config toAdConfig(final PortConfig pc) {
     Config config = null;
     if (pc.isPORTDOWN()) {
@@ -253,7 +244,7 @@ public class NodeMapping {
     }
     return config;
   }
-  
+
   public static org.opendaylight.controller.sal.core.State toAdState(final State s) {
 
     org.opendaylight.controller.sal.core.State state = null;
@@ -264,7 +255,7 @@ public class NodeMapping {
     }
     return state;
   }
-  
+
   public static Bandwidth toAdBandwidth(final PortFeatures pf) {
     Bandwidth bw = null;
     if (pf.isTenMbHd() || pf.isTenMbFd()) {
@@ -286,7 +277,7 @@ public class NodeMapping {
     }
     return bw;
   }
-  
+
   public static AdvertisedBandwidth toAdAdvertizedBandwidth(final PortFeatures pf) {
     AdvertisedBandwidth abw = null;
     final Bandwidth bw = toAdBandwidth(pf);
@@ -295,7 +286,7 @@ public class NodeMapping {
     }
     return abw;
   }
-  
+
   public static SupportedBandwidth toAdSupportedBandwidth(final PortFeatures pf) {
     SupportedBandwidth sbw = null;
     final Bandwidth bw = toAdBandwidth(pf);
@@ -304,7 +295,7 @@ public class NodeMapping {
     }
     return sbw;
   }
-  
+
   public static PeerBandwidth toAdPeerBandwidth(final PortFeatures pf) {
     PeerBandwidth pbw = null;
     final Bandwidth bw = toAdBandwidth(pf);
@@ -313,7 +304,7 @@ public class NodeMapping {
     }
     return pbw;
   }
-  
+
   public static HashSet<Property> toADNodeProperties(final NodeUpdated nu) {
     final FlowCapableNodeUpdated fcnu = nu.getAugmentation(FlowCapableNodeUpdated.class);
     if (fcnu != null) {
@@ -321,7 +312,7 @@ public class NodeMapping {
     }
     return new HashSet<org.opendaylight.controller.sal.core.Property>();
   }
-  
+
   public static HashSet<Property> toADNodeProperties(final FlowNode fcnu, final NodeId id) {
 
     final HashSet<org.opendaylight.controller.sal.core.Property> props = new HashSet<>();
@@ -348,13 +339,13 @@ public class NodeMapping {
     }
     return props;
   }
-  
+
   public static TimeStamp toADTimestamp() {
     final Date date = new Date();
     final TimeStamp timestamp = new TimeStamp(date.getTime(), "connectedSince");
     return timestamp;
   }
-  
+
   public static MacAddress toADMacAddress(final NodeId id) {
     final String nodeId = id.getValue().replaceAll("openflow:", "");
     long lNodeId = Long.parseLong(nodeId);
@@ -362,11 +353,11 @@ public class NodeMapping {
     byte[] bytesFromDpid = ToSalConversionsUtils.bytesFromDpid(lNodeId);
     return new MacAddress(bytesFromDpid);
   }
-  
+
   public static Tables toADTables(final Short tables) {
     return new Tables(tables.byteValue());
   }
-  
+
   public static Capabilities toADCapabiliities(final List<Class<? extends FeatureCapability>> capabilities) {
 
     int b = 0;
@@ -389,7 +380,7 @@ public class NodeMapping {
     }
     return new Capabilities(b);
   }
-  
+
   public static Buffers toADBuffers(final Long buffers) {
     return new Buffers(buffers.intValue());
   }
index a35c3ed..e798b68 100644 (file)
@@ -68,7 +68,7 @@ public class TopologyCommitHandler implements DataChangeListener {
             for (InstanceIdentifier<? extends DataObject> path : modification.getRemovedOperationalData()) {
                 if (path.getTargetType() == Link.class) {
                     Link link = (Link) modification.getOriginalOperationalData().get(path);
-                    msg.add(toTopoEdgeUpdate(toAdEdge(link, topology), UpdateType.CHANGED, reader));
+                    msg.add(toTopoEdgeUpdate(toAdEdge(link, topology), UpdateType.REMOVED, reader));
                 }
 
             }
diff --git a/opendaylight/md-sal/feature/pom.xml b/opendaylight/md-sal/feature/pom.xml
new file mode 100644 (file)
index 0000000..c08c3e5
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>sal-parent</artifactId>
+    <version>1.1-SNAPSHOT</version>
+  </parent>
+  <artifactId>mdsal-features</artifactId>
+
+  <packaging>pom</packaging>
+
+  <properties>
+    <features.file>features.xml</features.file>
+  </properties>
+
+  <dependencies></dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>filter</id>
+            <goals>
+              <goal>resources</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <phase>package</phase>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>${project.build.directory}/classes/${features.file}</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+  </scm>
+</project>
diff --git a/opendaylight/md-sal/feature/src/main/resources/features.xml b/opendaylight/md-sal/feature/src/main/resources/features.xml
new file mode 100644 (file)
index 0000000..f816018
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<features name="mdsal-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+    <feature name='mdsal-all' version='${project.version}'>
+        <feature version='${project.version}'>odl-mdsal-commons</feature>
+        <feature version='${project.version}'>odl-mdsal-broker</feature>
+        <feature version='${project.version}'>odl-mdsal-restconf</feature>
+    </feature>
+    <feature name='odl-mdsal-commons' version='${project.version}'>
+        <feature version='${yangtools.version}'>yangtools-concepts</feature>
+        <feature version='${yangtools.version}'>yangtools-binding</feature>
+        <bundle>mvn:org.opendaylight.controller/sal-common/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-common-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-common-impl/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-common-util/${project.version}</bundle>
+        <bundle>wrap:mvn:com.google.guava/guava/${guava.version}</bundle>
+        <bundle>wrap:mvn:org.eclipse.xtend/org.eclipse.xtend.lib/${xtend.version}</bundle>
+    </feature>
+    <feature name='odl-mdsal-broker' version='${project.version}'>
+        <feature version='${yangtools.version}'>yangtools-concepts</feature>
+        <feature version='${yangtools.version}'>yangtools-binding</feature>
+        <feature version='${mdsal.version}'>odl-mdsal-commons</feature>
+        <feature version='${config.version}'>odl-config-subsystem</feature>
+        <bundle>mvn:org.opendaylight.controller/sal-core-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-core-spi/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-broker-impl/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-config/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-broker-impl/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-binding-util/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller/sal-connector-api/${project.version}</bundle>
+    </feature>
+    <feature name='odl-mdsal-restconf' version='${project.version}'>
+        <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+        <bundle>mvn:org.opendaylight.controller/sal-rest-connector/${project.version}</bundle>
+        <bundle>wrap:mvn:com.google.code.gson/gson/${gson.version}</bundle>
+        <bundle>wrap:mvn:com.sun.jersey/jersey-core/${jersey.version}</bundle>
+        <bundle>wrap:mvn:com.sun.jersey/jersey-server/${jersey.version}</bundle>
+        <bundle>mvn:org.opendaylight.controller.thirdparty/com.sun.jersey.jersey-servlet/${jersey.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-buffer/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-codec/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-codec-http/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-common/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-handler/${netty.version}</bundle>
+        <bundle>wrap:mvn:io.netty/netty-transport/${netty.version}</bundle>
+    </feature>
+</features>
\ No newline at end of file
index 03cdf97..2a3d8fd 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.controller.md.inventory.manager;
 
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
@@ -37,10 +36,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Objects;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.JdkFutureAdapters;
 
 public class NodeChangeCommiter implements OpendaylightInventoryListener {
 
-    private final static Logger LOG = LoggerFactory.getLogger(NodeChangeCommiter.class);
+    protected final static Logger LOG = LoggerFactory.getLogger(NodeChangeCommiter.class);
 
     private final FlowCapableInventoryProvider manager;
 
@@ -57,15 +59,10 @@ public class NodeChangeCommiter implements OpendaylightInventoryListener {
 
         final NodeConnectorRef ref = connector.getNodeConnectorRef();
         final DataModificationTransaction it = this.getManager().startChange();
-        NodeChangeCommiter.LOG.debug("removing node connector {} ", ref.getValue());
+        LOG.debug("removing node connector {} ", ref.getValue());
         it.removeOperationalData(ref.getValue());
         Future<RpcResult<TransactionStatus>> commitResult = it.commit();
-        try {
-            commitResult.get();
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Node Connector {} not removed.", ref.getValue(), e);
-        }
-
+        listenOnTransactionState(it.getIdentifier(), commitResult, "nodeConnector removal", ref.getValue());
     }
 
     @Override
@@ -85,16 +82,11 @@ public class NodeChangeCommiter implements OpendaylightInventoryListener {
             data.addAugmentation(FlowCapableNodeConnector.class, augment);
         }
         InstanceIdentifier<? extends Object> value = ref.getValue();
-        NodeChangeCommiter.LOG.debug("updating node connector : {}.", value);
+        LOG.debug("updating node connector : {}.", value);
         NodeConnector build = data.build();
         it.putOperationalData((value), build);
         Future<RpcResult<TransactionStatus>> commitResult = it.commit();
-        try {
-            commitResult.get();
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Node Connector {} not updated.", ref.getValue(), e);
-        }
-
+        listenOnTransactionState(it.getIdentifier(), commitResult, "nodeConnector update", ref.getValue());
     }
 
     @Override
@@ -102,14 +94,10 @@ public class NodeChangeCommiter implements OpendaylightInventoryListener {
 
         final NodeRef ref = node.getNodeRef();
         final DataModificationTransaction it = this.manager.startChange();
-        NodeChangeCommiter.LOG.debug("removing node : {}", ref.getValue());
+        LOG.debug("removing node : {}", ref.getValue());
         it.removeOperationalData((ref.getValue()));
         Future<RpcResult<TransactionStatus>> commitResult = it.commit();
-        try {
-            commitResult.get();
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Node {} not removed.", ref.getValue(), e);
-        }
+        listenOnTransactionState(it.getIdentifier(), commitResult, "node removal", ref.getValue());
     }
 
     @Override
@@ -128,19 +116,39 @@ public class NodeChangeCommiter implements OpendaylightInventoryListener {
         final FlowCapableNode augment = InventoryMapping.toInventoryAugment(flowNode);
         nodeBuilder.addAugmentation(FlowCapableNode.class, augment);
         InstanceIdentifier<? extends Object> value = ref.getValue();
-        InstanceIdentifierBuilder<Node> builder = InstanceIdentifier.<Node> builder(((InstanceIdentifier<Node>) value));
+        InstanceIdentifierBuilder<Node> builder = ((InstanceIdentifier<Node>) value).builder();
         InstanceIdentifierBuilder<FlowCapableNode> augmentation = builder
                 .<FlowCapableNode> augmentation(FlowCapableNode.class);
         final InstanceIdentifier<FlowCapableNode> path = augmentation.build();
-        NodeChangeCommiter.LOG.debug("updating node :{} ", path);
+        LOG.debug("updating node :{} ", path);
         it.putOperationalData(path, augment);
 
         Future<RpcResult<TransactionStatus>> commitResult = it.commit();
-        try {
-            commitResult.get();
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Node  {} not updated.", ref.getValue(), e);
-        }
-
+        listenOnTransactionState(it.getIdentifier(), commitResult, "node update", ref.getValue());
+    }
+    
+    /**
+     * @param txId transaction identificator
+     * @param future transaction result
+     * @param action performed by transaction
+     * @param nodeConnectorPath target value
+     */
+    private static void listenOnTransactionState(final Object txId, Future<RpcResult<TransactionStatus>> future,
+            final String action, final InstanceIdentifier<?> nodeConnectorPath) {
+        Futures.addCallback(JdkFutureAdapters.listenInPoolThread(future),new FutureCallback<RpcResult<TransactionStatus>>() {
+            
+            @Override
+            public void onFailure(Throwable t) {
+                LOG.error("Action {} [{}] failed for Tx:{}", action, nodeConnectorPath, txId, t);
+                
+            }
+            
+            @Override
+            public void onSuccess(RpcResult<TransactionStatus> result) {
+                if(!result.isSuccessful()) {
+                    LOG.error("Action {} [{}] failed for Tx:{}", action, nodeConnectorPath, txId);
+                }
+            }
+        });
     }
 }
index 451edfd..a13d2bb 100644 (file)
         -->
     <!-- Documentation -->
     <module>sal-rest-docgen</module>
+
+    <!--  Karaf feature -->
+    <module>feature</module>
+
   </modules>
 
   <build>
       <plugin>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yang-maven-plugin</artifactId>
-        <version>${yangtools.version}</version>
         <dependencies>
           <dependency>
             <groupId>org.opendaylight.controller</groupId>
index fc29726..871abb2 100644 (file)
@@ -15,7 +15,7 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerCo
  * component of the controller or application supplies a concrete implementation
  * of this interface.
  * 
- * A user-implemented component (application) which faciliates the SAL and SAL
+ * A user-implemented component (application) which facilitates the SAL and SAL
  * services to access infrastructure services or providers' functionality.
  * 
  * 
index 14006a3..750defc 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
 
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import java.util.Hashtable;
 import java.util.Map.Entry;
 import java.util.Set;
+
 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
 import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
@@ -28,6 +27,9 @@ import org.opendaylight.yangtools.yang.model.api.SchemaServiceListener;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
 /**
 *
 */
@@ -61,14 +63,13 @@ public final class RuntimeMappingModule extends
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        
+
         RuntimeGeneratedMappingServiceProxy potential = tryToReuseGlobalInstance();
         if(potential != null) {
             return potential;
         }
-        RuntimeGeneratedMappingServiceImpl service = new RuntimeGeneratedMappingServiceImpl();
-        service.setPool(SingletonHolder.CLASS_POOL);
-        service.init();
+
+        final RuntimeGeneratedMappingServiceImpl service = new RuntimeGeneratedMappingServiceImpl(SingletonHolder.CLASS_POOL);
         bundleContext.registerService(SchemaServiceListener.class, service, new Hashtable<String,String>());
         return service;
     }
@@ -98,7 +99,7 @@ public final class RuntimeMappingModule extends
     BindingIndependentMappingService, //
     Delegator<BindingIndependentMappingService>, //
     AutoCloseable {
-        
+
         private BindingIndependentMappingService delegate;
         private ServiceReference<BindingIndependentMappingService> reference;
         private BundleContext bundleContext;
@@ -111,35 +112,42 @@ public final class RuntimeMappingModule extends
             this.delegate = Preconditions.checkNotNull(delegate);
         }
 
+        @Override
         public CodecRegistry getCodecRegistry() {
             return delegate.getCodecRegistry();
         }
 
+        @Override
         public CompositeNode toDataDom(DataObject data) {
             return delegate.toDataDom(data);
         }
 
+        @Override
         public Entry<InstanceIdentifier, CompositeNode> toDataDom(
                 Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject> entry) {
             return delegate.toDataDom(entry);
         }
 
+        @Override
         public InstanceIdentifier toDataDom(
                 org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject> path) {
             return delegate.toDataDom(path);
         }
 
+        @Override
         public DataObject dataObjectFromDataDom(
                 org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject> path,
                 CompositeNode result) throws DeserializationException {
             return delegate.dataObjectFromDataDom(path, result);
         }
 
+        @Override
         public org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> fromDataDom(InstanceIdentifier entry)
                 throws DeserializationException {
             return delegate.fromDataDom(entry);
         }
 
+        @Override
         public Set<QName> getRpcQNamesFor(Class<? extends RpcService> service) {
             return delegate.getRpcQNamesFor(service);
         }
@@ -149,10 +157,11 @@ public final class RuntimeMappingModule extends
             return delegate.getRpcServiceClassFor(namespace,revision);
         }
 
+        @Override
         public DataContainer dataObjectFromDataDom(Class<? extends DataContainer> inputClass, CompositeNode domInput) {
             return delegate.dataObjectFromDataDom(inputClass, domInput);
         }
-        
+
         @Override
         public void close() throws Exception {
             if(delegate != null) {
index 685a919..2a866a9 100644 (file)
@@ -96,10 +96,14 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         for (Map.Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, ? extends NormalizedNode<?, ?>> entry : normalized
                 .entrySet()) {
             try {
-                Entry<InstanceIdentifier<? extends DataObject>, DataObject> binding = getCodec().toBinding(entry);
-                newMap.put(binding.getKey(), binding.getValue());
+                Optional<Entry<InstanceIdentifier<? extends DataObject>, DataObject>> potential = getCodec().toBinding(
+                        entry);
+                if (potential.isPresent()) {
+                    Entry<InstanceIdentifier<? extends DataObject>, DataObject> binding = potential.get();
+                    newMap.put(binding.getKey(), binding.getValue());
+                }
             } catch (DeserializationException e) {
-                LOG.debug("Omitting {}", entry, e);
+                LOG.warn("Failed to transform {}, omitting it", entry, e);
             }
         }
         return newMap;
@@ -110,17 +114,20 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         Set<InstanceIdentifier<?>> hashSet = new HashSet<>();
         for (org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalizedPath : normalized) {
             try {
-                InstanceIdentifier<? extends DataObject> binding = getCodec().toBinding(normalizedPath);
-                hashSet.add(binding);
+                Optional<InstanceIdentifier<? extends DataObject>> potential = getCodec().toBinding(normalizedPath);
+                if (potential.isPresent()) {
+                    InstanceIdentifier<? extends DataObject> binding = potential.get();
+                    hashSet.add(binding);
+                }
             } catch (DeserializationException e) {
-                LOG.debug("Omitting {}", normalizedPath, e);
+                LOG.warn("Failed to transform {}, omitting it", normalizedPath, e);
             }
         }
         return hashSet;
     }
 
     protected Optional<DataObject> toBindingData(final InstanceIdentifier<?> path, final NormalizedNode<?, ?> data) {
-        if(path.isWildcarded()) {
+        if (path.isWildcarded()) {
             return Optional.absent();
         }
 
@@ -207,7 +214,11 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         @Override
         public DataObject getOriginalSubtree() {
             if (originalDataCache == null) {
-                originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                if(domEvent.getOriginalSubtree() != null) {
+                    originalDataCache = toBindingData(path, domEvent.getOriginalSubtree());
+                } else {
+                    originalDataCache = Optional.absent();
+                }
             }
             return originalDataCache.orNull();
         }
@@ -215,20 +226,23 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
         @Override
         public DataObject getUpdatedSubtree() {
             if (updatedDataCache == null) {
-                updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                if(domEvent.getUpdatedSubtree() != null) {
+                    updatedDataCache = toBindingData(path, domEvent.getUpdatedSubtree());
+                } else {
+                    updatedDataCache = Optional.absent();
+                }
             }
-
             return updatedDataCache.orNull();
         }
 
         @Override
         public String toString() {
             return Objects.toStringHelper(TranslatedDataChangeEvent.class) //
-                .add("created", getCreatedData()) //
-                .add("updated", getUpdatedData()) //
-                .add("removed", getRemovedPaths()) //
-                .add("dom", domEvent) //
-                .toString();
+                    .add("created", getCreatedData()) //
+                    .add("updated", getUpdatedData()) //
+                    .add("removed", getRemovedPaths()) //
+                    .add("dom", domEvent) //
+                    .toString();
         }
     }
 
index cc9c6eb..a935a33 100644 (file)
@@ -17,7 +17,6 @@ import java.util.concurrent.TimeUnit;
 
 import javax.annotation.Nullable;
 
-import org.eclipse.xtext.xbase.lib.Exceptions;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -79,17 +78,21 @@ public class AbstractForwardedTransaction<T extends AsyncTransaction<org.openday
             @Nullable
             @Override
             public Optional<DataObject> apply(@Nullable final Optional<NormalizedNode<?, ?>> normalizedNode) {
-                try {
-                    final DataObject dataObject = normalizedNode.isPresent() ? codec.toBinding(path,
-                            normalizedNode.get()) : null;
+                if (normalizedNode.isPresent()) {
+                    final DataObject dataObject;
+                    try {
+                        dataObject = codec.toBinding(path, normalizedNode.get());
+                    } catch (DeserializationException e) {
+                        LOG.warn("Failed to create dataobject from node {}", normalizedNode.get(), e);
+                        throw new IllegalStateException("Failed to create dataobject", e);
+                    }
+
                     if (dataObject != null) {
                         updateCache(store, path, dataObject);
+                        return Optional.of(dataObject);
                     }
-                    return Optional.fromNullable(dataObject);
-                } catch (DeserializationException e) {
-                    Exceptions.sneakyThrow(e);
                 }
-                return null;
+                return Optional.absent();
             }
         });
     }
@@ -108,10 +111,10 @@ public class AbstractForwardedTransaction<T extends AsyncTransaction<org.openday
         final Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, NormalizedNode<?, ?>> normalized = codec
                 .toNormalizedNode(path, data);
 
-        org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalizedPath = normalized.getKey();
-        ensureParentsByMerge(writeTransaction, store, normalized.getKey(), path);
-        LOG.debug("Tx: {} : Putting data {}",getDelegate().getIdentifier(),normalized.getKey());
-        writeTransaction.put(store, normalized.getKey(), normalized.getValue());
+        final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalizedPath = normalized.getKey();
+        ensureParentsByMerge(writeTransaction, store, normalizedPath, path);
+        LOG.debug("Tx: {} : Putting data {}", getDelegate().getIdentifier(), normalizedPath);
+        writeTransaction.put(store, normalizedPath, normalized.getValue());
     }
 
     protected void doMergeWithEnsureParents(final DOMDataReadWriteTransaction writeTransaction,
@@ -120,10 +123,10 @@ public class AbstractForwardedTransaction<T extends AsyncTransaction<org.openday
         final Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, NormalizedNode<?, ?>> normalized = codec
                 .toNormalizedNode(path, data);
 
-        org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalizedPath = normalized.getKey();
-        ensureParentsByMerge(writeTransaction, store, normalized.getKey(), path);
-        LOG.debug("Tx: {} : Merge data {}",getDelegate().getIdentifier(),normalized.getKey());
-        writeTransaction.merge(store, normalized.getKey(), normalized.getValue());
+        final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalizedPath = normalized.getKey();
+        ensureParentsByMerge(writeTransaction, store, normalizedPath, path);
+        LOG.debug("Tx: {} : Merge data {}",getDelegate().getIdentifier(),normalizedPath);
+        writeTransaction.merge(store, normalizedPath, normalized.getValue());
     }
 
     private void ensureParentsByMerge(final DOMDataReadWriteTransaction writeTransaction,
index 6329637..53615ad 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Map.Entry;
 import java.util.concurrent.Callable;
 
 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationException;
+import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizationOperation;
 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer;
 import org.opendaylight.yangtools.concepts.util.ClassLoaderUtils;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
@@ -42,6 +43,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
@@ -60,7 +62,8 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
     public org.opendaylight.yangtools.yang.data.api.InstanceIdentifier toNormalized(
             final InstanceIdentifier<? extends DataObject> binding) {
 
-        // Used instance-identifier codec do not support serialization of last path
+        // Used instance-identifier codec do not support serialization of last
+        // path
         // argument if it is Augmentation (behaviour expected by old datastore)
         // in this case, we explicitly check if last argument is augmentation
         // to process it separately
@@ -103,13 +106,24 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
 
     }
 
-    public InstanceIdentifier<? extends DataObject> toBinding(
+    /**
+     *
+     * Returns a Binding-Aware instance identifier from normalized
+     * instance-identifier if it is possible to create representation.
+     *
+     * Returns Optional.absent for cases where target is mixin node except
+     * augmentation.
+     *
+     */
+    public Optional<InstanceIdentifier<? extends DataObject>> toBinding(
             final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
             throws DeserializationException {
 
         PathArgument lastArgument = Iterables.getLast(normalized.getPath());
-        // Used instance-identifier codec do not support serialization of last path
-        // argument if it is AugmentationIdentifier (behaviour expected by old datastore)
+        // Used instance-identifier codec do not support serialization of last
+        // path
+        // argument if it is AugmentationIdentifier (behaviour expected by old
+        // datastore)
         // in this case, we explicitly check if last argument is augmentation
         // to process it separately
         if (lastArgument instanceof AugmentationIdentifier) {
@@ -118,46 +132,71 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return toBindingImpl(normalized);
     }
 
-    private InstanceIdentifier<? extends DataObject> toBindingAugmented(
-            final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized) throws DeserializationException {
-        InstanceIdentifier<? extends DataObject> potential = toBindingImpl(normalized);
+    private Optional<InstanceIdentifier<? extends DataObject>> toBindingAugmented(
+            final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
+            throws DeserializationException {
+        Optional<InstanceIdentifier<? extends DataObject>> potential = toBindingImpl(normalized);
         // Shorthand check, if codec already supports deserialization
         // of AugmentationIdentifier we will return
-        if(isAugmentationIdentifier(potential)) {
+        if (potential.isPresent() && isAugmentationIdentifier(potential.get())) {
             return potential;
         }
 
         AugmentationIdentifier lastArgument = (AugmentationIdentifier) Iterables.getLast(normalized.getPath());
 
-        // Here we employ small trick - Binding-aware Codec injects an pointer to augmentation class
-        // if child is referenced - so we will reference child and then shorten path.
+        // Here we employ small trick - Binding-aware Codec injects an pointer
+        // to augmentation class
+        // if child is referenced - so we will reference child and then shorten
+        // path.
         for (QName child : lastArgument.getPossibleChildNames()) {
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier childPath = new org.opendaylight.yangtools.yang.data.api.InstanceIdentifier(
-                    ImmutableList.<PathArgument> builder()
-                    .addAll(normalized.getPath()).add(new NodeIdentifier(child)).build());
+                    ImmutableList.<PathArgument> builder().addAll(normalized.getPath()).add(new NodeIdentifier(child))
+                            .build());
             try {
-
-                InstanceIdentifier<? extends DataObject> potentialPath = shortenToLastAugment(toBindingImpl(childPath));
-                return potentialPath;
+                if (!isChoiceOrCasePath(childPath)) {
+                    InstanceIdentifier<? extends DataObject> potentialPath = shortenToLastAugment(toBindingImpl(
+                            childPath).get());
+                    return Optional.<InstanceIdentifier<? extends DataObject>> of(potentialPath);
+                }
             } catch (Exception e) {
-                LOG.trace("Unable to deserialize aug. child path for {}",childPath,e);
+                LOG.trace("Unable to deserialize aug. child path for {}", childPath, e);
             }
         }
         return toBindingImpl(normalized);
     }
 
-    private InstanceIdentifier<? extends DataObject> toBindingImpl(
+    private Optional<InstanceIdentifier<? extends DataObject>> toBindingImpl(
             final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
             throws DeserializationException {
         org.opendaylight.yangtools.yang.data.api.InstanceIdentifier legacyPath;
+
         try {
+            if (isChoiceOrCasePath(normalized)) {
+                return Optional.absent();
+            }
             legacyPath = legacyToNormalized.toLegacy(normalized);
         } catch (DataNormalizationException e) {
             throw new IllegalStateException("Could not denormalize path.", e);
         }
         LOG.trace("InstanceIdentifier Path Deserialization: Legacy representation {}, Normalized representation: {}",
                 legacyPath, normalized);
-        return bindingToLegacy.fromDataDom(legacyPath);
+        return Optional.<InstanceIdentifier<? extends DataObject>> of(bindingToLegacy.fromDataDom(legacyPath));
+    }
+
+    private boolean isChoiceOrCasePath(final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
+            throws DataNormalizationException {
+        DataNormalizationOperation<?> op = findNormalizationOperation(normalized);
+        return op.isMixin() && op.getIdentifier() instanceof NodeIdentifier;
+    }
+
+    private DataNormalizationOperation<?> findNormalizationOperation(
+            final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized)
+            throws DataNormalizationException {
+        DataNormalizationOperation<?> current = legacyToNormalized.getRootOperation();
+        for (PathArgument arg : normalized.getPath()) {
+            current = current.getChild(arg);
+        }
+        return current;
     }
 
     private static final Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject> toEntry(
@@ -170,7 +209,7 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
     public DataObject toBinding(final InstanceIdentifier<?> path, final NormalizedNode<?, ?> normalizedNode)
             throws DeserializationException {
         CompositeNode legacy = null;
-        if(isAugmentationIdentifier(path) && normalizedNode instanceof AugmentationNode) {
+        if (isAugmentationIdentifier(path) && normalizedNode instanceof AugmentationNode) {
             QName augIdentifier = BindingReflections.findQName(path.getTargetType());
             ContainerNode virtualNode = Builders.containerBuilder() //
                     .withNodeIdentifier(new NodeIdentifier(augIdentifier)) //
@@ -188,12 +227,20 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return legacyToNormalized;
     }
 
-    public Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject> toBinding(
+    public Optional<Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject>> toBinding(
             final Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, ? extends NormalizedNode<?, ?>> normalized)
             throws DeserializationException {
-        InstanceIdentifier<? extends DataObject> bindingPath = toBinding(normalized.getKey());
-        DataObject bindingData = toBinding(bindingPath, normalized.getValue());
-        return toEntry(bindingPath, bindingData);
+        Optional<InstanceIdentifier<? extends DataObject>> potentialPath = toBinding(normalized.getKey());
+        if (potentialPath.isPresent()) {
+            InstanceIdentifier<? extends DataObject> bindingPath = potentialPath.get();
+            DataObject bindingData = toBinding(bindingPath, normalized.getValue());
+            if (bindingData == null) {
+                LOG.warn("Failed to deserialize {} to Binding format. Binding path is: {}", normalized, bindingPath);
+            }
+            return Optional.of(toEntry(bindingPath, bindingData));
+        } else {
+            return Optional.absent();
+        }
     }
 
     @Override
@@ -206,14 +253,17 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         org.opendaylight.yangtools.yang.data.api.InstanceIdentifier processed = toNormalizedImpl(augPath);
         // If used instance identifier codec added supports for deserialization
         // of last AugmentationIdentifier we will just reuse it
-        if(isAugmentationIdentifier(processed)) {
+        if (isAugmentationIdentifier(processed)) {
             return processed;
         }
-        // Here we employ small trick - DataNormalizer injecst augmentation identifier if child is
-        // also part of the path (since using a child we can safely identify augmentation)
+        // Here we employ small trick - DataNormalizer injecst augmentation
+        // identifier if child is
+        // also part of the path (since using a child we can safely identify
+        // augmentation)
         // so, we scan augmentation for children add it to path
         // and use original algorithm, then shorten it to last augmentation
-        for (@SuppressWarnings("rawtypes") Class augChild : getAugmentationChildren(augPath.getTargetType())) {
+        for (@SuppressWarnings("rawtypes")
+        Class augChild : getAugmentationChildren(augPath.getTargetType())) {
             @SuppressWarnings("unchecked")
             InstanceIdentifier<?> childPath = augPath.child(augChild);
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized = toNormalizedImpl(childPath);
@@ -225,8 +275,6 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return processed;
     }
 
-
-
     private org.opendaylight.yangtools.yang.data.api.InstanceIdentifier shortenToLastAugmentation(
             final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier normalized) {
         int position = 0;
@@ -248,7 +296,7 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
             final InstanceIdentifier<? extends DataObject> binding) {
         int position = 0;
         int foundPosition = -1;
-        for(org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument arg : binding.getPathArguments()) {
+        for (org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument arg : binding.getPathArguments()) {
             position++;
             if (isAugmentation(arg.getType())) {
                 foundPosition = position;
@@ -257,8 +305,6 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return InstanceIdentifier.create(Iterables.limit(binding.getPathArguments(), foundPosition));
     }
 
-
-
     private org.opendaylight.yangtools.yang.data.api.InstanceIdentifier toNormalizedImpl(
             final InstanceIdentifier<? extends DataObject> binding) {
         final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier legacyPath = bindingToLegacy
@@ -326,13 +372,12 @@ public class BindingToNormalizedNodeCodec implements SchemaContextListener {
         return InstanceIdentifier.create(wildArgs);
     }
 
-
     private static boolean isAugmentation(final Class<? extends DataObject> type) {
         return Augmentation.class.isAssignableFrom(type);
     }
 
-    private static boolean isAugmentationIdentifier(final InstanceIdentifier<?> path) {
-        return Augmentation.class.isAssignableFrom(path.getTargetType());
+    private static boolean isAugmentationIdentifier(final InstanceIdentifier<?> potential) {
+        return Augmentation.class.isAssignableFrom(potential.getTargetType());
     }
 
     private boolean isAugmentationIdentifier(final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier processed) {
index ea8b6c0..ae90a77 100644 (file)
  */
 package org.opendaylight.controller.sal.binding.codegen;
 
-import com.google.common.base.Objects;
 import java.lang.reflect.Field;
 import java.util.Map;
-import org.eclipse.xtext.xbase.lib.Exceptions;
-import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeSpecification;
+
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
-@SuppressWarnings("all")
-public class RuntimeCodeHelper {
-  /**
-   * Helper method to return delegate from ManagedDirectedProxy with use of reflection.
-   *
-   * Note: This method uses reflection, but access to delegate field should be
-   * avoided and called only if neccessary.
-   */
-  public static <T extends RpcService> T getDelegate(final RpcService proxy) {
-    try {
-      Class<? extends RpcService> _class = proxy.getClass();
-      final Field field = _class.getField(RuntimeCodeSpecification.DELEGATE_FIELD);
-      boolean _equals = Objects.equal(field, null);
-      if (_equals) {
-        UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException("Unable to get delegate from proxy");
-        throw _unsupportedOperationException;
-      }
-      try {
-        Object _get = field.get(proxy);
-        return ((T) _get);
-      } catch (Throwable _e) {
-        throw Exceptions.sneakyThrow(_e);
-      }
-    } catch (Throwable _e_1) {
-      throw Exceptions.sneakyThrow(_e_1);
+public final class RuntimeCodeHelper {
+    private RuntimeCodeHelper() {
+        throw new UnsupportedOperationException("Utility class should never be instantiated");
+    }
+
+    private static Field getField(final Class<?> cls, final String name) {
+        try {
+            return cls.getField(name);
+        } catch (NoSuchFieldException e) {
+            throw new IllegalArgumentException(
+                    String.format("Class %s is missing field %s", cls, name), e);
+        } catch (SecurityException e) {
+            throw new IllegalStateException(String.format("Failed to examine class %s", cls), e);
+        }
     }
-  }
 
-  /**
-   * Helper method to set delegate to ManagedDirectedProxy with use of reflection.
-   *
-   * Note: This method uses reflection, but setting delegate field should not occur too much
-   * to introduce any significant performance hits.
-   */
-  public static void setDelegate(final RpcService proxy, final RpcService delegate) {
-    try {
-      Class<? extends RpcService> _class = proxy.getClass();
-      final Field field = _class.getField(RuntimeCodeSpecification.DELEGATE_FIELD);
-      boolean _equals = Objects.equal(field, null);
-      if (_equals) {
-        UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException("Unable to set delegate to proxy");
-        throw _unsupportedOperationException;
-      }
-      boolean _or = false;
-      boolean _equals_1 = Objects.equal(delegate, null);
-      if (_equals_1) {
-        _or = true;
-      } else {
-        Class<? extends Object> _type = field.getType();
-        Class<? extends RpcService> _class_1 = delegate.getClass();
-        boolean _isAssignableFrom = _type.isAssignableFrom(_class_1);
-        _or = (_equals_1 || _isAssignableFrom);
-      }
-      if (_or) {
-        field.set(proxy, delegate);
-      } else {
-        IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("delegate class is not assignable to proxy");
-        throw _illegalArgumentException;
-      }
-    } catch (Throwable _e) {
-      throw Exceptions.sneakyThrow(_e);
+    private static Field getDelegateField(final Class<?> cls) {
+        return getField(cls, RuntimeCodeSpecification.DELEGATE_FIELD);
     }
-  }
 
-  /**
-   * Helper method to set delegate to ManagedDirectedProxy with use of reflection.
-   *
-   * Note: This method uses reflection, but setting delegate field should not occur too much
-   * to introduce any significant performance hits.
-   */
-  public static void setDelegate(final Object proxy, final Object delegate) {
-    try {
-      Class<? extends Object> _class = proxy.getClass();
-      final Field field = _class.getField(RuntimeCodeSpecification.DELEGATE_FIELD);
-      boolean _equals = Objects.equal(field, null);
-      if (_equals) {
-        UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException("Unable to set delegate to proxy");
-        throw _unsupportedOperationException;
-      }
-      boolean _or = false;
-      boolean _equals_1 = Objects.equal(delegate, null);
-      if (_equals_1) {
-        _or = true;
-      } else {
-        Class<? extends Object> _type = field.getType();
-        Class<? extends Object> _class_1 = delegate.getClass();
-        boolean _isAssignableFrom = _type.isAssignableFrom(_class_1);
-        _or = (_equals_1 || _isAssignableFrom);
-      }
-      if (_or) {
-        field.set(proxy, delegate);
-      } else {
-        IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("delegate class is not assignable to proxy");
-        throw _illegalArgumentException;
-      }
-    } catch (Throwable _e) {
-      throw Exceptions.sneakyThrow(_e);
+    private static Object getFieldValue(final Field field, final Object obj) {
+        try {
+            return field.get(obj);
+        } catch (IllegalAccessException e) {
+            throw new IllegalStateException(String.format("Failed to get field %s of object %s", field, obj), e);
+        }
+    }
+
+    private static void setFieldValue(final Field field, final Object obj, final Object value) {
+        try {
+            field.set(obj, value);
+        } catch (IllegalAccessException e) {
+            throw new IllegalStateException(String.format("Failed to set field %s to %s", field, value), e);
+        }
+    }
+
+    /**
+     * Helper method to return delegate from ManagedDirectedProxy with use of reflection.
+     *
+     * Note: This method uses reflection, but access to delegate field should be
+     * avoided and called only if necessary.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T extends RpcService> T getDelegate(final RpcService proxy) {
+        return (T)getFieldValue(getDelegateField(proxy.getClass()), proxy);
+    }
+
+    /**
+     * Helper method to set delegate to ManagedDirectedProxy with use of reflection.
+     *
+     * Note: This method uses reflection, but setting delegate field should not occur too much
+     * to introduce any significant performance hits.
+     */
+    public static void setDelegate(final Object proxy, final Object delegate) {
+        final Field field = getDelegateField(proxy.getClass());
+
+        if (delegate != null) {
+            final Class<?> ft = field.getType();
+            if (!ft.isAssignableFrom(delegate.getClass())) {
+                throw new IllegalArgumentException(
+                        String.format("Field %s type %s is not compatible with delegate type %s",
+                                field, ft, delegate.getClass()));
+            }
+        }
+
+        setFieldValue(field, proxy, delegate);
     }
-  }
 
-  public static Map<InstanceIdentifier<? extends Object>,? extends RpcService> getRoutingTable(final RpcService target, final Class<? extends BaseIdentity> tableClass) {
-    try {
-      Class<? extends RpcService> _class = target.getClass();
-      String _routingTableField = RuntimeCodeSpecification.getRoutingTableField(tableClass);
-      final Field field = _class.getField(_routingTableField);
-      boolean _equals = Objects.equal(field, null);
-      if (_equals) {
-        UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException(
-          "Unable to get routing table. Table field does not exists");
-        throw _unsupportedOperationException;
-      }
-      try {
-        Object _get = field.get(target);
-        return ((Map<InstanceIdentifier<? extends Object>,? extends RpcService>) _get);
-      } catch (Throwable _e) {
-        throw Exceptions.sneakyThrow(_e);
-      }
-    } catch (Throwable _e_1) {
-      throw Exceptions.sneakyThrow(_e_1);
+    @SuppressWarnings("unchecked")
+    public static Map<InstanceIdentifier<? extends Object>,? extends RpcService> getRoutingTable(final RpcService target, final Class<? extends BaseIdentity> tableClass) {
+        final Field field = getField(target.getClass(), RuntimeCodeSpecification.getRoutingTableField(tableClass));
+        return (Map<InstanceIdentifier<? extends Object>,? extends RpcService>) getFieldValue(field, target);
     }
-  }
 
-  public static void setRoutingTable(final RpcService target, final Class<? extends BaseIdentity> tableClass, final Map<InstanceIdentifier<? extends Object>,? extends RpcService> routingTable) {
-    try {
-      Class<? extends RpcService> _class = target.getClass();
-      String _routingTableField = RuntimeCodeSpecification.getRoutingTableField(tableClass);
-      final Field field = _class.getField(_routingTableField);
-      boolean _equals = Objects.equal(field, null);
-      if (_equals) {
-        UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException(
-          "Unable to set routing table. Table field does not exists");
-        throw _unsupportedOperationException;
-      }
-      field.set(target, routingTable);
-    } catch (Throwable _e) {
-      throw Exceptions.sneakyThrow(_e);
+    public static void setRoutingTable(final RpcService target, final Class<? extends BaseIdentity> tableClass, final Map<InstanceIdentifier<? extends Object>,? extends RpcService> routingTable) {
+        final Field field = getField(target.getClass(), RuntimeCodeSpecification.getRoutingTableField(tableClass));
+        setFieldValue(field, target, routingTable);
     }
-  }
-}
\ No newline at end of file
+}
index 6723713..465a1f7 100644 (file)
@@ -43,13 +43,11 @@ import javassist.LoaderClassPath
 class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator, NotificationInvokerFactory {
 
     val CtClass BROKER_NOTIFICATION_LISTENER;
-    val ClassPool classPool;
     val extension JavassistUtils utils;
     val Map<Class<? extends NotificationListener>, RuntimeGeneratedInvokerPrototype> invokerClasses;
 
 
     new(ClassPool pool) {
-        classPool = pool;
         utils = new JavassistUtils(pool);
         invokerClasses = new WeakHashMap();
         BROKER_NOTIFICATION_LISTENER = org.opendaylight.controller.sal.binding.api.NotificationListener.asCtClass;
index 4141bba..8276446 100644 (file)
@@ -7,13 +7,6 @@
  */
 package org.opendaylight.controller.sal.binding.codegen.impl;
 
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import javassist.ClassPool;
-import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator;
-import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory;
-
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -23,7 +16,20 @@ import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import javassist.ClassPool;
+
+import org.apache.commons.lang3.StringUtils;
+import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator;
+import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+
 public class SingletonHolder {
+    private static final Logger logger = LoggerFactory.getLogger(SingletonHolder.class);
 
     public static final ClassPool CLASS_POOL = ClassPool.getDefault();
     public static final org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator RPC_GENERATOR_IMPL = new org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator(
@@ -34,8 +40,9 @@ public class SingletonHolder {
     public static final int CORE_NOTIFICATION_THREADS = 4;
     public static final int MAX_NOTIFICATION_THREADS = 32;
     // block caller thread after MAX_NOTIFICATION_THREADS + MAX_NOTIFICATION_QUEUE_SIZE pending notifications
-    public static final int MAX_NOTIFICATION_QUEUE_SIZE = 10;
+    public static final int MAX_NOTIFICATION_QUEUE_SIZE = 1000;
     public static final int NOTIFICATION_THREAD_LIFE = 15;
+    private static final String NOTIFICATION_QUEUE_SIZE_PROPERTY = "mdsal.notificationqueue.size";
 
     private static ListeningExecutorService NOTIFICATION_EXECUTOR = null;
     private static ListeningExecutorService COMMIT_EXECUTOR = null;
@@ -46,14 +53,27 @@ public class SingletonHolder {
      *             should use service injection to make the executor configurable.
      */
     @Deprecated
-    public static synchronized final ListeningExecutorService getDefaultNotificationExecutor() {
+    public static synchronized ListeningExecutorService getDefaultNotificationExecutor() {
 
         if (NOTIFICATION_EXECUTOR == null) {
+            int queueSize = MAX_NOTIFICATION_QUEUE_SIZE;
+            String queueValue = System.getProperty(NOTIFICATION_QUEUE_SIZE_PROPERTY);
+            if (StringUtils.isNotBlank(queueValue)) {
+                try {
+                    queueSize = Integer.parseInt(queueValue);
+                    logger.trace("Queue size was set to {}", queueSize);
+                }catch(NumberFormatException e) {
+                    logger.warn("Cannot parse {} as set by {}, using default {}", queueValue,
+                            NOTIFICATION_QUEUE_SIZE_PROPERTY, queueSize);
+                }
+            }
             // Overriding the queue:
             // ThreadPoolExecutor would not create new threads if the queue is not full, thus adding
             // occurs in RejectedExecutionHandler.
             // This impl saturates threadpool first, then queue. When both are full caller will get blocked.
-            BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(MAX_NOTIFICATION_QUEUE_SIZE) {
+            BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(queueSize) {
+                private static final long serialVersionUID = 1L;
+
                 @Override
                 public boolean offer(Runnable r) {
                     // ThreadPoolExecutor will spawn a new thread after core size is reached only if the queue.offer returns false.
@@ -89,7 +109,7 @@ public class SingletonHolder {
      *             should use service injection to make the executor configurable.
      */
     @Deprecated
-    public static synchronized final ListeningExecutorService getDefaultCommitExecutor() {
+    public static synchronized ListeningExecutorService getDefaultCommitExecutor() {
         if (COMMIT_EXECUTOR == null) {
             ThreadFactory factory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("md-sal-binding-commit-%d").build();
             /*
index a398abc..b27c80d 100644 (file)
@@ -98,11 +98,8 @@ public class BindingIndependentConnector implements //
         Provider, //
         AutoCloseable {
 
-
-
     private final Logger LOG = LoggerFactory.getLogger(BindingIndependentConnector.class);
 
-
     private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier ROOT_BI = org.opendaylight.yangtools.yang.data.api.InstanceIdentifier
             .builder().toInstance();
 
@@ -200,30 +197,30 @@ public class BindingIndependentConnector implements //
     private DataModificationTransaction createBindingToDomTransaction(
             final DataModification<InstanceIdentifier<? extends DataObject>, DataObject> source) {
         DataModificationTransaction target = biDataService.beginTransaction();
-        LOG.debug("Created DOM Transaction {} for {},", target.getIdentifier(),source.getIdentifier());
+        LOG.debug("Created DOM Transaction {} for {},", target.getIdentifier(), source.getIdentifier());
         for (InstanceIdentifier<? extends DataObject> entry : source.getRemovedConfigurationData()) {
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier biEntry = mappingService.toDataDom(entry);
             target.removeConfigurationData(biEntry);
-            LOG.debug("Delete of Binding Configuration Data {} is translated to {}",entry,biEntry);
+            LOG.debug("Delete of Binding Configuration Data {} is translated to {}", entry, biEntry);
         }
         for (InstanceIdentifier<? extends DataObject> entry : source.getRemovedOperationalData()) {
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier biEntry = mappingService.toDataDom(entry);
             target.removeOperationalData(biEntry);
-            LOG.debug("Delete of Binding Operational Data {} is translated to {}",entry,biEntry);
+            LOG.debug("Delete of Binding Operational Data {} is translated to {}", entry, biEntry);
         }
         for (Entry<InstanceIdentifier<? extends DataObject>, DataObject> entry : source.getUpdatedConfigurationData()
                 .entrySet()) {
             Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, CompositeNode> biEntry = mappingService
                     .toDataDom(entry);
             target.putConfigurationData(biEntry.getKey(), biEntry.getValue());
-            LOG.debug("Update of Binding Configuration Data {} is translated to {}",entry,biEntry);
+            LOG.debug("Update of Binding Configuration Data {} is translated to {}", entry, biEntry);
         }
         for (Entry<InstanceIdentifier<? extends DataObject>, DataObject> entry : source.getUpdatedOperationalData()
                 .entrySet()) {
             Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, CompositeNode> biEntry = mappingService
                     .toDataDom(entry);
             target.putOperationalData(biEntry.getKey(), biEntry.getValue());
-            LOG.debug("Update of Binding Operational Data {} is translated to {}",entry,biEntry);
+            LOG.debug("Update of Binding Operational Data {} is translated to {}", entry, biEntry);
         }
 
         return target;
@@ -279,7 +276,8 @@ public class BindingIndependentConnector implements //
         return biDataService;
     }
 
-    protected void setDomDataService(final org.opendaylight.controller.sal.core.api.data.DataProviderService biDataService) {
+    protected void setDomDataService(
+            final org.opendaylight.controller.sal.core.api.data.DataProviderService biDataService) {
         this.biDataService = biDataService;
     }
 
@@ -300,14 +298,14 @@ public class BindingIndependentConnector implements //
     }
 
     public void startDataForwarding() {
-        if(baDataService instanceof AbstractForwardedDataBroker) {
+        if (baDataService instanceof AbstractForwardedDataBroker) {
             dataForwarding = true;
             return;
         }
 
         final DataProviderService baData;
         if (baDataService instanceof BindingMountPointImpl) {
-            baData = ((BindingMountPointImpl)baDataService).getDataBrokerImpl();
+            baData = ((BindingMountPointImpl) baDataService).getDataBrokerImpl();
             LOG.debug("Extracted BA Data provider {} from mount point {}", baData, baDataService);
         } else {
             baData = baDataService;
@@ -478,8 +476,8 @@ public class BindingIndependentConnector implements //
             }
             DataModificationTransaction domTransaction = createBindingToDomTransaction(bindingTransaction);
             BindingToDomTransaction wrapped = new BindingToDomTransaction(domTransaction, bindingTransaction);
-            LOG.trace("Forwarding Binding Transaction: {} as DOM Transaction: {} .", bindingTransaction.getIdentifier(),
-                    domTransaction.getIdentifier());
+            LOG.trace("Forwarding Binding Transaction: {} as DOM Transaction: {} .",
+                    bindingTransaction.getIdentifier(), domTransaction.getIdentifier());
             return wrapped;
         }
     }
@@ -489,7 +487,8 @@ public class BindingIndependentConnector implements //
             DataCommitHandler<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, CompositeNode> {
 
         @Override
-        public void onRegister(final DataCommitHandlerRegistration<InstanceIdentifier<? extends DataObject>, DataObject> registration) {
+        public void onRegister(
+                final DataCommitHandlerRegistration<InstanceIdentifier<? extends DataObject>, DataObject> registration) {
 
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier domPath = mappingService.toDataDom(registration
                     .getPath());
@@ -497,7 +496,8 @@ public class BindingIndependentConnector implements //
         }
 
         @Override
-        public void onUnregister(final DataCommitHandlerRegistration<InstanceIdentifier<? extends DataObject>, DataObject> registration) {
+        public void onUnregister(
+                final DataCommitHandlerRegistration<InstanceIdentifier<? extends DataObject>, DataObject> registration) {
             // NOOP for now
             // FIXME: do registration based on only active commit handlers.
         }
@@ -531,8 +531,7 @@ public class BindingIndependentConnector implements //
      *
      */
     private class DomToBindingRpcForwardingManager implements
-            RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>,
-            RouterInstantiationListener,
+            RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>, RouterInstantiationListener,
             GlobalRpcRegistrationListener {
 
         private final Map<Class<? extends RpcService>, DomToBindingRpcForwarder> forwarders = new WeakHashMap<>();
@@ -615,7 +614,7 @@ public class BindingIndependentConnector implements //
                 }
 
             } catch (Exception e) {
-                LOG.error("Could not forward Rpcs of type {}", service.getName(),e);
+                LOG.error("Could not forward Rpcs of type {}", service.getName(), e);
             }
             registrations = ImmutableSet.of();
         }
@@ -626,7 +625,8 @@ public class BindingIndependentConnector implements //
          * @param service
          * @param context
          */
-        public DomToBindingRpcForwarder(final Class<? extends RpcService> service, final Class<? extends BaseIdentity> context) {
+        public DomToBindingRpcForwarder(final Class<? extends RpcService> service,
+                final Class<? extends BaseIdentity> context) {
             this.rpcServiceType = new WeakReference<Class<? extends RpcService>>(service);
             this.supportedRpcs = mappingService.getRpcQNamesFor(service);
             Builder<RoutedRpcRegistration> registrationsBuilder = ImmutableSet
@@ -645,8 +645,8 @@ public class BindingIndependentConnector implements //
             registrations = registrationsBuilder.build();
         }
 
-        public void registerPaths(final Class<? extends BaseIdentity> context, final Class<? extends RpcService> service,
-                final Set<InstanceIdentifier<?>> set) {
+        public void registerPaths(final Class<? extends BaseIdentity> context,
+                final Class<? extends RpcService> service, final Set<InstanceIdentifier<?>> set) {
             QName ctx = BindingReflections.findQName(context);
             for (org.opendaylight.yangtools.yang.data.api.InstanceIdentifier path : FluentIterable.from(set).transform(
                     toDOMInstanceIdentifier)) {
@@ -656,7 +656,6 @@ public class BindingIndependentConnector implements //
             }
         }
 
-
         @Override
         public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
             if (EQUALS_METHOD.equals(method)) {
@@ -700,7 +699,6 @@ public class BindingIndependentConnector implements //
             }
         }
 
-
         @Override
         public ListenableFuture<RpcResult<CompositeNode>> invokeRpc(final QName rpc, final CompositeNode domInput) {
             checkArgument(rpc != null);
@@ -748,12 +746,12 @@ public class BindingIndependentConnector implements //
                             strategy = new DefaultInvocationStrategy(rpc, targetMethod, outputClass.get(), inputClass
                                     .get());
                         } else {
-                            strategy = new NoInputNoOutputInvocationStrategy(rpc, targetMethod);
+                            strategy = new NoInputInvocationStrategy(rpc, targetMethod, outputClass.get());
                         }
-                    } else if(inputClass.isPresent()){
-                        strategy = new NoOutputInvocationStrategy(rpc,targetMethod, inputClass.get());
+                    } else if (inputClass.isPresent()) {
+                        strategy = new NoOutputInvocationStrategy(rpc, targetMethod, inputClass.get());
                     } else {
-                        strategy = new NoInputNoOutputInvocationStrategy(rpc,targetMethod);
+                        strategy = new NoInputNoOutputInvocationStrategy(rpc, targetMethod);
                     }
                     return strategy;
                 }
@@ -777,7 +775,8 @@ public class BindingIndependentConnector implements //
         public abstract RpcResult<CompositeNode> uncheckedInvoke(RpcService rpcService, CompositeNode domInput)
                 throws Exception;
 
-        public RpcResult<CompositeNode> invokeOn(final RpcService rpcService, final CompositeNode domInput) throws Exception {
+        public RpcResult<CompositeNode> invokeOn(final RpcService rpcService, final CompositeNode domInput)
+                throws Exception {
             return uncheckedInvoke(rpcService, domInput);
         }
     }
@@ -800,7 +799,8 @@ public class BindingIndependentConnector implements //
 
         @SuppressWarnings("unchecked")
         @Override
-        public RpcResult<CompositeNode> uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput) throws Exception {
+        public RpcResult<CompositeNode> uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput)
+                throws Exception {
             DataContainer bindingInput = mappingService.dataObjectFromDataDom(inputClass.get(), domInput);
             Future<RpcResult<?>> futureResult = (Future<RpcResult<?>>) targetMethod.invoke(rpcService, bindingInput);
             if (futureResult == null) {
@@ -809,31 +809,84 @@ public class BindingIndependentConnector implements //
             RpcResult<?> bindingResult = futureResult.get();
             final Object resultObj = bindingResult.getResult();
             if (resultObj instanceof DataObject) {
-                final CompositeNode output = mappingService.toDataDom((DataObject)resultObj);
-                return Rpcs.getRpcResult(true, output, Collections.<RpcError>emptySet());
+                final CompositeNode output = mappingService.toDataDom((DataObject) resultObj);
+                return Rpcs.getRpcResult(true, output, Collections.<RpcError> emptySet());
             }
             return Rpcs.getRpcResult(true);
         }
 
         @Override
         public ListenableFuture<RpcResult<?>> forwardToDomBroker(final DataObject input) {
-            if(biRpcRegistry == null) {
+            if (biRpcRegistry == null) {
                 return Futures.<RpcResult<?>> immediateFuture(Rpcs.getRpcResult(false));
             }
 
             CompositeNode xml = mappingService.toDataDom(input);
             CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc, ImmutableList.<Node<?>> of(xml));
 
-            return Futures.transform(biRpcRegistry.invokeRpc(rpc, wrappedXml), new Function<RpcResult<CompositeNode>, RpcResult<?>>() {
-                @Override
-                public RpcResult<?> apply(RpcResult<CompositeNode> input) {
-                    Object baResultValue = null;
-                    if (input.getResult() != null) {
-                        baResultValue = mappingService.dataObjectFromDataDom(outputClass.get(), input.getResult());
-                    }
-                    return Rpcs.getRpcResult(input.isSuccessful(), baResultValue, input.getErrors());
-                }
-            });
+            return Futures.transform(biRpcRegistry.invokeRpc(rpc, wrappedXml),
+                    new Function<RpcResult<CompositeNode>, RpcResult<?>>() {
+                        @Override
+                        public RpcResult<?> apply(final RpcResult<CompositeNode> input) {
+                            Object baResultValue = null;
+                            if (input.getResult() != null) {
+                                baResultValue = mappingService.dataObjectFromDataDom(outputClass.get(),
+                                        input.getResult());
+                            }
+                            return Rpcs.getRpcResult(input.isSuccessful(), baResultValue, input.getErrors());
+                        }
+                    });
+        }
+    }
+
+    private class NoInputInvocationStrategy extends RpcInvocationStrategy {
+
+        @SuppressWarnings("rawtypes")
+        private final WeakReference<Class> outputClass;
+
+        @SuppressWarnings({ "rawtypes", "unchecked" })
+        public NoInputInvocationStrategy(final QName rpc, final Method targetMethod, final Class<?> outputClass) {
+            super(rpc, targetMethod);
+            this.outputClass = new WeakReference(outputClass);
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public RpcResult<CompositeNode> uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput)
+                throws Exception {
+            Future<RpcResult<?>> futureResult = (Future<RpcResult<?>>) targetMethod.invoke(rpcService);
+            if (futureResult == null) {
+                return Rpcs.getRpcResult(false);
+            }
+            RpcResult<?> bindingResult = futureResult.get();
+            final Object resultObj = bindingResult.getResult();
+            if (resultObj instanceof DataObject) {
+                final CompositeNode output = mappingService.toDataDom((DataObject) resultObj);
+                return Rpcs.getRpcResult(true, output, Collections.<RpcError> emptySet());
+            }
+            return Rpcs.getRpcResult(true);
+        }
+
+        @Override
+        public Future<RpcResult<?>> forwardToDomBroker(final DataObject input) {
+            if (biRpcRegistry != null) {
+                CompositeNode xml = mappingService.toDataDom(input);
+                CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc, ImmutableList.<Node<?>> of(xml));
+                return Futures.transform(biRpcRegistry.invokeRpc(rpc, wrappedXml),
+                        new Function<RpcResult<CompositeNode>, RpcResult<?>>() {
+                            @Override
+                            public RpcResult<?> apply(final RpcResult<CompositeNode> input) {
+                                Object baResultValue = null;
+                                if (input.getResult() != null) {
+                                    baResultValue = mappingService.dataObjectFromDataDom(outputClass.get(),
+                                            input.getResult());
+                                }
+                                return Rpcs.getRpcResult(input.isSuccessful(), baResultValue, input.getErrors());
+                            }
+                        });
+            } else {
+                return Futures.<RpcResult<?>> immediateFuture(Rpcs.getRpcResult(false));
+            }
         }
     }
 
@@ -844,7 +897,8 @@ public class BindingIndependentConnector implements //
         }
 
         @Override
-        public RpcResult<CompositeNode> uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput) throws Exception {
+        public RpcResult<CompositeNode> uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput)
+                throws Exception {
             @SuppressWarnings("unchecked")
             Future<RpcResult<Void>> result = (Future<RpcResult<Void>>) targetMethod.invoke(rpcService);
             RpcResult<Void> bindingResult = result.get();
@@ -859,20 +913,19 @@ public class BindingIndependentConnector implements //
 
     private class NoOutputInvocationStrategy extends RpcInvocationStrategy {
 
-
         @SuppressWarnings("rawtypes")
         private final WeakReference<Class> inputClass;
 
         @SuppressWarnings({ "rawtypes", "unchecked" })
         public NoOutputInvocationStrategy(final QName rpc, final Method targetMethod,
                 final Class<? extends DataContainer> inputClass) {
-            super(rpc,targetMethod);
+            super(rpc, targetMethod);
             this.inputClass = new WeakReference(inputClass);
         }
 
-
         @Override
-        public RpcResult<CompositeNode> uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput) throws Exception {
+        public RpcResult<CompositeNode> uncheckedInvoke(final RpcService rpcService, final CompositeNode domInput)
+                throws Exception {
             DataContainer bindingInput = mappingService.dataObjectFromDataDom(inputClass.get(), domInput);
             Future<RpcResult<?>> result = (Future<RpcResult<?>>) targetMethod.invoke(rpcService, bindingInput);
             if (result == null) {
@@ -884,19 +937,20 @@ public class BindingIndependentConnector implements //
 
         @Override
         public ListenableFuture<RpcResult<?>> forwardToDomBroker(final DataObject input) {
-            if(biRpcRegistry == null) {
+            if (biRpcRegistry == null) {
                 return Futures.<RpcResult<?>> immediateFuture(Rpcs.getRpcResult(false));
             }
 
             CompositeNode xml = mappingService.toDataDom(input);
-            CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc,ImmutableList.<Node<?>>of(xml));
+            CompositeNode wrappedXml = ImmutableCompositeNode.create(rpc, ImmutableList.<Node<?>> of(xml));
 
-            return Futures.transform(biRpcRegistry.invokeRpc(rpc, wrappedXml), new Function<RpcResult<CompositeNode>, RpcResult<?>>() {
-                @Override
-                public RpcResult<?> apply(RpcResult<CompositeNode> input) {
-                    return Rpcs.<Void>getRpcResult(input.isSuccessful(), null, input.getErrors());
-                }
-            });
+            return Futures.transform(biRpcRegistry.invokeRpc(rpc, wrappedXml),
+                    new Function<RpcResult<CompositeNode>, RpcResult<?>>() {
+                        @Override
+                        public RpcResult<?> apply(final RpcResult<CompositeNode> input) {
+                            return Rpcs.<Void> getRpcResult(input.isSuccessful(), null, input.getErrors());
+                        }
+                    });
         }
     }
 
index b147e03..6b2568a 100644 (file)
@@ -61,9 +61,8 @@ public class MultipleAugmentationPuts extends AbstractDataServiceTest implements
     private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
             .toInstance();
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier
-            .builder(NODES_INSTANCE_ID_BA) //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA =
+            NODES_INSTANCE_ID_BA.child(Node.class, NODE_KEY);
 
     private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier NODE_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
@@ -74,7 +73,7 @@ public class MultipleAugmentationPuts extends AbstractDataServiceTest implements
 
     /**
      * Test for Bug 148
-     * 
+     *
      * @throws Exception
      */
     @Test
@@ -111,12 +110,12 @@ public class MultipleAugmentationPuts extends AbstractDataServiceTest implements
 //        Node meterStatsNodeWithDuration = createTestNode(NodeMeterStatistics.class, nodeMeterStatistics(5, true));
 //        commitNodeAndVerifyTransaction(meterStatsNodeWithDuration);
 //
-//        
+//
 //        Node nodeWithUpdatedList = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
 //        AugmentationVerifier.from(nodeWithUpdatedList) //
 //                .assertHasAugmentation(FlowCapableNode.class) //
 //                .assertHasAugmentation(NodeMeterStatistics.class);
-//        
+//
 //        List<MeterStats> meterStats = nodeWithUpdatedList.getAugmentation(NodeMeterStatistics.class).getMeterStatistics().getMeterStats();
 //        assertNotNull(meterStats);
 //        assertFalse(meterStats.isEmpty());
index 9cdf703..ae65c88 100644 (file)
@@ -267,9 +267,7 @@ public class BindingTestContext implements AutoCloseable, SchemaContextProvider
 
     public void startBindingToDomMappingService() {
         checkState(classPool != null, "ClassPool needs to be present");
-        mappingServiceImpl = new RuntimeGeneratedMappingServiceImpl();
-        mappingServiceImpl.setPool(classPool);
-        mappingServiceImpl.init();
+        mappingServiceImpl = new RuntimeGeneratedMappingServiceImpl(classPool);
     }
 
     public void updateYangSchema(final String[] files) {
index 61a73d6..c5dbdce 100644 (file)
@@ -30,10 +30,8 @@ public class ConcurrentImplicitCreateTest extends AbstractDataServiceTest {
     private static final NodeKey NODE_FOO_KEY = new NodeKey(new NodeId("foo"));
     private static final NodeKey NODE_BAR_KEY = new NodeKey(new NodeId("foo"));
     private static InstanceIdentifier<Nodes> NODES_PATH = InstanceIdentifier.builder(Nodes.class).build();
-    private static InstanceIdentifier<Node> NODE_FOO_PATH = InstanceIdentifier.builder(NODES_PATH)
-            .child(Node.class, NODE_FOO_KEY).build();
-    private static InstanceIdentifier<Node> NODE_BAR_PATH = InstanceIdentifier.builder(NODES_PATH)
-            .child(Node.class, NODE_FOO_KEY).build();
+    private static InstanceIdentifier<Node> NODE_FOO_PATH = NODES_PATH.child(Node.class, NODE_FOO_KEY);
+    private static InstanceIdentifier<Node> NODE_BAR_PATH = NODES_PATH.child(Node.class, NODE_FOO_KEY);
 
     @Test
     public void testConcurrentCreate() throws InterruptedException, ExecutionException {
index 0925e9b..800c1b4 100644 (file)
@@ -75,13 +75,13 @@ public class ListProcessingAndOrderingTest extends AbstractDataServiceTest {
     private static final UnorderedListKey UNORDERED_FOO_KEY = new UnorderedListKey("foo");
     private static final UnorderedListKey UNORDERED_BAR_KEY = new UnorderedListKey("bar");
 
-    private static final InstanceIdentifier<UnorderedList> UNORDERED_FOO_PATH = InstanceIdentifier.builder(UNORDERED_CONTAINER_PATH).child(UnorderedList.class,UNORDERED_FOO_KEY).build();
-    private static final InstanceIdentifier<UnorderedList> UNORDERED_BAR_PATH = InstanceIdentifier.builder(UNORDERED_CONTAINER_PATH).child(UnorderedList.class,UNORDERED_BAR_KEY).build();
+    private static final InstanceIdentifier<UnorderedList> UNORDERED_FOO_PATH = UNORDERED_CONTAINER_PATH.child(UnorderedList.class,UNORDERED_FOO_KEY);
+    private static final InstanceIdentifier<UnorderedList> UNORDERED_BAR_PATH = UNORDERED_CONTAINER_PATH.child(UnorderedList.class,UNORDERED_BAR_KEY);
 
     private static final OrderedListKey ORDERED_FOO_KEY = new OrderedListKey("foo");
     private static final OrderedListKey ORDERED_BAR_KEY = new OrderedListKey("bar");
-    private static final InstanceIdentifier<OrderedList> ORDERED_FOO_PATH = InstanceIdentifier.builder(ORDERED_CONTAINER_PATH).child(OrderedList.class,ORDERED_FOO_KEY).build();
-    private static final InstanceIdentifier<OrderedList> ORDERED_BAR_PATH = InstanceIdentifier.builder(ORDERED_CONTAINER_PATH).child(OrderedList.class,ORDERED_BAR_KEY).build();
+    private static final InstanceIdentifier<OrderedList> ORDERED_FOO_PATH = ORDERED_CONTAINER_PATH.child(OrderedList.class,ORDERED_FOO_KEY);
+    private static final InstanceIdentifier<OrderedList> ORDERED_BAR_PATH = ORDERED_CONTAINER_PATH.child(OrderedList.class,ORDERED_BAR_KEY);
 
 
     @Test
index 450ca1c..6b4cc57 100644 (file)
@@ -78,14 +78,12 @@ public class WildcardedDataChangeListenerTest extends AbstractDataServiceTest {
 
     private static final FlowKey FLOW_KEY = new FlowKey(new FlowId("test"));
 
-    private static final InstanceIdentifier<Flow> NODE_0_FLOW_PATH = InstanceIdentifier.builder(NODE_0_TABLE_PATH)
-            .child(Flow.class, FLOW_KEY).build();
+    private static final InstanceIdentifier<Flow> NODE_0_FLOW_PATH = NODE_0_TABLE_PATH.child(Flow.class, FLOW_KEY);
 
-    private static final InstanceIdentifier<Flow> NODE_1_FLOW_PATH = InstanceIdentifier.builder(NODE_1_TABLE_PATH)
-            .child(Flow.class, FLOW_KEY).build();
+    private static final InstanceIdentifier<Flow> NODE_1_FLOW_PATH = NODE_1_TABLE_PATH.child(Flow.class, FLOW_KEY);
 
-    private static final InstanceIdentifier<TableFeatures> NODE_0_TABLE_FEATURES_PATH = InstanceIdentifier
-            .builder(NODE_0_TABLE_PATH).child(TableFeatures.class, TABLE_FEATURES_KEY).build();
+    private static final InstanceIdentifier<TableFeatures> NODE_0_TABLE_FEATURES_PATH =
+            NODE_0_TABLE_PATH.child(TableFeatures.class, TABLE_FEATURES_KEY);
 
     private static final TableFeatures TABLE_FEATURES = new TableFeaturesBuilder()//
             .setKey(TABLE_FEATURES_KEY) //
index e893713..ccbd52f 100644 (file)
@@ -60,13 +60,11 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
             .toInstance();
 
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = NODES_INSTANCE_ID_BA.child(Node.class, NODE_KEY);
 
 
-    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class, NODE_KEY) //
             .augmentation(FlowCapableNode.class) //
             .child(SupportedActions.class)
@@ -163,7 +161,7 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
 
         NodeConnectorId ncId = new NodeConnectorId("openflow:1:bar");
         NodeConnectorKey nodeKey = new NodeConnectorKey(ncId );
-        InstanceIdentifier<NodeConnector> ncInstanceId = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA).child(NodeConnector.class, nodeKey).toInstance();
+        InstanceIdentifier<NodeConnector> ncInstanceId = NODE_INSTANCE_ID_BA.child(NodeConnector.class, nodeKey);
         NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
         ncBuilder.setId(ncId);
         ncBuilder.setKey(nodeKey);
diff --git a/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DeleteNestedAugmentationListenParentTest.java b/opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DeleteNestedAugmentationListenParentTest.java
new file mode 100644 (file)
index 0000000..c1eba3e
--- /dev/null
@@ -0,0 +1,96 @@
+package org.opendaylight.controller.sal.binding.test.bugfix;
+
+import static org.junit.Assert.assertFalse;
+
+import java.util.concurrent.ExecutionException;
+
+import org.junit.Test;
+import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
+import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
+import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatisticsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+import com.google.common.util.concurrent.SettableFuture;
+
+public class DeleteNestedAugmentationListenParentTest extends AbstractDataServiceTest {
+
+    private static final NodeKey NODE_KEY = new NodeKey(new NodeId("foo"));
+
+    private static final TableKey TABLE_KEY = new TableKey((short) 0);
+
+    private static final FlowKey FLOW_KEY = new FlowKey(new FlowId("100"));
+
+    private static final InstanceIdentifier<FlowCapableNode> LISTENER_PATH = InstanceIdentifier.builder(Nodes.class) //
+            .child(Node.class)
+            .augmentation(FlowCapableNode.class).build();
+
+
+    private static final InstanceIdentifier<FlowCapableNode> NODE_AUGMENT_PATH = InstanceIdentifier.builder(Nodes.class)
+            .child(Node.class,NODE_KEY)
+            .augmentation(FlowCapableNode.class)
+            .build();
+
+    private static final InstanceIdentifier<Flow> FLOW_PATH = NODE_AUGMENT_PATH.builder()
+            .child(Table.class,TABLE_KEY)
+            .child(Flow.class,FLOW_KEY)
+            .build();
+
+
+    @Test
+    public void deleteChildListenParent() throws InterruptedException, ExecutionException {
+        DataModificationTransaction initTx = baDataService.beginTransaction();
+
+        initTx.putOperationalData(FLOW_PATH, flow());
+        initTx.commit().get();
+
+        final SettableFuture<DataChangeEvent<InstanceIdentifier<?>, DataObject>> event = SettableFuture.create();
+
+        ListenerRegistration<DataChangeListener> listenerReg = baDataService.registerDataChangeListener(FLOW_PATH, new DataChangeListener() {
+
+            @Override
+            public void onDataChanged(final DataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
+                event.set(change);
+            }
+        });
+
+        DataModificationTransaction deleteTx = baDataService.beginTransaction();
+        deleteTx.removeOperationalData(FLOW_PATH.augmentation(FlowStatisticsData.class));
+        deleteTx.commit().get();
+
+        DataChangeEvent<InstanceIdentifier<?>, DataObject> receivedEvent = event.get();
+        assertFalse(receivedEvent.getRemovedOperationalData().contains(NODE_AUGMENT_PATH));
+    }
+
+    private Flow flow() {
+        FlowBuilder builder = new FlowBuilder()
+            .setKey(FLOW_KEY)
+            .addAugmentation(FlowStatisticsData.class,new FlowStatisticsDataBuilder()
+                    .setFlowStatistics(new FlowStatisticsBuilder()
+                        .setBarrier(true)
+                        .setMatch(new MatchBuilder()
+                            .build())
+                        .build())
+                    .build())
+        ;//.build();
+        return builder.build();
+    }
+
+}
\ No newline at end of file
index 023bd79..30c7af7 100644 (file)
@@ -7,7 +7,15 @@
  */
 package org.opendaylight.controller.sal.binding.test.bugfix;
 
-import com.google.common.collect.ImmutableSet;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
@@ -44,14 +52,7 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import com.google.common.collect.ImmutableSet;
 
 public class FlagsSerializationTest extends AbstractDataServiceTest {
 
@@ -65,7 +66,7 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
     private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
     private static final FlowKey FLOW_KEY = new FlowKey(new FlowId(FLOW_ID));
     private static final TableKey TABLE_KEY = new TableKey(TABLE_ID);
-    
+
     private static final Map<QName, Object> NODE_KEY_BI = Collections.<QName, Object> singletonMap(NODE_ID_QNAME,
             NODE_ID);
 
@@ -83,12 +84,12 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
 
 //    private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier FLOW_INSTANCE_ID_BI = //
 //    org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
-//            
+//
 //            .node(Flows.QNAME) //
 //            .nodeWithKey(Flow.QNAME, FLOW_KEY_BI) //
 //            .toInstance();
     private static final InstanceIdentifier<? extends DataObject> FLOW_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(NODE_INSTANCE_ID_BA) //
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class)
             .child(Table.class,TABLE_KEY)
             .child(Flow.class, FLOW_KEY) //
@@ -101,34 +102,34 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
         FlowModFlags checkOverlapFlags = new FlowModFlags(true,false,false,false,false);
         ImmutableSet<String> domCheckOverlapFlags = ImmutableSet.<String>of("CHECK_OVERLAP");
         testFlags(checkOverlapFlags,domCheckOverlapFlags);
-        
-        
-        
+
+
+
         FlowModFlags allFalseFlags = new FlowModFlags(false,false,false,false,false);
         ImmutableSet<String> domAllFalseFlags = ImmutableSet.<String>of();
         testFlags(allFalseFlags,domAllFalseFlags);
-        
+
         FlowModFlags allTrueFlags = new FlowModFlags(true,true,true,true,true);
         ImmutableSet<String> domAllTrueFlags = ImmutableSet.<String>of("CHECK_OVERLAP","NO_BYT_COUNTS", "NO_PKT_COUNTS", "RESET_COUNTS", "SEND_FLOW_REM");
         testFlags(allTrueFlags,domAllTrueFlags);
-        
+
         FlowModFlags nullFlags = null;
         ImmutableSet<String> domNullFlags = null;
         testFlags(null,null);
-        
-        
+
+
 
     }
 
     private void testFlags(FlowModFlags flagsToTest, ImmutableSet<String> domFlags) throws Exception {
         Flow flow = createFlow(flagsToTest);
         assertNotNull(flow);
-        
+
         CompositeNode domFlow = biDataService.readConfigurationData(mappingService.toDataDom(FLOW_INSTANCE_ID_BA));
-        
+
         assertNotNull(domFlow);
         org.opendaylight.yangtools.yang.data.api.Node<?> readedFlags = domFlow.getFirstSimpleByName(FLOW_FLAGS_QNAME);
-        
+
         if(domFlags != null) {
             assertNotNull(readedFlags);
             assertEquals(domFlags,readedFlags.getValue());
@@ -136,12 +137,12 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
             assertNull(readedFlags);
         }
         assertEquals(flagsToTest, flow.getFlags());
-        
+
         DataModificationTransaction transaction = baDataService.beginTransaction();
         transaction.removeConfigurationData(FLOW_INSTANCE_ID_BA);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-           
+
     }
 
     private Flow createFlow(FlowModFlags flagsToTest) throws Exception {
@@ -158,12 +159,12 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
 
         flow.setKey(FLOW_KEY);
         flow.setMatch(match.build());
-        
+
         flow.setFlags(flagsToTest);
-        
+
         InstructionsBuilder instructions = new InstructionsBuilder();
         InstructionBuilder instruction = new InstructionBuilder();
-        
+
         instruction.setOrder(10);
         ApplyActionsBuilder applyActions = new ApplyActionsBuilder();
         List<Action> actionList = new ArrayList<>();
index 027a8ee..7f16320 100644 (file)
@@ -58,18 +58,18 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
     private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
             .toInstance();
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class, NODE_KEY).toInstance();
 
-    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = InstanceIdentifier//
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class, NODE_KEY) //
             .augmentation(FlowCapableNode.class) //
             .child(SupportedActions.class).toInstance();
 
-    private static final InstanceIdentifier<FlowCapableNode> ALL_FLOW_CAPABLE_NODES = InstanceIdentifier //
-            .builder(NODES_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<FlowCapableNode> ALL_FLOW_CAPABLE_NODES = //
+            NODES_INSTANCE_ID_BA.builder() //
             .child(Node.class) //
             .augmentation(FlowCapableNode.class) //
             .build();
@@ -88,8 +88,8 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
             .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
             .node(SUPPORTED_ACTIONS_QNAME) //
             .toInstance();
-    private static final InstanceIdentifier<FlowCapableNode> FLOW_AUGMENTATION_PATH = InstanceIdentifier //
-            .builder(NODE_INSTANCE_ID_BA) //
+    private static final InstanceIdentifier<FlowCapableNode> FLOW_AUGMENTATION_PATH =
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class) //
             .build();
 
@@ -126,8 +126,8 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         fnub.setDescription("Description Foo");
         fnub.setSoftware("JUnit emulated");
         FlowCapableNode fnu = fnub.build();
-        InstanceIdentifier<FlowCapableNode> augmentIdentifier = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA)
-                .augmentation(FlowCapableNode.class).toInstance();
+        InstanceIdentifier<FlowCapableNode> augmentIdentifier = NODE_INSTANCE_ID_BA
+                .augmentation(FlowCapableNode.class);
         DataModificationTransaction augmentedTransaction = baDataService.beginTransaction();
         augmentedTransaction.putOperationalData(augmentIdentifier, fnu);
 
@@ -183,8 +183,8 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         lastReceivedChangeEvent = SettableFuture.create();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        FlowCapableNode readedAugmentation = (FlowCapableNode) baDataService.readOperationalData(InstanceIdentifier
-                .builder(NODE_INSTANCE_ID_BA).augmentation(FlowCapableNode.class).toInstance());
+        FlowCapableNode readedAugmentation = (FlowCapableNode) baDataService.readOperationalData(
+                NODE_INSTANCE_ID_BA.augmentation(FlowCapableNode.class));
         assertNotNull(readedAugmentation);
 
         assertEquals(fnu.getHardware(), readedAugmentation.getHardware());
@@ -198,10 +198,10 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
 
     private void testPutNodeConnectorWithAugmentation() throws Exception {
         NodeConnectorKey ncKey = new NodeConnectorKey(new NodeConnectorId("test:0:0"));
-        InstanceIdentifier<NodeConnector> ncPath = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA)
-                .child(NodeConnector.class, ncKey).toInstance();
-        InstanceIdentifier<FlowCapableNodeConnector> ncAugmentPath = InstanceIdentifier.builder(ncPath)
-                .augmentation(FlowCapableNodeConnector.class).toInstance();
+        InstanceIdentifier<NodeConnector> ncPath = NODE_INSTANCE_ID_BA
+                .child(NodeConnector.class, ncKey);
+        InstanceIdentifier<FlowCapableNodeConnector> ncAugmentPath = ncPath
+                .augmentation(FlowCapableNodeConnector.class);
 
         NodeConnectorBuilder nc = new NodeConnectorBuilder();
         nc.setKey(ncKey);
index 35b4e92..f7b81a4 100644 (file)
@@ -54,13 +54,11 @@ public class WriteParentReadChildTest extends AbstractDataServiceTest {
             .child(Node.class, NODE_KEY).toInstance();
 
     private static final InstanceIdentifier<Table> TABLE_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(NODE_INSTANCE_ID_BA) //
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class).child(Table.class, TABLE_KEY).build();
 
     private static final InstanceIdentifier<? extends DataObject> FLOW_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(TABLE_INSTANCE_ID_BA) //
-            .child(Flow.class, FLOW_KEY) //
-            .toInstance();
+            TABLE_INSTANCE_ID_BA.child(Flow.class, FLOW_KEY);
     /**
      *
      * The scenario tests writing parent node, which also contains child items
@@ -103,11 +101,11 @@ public class WriteParentReadChildTest extends AbstractDataServiceTest {
         DataObject readedTable = baDataService.readConfigurationData(TABLE_INSTANCE_ID_BA);
         assertNotNull("Readed table should not be nul.", readedTable);
         assertTrue(readedTable instanceof Table);
-        
+
         DataObject readedFlow = baDataService.readConfigurationData(FLOW_INSTANCE_ID_BA);
         assertNotNull("Readed flow should not be null.",readedFlow);
         assertTrue(readedFlow instanceof Flow);
         assertEquals(flow, readedFlow);
 
     }
-}
\ No newline at end of file
+}
index 1661ff2..422b9cc 100644 (file)
@@ -110,16 +110,14 @@ public class ChangeOriginatedInDomBrokerTest extends AbstractDataServiceTest {
     private static final TableKey TABLE_KEY_BA = new TableKey((short) 0);
 
     private static final InstanceIdentifier<Flow> FLOWS_PATH_BA = //
-    InstanceIdentifier.builder(NODE_INSTANCE_ID_BA) //
+            NODE_INSTANCE_ID_BA.builder() //
             .augmentation(FlowCapableNode.class) //
             .child(Table.class, TABLE_KEY_BA) //
             .child(Flow.class) //
             .toInstance();
 
     private static final InstanceIdentifier<Flow> FLOW_INSTANCE_ID_BA = //
-    InstanceIdentifier.builder(FLOWS_PATH_BA.firstIdentifierOf(Table.class)) //
-            .child(Flow.class, FLOW_KEY) //
-            .toInstance();
+    FLOWS_PATH_BA.firstIdentifierOf(Table.class).child(Flow.class, FLOW_KEY);
 
     @Test
     public void simpleModifyOperation() throws Exception {
index 63094ef..9457051 100644 (file)
@@ -61,8 +61,8 @@ public class CrossBrokerMountPointTest {
             .child(Node.class, NODE_KEY).toInstance();
     private static GroupKey GROUP_KEY = new GroupKey(new GroupId(0L));
 
-    private static final InstanceIdentifier<GroupStatistics> GROUP_STATISTICS_ID_BA = InstanceIdentifier
-            .builder(NODE_INSTANCE_ID_BA).augmentation(FlowCapableNode.class) //
+    private static final InstanceIdentifier<GroupStatistics> GROUP_STATISTICS_ID_BA = NODE_INSTANCE_ID_BA
+            .builder().augmentation(FlowCapableNode.class) //
             .child(Group.class, GROUP_KEY) //
             .augmentation(NodeGroupStatistics.class) //
             .child(GroupStatistics.class) //
index 0d20a07..70847aa 100644 (file)
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-binding-broker-impl</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.thirdparty</groupId>
-      <artifactId>nagasena</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.thirdparty</groupId>
-      <artifactId>nagasena-rta</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools.thirdparty</groupId>
       <artifactId>antlr4-runtime-osgi-nohead</artifactId>
       <artifactId>xtend-lib-osgi</artifactId>
       <version>2.4.3</version>
     </dependency>
+    <dependency>
+      <groupId>org.openexi</groupId>
+      <artifactId>nagasena</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.openexi</groupId>
+      <artifactId>nagasena-rta</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam</artifactId>
index 166216b..734733a 100644 (file)
@@ -68,8 +68,8 @@ public class TestHelper {
 
                 mavenBundle(CONTROLLER, "netconf-client").versionAsInProject(), //
                 mavenBundle(CONTROLLER, "netconf-util").versionAsInProject(), //
-                mavenBundle(CONTROLLER + ".thirdparty", "nagasena").versionAsInProject(), //
-                mavenBundle(CONTROLLER + ".thirdparty", "nagasena-rta").versionAsInProject(), //
+                mavenBundle("org.openexi", "nagasena").versionAsInProject(), //
+                mavenBundle("org.openexi", "nagasena-rta").versionAsInProject(), //
                 mavenBundle(CONTROLLER + ".thirdparty", "ganymed").versionAsInProject(), //
                 mavenBundle(CONTROLLER, "netconf-mapping-api").versionAsInProject(), //
 
index 3d78f94..b2f89cf 100644 (file)
@@ -70,8 +70,8 @@ public abstract class AbstractTest {
                 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
                 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
                 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
-                mavenBundle("org.opendaylight.controller.thirdparty", "nagasena").versionAsInProject(),
-                mavenBundle("org.opendaylight.controller.thirdparty", "nagasena-rta").versionAsInProject(),
+                mavenBundle("org.openexi", "nagasena").versionAsInProject(),
+                mavenBundle("org.openexi", "nagasena-rta").versionAsInProject(),
                  //
                 systemProperty("osgi.bundles.defaultStartLevel").value("4"),
                 systemPackages("sun.nio.ch"),
index 82ce44c..d8bde3d 100644 (file)
@@ -14,14 +14,12 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.eclipse.xtext.xbase.lib.Exceptions;
 import org.opendaylight.controller.md.sal.common.api.RegistrationListener;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
@@ -46,6 +44,7 @@ import org.slf4j.LoggerFactory;
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
+import com.google.common.base.Supplier;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.ImmutableList;
@@ -120,9 +119,9 @@ public abstract class AbstractDataBroker<P extends Path<P>, D extends Object, DC
     }
 
     protected ImmutableList<DataCommitHandler<P, D>> affectedCommitHandlers(final Set<P> paths) {
-        final Callable<ImmutableList<DataCommitHandler<P, D>>> _function = new Callable<ImmutableList<DataCommitHandler<P, D>>>() {
+        final Supplier<ImmutableList<DataCommitHandler<P, D>>> _function = new Supplier<ImmutableList<DataCommitHandler<P, D>>>() {
             @Override
-            public ImmutableList<DataCommitHandler<P, D>> call() throws Exception {
+            public ImmutableList<DataCommitHandler<P, D>> get() {
                 Map<P, Collection<DataCommitHandlerRegistrationImpl<P, D>>> _asMap = commitHandlers.asMap();
                 Set<Entry<P, Collection<DataCommitHandlerRegistrationImpl<P, D>>>> _entrySet = _asMap.entrySet();
                 FluentIterable<Entry<P, Collection<DataCommitHandlerRegistrationImpl<P, D>>>> _from = FluentIterable
@@ -163,9 +162,9 @@ public abstract class AbstractDataBroker<P extends Path<P>, D extends Object, DC
     }
 
     protected ImmutableList<DataCommitHandler<P, D>> probablyAffectedCommitHandlers(final HashSet<P> paths) {
-        final Callable<ImmutableList<DataCommitHandler<P, D>>> _function = new Callable<ImmutableList<DataCommitHandler<P, D>>>() {
+        final Supplier<ImmutableList<DataCommitHandler<P, D>>> _function = new Supplier<ImmutableList<DataCommitHandler<P, D>>>() {
             @Override
-            public ImmutableList<DataCommitHandler<P, D>> call() throws Exception {
+            public ImmutableList<DataCommitHandler<P, D>> get() {
                 Map<P, Collection<DataCommitHandlerRegistrationImpl<P, D>>> _asMap = commitHandlers.asMap();
                 Set<Entry<P, Collection<DataCommitHandlerRegistrationImpl<P, D>>>> _entrySet = _asMap.entrySet();
                 FluentIterable<Entry<P, Collection<DataCommitHandlerRegistrationImpl<P, D>>>> _from = FluentIterable
@@ -221,12 +220,10 @@ public abstract class AbstractDataBroker<P extends Path<P>, D extends Object, DC
         return _dataReadRouter.readOperationalData(path);
     }
 
-    private static <T extends Object> T withLock(final Lock lock, final Callable<T> method) {
+    private static <T extends Object> T withLock(final Lock lock, final Supplier<T> method) {
         lock.lock();
         try {
-            return method.call();
-        } catch (Exception e) {
-            throw Exceptions.sneakyThrow(e);
+            return method.get();
         } finally {
             lock.unlock();
         }
index a36d984..663493a 100644 (file)
@@ -45,6 +45,7 @@ import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
+import com.google.common.base.Optional;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
@@ -223,20 +224,32 @@ public abstract class DataNormalizationOperation<T extends PathArgument> impleme
             if (potential != null) {
                 return potential;
             }
-            potential = fromSchema(schema, child);
+            potential = fromLocalSchema(child);
             return register(potential);
         }
 
+        private DataNormalizationOperation<?> fromLocalSchema(final PathArgument child) throws DataNormalizationException {
+            if (child instanceof AugmentationIdentifier) {
+                return fromSchemaAndQNameChecked(schema, ((AugmentationIdentifier) child).getPossibleChildNames()
+                        .iterator().next());
+            }
+            return fromSchemaAndQNameChecked(schema, child.getNodeType());
+        }
+
         @Override
         public DataNormalizationOperation<?> getChild(final QName child) throws DataNormalizationException {
             DataNormalizationOperation<?> potential = byQName.get(child);
             if (potential != null) {
                 return potential;
             }
-            potential = fromSchemaAndPathArgument(schema, child);
+            potential = fromLocalSchemaAndQName(schema, child);
             return register(potential);
         }
 
+        protected DataNormalizationOperation<?> fromLocalSchemaAndQName(final DataNodeContainer schema2, final QName child) throws DataNormalizationException {
+            return fromSchemaAndQNameChecked(schema2, child);
+        }
+
         private DataNormalizationOperation<?> register(final DataNormalizationOperation<?> potential) {
             if (potential != null) {
                 byArg.put(potential.getIdentifier(), potential);
@@ -398,38 +411,34 @@ public abstract class DataNormalizationOperation<T extends PathArgument> impleme
         }
     }
 
-    private static final class AugmentationNormalization extends MixinNormalizationOp<AugmentationIdentifier> {
-
-        private final Map<QName, DataNormalizationOperation<?>> byQName;
-        private final Map<PathArgument, DataNormalizationOperation<?>> byArg;
+    private static final class AugmentationNormalization extends DataContainerNormalizationOperation<AugmentationIdentifier> {
 
         public AugmentationNormalization(final AugmentationSchema augmentation, final DataNodeContainer schema) {
-            super(augmentationIdentifierFrom(augmentation));
-
-            ImmutableMap.Builder<QName, DataNormalizationOperation<?>> byQNameBuilder = ImmutableMap.builder();
-            ImmutableMap.Builder<PathArgument, DataNormalizationOperation<?>> byArgBuilder = ImmutableMap.builder();
-
-            for (DataSchemaNode augNode : augmentation.getChildNodes()) {
-                DataSchemaNode resolvedNode = schema.getDataChildByName(augNode.getQName());
-                DataNormalizationOperation<?> resolvedOp = fromDataSchemaNode(resolvedNode);
-                byArgBuilder.put(resolvedOp.getIdentifier(), resolvedOp);
-                for (QName resQName : resolvedOp.getQNameIdentifiers()) {
-                    byQNameBuilder.put(resQName, resolvedOp);
-                }
-            }
-            byQName = byQNameBuilder.build();
-            byArg = byArgBuilder.build();
-
+            //super();
+            super(augmentationIdentifierFrom(augmentation), augmentationProxy(augmentation,schema));
         }
 
         @Override
-        public DataNormalizationOperation<?> getChild(final PathArgument child) {
-            return byArg.get(child);
+        public boolean isMixin() {
+            return true;
         }
 
+
+
         @Override
-        public DataNormalizationOperation<?> getChild(final QName child) {
-            return byQName.get(child);
+        protected DataNormalizationOperation<?> fromLocalSchemaAndQName(final DataNodeContainer schema, final QName child)
+                throws DataNormalizationException {
+            Optional<DataSchemaNode> potential = findChildSchemaNode(schema, child);
+            if (!potential.isPresent()) {
+                return null;
+            }
+
+            DataSchemaNode result = potential.get();
+            // We try to look up if this node was added by augmentation
+            if ((schema instanceof DataSchemaNode) && result.isAugmenting()) {
+                return fromAugmentation(schema, (AugmentationTarget) schema, result);
+            }
+            return fromDataSchemaNode(result);
         }
 
         @Override
@@ -591,23 +600,30 @@ public abstract class DataNormalizationOperation<T extends PathArgument> impleme
         }
     }
 
-    private static DataNormalizationOperation<?> fromSchemaAndPathArgument(final DataNodeContainer schema,
-            final QName child) throws DataNormalizationException {
-        DataSchemaNode potential = schema.getDataChildByName(child);
+    private static final Optional<DataSchemaNode> findChildSchemaNode(final DataNodeContainer parent,final QName child) {
+        DataSchemaNode potential = parent.getDataChildByName(child);
         if (potential == null) {
             Iterable<org.opendaylight.yangtools.yang.model.api.ChoiceNode> choices = FluentIterable.from(
-                    schema.getChildNodes()).filter(org.opendaylight.yangtools.yang.model.api.ChoiceNode.class);
+                    parent.getChildNodes()).filter(org.opendaylight.yangtools.yang.model.api.ChoiceNode.class);
             potential = findChoice(choices, child);
         }
+        return Optional.fromNullable(potential);
+    }
 
-        if (potential == null) {
+    private static DataNormalizationOperation<?> fromSchemaAndQNameChecked(final DataNodeContainer schema,
+            final QName child) throws DataNormalizationException {
+
+        Optional<DataSchemaNode> potential = findChildSchemaNode(schema, child);
+        if (!potential.isPresent()) {
             throw new DataNormalizationException(String.format("Supplied QName %s is not valid according to schema %s, potential children nodes: %s", child, schema,schema.getChildNodes()));
         }
 
-        if ((schema instanceof DataSchemaNode) && !((DataSchemaNode) schema).isAugmenting() && potential.isAugmenting()) {
-            return fromAugmentation(schema, (AugmentationTarget) schema, potential);
+        DataSchemaNode result = potential.get();
+        // We try to look up if this node was added by augmentation
+        if ((schema instanceof DataSchemaNode) && result.isAugmenting()) {
+            return fromAugmentation(schema, (AugmentationTarget) schema, result);
         }
-        return fromDataSchemaNode(potential);
+        return fromDataSchemaNode(result);
     }
 
     private static org.opendaylight.yangtools.yang.model.api.ChoiceNode findChoice(
@@ -615,7 +631,7 @@ public abstract class DataNormalizationOperation<T extends PathArgument> impleme
         org.opendaylight.yangtools.yang.model.api.ChoiceNode foundChoice = null;
         choiceLoop: for (org.opendaylight.yangtools.yang.model.api.ChoiceNode choice : choices) {
             for (ChoiceCaseNode caze : choice.getCases()) {
-                if (caze.getDataChildByName(child) != null) {
+                if (findChildSchemaNode(caze, child).isPresent()) {
                     foundChoice = choice;
                     break choiceLoop;
                 }
@@ -632,30 +648,44 @@ public abstract class DataNormalizationOperation<T extends PathArgument> impleme
         return new AugmentationIdentifier(null, potentialChildren.build());
     }
 
-    private static AugmentationNormalization fromAugmentation(final DataNodeContainer schema,
-            final AugmentationTarget augments, final DataSchemaNode potential) {
+    private static DataNodeContainer augmentationProxy(final AugmentationSchema augmentation, final DataNodeContainer schema) {
+        Set<DataSchemaNode> children = new HashSet<>();
+        for (DataSchemaNode augNode : augmentation.getChildNodes()) {
+            children.add(schema.getDataChildByName(augNode.getQName()));
+        }
+        return new DataSchemaContainerProxy(children);
+    }
+
+    /**
+     * Returns a DataNormalizationOperation for provided child node
+     *
+     * If supplied child is added by Augmentation this operation returns
+     * a DataNormalizationOperation for augmentation,
+     * otherwise returns a DataNormalizationOperation for child as
+     * call for {@link #fromDataSchemaNode(DataSchemaNode)}.
+     *
+     *
+     * @param parent
+     * @param parentAug
+     * @param child
+     * @return
+     */
+    private static DataNormalizationOperation<?> fromAugmentation(final DataNodeContainer parent,
+            final AugmentationTarget parentAug, final DataSchemaNode child) {
         AugmentationSchema augmentation = null;
-        for (AugmentationSchema aug : augments.getAvailableAugmentations()) {
-            DataSchemaNode child = aug.getDataChildByName(potential.getQName());
-            if (child != null) {
+        for (AugmentationSchema aug : parentAug.getAvailableAugmentations()) {
+            DataSchemaNode potential = aug.getDataChildByName(child.getQName());
+            if (potential != null) {
                 augmentation = aug;
                 break;
             }
 
         }
         if (augmentation != null) {
-            return new AugmentationNormalization(augmentation, schema);
+            return new AugmentationNormalization(augmentation, parent);
         } else {
-            return null;
-        }
-    }
-
-    private static DataNormalizationOperation<?> fromSchema(final DataNodeContainer schema, final PathArgument child) throws DataNormalizationException {
-        if (child instanceof AugmentationIdentifier) {
-            return fromSchemaAndPathArgument(schema, ((AugmentationIdentifier) child).getPossibleChildNames()
-                    .iterator().next());
+            return fromDataSchemaNode(child);
         }
-        return fromSchemaAndPathArgument(schema, child.getNodeType());
     }
 
     public static DataNormalizationOperation<?> fromDataSchemaNode(final DataSchemaNode potential) {
diff --git a/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataSchemaContainerProxy.java b/opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/compat/DataSchemaContainerProxy.java
new file mode 100644 (file)
index 0000000..d243c88
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014 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.md.sal.common.impl.util.compat;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.UsesNode;
+
+class DataSchemaContainerProxy implements DataNodeContainer {
+
+    private final Set<DataSchemaNode> realChildSchemas;
+    private final Map<QName, DataSchemaNode> mappedChildSchemas;
+
+    public DataSchemaContainerProxy(final Set<DataSchemaNode> realChildSchema) {
+        realChildSchemas = realChildSchema;
+        mappedChildSchemas = new HashMap<QName, DataSchemaNode>();
+        for(DataSchemaNode schema : realChildSchemas) {
+            mappedChildSchemas.put(schema.getQName(),schema);
+        }
+    }
+
+    @Override
+    public DataSchemaNode getDataChildByName(final QName name) {
+        return mappedChildSchemas.get(name);
+    }
+
+    @Override
+    public Set<DataSchemaNode> getChildNodes() {
+        return realChildSchemas;
+    }
+
+    @Override
+    public DataSchemaNode getDataChildByName(final String arg0) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Set<GroupingDefinition> getGroupings() {
+        return Collections.emptySet();
+    }
+
+    @Override
+    public Set<TypeDefinition<?>> getTypeDefinitions() {
+        return Collections.emptySet();
+    }
+
+    @Override
+    public Set<UsesNode> getUses() {
+        return Collections.emptySet();
+    }
+
+}