Merge "Dynamically update DatastoreContext properties"
authorMoiz Raja <moraja@cisco.com>
Wed, 4 Mar 2015 18:47:25 +0000 (18:47 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 4 Mar 2015 18:47:25 +0000 (18:47 +0000)
331 files changed:
features/flow/pom.xml [deleted file]
features/flow/src/main/resources/features.xml [deleted file]
features/mdsal/pom.xml
features/pom.xml
karaf/opendaylight-karaf-empty/pom.xml
opendaylight/adsal/features/adsal-compatibility/pom.xml [deleted file]
opendaylight/adsal/features/adsal-compatibility/src/main/resources/features.xml [deleted file]
opendaylight/adsal/northbound/swagger-ui/pom.xml
opendaylight/adsal/pom.xml
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml
opendaylight/md-sal/compatibility/pom.xml [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/pom.xml [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/AbstractDataChangeListener.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/DataPacketAdapter.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryMapping.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryNotificationProvider.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDSalNodeConnectorFactory.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDSalNodeFactory.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NCDataChangeListener.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeConnectorDataChangeListener.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ProtocolConstants.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/DataPacketServiceAdapter.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowServiceAdapter.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowStatisticsAdapter.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyAdapter.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyCommitHandler.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyMapping.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyProvider.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/FromSalConversionsUtilsTest.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/MDFlowMappingTest.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/NodeMappingTest.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/ToSalConversionsUtilsTest.java [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/pom.xml [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/FRMActivator.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/FlowNodeReconciliation.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/ForwardingRulesCommiter.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/ForwardingRulesManager.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/AbstractListeningCommiter.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowForwarder.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowNodeReconciliationImpl.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/ForwardingRulesManagerImpl.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/GroupForwarder.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/MeterForwarder.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/FlowListenerTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/GroupListenerTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/MeterListenerTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/NodeListenerTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/AbstractDataBrokerTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/AbstractSchemaAwareTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/MockSchemaService.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/RpcProviderRegistryMock.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalFlowServiceMock.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalGroupServiceMock.java [deleted file]
opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalMeterServiceMock.java [deleted file]
opendaylight/md-sal/inventory-manager/pom.xml [deleted file]
opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.java [deleted file]
opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryActivator.java [deleted file]
opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryMapping.java [deleted file]
opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryOperation.java [deleted file]
opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/NodeChangeCommiter.java [deleted file]
opendaylight/md-sal/model/model-flow-base/pom.xml [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/flow/types/port/rev130925/PortNumberBuilder.java [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-action-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-flow-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-group-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-match-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-queue-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-table-types.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/pom.xml [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-capable-transaction.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-errors.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-topology-discovery.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/node-config.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/node-errors.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/packet-processing.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-flow.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-group.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-meter.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-port.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-queue.yang [deleted file]
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang [deleted file]
opendaylight/md-sal/model/model-flow-statistics/pom.xml [deleted file]
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang [deleted file]
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang [deleted file]
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang [deleted file]
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang [deleted file]
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang [deleted file]
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang [deleted file]
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-statistics-types.yang [deleted file]
opendaylight/md-sal/model/pom.xml
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyJournalEntries.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyLogEntries.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/FollowerInitialSyncUpStatus.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MockAkkaJournal.java
opendaylight/md-sal/sal-binding-broker/pom.xml
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/compat/MultipleAugmentationPutsTest.java
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/NotificationTest.java
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/05-clustering.xml.conf
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/OperationCallback.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionRateLimitingCallback.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionRateLimitingCommitCallbackTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMNotificationRouter.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceSalProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/NormalizedNodeJsonBodyWriter.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfCompositeWrapper.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/StatisticsRestconfServiceWrapper.java
opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/iana-if-type.yang [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-inet-types.yang [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-interfaces@2013-07-04.yang [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf@2013-10-19.yang [new file with mode: 0644]
opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-yang-types.yang [new file with mode: 0644]
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-provider/pom.xml
opendaylight/md-sal/statistics-manager-config/pom.xml [deleted file]
opendaylight/md-sal/statistics-manager-config/src/main/resources/initial/30-statistics-manager.xml [deleted file]
opendaylight/md-sal/statistics-manager/pom.xml [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/config/yang/md/sal/statistics_manager/StatisticsManagerModule.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/config/yang/md/sal/statistics_manager/StatisticsManagerModuleFactory.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatListeningCommiter.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatNodeRegistration.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatNotifyCommiter.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatPermCollector.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatRpcMsgManager.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsManager.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractListenCommit.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractNotifyCommit.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitFlow.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitGroup.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitMeter.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitQueue.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNodeRegistrationImpl.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNotifyCommitPort.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNotifyCommitTable.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatPermCollectorImpl.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRPCFailedException.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRpcMsgManagerImpl.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatisticsManagerConfig.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatisticsManagerImpl.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/helper/FlowComparator.java [deleted file]
opendaylight/md-sal/statistics-manager/src/main/yang/statistics-manager.yang [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/org/opendaylight/controller/md/statistics/manager/impl/helper/StatisticsUpdateCommiterTest.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/NodeRegistrationTest.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/StatCollectorTest.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/AbstractDataBrokerTest.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/AbstractSchemaAwareTest.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/BundleContextMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/FlowMockGenerator.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/GroupMockGenerator.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MatchMockGenerator.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MeterMockGenerator.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MockSchemaService.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/NotificationProviderServiceHelper.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightFlowStatisticsServiceMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightFlowTableStatisticsServiceMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightGroupStatisticsServiceMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightMeterStatisticsServiceMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightPortStatisticsServiceMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightQueueStatisticsServiceMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/PortMockGenerator.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/QueueMockGenerator.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/RpcProviderRegistryMock.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/StatisticsManagerTest.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/TestUtils.java [deleted file]
opendaylight/md-sal/statistics-manager/src/test/resources/log4j-test.xml [deleted file]
opendaylight/md-sal/topology-lldp-discovery/pom.xml [deleted file]
opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPActivator.java [deleted file]
opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPDiscoveryListener.java [deleted file]
opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPDiscoveryProvider.java [deleted file]
opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPLinkAger.java [deleted file]
opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/utils/LLDPDiscoveryUtils.java [deleted file]
opendaylight/md-sal/topology-manager/pom.xml [deleted file]
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java [deleted file]
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java [deleted file]
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java [deleted file]
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/OperationProcessor.java [deleted file]
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/TopologyOperation.java [deleted file]
opendaylight/md-sal/topology-manager/src/test/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporterTest.java [deleted file]
opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/writer/impl/CliOutputFromNormalizedNodeSerializerFactory.java
opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/writer/impl/MapEntryNodeCliSerializer.java
opendaylight/networkconfiguration/neutron/features/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/features/src/main/resources/features.xml [deleted file]
opendaylight/networkconfiguration/neutron/implementation/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/Activator.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallPolicyInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallRuleInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFloatingIPInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerHealthMonitorInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerListenerInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolMemberInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronNetworkInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronRouterInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityGroupInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityRuleInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSubnetInterface.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/enunciate.xml [deleted file]
opendaylight/networkconfiguration/neutron/northbound/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/BadRequestException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/INeutronRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/InternalServerErrorException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRuleRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRulesNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMemberRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMembersNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworkRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPageLink.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRouterRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRuleRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRulesNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronUtil.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/PaginatedRequestFactory.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceConflictException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceNotFoundException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/RestMessages.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ServiceUnavailableException.java [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml [deleted file]
opendaylight/networkconfiguration/neutron/northbound/src/main/resources/org/opendaylight/controller/networkconfig/neutron/northbound/jaxb.properties [deleted file]
opendaylight/networkconfiguration/neutron/pom.xml [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberRequest.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronObject.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetAware.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetCRUD.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronCRUDInterfaces.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewall.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallPolicy.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallRule.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFloatingIP.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancer.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerHealthMonitor.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerListener.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPool.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPoolMember.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronNetwork.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_Interface.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_NetworkReference.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityGroup.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityRule.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_HostRoute.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java [deleted file]
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/Neutron_IPs.java [deleted file]
pom.xml

diff --git a/features/flow/pom.xml b/features/flow/pom.xml
deleted file mode 100644 (file)
index ad513e5..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-    <relativePath>../../opendaylight/md-sal</relativePath>
-  </parent>
-  <artifactId>features-flow</artifactId>
-
-  <packaging>jar</packaging>
-
-  <properties>
-    <features.file>features.xml</features.file>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>features-mdsal</artifactId>
-      <version>${mdsal.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-
-  <dependency>
-      <groupId>org.opendaylight.controller.md</groupId>
-      <artifactId>statistics-manager-config</artifactId>
-      <version>${mdsal.version}</version>
-      <type>xml</type>
-      <classifier>config</classifier>
-  </dependency>
-
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-base</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-statistics</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-topology</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.md</groupId>
-      <artifactId>topology-manager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.md</groupId>
-      <artifactId>topology-lldp-discovery</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.md</groupId>
-      <artifactId>statistics-manager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.md</groupId>
-      <artifactId>inventory-manager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.md</groupId>
-      <artifactId>forwardingrules-manager</artifactId>
-    </dependency>
-    <!-- test to validate features.xml -->
-    <dependency>
-      <groupId>org.opendaylight.odlparent</groupId>
-      <artifactId>features-test</artifactId>
-    </dependency>
-  </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>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <systemPropertyVariables>
-            <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
-            <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
-            <karaf.distro.version>${commons.opendaylight.version}</karaf.distro.version>
-          </systemPropertyVariables>
-          <dependenciesToScan>
-           <dependency>org.opendaylight.odlparent:features-test</dependency>
-          </dependenciesToScan>
-        </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:MD-SAL</url>
-  </scm>
-</project>
diff --git a/features/flow/src/main/resources/features.xml b/features/flow/src/main/resources/features.xml
deleted file mode 100644 (file)
index cf54e8b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<features name="odl-flow-${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">
-    <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
-    <feature name='odl-flow-model' version='${project.version}' description="OpenDaylight :: Flow :: Model">
-        <feature version='${yangtools.version}'>odl-yangtools-models</feature>
-        <bundle>mvn:org.opendaylight.controller.model/model-flow-base/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.model/model-flow-service/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.model/model-flow-statistics/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.model/model-inventory/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.model/model-topology/${project.version}</bundle>
-    </feature>
-    <feature name='odl-flow-services' version='${project.version}' description="OpenDaylight :: Flow :: Services">
-        <feature version='${project.version}'>odl-mdsal-broker</feature>
-        <feature version='${project.version}'>odl-flow-model</feature>
-        <bundle>mvn:org.opendaylight.controller.md/topology-manager/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.md/topology-lldp-discovery/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.md/statistics-manager/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.md/inventory-manager/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller.md/forwardingrules-manager/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.controller/liblldp/${sal.version}</bundle>
-        <configfile finalname="${config.configfile.directory}/${config.statistics.manager.configfile}">mvn:org.opendaylight.controller.md/statistics-manager-config/${mdsal.version}/xml/config</configfile>
-    </feature>
-
-</features>
index 35edb286ab49a003389b9e2cf93b10d3123af674..5b5c1b94e09f78cada5baf183648ee30054fa0ab 100644 (file)
       <type>xml</type>
       <classifier>config</classifier>
     </dependency>
-
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-clustering-config</artifactId>
+      <version>${mdsal.version}</version>
+      <type>cfg</type>
+      <classifier>datastore</classifier>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-distributed-datastore</artifactId>
index 9363d9e03be18c1e7af7a889e9902e9fc905e312..5aa9edc6696545402bc588b3ffd516a4a38b488d 100644 (file)
@@ -15,7 +15,6 @@
     <module>config-persister</module>
     <module>config-netty</module>
     <module>mdsal</module>
-    <module>flow</module>
     <module>netconf</module>
     <module>protocol-framework</module>
     <module>akka</module>
index aa772096cd958307341bbff1e652224adec0aa6f..ae3a03f328692ab88ce33eb4907a7ee1bf3e5c34 100644 (file)
 <?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>
+    <artifactId>karaf-parent</artifactId>
     <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../opendaylight/commons/opendaylight</relativePath>
+    <relativePath/>
   </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.controller</groupId>
   <artifactId>opendaylight-karaf-empty</artifactId>
-  <packaging>pom</packaging>
-
+  <version>1.5.0-SNAPSHOT</version>
+  <name>${project.artifactId}</name>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
   <dependencies>
     <dependency>
       <!-- scope is compile so all features (there is only one) are installed
-            into startup.properties and the feature repo itself is not installed -->
+      into startup.properties and the feature repo itself is not installed -->
       <groupId>org.apache.karaf.features</groupId>
       <artifactId>framework</artifactId>
-      <version>${karaf.version}</version>
       <type>kar</type>
     </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 -->
-    <dependency>
-      <groupId>org.apache.karaf.features</groupId>
-      <artifactId>standard</artifactId>
-      <version>${karaf.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-      <scope>runtime</scope>
-    </dependency>
-
-    <!-- ODL Branding -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>karaf.branding</artifactId>
-      <scope>compile</scope>
-    </dependency>
-
-    <!-- Resources needed -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>opendaylight-karaf-resources</artifactId>
-      <version>${project.version}</version>
-    </dependency>
   </dependencies>
-
-  <build>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.eclipse.m2e</groupId>
-          <artifactId>lifecycle-mapping</artifactId>
-          <version>1.0.0</version>
-          <configuration>
-            <lifecycleMappingMetadata>
-              <pluginExecutions>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.felix</groupId>
-                    <artifactId>maven-bundle-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>cleanVersions</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-dependency-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>copy</goal>
-                      <goal>unpack</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.karaf.tooling</groupId>
-                    <artifactId>karaf-maven-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>commands-generate-help</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.fusesource.scalate</groupId>
-                    <artifactId>maven-scalate-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>sitegen</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-                <pluginExecution>
-                  <pluginExecutionFilter>
-                    <groupId>org.apache.servicemix.tooling</groupId>
-                    <artifactId>depends-maven-plugin</artifactId>
-                    <versionRange>[0,)</versionRange>
-                    <goals>
-                      <goal>generate-depends-file</goal>
-                    </goals>
-                  </pluginExecutionFilter>
-                  <action>
-                    <ignore></ignore>
-                  </action>
-                </pluginExecution>
-              </pluginExecutions>
-            </lifecycleMappingMetadata>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.karaf.tooling</groupId>
-        <artifactId>karaf-maven-plugin</artifactId>
-        <version>${karaf.version}</version>
-        <extensions>true</extensions>
-        <executions>
-          <execution>
-            <id>process-resources</id>
-            <goals>
-              <goal>install-kars</goal>
-            </goals>
-            <phase>process-resources</phase>
-          </execution>
-          <execution>
-            <id>package</id>
-            <goals>
-              <goal>instance-create-archive</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-        <configuration>
-          <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/</excludes>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <version>2.6</version>
-        <executions>
-          <execution>
-            <id>copy</id>
-            <goals>
-              <goal>copy</goal>
-            </goals>
-            <!-- here the phase you need -->
-            <phase>generate-resources</phase>
-            <configuration>
-              <artifactItems>
-                <artifactItem>
-                  <groupId>org.opendaylight.controller</groupId>
-                  <artifactId>karaf.branding</artifactId>
-                  <version>${karaf.branding.version}</version>
-                  <outputDirectory>target/assembly/lib</outputDirectory>
-                  <destFileName>karaf.branding-${branding.version}.jar</destFileName>
-                </artifactItem>
-              </artifactItems>
-            </configuration>
-          </execution>
-          <execution>
-            <id>unpack-karaf-resources</id>
-            <goals>
-              <goal>unpack-dependencies</goal>
-            </goals>
-            <phase>prepare-package</phase>
-            <configuration>
-             <outputDirectory>${project.build.directory}/assembly</outputDirectory>
-             <groupId>org.opendaylight.controller</groupId>
-             <includeArtifactIds>opendaylight-karaf-resources</includeArtifactIds>
-             <excludes>META-INF\/**</excludes>
-             <excludeTransitive>true</excludeTransitive>
-             <ignorePermissions>false</ignorePermissions>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <executions>
-            <execution>
-                <phase>prepare-package</phase>
-                <goals>
-                    <goal>run</goal>
-                </goals>
-                <configuration>
-                  <tasks>
-                    <chmod perm="755">
-                        <fileset dir="${project.build.directory}/assembly/bin">
-                          <include name="karaf"/>
-                          <include name="instance"/>
-                        </fileset>
-                    </chmod>
-                  </tasks>
-                </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>
diff --git a/opendaylight/adsal/features/adsal-compatibility/pom.xml b/opendaylight/adsal/features/adsal-compatibility/pom.xml
deleted file mode 100644 (file)
index d8d1888..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
- Necessary TODO: Put your copyright here.\r
-\r
- This program and the accompanying materials are made available under the\r
- terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- and is available at http://www.eclipse.org/legal/epl-v10.html\r
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-   <modelVersion>4.0.0</modelVersion>\r
-   <parent>\r
-     <groupId>org.opendaylight.controller</groupId>\r
-     <artifactId>commons.opendaylight</artifactId>\r
-     <version>1.5.0-SNAPSHOT</version>\r
-     <relativePath>../../../../opendaylight/commons/opendaylight</relativePath>\r
-   </parent>\r
-   <artifactId>features-adsal-compatibility</artifactId>\r
-   <packaging>jar</packaging>\r
-   <properties>\r
-      <features.file>features.xml</features.file>\r
-      <feature.test.version>0.7.0-SNAPSHOT</feature.test.version>\r
-   </properties>\r
-   <dependencies>\r
-    <!--\r
-      Necessary TODO: Put dependencies on any feature repos\r
-      you use in your features.xml file.\r
-\r
-      Note: they will need to be <type>xml</xml>\r
-      and <classifier>features</classifier>.\r
-      One other thing to watch for is to make sure they are\r
-      <scope>compile</compile>, which they should be by default,\r
-      but be cautious lest they be at a different scope in a parent pom.\r
-\r
-      Examples:\r
-        <dependency>\r
-          <groupId>org.opendaylight.yangtools</groupId>\r
-          <artifactId>features-yangtools</artifactId>\r
-          <version>0.7.0-SNAPSHOT</version>\r
-          <classifier>features</classifier>\r
-          <type>xml</type>\r
-        </dependency>\r
-        <dependency>\r
-          <groupId>org.opendaylight.controller</groupId>\r
-          <artifactId>features-mdsal</artifactId>\r
-          <version>1.2.0-SNAPSHOT</version>\r
-          <classifier>features</classifier>\r
-          <type>xml</type>\r
-        </dependency>\r
-        <dependency>\r
-          <groupId>org.opendaylight.openflowplugin</groupId>\r
-          <artifactId>features-openflowplugin</artifactId>\r
-          <version>0.1.0-SNAPSHOT</version>\r
-          <classifier>features</classifier>\r
-          <type>xml</type>\r
-        </dependency>\r
-    -->\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>features-mdsal</artifactId>\r
-        <version>${mdsal.version}</version>\r
-        <classifier>features</classifier>\r
-        <type>xml</type>\r
-      </dependency>\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>features-flow</artifactId>\r
-        <version>${mdsal.version}</version>\r
-        <classifier>features</classifier>\r
-        <type>xml</type>\r
-      </dependency>\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>features-adsal</artifactId>\r
-        <version>${sal.version}</version>\r
-        <classifier>features</classifier>\r
-        <type>xml</type>\r
-      </dependency>\r
-\r
-    <!--\r
-      Necessary TODO: Put dependencies for bundles directly referenced\r
-      in your features.xml file.  For every <bundle> reference in your\r
-      features.xml file, you need a corresponding dependency here.\r
-\r
-      Examples:\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>controller-provider</artifactId>\r
-        <version>${project.version}</version>\r
-      </dependency>\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>controller-model</artifactId>\r
-        <version>${project.version}</version>\r
-      </dependency>\r
-    -->\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>sal-compatibility</artifactId>\r
-        <version>${mdsal.version}</version>\r
-      </dependency>\r
-\r
-    <!--\r
-      Necessary TODO: Put dependencies for configfiles directly referenced\r
-      in your features.xml file.  For every <configfile> reference in your\r
-      features.xml file, you need a corresponding dependency here.\r
-\r
-      Example (presuming here version is coming from the parent pom):\r
-      <dependency>\r
-        <groupId>org.opendaylight.controller</groupId>\r
-        <artifactId>controller-config</artifactId>\r
-        <version>${project.version}</version>\r
-        <type>xml</type>\r
-        <classifier>config</classifier>\r
-      </dependency>\r
-    -->\r
-\r
-    <!--\r
-      Optional TODO: Remove TODO comments.\r
-    -->\r
-    <!-- test to validate features.xml -->\r
-    <dependency>\r
-      <groupId>org.opendaylight.yangtools</groupId>\r
-      <artifactId>features-test</artifactId>\r
-      <version>${feature.test.version}</version>\r
-      <scope>test</scope>\r
-    </dependency>\r
-    <!-- dependency for opendaylight-karaf-empty for use by testing -->\r
-    <dependency>\r
-      <groupId>org.opendaylight.controller</groupId>\r
-      <artifactId>opendaylight-karaf-empty</artifactId>\r
-      <version>${commons.opendaylight.version}</version>\r
-      <type>zip</type>\r
-    </dependency>\r
-    <!-- Uncomment this if you get an error : java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;\r
-    <dependency>\r
-      <groupId>org.slf4j</groupId>\r
-      <artifactId>slf4j-simple</artifactId>\r
-      <version>1.7.2</version>\r
-    </dependency>\r
-    -->\r
-\r
-   </dependencies>\r
-   <build>\r
-      <resources>\r
-         <resource>\r
-            <directory>src/main/resources</directory>\r
-            <filtering>true</filtering>\r
-         </resource>\r
-      </resources>\r
-      <plugins>\r
-         <plugin>\r
-            <groupId>org.apache.maven.plugins</groupId>\r
-            <artifactId>maven-resources-plugin</artifactId>\r
-            <executions>\r
-               <execution>\r
-                  <id>filter</id>\r
-                  <phase>generate-resources</phase>\r
-                  <goals>\r
-                     <goal>resources</goal>\r
-                  </goals>\r
-               </execution>\r
-            </executions>\r
-         </plugin>\r
-         <plugin>\r
-            <groupId>org.codehaus.mojo</groupId>\r
-            <artifactId>build-helper-maven-plugin</artifactId>\r
-            <executions>\r
-               <execution>\r
-                  <id>attach-artifacts</id>\r
-                  <phase>package</phase>\r
-                  <goals>\r
-                     <goal>attach-artifact</goal>\r
-                  </goals>\r
-                  <configuration>\r
-                     <artifacts>\r
-                        <artifact>\r
-                           <file>${project.build.directory}/classes/${features.file}</file>\r
-                           <type>xml</type>\r
-                           <classifier>features</classifier>\r
-                        </artifact>\r
-                     </artifacts>\r
-                  </configuration>\r
-               </execution>\r
-            </executions>\r
-         </plugin>\r
-         <plugin>\r
-            <groupId>org.apache.maven.plugins</groupId>\r
-            <artifactId>maven-surefire-plugin</artifactId>\r
-            <version>${surefire.version}</version>\r
-            <configuration>\r
-              <systemPropertyVariables>\r
-                <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>\r
-                <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>\r
-                <karaf.distro.version>${commons.opendaylight.version}</karaf.distro.version>\r
-              </systemPropertyVariables>\r
-              <dependenciesToScan>\r
-               <dependency>org.opendaylight.yangtools:features-test</dependency>\r
-              </dependenciesToScan>\r
-            </configuration>\r
-          </plugin>\r
-      </plugins>\r
-   </build>\r
-   <scm>\r
-      <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
-      <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
-      <tag>HEAD</tag>\r
-      <url>https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=summary</url>\r
-   </scm>\r
-</project>\r
diff --git a/opendaylight/adsal/features/adsal-compatibility/src/main/resources/features.xml b/opendaylight/adsal/features/adsal-compatibility/src/main/resources/features.xml
deleted file mode 100644 (file)
index de939f2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
- Necessary TODO: Put your copyright statement here
-
- 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
--->
-<features name="odl-adsal-compatibility-${sal.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">
-    <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
-    <repository>mvn:org.opendaylight.controller/features-adsal/${sal.version}/xml/features</repository>
-    <repository>mvn:org.opendaylight.controller/features-flow/${mdsal.version}/xml/features</repository>
-    <feature name='odl-adsal-compatibility-all' version='${project.version}' description='OpenDaylight :: controller :: All'>
-        <feature version='${sal.version}'>odl-adsal-compatibility</feature>
-    </feature>
-    <feature name='odl-adsal-compatibility' description="OpenDaylight :: AD-SAL :: Compatibility" version="${sal.version}">
-      <feature version="${mdsal.version}">odl-mdsal-broker</feature>
-      <feature version="${mdsal.version}">odl-flow-model</feature>
-      <feature version="${sal.version}">odl-adsal-all</feature>
-      <bundle>mvn:org.opendaylight.controller/sal-compatibility/${mdsal.version}</bundle>
-   </feature>
-</features>
index ba1e5c0bc4eaae907511ac2a045dcdb2def50044..8c1c8a1bdde865d266c4691e45923ed1b7cfac1c 100644 (file)
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>usermanager.northbound</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron.northbound</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
                   </fileset>
                   <mapper>
                     <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*Northbound).*$$" to="\3"></regexpmapper>
-                    <regexpmapper from="^(.*)/neutron/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*resource-list.json)$$" to="neutron-\3"></regexpmapper>
                     <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*resource-list.json)$$" to="\2-\3"></regexpmapper>
                   </mapper>
                 </copy>
                   <path>
                     <fileset dir="${api.dir}">
                       <include name="**/*resource-list.json"></include>
-                      <exclude name="**/neutron*"></exclude>
                     </fileset>
                   </path>
                   <sequential>
                     <var name="jsoncontent" unset="true"></var>
                   </sequential>
                 </for>
-                <sequential>
-                  <loadfile property="jsoncontent" srcfile="${api.dir}/neutron-resource-list.json">
-                    <filterchain>
-                      <headfilter lines="46"></headfilter>
-                      <tailfilter lines="42"></tailfilter>
-                    </filterchain>
-                  </loadfile>
-                  <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
-                  <var name="jsoncontent" unset="true"></var>
-                </sequential>
                 <echo append="true" file="${resource.dir}/apilist.json">{ }
   ]
 }</echo>
index 682d2a0729d04db6e5d0721c117d8ef192137834..6d77732f6a720b0bb34d9e0222ee1f88c3545c45 100644 (file)
     <module>features/adsal</module>
     <module>features/nsf</module>
     <module>features/extras</module>
-    <module>features/adsal-compatibility</module>
   </modules>
   <profiles>
     <profile>
index 616704ada025601d9c0b069e6de3448bcea78bdf..6dfd614a295e275917cccc90bf53b50075f32bc3 100644 (file)
@@ -6,6 +6,13 @@ terms of the Eclipse Public License v1.0 which accompanies this distribution,
 and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <parent>
+    <groupId>org.opendaylight.odlparent</groupId>
+    <artifactId>odlparent</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+  </parent>
+
   <groupId>${groupId}</groupId>
   <artifactId>${artifactId}-aggregator</artifactId>
   <version>${version}</version>
diff --git a/opendaylight/md-sal/compatibility/pom.xml b/opendaylight/md-sal/compatibility/pom.xml
deleted file mode 100644 (file)
index a7da4a1..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>compatibility-parent</artifactId>
-  <packaging>pom</packaging>
-  <name>MD-SAL to AD-SAL Adaptation Parent</name>
-
-  <modules>
-    <module>sal-compatibility</module>
-  </modules>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-common-util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-Name>${project.name}</Bundle-Name>
-            <Bundle-Activator>org.opendaylight.controller.sal.compability.ComponentActivator</Bundle-Activator>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-        <configuration>
-          <includes>
-            <include>org.opendaylight.controller.*</include>
-          </includes>
-        </configuration>
-        <executions>
-          <execution>
-            <id>pre-test</id>
-            <goals>
-              <goal>prepare-agent</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>post-test</id>
-            <goals>
-              <goal>report</goal>
-            </goals>
-            <phase>test</phase>
-          </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/compatibility/sal-compatibility/pom.xml b/opendaylight/md-sal/compatibility/sal-compatibility/pom.xml
deleted file mode 100644 (file)
index 32014de..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?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>compatibility-parent</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>sal-compatibility</artifactId>
-  <packaging>bundle</packaging>
-  <name>MD-SAL to AD-SAL Adaptation</name>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-statistics</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-topology</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-Name>${project.name}</Bundle-Name>
-            <Bundle-Activator>org.opendaylight.controller.sal.compatibility.ComponentActivator</Bundle-Activator>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-        <configuration>
-          <includes>
-            <include>org.opendaylight.controller.*</include>
-          </includes>
-        </configuration>
-        <executions>
-          <execution>
-            <id>pre-test</id>
-            <goals>
-              <goal>prepare-agent</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>post-test</id>
-            <goals>
-              <goal>report</goal>
-            </goals>
-            <phase>test</phase>
-          </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/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/AbstractDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/AbstractDataChangeListener.java
deleted file mode 100644 (file)
index 2306508..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * 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 java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-public abstract class AbstractDataChangeListener <T extends DataObject> implements AutoCloseable,DataChangeListener{
-
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractDataChangeListener.class);
-    protected InventoryAndReadAdapter adapter;
-    protected final Class<T> clazz;
-    protected ListenerRegistration<DataChangeListener> listenerRegistration;
-
-    public AbstractDataChangeListener(final InventoryAndReadAdapter adapter, DataBroker db, final Class<T> clazz) {
-        this.adapter = Preconditions.checkNotNull(adapter, "InventoryAndReadAdapter can not be null!");
-        this.clazz = Preconditions.checkNotNull(clazz, "Class can not be null!");
-        Preconditions.checkNotNull(db, "DataBroker can not be null!");
-        registrationListener(db, 5);
-    }
-
-    @Override
-    public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changeEvent) {
-        Preconditions.checkNotNull(changeEvent,"Async ChangeEvent can not be null!");
-        /* All DataObjects for create */
-        final Map<InstanceIdentifier<?>, DataObject> createdData = changeEvent.getCreatedData() != null
-                ? changeEvent.getCreatedData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        /* All DataObjects for remove */
-        final Set<InstanceIdentifier<?>> removeData = changeEvent.getRemovedPaths() != null
-                ? changeEvent.getRemovedPaths() : Collections.<InstanceIdentifier<?>> emptySet();
-        /* All DataObjects for updates */
-        final Map<InstanceIdentifier<?>, DataObject> updateData = changeEvent.getUpdatedData() != null
-                ? changeEvent.getUpdatedData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        /* All Original DataObjects */
-        final Map<InstanceIdentifier<?>, DataObject> originalData = changeEvent.getOriginalData() != null
-                ? changeEvent.getOriginalData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        this.createData(createdData);
-        this.updateData(updateData, originalData);
-        this.removeData(removeData, originalData);
-    }
-
-    @SuppressWarnings("unchecked")
-    private void createData(final Map<InstanceIdentifier<?>, DataObject> createdData) {
-        final Set<InstanceIdentifier<?>> keys = createdData.keySet() != null
-                ? createdData.keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-        for (InstanceIdentifier<?> key : keys) {
-            if (clazz.equals(key.getTargetType())) {
-                InstanceIdentifier<T> createKeyIdent = key.firstIdentifierOf(clazz);
-                final Optional<DataObject> value = Optional.of(createdData.get(key));
-                if (value.isPresent()) {
-                    this.add(createKeyIdent, (T)value.get());
-                }
-            }
-        }
-    }
-
-    abstract protected void add(InstanceIdentifier<T> createKeyIdent, T node);
-
-    @SuppressWarnings("unchecked")
-    private void updateData(final Map<InstanceIdentifier<?>, DataObject> updateData, final Map<InstanceIdentifier<?>, DataObject> originalData) {
-
-        final Set<InstanceIdentifier<?>> keys = updateData.keySet() != null
-                ? updateData.keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-        for (InstanceIdentifier<?> key : keys) {
-            if (clazz.equals(key.getTargetType())) {
-                InstanceIdentifier<T> updateKeyIdent = key.firstIdentifierOf(clazz);
-                final Optional<DataObject> value = Optional.of(updateData.get(key));
-                final Optional<DataObject> original = Optional.of(originalData.get(key));
-                if (value.isPresent() && original.isPresent()) {
-                    this.update(updateKeyIdent, (T)original.get(), (T)value.get());
-                }
-            }
-        }
-    }
-
-    abstract protected void update(InstanceIdentifier<T> updateKeyIdent, T node,
-            T node2);
-
-    @SuppressWarnings("unchecked")
-    private void removeData(final Set<InstanceIdentifier<?>> removeData, final Map<InstanceIdentifier<?>, DataObject> originalData) {
-
-        for (InstanceIdentifier<?> key : removeData) {
-            if (clazz.equals(key.getTargetType())) {
-                final InstanceIdentifier<T> ident = key.firstIdentifierOf(clazz);
-                final DataObject removeValue = originalData.get(key);
-                this.remove(ident, (T)removeValue);
-            }
-        }
-    }
-
-    abstract protected void remove(InstanceIdentifier<T> ident, T removeValue);
-
-    protected void registrationListener(final DataBroker db, int i) {
-        try {
-            listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                    getWildCardPath(), this, DataChangeScope.BASE);
-        } catch (final Exception e) {
-            if (i >= 1) {
-                try {
-                    Thread.sleep(100);
-                } catch (InterruptedException e1) {
-                    LOG.error("Thread interrupted '{}'", e1);
-                    Thread.currentThread().interrupt();
-                }
-                registrationListener(db, --i);
-            } else {
-                LOG.error("AbstractDataChangeListener registration fail!", e);
-                throw new IllegalStateException("AbstractDataChangeListener registration Listener fail! System needs restart.", e);
-            }
-        }
-    }
-
-    protected abstract InstanceIdentifier<?> getWildCardPath();
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (final Exception e) {
-                LOG.error("Error by stop AbstractDataChangeListener.", e);
-            }
-            listenerRegistration = null;
-        }
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ComponentActivator.java
deleted file mode 100644 (file)
index 6a8e3c0..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * 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.Preconditions;
-import org.apache.felix.dm.Component;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.compatibility.adsal.DataPacketServiceAdapter;
-import org.opendaylight.controller.sal.compatibility.topology.TopologyAdapter;
-import org.opendaylight.controller.sal.compatibility.topology.TopologyProvider;
-import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.discovery.IDiscoveryService;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginOutFlowProgrammerService;
-import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.controller.sal.packet.IPluginInDataPacketService;
-import org.opendaylight.controller.sal.packet.IPluginOutDataPacketService;
-import org.opendaylight.controller.sal.reader.IPluginInReadService;
-import org.opendaylight.controller.sal.reader.IPluginOutReadService;
-import org.opendaylight.controller.sal.topology.IPluginInTopologyService;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.controller.sal.utils.GlobalConstants;
-import org.opendaylight.controller.sal.utils.INodeConnectorFactory;
-import org.opendaylight.controller.sal.utils.INodeFactory;
-import org.osgi.framework.BundleContext;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-public class ComponentActivator extends ComponentActivatorAbstractBase {
-    private final INodeConnectorFactory nodeConnectorFactory = new MDSalNodeConnectorFactory();
-    private final DataPacketServiceAdapter dataPacketService = new DataPacketServiceAdapter();
-    private final InventoryAndReadAdapter inventory = new InventoryAndReadAdapter();
-    private final FlowProgrammerAdapter flow = new FlowProgrammerAdapter();
-    private final DataPacketAdapter dataPacket = new DataPacketAdapter();
-    private final TopologyProvider tpProvider = new TopologyProvider();
-    private final INodeFactory nodeFactory = new MDSalNodeFactory();
-    private final TopologyAdapter topology = new TopologyAdapter();
-    private BundleContext context;
-
-    public INodeConnectorFactory getNodeConnectorFactory() {
-        return nodeConnectorFactory;
-    }
-
-    public DataPacketServiceAdapter getDataPacketService() {
-        return dataPacketService;
-    }
-
-    public InventoryAndReadAdapter getInventory() {
-        return inventory;
-    }
-
-    public FlowProgrammerAdapter getFlow() {
-        return flow;
-    }
-
-    public DataPacketAdapter getDataPacket() {
-        return dataPacket;
-    }
-
-    public TopologyProvider getTpProvider() {
-        return tpProvider;
-    }
-
-    public INodeFactory getNodeFactory() {
-        return nodeFactory;
-    }
-
-    public TopologyAdapter getTopology() {
-        return topology;
-    }
-
-    @Override
-    protected void init() {
-        // TODO: deprecated, should be removed soon
-        NodeIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class);
-        NodeConnectorIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class, NodeMapping.MD_SAL_TYPE);
-    }
-
-    @Override
-    public void start(final BundleContext context) {
-        this.context = Preconditions.checkNotNull(context);
-        super.start(context);
-    }
-
-    public ProviderContext setBroker(final BindingAwareBroker broker) {
-        return broker.registerProvider(new SalCompatibilityProvider(this), context);
-    }
-
-    @Override
-    protected Object[] getGlobalImplementations() {
-        return new Object[] {
-                this, // Used for setBroker callback
-                flow,
-                inventory,
-                dataPacket,
-                nodeFactory,
-                nodeConnectorFactory,
-                topology,
-                tpProvider
-        };
-    }
-
-    @Override
-    protected void configureGlobalInstance(final Component c, final Object imp) {
-        if (imp instanceof DataPacketAdapter) {
-            _configure((DataPacketAdapter)imp, c);
-        } else if (imp instanceof FlowProgrammerAdapter) {
-            _configure((FlowProgrammerAdapter)imp, c);
-        } else if (imp instanceof InventoryAndReadAdapter) {
-            _configure((InventoryAndReadAdapter)imp, c);
-        } else if (imp instanceof ComponentActivator) {
-            _configure((ComponentActivator)imp, c);
-        } else if (imp instanceof MDSalNodeConnectorFactory) {
-            _configure((MDSalNodeConnectorFactory)imp, c);
-        } else if (imp instanceof MDSalNodeFactory) {
-            _configure((MDSalNodeFactory)imp, c);
-        } else if (imp instanceof TopologyAdapter) {
-            _configure((TopologyAdapter)imp, c);
-        } else if (imp instanceof TopologyProvider) {
-            _configure((TopologyProvider)imp, c);
-        } else {
-            throw new IllegalArgumentException(String.format("Unhandled implementation class %s", imp.getClass()));
-        }
-    }
-
-    @Override
-    protected Object[] getImplementations() {
-        return new Object[] {
-                dataPacketService,
-                inventory,
-        };
-    }
-
-    @Override
-    protected void configureInstance(final Component c, final Object imp, final String containerName) {
-        if (imp instanceof ComponentActivator) {
-            _instanceConfigure((ComponentActivator)imp, c, containerName);
-        } else if (imp instanceof DataPacketServiceAdapter) {
-            _instanceConfigure((DataPacketServiceAdapter)imp, c, containerName);
-        } else if (imp instanceof InventoryAndReadAdapter) {
-            _instanceConfigure((InventoryAndReadAdapter)imp, c, containerName);
-        } else {
-            throw new IllegalArgumentException(String.format("Unhandled implementation class %s", imp.getClass()));
-        }
-    }
-
-    private void _configure(final MDSalNodeFactory imp, final Component it) {
-        it.setInterface(INodeFactory.class.getName(), properties());
-    }
-
-    private void _configure(final MDSalNodeConnectorFactory imp, final Component it) {
-        it.setInterface(INodeConnectorFactory.class.getName(), properties());
-    }
-
-    private void _configure(final ComponentActivator imp, final Component it) {
-        it.add(createServiceDependency()
-                .setService(BindingAwareBroker.class)
-                .setCallbacks("setBroker", "setBroker")
-                .setRequired(true));
-    }
-
-    private void _configure(final DataPacketAdapter imp, final Component it) {
-        it.add(createServiceDependency()
-                .setService(IPluginOutDataPacketService.class)
-                .setCallbacks("setDataPacketPublisher", "setDataPacketPublisher")
-                .setRequired(false));
-    }
-
-    private void _configure(final FlowProgrammerAdapter imp, final Component it) {
-        it.setInterface(IPluginInFlowProgrammerService.class.getName(), properties());
-        it.add(createServiceDependency()
-                .setService(IPluginOutFlowProgrammerService.class)
-                .setCallbacks("setFlowProgrammerPublisher", "setFlowProgrammerPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IClusterGlobalServices.class)
-                .setCallbacks("setClusterGlobalServices", "unsetClusterGlobalServices")
-                .setRequired(false));
-    }
-
-    private void _instanceConfigure(final DataPacketServiceAdapter imp, final Component it, final String containerName) {
-        it.setInterface(IPluginInDataPacketService.class.getName(), properties());
-    }
-
-    private void _instanceConfigure(final ComponentActivator imp, final Component it, final String containerName) {
-        // No-op
-    }
-
-    private void _configure(final InventoryAndReadAdapter imp, final Component it) {
-        it.setInterface(new String[] {
-                IPluginInInventoryService.class.getName(),
-                IPluginInReadService.class.getName(),
-        }, properties());
-
-        it.add(createServiceDependency()
-                .setService(IPluginOutReadService.class)
-                .setCallbacks("setReadPublisher", "unsetReadPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IPluginOutInventoryService.class)
-                .setCallbacks("setInventoryPublisher", "unsetInventoryPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IDiscoveryService.class)
-                .setCallbacks("setDiscoveryPublisher", "setDiscoveryPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(BindingAwareBroker.class)
-                .setRequired(true));
-    }
-
-    private void _instanceConfigure(final InventoryAndReadAdapter imp, final Component it, String containerName) {
-        it.setInterface(new String[] {
-                IPluginInInventoryService.class.getName(),
-                IPluginInReadService.class.getName(),
-        }, properties());
-
-        it.add(createServiceDependency()
-                .setService(IPluginOutReadService.class)
-                .setCallbacks("setReadPublisher", "unsetReadPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(IPluginOutInventoryService.class)
-                .setCallbacks("setInventoryPublisher", "unsetInventoryPublisher")
-                .setRequired(false));
-        it.add(createServiceDependency()
-                .setService(BindingAwareBroker.class)
-                .setRequired(true));
-    }
-
-    private void _configure(final TopologyAdapter imp, final Component it) {
-        it.setInterface(IPluginInTopologyService.class.getName(), properties());
-
-        it.add(createServiceDependency()
-                .setService(IPluginOutTopologyService.class)
-                .setCallbacks("setTopologyPublisher", "setTopologyPublisher")
-                .setRequired(false));
-    }
-
-    private void _configure(final TopologyProvider imp, final Component it) {
-        it.add(createServiceDependency()
-                .setService(IPluginOutTopologyService.class)
-                .setCallbacks("setTopologyPublisher", "setTopologyPublisher")
-                .setRequired(false));
-    }
-
-    private Dictionary<String,Object> properties() {
-        final Hashtable<String,Object> props = new Hashtable<String, Object>();
-        props.put(GlobalConstants.PROTOCOLPLUGINTYPE.toString(), NodeIDType.OPENFLOW);
-        props.put("protocolName", NodeIDType.OPENFLOW);
-        return props;
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/DataPacketAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/DataPacketAdapter.java
deleted file mode 100644 (file)
index 4d26a3a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.packet.IPluginOutDataPacketService;
-import org.opendaylight.controller.sal.packet.RawPacket;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class DataPacketAdapter implements PacketProcessingListener {
-    private static final Logger LOG = LoggerFactory.getLogger(DataPacketAdapter.class);
-
-    // These are injected via Apache DM (see ComponentActivator)
-    private IPluginOutDataPacketService dataPacketPublisher;
-
-    @Override
-    public void onPacketReceived(final PacketReceived packet) {
-        try {
-            RawPacket inPacket = toRawPacket(packet);
-            if (dataPacketPublisher != null) {
-                dataPacketPublisher.receiveDataPacket(inPacket);
-            } else {
-                LOG.warn("IPluginOutDataPacketService is not available. Not forwarding packet to AD-SAL.");
-            }
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct raw packet from {}, dropping it", packet, e);
-        }
-    }
-
-    public static RawPacket toRawPacket(final PacketReceived received) throws ConstructionException {
-        final RawPacket ret = new RawPacket(received.getPayload());
-        ret.setIncomingNodeConnector(NodeMapping.toADNodeConnector(received.getIngress()));
-        return ret;
-    }
-
-    public IPluginOutDataPacketService getDataPacketPublisher() {
-        return dataPacketPublisher;
-    }
-
-    // These are injected via Apache DM (see ComponentActivator)
-    public void setDataPacketPublisher(final IPluginOutDataPacketService dataPacketPublisher) {
-        this.dataPacketPublisher = dataPacketPublisher;
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.java
deleted file mode 100644 (file)
index acb54ba..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-/**
- * 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 java.util.EnumSet;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-import org.opendaylight.controller.clustering.services.CacheConfigException;
-import org.opendaylight.controller.clustering.services.CacheExistException;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.clustering.services.IClusterServices.cacheMode;
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
-import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginInFlowProgrammerService;
-import org.opendaylight.controller.sal.flowprogrammer.IPluginOutFlowProgrammerService;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.controller.sal.utils.StatusCode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-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.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowListener {
-    private final static Logger LOG = LoggerFactory.getLogger(FlowProgrammerAdapter.class);
-
-    // Note: clustering services manipulate this
-    private final Map<Flow, UUID> flowToFlowId = new ConcurrentHashMap<Flow, UUID>();
-    private final static String CACHE_NAME = "flowprogrammeradapter.flowtoid";
-
-    // These are injected via Apache DM (see ComponentActivator)
-    private IPluginOutFlowProgrammerService flowProgrammerPublisher;
-    private IClusterGlobalServices clusterGlobalServices;
-    private DataBrokerService dataBrokerService;
-    private SalFlowService delegate;
-
-    public SalFlowService getDelegate() {
-        return this.delegate;
-    }
-
-    public void setDelegate(final SalFlowService delegate) {
-        this.delegate = delegate;
-    }
-
-    public DataBrokerService getDataBrokerService() {
-        return this.dataBrokerService;
-    }
-
-    public void setDataBrokerService(final DataBrokerService dataBrokerService) {
-        this.dataBrokerService = dataBrokerService;
-    }
-
-    public IPluginOutFlowProgrammerService getFlowProgrammerPublisher() {
-        return this.flowProgrammerPublisher;
-    }
-
-    public void setFlowProgrammerPublisher(final IPluginOutFlowProgrammerService flowProgrammerPublisher) {
-        this.flowProgrammerPublisher = flowProgrammerPublisher;
-    }
-
-    public IClusterGlobalServices getClusterGlobalServices() {
-        return this.clusterGlobalServices;
-    }
-
-    public void setClusterGlobalServices(final IClusterGlobalServices clusterGlobalServices) {
-        this.clusterGlobalServices = clusterGlobalServices;
-    }
-
-    @Override
-    public Status addFlow(final Node node, final Flow flow) {
-        return toFutureStatus(internalAddFlowAsync(node, flow, 0));
-    }
-
-    @Override
-    public Status modifyFlow(final Node node, final Flow oldFlow, final Flow newFlow) {
-        return toFutureStatus(internalModifyFlowAsync(node, oldFlow, newFlow, 0));
-    }
-
-    @Override
-    public Status removeFlow(final Node node, final Flow flow) {
-        return toFutureStatus(internalRemoveFlowAsync(node, flow, 0));
-    }
-
-    @Override
-    public Status addFlowAsync(final Node node, final Flow flow, final long rid) {
-        // FIXME is this correct? What if the future fails?
-        this.internalAddFlowAsync(node, flow, rid);
-        return FlowProgrammerAdapter.toStatus(true);
-    }
-
-    @Override
-    public Status modifyFlowAsync(final Node node, final Flow oldFlow, final Flow newFlow, final long rid) {
-        // FIXME is this correct? What if the future fails?
-        this.internalModifyFlowAsync(node, oldFlow, newFlow, rid);
-        return FlowProgrammerAdapter.toStatus(true);
-    }
-
-    @Override
-    public Status removeFlowAsync(final Node node, final Flow flow, final long rid) {
-        // FIXME is this correct? What if the future fails?
-        this.internalRemoveFlowAsync(node, flow, rid);
-        return FlowProgrammerAdapter.toStatus(true);
-    }
-
-    @Override
-    public Status removeAllFlows(final Node node) {
-        // FIXME: unfinished?
-        return new Status(StatusCode.SUCCESS);
-    }
-
-    @Override
-    public Status syncSendBarrierMessage(final Node node) {
-        // FIXME: unfinished?
-        return null;
-    }
-
-    @Override
-    public Status asyncSendBarrierMessage(final Node node) {
-        // FIXME: unfinished?
-        return null;
-    }
-
-    private static Status toStatus(final boolean successful) {
-        return new Status(successful ? StatusCode.SUCCESS : StatusCode.INTERNALERROR);
-    }
-
-    public static Status toStatus(final RpcResult<? extends Object> result) {
-        return toStatus(result.isSuccessful());
-    }
-
-    @Override
-    public void onFlowAdded(final FlowAdded notification) {
-        // FIXME: unfinished?
-    }
-
-    @Override
-    public void onFlowRemoved(final FlowRemoved notification) {
-        // notified upon remove flow rpc successfully invoked
-        if (notification == null) {
-            return;
-        }
-
-        final NodeRef node = notification.getNode();
-        if (node == null) {
-            LOG.debug("Notification {} has not node, ignoring it", notification);
-            return;
-        }
-
-        Node adNode;
-        try {
-            adNode = NodeMapping.toADNode(notification.getNode());
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct AD node for {}, ignoring notification", node, e);
-            return;
-        }
-        flowProgrammerPublisher.flowRemoved(adNode, ToSalConversionsUtils.toFlow(notification, adNode));
-    }
-
-    @Override
-    public void onFlowUpdated(final FlowUpdated notification) {
-        // FIXME: unfinished?
-    }
-
-    @Override
-    public void onSwitchFlowRemoved(final SwitchFlowRemoved notification) {
-        // notified upon remove flow message from device arrives
-        if (notification == null) {
-            return;
-        }
-
-        final NodeRef node = notification.getNode();
-        if (node == null) {
-            LOG.debug("Notification {} has not node, ignoring it", notification);
-            return;
-        }
-
-        Node adNode;
-        try {
-            adNode = NodeMapping.toADNode(notification.getNode());
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct AD node for {}, ignoring notification", node, e);
-            return;
-        }
-        flowProgrammerPublisher.flowRemoved(adNode, ToSalConversionsUtils.toFlow(notification, adNode));
-    }
-
-    @Override
-    public void onNodeErrorNotification(final NodeErrorNotification notification) {
-        // FIXME: unfinished?
-    }
-
-    @Override
-    public void onNodeExperimenterErrorNotification(final NodeExperimenterErrorNotification notification) {
-        // FIXME: unfinished?
-    }
-
-    private static final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> flowPath(
-            final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, final NodeKey nodeKey) {
-        return InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey)
-                .augmentation(FlowCapableNode.class)
-                .child(Table.class, new TableKey(flow.getTableId()))
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.class, new FlowKey(flow.getId()))
-                .toInstance();
-    }
-
-    private Future<RpcResult<TransactionStatus>> writeFlowAsync(final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, final NodeKey nodeKey) {
-        final DataModificationTransaction modification = this.dataBrokerService.beginTransaction();
-        modification.putConfigurationData(flowPath(flow, nodeKey), flow);
-        return modification.commit();
-    }
-
-    private Future<RpcResult<TransactionStatus>> internalAddFlowAsync(final Node node, final Flow flow, final long rid) {
-        final Map<Flow,UUID> cache = this.getCache();
-        UUID flowId = cache.get(flow);
-        if (flowId != null) {
-            this.removeFlow(node, flow);
-        }
-
-        flowId = UUID.randomUUID();
-        cache.put(flow, flowId);
-        return this.writeFlowAsync(MDFlowMapping.toMDFlow(flow, flowId.toString()), new NodeKey(
-                new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID())));
-    }
-
-    private Future<RpcResult<TransactionStatus>> internalModifyFlowAsync(final Node node, final Flow oldFlow, final Flow newFlow, final long rid) {
-        final Map<Flow,UUID> cache = this.getCache();
-
-        UUID flowId = cache.remove(oldFlow);
-        if (flowId == null) {
-            flowId = UUID.randomUUID();
-            cache.put(oldFlow, flowId);
-            LOG.warn("Could not find flow {} in cache, assigned new ID {}", oldFlow.hashCode(), flowId);
-        }
-
-        cache.put(newFlow, flowId);
-        return this.writeFlowAsync(MDFlowMapping.toMDFlow(newFlow, flowId.toString()), new NodeKey(
-                new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID())));
-    }
-
-    private Future<RpcResult<TransactionStatus>> internalRemoveFlowAsync(final Node node, final Flow adflow, final long rid) {
-        final Map<Flow,UUID> cache = this.getCache();
-
-        final UUID flowId = cache.remove(adflow);
-        if (flowId == null) {
-            LOG.warn("Could not find flow {} in cache, nothing to do", adflow.hashCode());
-            return null;
-        }
-
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow = MDFlowMapping.toMDFlow(adflow, flowId.toString());
-        final DataModificationTransaction modification = this.dataBrokerService.beginTransaction();
-        modification.removeConfigurationData(flowPath(flow, new NodeKey(
-                new NodeId(NodeMapping.OPENFLOW_ID_PREFIX + node.getID()))));
-        return modification.commit();
-    }
-
-    private static Status toFutureStatus(final Future<RpcResult<TransactionStatus>> future) {
-        if (future == null) {
-            // FIXME: really?
-            return FlowProgrammerAdapter.toStatus(true);
-        }
-
-        try {
-            final RpcResult<TransactionStatus> result = future.get();
-            return FlowProgrammerAdapter.toStatus(result);
-        } catch (final InterruptedException e) {
-            FlowProgrammerAdapter.LOG.error("Interrupted while processing flow", e);
-        } catch (ExecutionException e) {
-            FlowProgrammerAdapter.LOG.error("Failed to process flow", e);
-        }
-
-        return new Status(StatusCode.INTERNALERROR);
-    }
-
-    @SuppressWarnings("unchecked")
-    private Map<Flow,UUID> getCache() {
-        final IClusterGlobalServices cgs = getClusterGlobalServices();
-        if (cgs == null) {
-            return new ConcurrentHashMap<Flow, UUID>();
-        }
-
-        Map<Flow, UUID> cache = (Map<Flow, UUID>) cgs.getCache(FlowProgrammerAdapter.CACHE_NAME);
-        if (cache != null) {
-            return cache;
-        }
-
-        try {
-            return (Map<Flow, UUID>) cgs.createCache(CACHE_NAME, EnumSet.of(cacheMode.TRANSACTIONAL));
-        } catch (CacheExistException e) {
-            return (Map<Flow, UUID>) cgs.getCache(CACHE_NAME);
-        } catch (CacheConfigException e) {
-            throw new IllegalStateException("Unexpected cache configuration problem", e);
-        }
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java
deleted file mode 100644 (file)
index 8468c2d..0000000
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * 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 static org.opendaylight.controller.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.UDP;
-import static org.opendaylight.controller.sal.match.MatchType.DL_DST;
-import static org.opendaylight.controller.sal.match.MatchType.DL_SRC;
-import static org.opendaylight.controller.sal.match.MatchType.DL_TYPE;
-
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.match.Match;
-import org.opendaylight.controller.sal.match.MatchField;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.controller.sal.utils.NetUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
-
-import com.google.common.net.InetAddresses;
-
-/**
- * MD-SAL to AD-SAL conversions collection
- */
-public final class FromSalConversionsUtils {
-
-    /** http://en.wikipedia.org/wiki/IPv4#Packet_structure (end of octet number 1, bit 14.+15.) */
-    public static final int ENC_FIELD_BIT_SIZE = 2;
-
-    private FromSalConversionsUtils() {
-        throw new IllegalAccessError("forcing no instance for factory");
-    }
-
-    @SuppressWarnings("unused")
-    private static Address addressFromAction(InetAddress inetAddress) {
-        String strInetAddresss = InetAddresses.toAddrString(inetAddress);
-        if (inetAddress instanceof Inet4Address) {
-            Ipv4Builder ipv4Builder = new Ipv4Builder();
-            ipv4Builder.setIpv4Address(new Ipv4Prefix(strInetAddresss));
-            return ipv4Builder.build();
-        } else if (inetAddress instanceof Inet6Address) {
-            Ipv6Builder ipv6Builder = new Ipv6Builder();
-            ipv6Builder.setIpv6Address(new Ipv6Prefix(strInetAddresss));
-            return ipv6Builder.build();
-        }
-        return null;
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match toMatch(
-            Match sourceMatch) {
-        if (sourceMatch != null) {
-            MatchBuilder targetBuilder = new MatchBuilder();
-
-            targetBuilder.setEthernetMatch(ethernetMatch(sourceMatch));
-            targetBuilder.setIpMatch(ipMatch(sourceMatch));
-            targetBuilder.setVlanMatch(vlanMatch(sourceMatch));
-            targetBuilder.setLayer3Match(layer3Match(sourceMatch));
-            targetBuilder.setLayer4Match(layer4Match(sourceMatch));
-            targetBuilder.setInPort(inPortMatch(sourceMatch));
-
-            return targetBuilder.build();
-        }
-        return null;
-
-    }
-
-    private static NodeConnectorId inPortMatch(Match sourceMatch) {
-        MatchField inPort = sourceMatch.getField(MatchType.IN_PORT);
-        if(inPort != null && inPort.getValue() != null && (inPort.getValue() instanceof NodeConnector)) {
-            NodeConnector port = (NodeConnector)inPort.getValue();
-            return (NodeConnectorId)MDFlowMapping.toUri(port);
-        }
-        return null;
-    }
-
-    private static Layer4Match layer4Match(final Match sourceMatch) {
-        MatchField nwProto = sourceMatch.getField(MatchType.NW_PROTO);
-        Short nwProtocolSource = null;
-        if (nwProto != null && nwProto.getValue() != null) {
-            nwProtocolSource = (short) ((byte) nwProto.getValue());
-            switch (nwProtocolSource) {
-            case TCP:
-                return Layer4MatchAsTcp(sourceMatch);
-            case UDP:
-                return Layer4MatchAsUdp(sourceMatch);
-            case CRUDP:
-                return Layer4MatchAsSctp(sourceMatch);
-            }
-        }
-        return null;
-    }
-
-    private static Layer4Match Layer4MatchAsSctp(final Match sourceMatch) {
-        SctpMatchBuilder sctpMatchBuilder = new SctpMatchBuilder();
-
-        Integer sourcePort = transportPort(sourceMatch, MatchType.TP_SRC);
-        Integer destinationPort = transportPort(sourceMatch,
-                MatchType.TP_DST);
-
-        if (sourcePort != null) {
-            sctpMatchBuilder.setSctpSourcePort(new PortNumber(sourcePort));
-        }
-        if (destinationPort != null) {
-            sctpMatchBuilder.setSctpDestinationPort(new PortNumber(
-                    destinationPort));
-        }
-        if(sourcePort != null || destinationPort != null) {
-            return sctpMatchBuilder.build();
-        }
-        return null;
-    }
-
-    private static Layer4Match Layer4MatchAsUdp(final Match sourceMatch) {
-        UdpMatchBuilder udpMatchBuilder = new UdpMatchBuilder();
-
-        Integer sourcePort = transportPort(sourceMatch, MatchType.TP_SRC);
-        Integer destinationPort = transportPort(sourceMatch,
-                MatchType.TP_DST);
-
-        if (sourcePort != null) {
-            udpMatchBuilder.setUdpSourcePort(new PortNumber(sourcePort));
-        }
-
-        if (destinationPort != null) {
-            udpMatchBuilder.setUdpDestinationPort(new PortNumber(
-                    destinationPort));
-        }
-        if(sourcePort != null || destinationPort != null) {
-            return udpMatchBuilder.build();
-        }
-        return null;
-    }
-
-    private static Layer4Match Layer4MatchAsTcp(final Match sourceMatch) {
-        TcpMatchBuilder tcpMatchBuilder = new TcpMatchBuilder();
-
-        Integer sourcePort = transportPort(sourceMatch, MatchType.TP_SRC);
-        Integer destinationPort = transportPort(sourceMatch,
-                MatchType.TP_DST);
-
-        if (sourcePort != null) {
-            tcpMatchBuilder.setTcpSourcePort(new PortNumber(sourcePort));
-        }
-        if (destinationPort != null) {
-            tcpMatchBuilder.setTcpDestinationPort(new PortNumber(
-                    destinationPort));
-        }
-        if(sourcePort != null || destinationPort != null) {
-            return tcpMatchBuilder.build();
-        }
-        return null;
-    }
-
-    private static Integer transportPort(final Match sourceMatch,
-            final MatchType matchType) {
-        MatchField transportPort = sourceMatch.getField(matchType);
-        if (transportPort != null && transportPort.getValue() != null
-                && transportPort.getValue().getClass().equals(Short.class)) {
-            return new Integer(NetUtils.getUnsignedShort((short) transportPort
-                    .getValue()));
-        }
-        return null;
-    }
-
-    private static VlanMatch vlanMatch(final Match sourceMatch) {
-        VlanMatchBuilder vlanMatchBuild = new VlanMatchBuilder();
-
-        MatchField vlan = sourceMatch.getField(MatchType.DL_VLAN);
-        if (vlan != null && vlan.getValue() != null) {
-            VlanIdBuilder vlanIDBuilder = new VlanIdBuilder();
-            short vid = (short)vlan.getValue();
-            boolean present = (vid != MatchType.DL_VLAN_NONE);
-            vlanIDBuilder.setVlanId(new VlanId((NetUtils
-                    .getUnsignedShort(vid))));
-            vlanIDBuilder.setVlanIdPresent(present);
-            vlanMatchBuild.setVlanId(vlanIDBuilder.build());
-        }
-
-        MatchField vlanPriority = sourceMatch.getField(MatchType.DL_VLAN_PR);
-        if (vlanPriority != null && vlanPriority.getValue() != null) {
-            vlanMatchBuild.setVlanPcp(new VlanPcp((short) ((byte) vlanPriority
-                    .getValue())));
-        }
-        if((vlan != null && vlan.getValue() != null) || (vlanPriority != null && vlanPriority.getValue() != null)) {
-            return vlanMatchBuild.build();
-        }
-        return null;
-    }
-
-    private static IpMatch ipMatch(final Match sourceMatch) {
-        IpMatchBuilder targetIpMatchBuild = new IpMatchBuilder();
-        MatchField networkTos = sourceMatch.getField(MatchType.NW_TOS);
-        if (networkTos != null && networkTos.getValue() != null) {
-            Dscp dscp = new Dscp(
-                    (short) (NetUtils.getUnsignedByte((Byte) networkTos
-                            .getValue())));
-            targetIpMatchBuild.setIpDscp(dscp);
-        }
-
-        MatchField protocol = sourceMatch.getField(MatchType.NW_PROTO);
-        if (protocol != null && protocol.getValue() != null) {
-            targetIpMatchBuild.setIpProtocol((short) ((byte) protocol
-                    .getValue()));
-        }
-        if((networkTos != null && networkTos.getValue() != null) || (protocol != null && protocol.getValue() != null)) {
-            return targetIpMatchBuild.build();
-        }
-        return null;
-    }
-
-    private static EthernetMatch ethernetMatch(final Match sourceMatch) {
-        final EthernetMatchBuilder targetEthMatchBuild = new EthernetMatchBuilder();
-        if(sourceMatch.getField(DL_SRC) != null && sourceMatch.getField(DL_SRC).getValue() != null) {
-            EthernetSourceBuilder ethSourBuild = new EthernetSourceBuilder()
-                    .setAddress(ethernetSourceAddress(sourceMatch));
-            targetEthMatchBuild.setEthernetSource(ethSourBuild.build());
-        }
-        if(sourceMatch.getField(DL_DST) != null && sourceMatch.getField(DL_DST).getValue() != null) {
-            EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder()
-                    .setAddress(ethernetDestAddress(sourceMatch));
-            targetEthMatchBuild.setEthernetDestination(ethDestBuild.build());
-        }
-
-        final MatchField dataLinkType = sourceMatch.getField(MatchType.DL_TYPE);
-        if (dataLinkType != null && dataLinkType.getValue() != null) {
-            EtherType etherType = new EtherType(new Long(
-                    NetUtils.getUnsignedShort((Short) dataLinkType.getValue())));
-            EthernetTypeBuilder ethType = new EthernetTypeBuilder()
-                    .setType(etherType);
-            targetEthMatchBuild.setEthernetType(ethType.build());
-        }
-        if((sourceMatch.getField(DL_SRC) != null && sourceMatch.getField(DL_SRC).getValue() != null) ||
-                (sourceMatch.getField(DL_DST) != null && sourceMatch.getField(DL_DST).getValue() != null)||
-                dataLinkType != null ) {
-            return targetEthMatchBuild.build();
-        }
-        return null;
-    }
-
-    private static MacAddress ethernetSourceAddress(final Match sourceMatch) {
-        final MatchField dataLinkSource = sourceMatch.getField(DL_SRC);
-        if (dataLinkSource != null && dataLinkSource.getValue() != null) {
-            return MDFlowMapping.toMacAddress((byte[])dataLinkSource.getValue());
-        }
-        return null;
-
-    }
-
-    private static Layer3Match layer3Match(final Match sourceMatch) {
-        InetAddress inetSourceAddress = null;
-        MatchField netSource = sourceMatch.getField(MatchType.NW_SRC);
-        if (netSource != null && netSource.getValue() != null) {
-            inetSourceAddress = (InetAddress) (netSource.getValue());
-        }
-
-        InetAddress inetDestAddress = null;
-        MatchField netDest = sourceMatch.getField(MatchType.NW_DST);
-        if (netDest != null && netDest.getValue() != null) {
-            inetDestAddress = (InetAddress) (netDest.getValue());
-        }
-
-        if ((inetSourceAddress instanceof Inet4Address)
-                || (inetDestAddress instanceof Inet4Address)) {
-            MatchField dataLinkType = sourceMatch.getField(DL_TYPE);
-            Short dLType = null;
-            if (dataLinkType != null && dataLinkType.getValue() != null) {
-                dLType = (Short) (dataLinkType.getValue());
-            }
-            if (dLType != null && dLType.equals(ETHERNET_ARP)) {
-                return setLayer3MatchAsArp(sourceMatch,
-                        (Inet4Address) inetSourceAddress,
-                        (Inet4Address) inetDestAddress);
-            } else {
-                return setLayer3MatchAsIpv4((Inet4Address) inetSourceAddress,
-                        (Inet4Address) inetDestAddress);
-            }
-        } else if ((inetSourceAddress instanceof Inet6Address)
-                || (inetDestAddress instanceof Inet6Address)) {
-            return setLayer3MatchAsIpv6((Inet6Address) inetSourceAddress,
-                    (Inet6Address) inetDestAddress);
-        }
-
-        return null;
-
-    }
-
-    private static Layer3Match setLayer3MatchAsArp(final Match sourceMatch,
-            final Inet4Address inetSourceAddress,
-            final Inet4Address inetDestAddress) {
-        String inetSourceAddressStr = InetAddresses
-                .toAddrString(inetSourceAddress);
-        Ipv4Prefix ipv4SourcePrefix = new Ipv4Prefix(inetSourceAddressStr + "/32");
-
-        String inetDestAddressValue = InetAddresses
-                .toAddrString(inetDestAddress);
-        Ipv4Prefix ipv4DestPrefix = new Ipv4Prefix(inetDestAddressValue + "/32");
-
-        ArpMatchBuilder arpMatchBuilder = new ArpMatchBuilder();
-
-        arpMatchBuilder.setArpSourceTransportAddress(ipv4SourcePrefix);
-        arpMatchBuilder.setArpTargetTransportAddress(ipv4DestPrefix);
-
-        ArpSourceHardwareAddressBuilder arpSourceHardwareAddressBuilder = new ArpSourceHardwareAddressBuilder();
-        arpSourceHardwareAddressBuilder
-                .setAddress(ethernetSourceAddress(sourceMatch));
-        arpMatchBuilder
-                .setArpSourceHardwareAddress(arpSourceHardwareAddressBuilder
-                        .build());
-
-        ArpTargetHardwareAddressBuilder arpTargetHardwareAddressBuilder = new ArpTargetHardwareAddressBuilder();
-        arpTargetHardwareAddressBuilder
-                .setAddress(ethernetDestAddress(sourceMatch));
-        arpMatchBuilder
-                .setArpTargetHardwareAddress(arpTargetHardwareAddressBuilder
-                        .build());
-
-        return arpMatchBuilder.build();
-
-    }
-
-    private static MacAddress ethernetDestAddress(final Match sourceMatch) {
-        final MatchField dataLinkDest = sourceMatch.getField(DL_DST);
-        if (dataLinkDest != null && dataLinkDest.getValue() != null) {
-            return MDFlowMapping.toMacAddress((byte[]) dataLinkDest.getValue());
-        }
-        return null;
-    }
-
-    private static Layer3Match setLayer3MatchAsIpv4(
-            final Inet4Address inetSourceAddress,
-            final Inet4Address inetDestAddress) {
-        Ipv4MatchBuilder layer4MatchBuild = new Ipv4MatchBuilder();
-        if(inetSourceAddress != null) {
-            String inetSrcAddressString = InetAddresses
-                    .toAddrString(inetSourceAddress);
-            layer4MatchBuild.setIpv4Source(new Ipv4Prefix(inetSrcAddressString + "/32"));
-        }
-        if(inetDestAddress != null) {
-            String inetDstAddressString = InetAddresses
-                    .toAddrString(inetDestAddress);
-            layer4MatchBuild
-            .setIpv4Destination(new Ipv4Prefix(inetDstAddressString + "/32"));
-        }
-        return layer4MatchBuild.build();
-
-    }
-
-    private static Layer3Match setLayer3MatchAsIpv6(
-            final Inet6Address inetSourceAddress,
-            final Inet6Address inetDestAddress) {
-        Ipv6MatchBuilder layer6MatchBuild = new Ipv6MatchBuilder();
-        if(inetSourceAddress != null) {
-            String inetSrcAddressString = InetAddresses
-                    .toAddrString(inetSourceAddress);
-            layer6MatchBuild.setIpv6Source(new Ipv6Prefix(inetSrcAddressString + "/128"));
-        }
-        if(inetDestAddress != null) {
-            String inetDstAddressString = InetAddresses
-                    .toAddrString(inetDestAddress);
-            layer6MatchBuild
-                    .setIpv6Destination(new Ipv6Prefix(inetDstAddressString + "/128"));
-        }
-        return layer6MatchBuild.build();
-    }
-
-    public static boolean flowEquals(Flow statsFlow, Flow storedFlow) {
-        if (statsFlow.getClass() != storedFlow.getClass()) {
-            return false;
-        }
-        if (statsFlow.getBufferId()== null) {
-            if (storedFlow.getBufferId() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getBufferId().equals(storedFlow.getBufferId())) {
-            return false;
-        }
-        if (statsFlow.getContainerName()== null) {
-            if (storedFlow.getContainerName()!= null) {
-                return false;
-            }
-        } else if(!statsFlow.getContainerName().equals(storedFlow.getContainerName())) {
-            return false;
-        }
-        if (statsFlow.getCookie()== null) {
-            if (storedFlow.getCookie()!= null) {
-                return false;
-            }
-        } else if(!statsFlow.getCookie().equals(storedFlow.getCookie())) {
-            return false;
-        }
-        if (statsFlow.getMatch()== null) {
-            if (storedFlow.getMatch() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getMatch().equals(storedFlow.getMatch())) {
-            return false;
-        }
-        if (statsFlow.getCookie()== null) {
-            if (storedFlow.getCookie()!= null) {
-                return false;
-            }
-        } else if(!statsFlow.getCookie().equals(storedFlow.getCookie())) {
-            return false;
-        }
-        if (statsFlow.getHardTimeout() == null) {
-            if (storedFlow.getHardTimeout() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getHardTimeout().equals(storedFlow.getHardTimeout() )) {
-            return false;
-        }
-        if (statsFlow.getIdleTimeout()== null) {
-            if (storedFlow.getIdleTimeout() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getIdleTimeout().equals(storedFlow.getIdleTimeout())) {
-            return false;
-        }
-        if (statsFlow.getPriority() == null) {
-            if (storedFlow.getPriority() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getPriority().equals(storedFlow.getPriority())) {
-            return false;
-        }
-        if (statsFlow.getTableId() == null) {
-            if (storedFlow.getTableId() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getTableId().equals(storedFlow.getTableId())) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * @param nwDscp NW-DSCP
-     * @return shifted to NW-TOS (with empty ECN part)
-     */
-    public static int dscpToTos(int nwDscp) {
-        return (short) (nwDscp << ENC_FIELD_BIT_SIZE);
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryAndReadAdapter.java
deleted file mode 100644 (file)
index 560d8a1..0000000
+++ /dev/null
@@ -1,917 +0,0 @@
-/**
- * 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.Optional;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.collect.Iterables;
-
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
-import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Edge;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeTable;
-import org.opendaylight.controller.sal.core.NodeTable.NodeTableIDType;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.controller.sal.reader.FlowOnNode;
-import org.opendaylight.controller.sal.reader.IPluginInReadService;
-import org.opendaylight.controller.sal.reader.IPluginOutReadService;
-import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
-import org.opendaylight.controller.sal.reader.NodeDescription;
-import org.opendaylight.controller.sal.reader.NodeTableStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-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.statistics.rev130819.AggregateFlowStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.statistics.FlowTableStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.Link;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Bytes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Packets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-public class InventoryAndReadAdapter implements IPluginInReadService, IPluginInInventoryService, OpendaylightFlowStatisticsListener, OpendaylightFlowTableStatisticsListener, OpendaylightPortStatisticsListener {
-    private static final Logger LOG = LoggerFactory.getLogger(InventoryAndReadAdapter.class);
-    private static final short OPENFLOWV10_TABLE_ID = 0;
-    private static final int SLEEP_FOR_NOTIFICATIONS_MILLIS = 500;
-
-    private final InventoryNotificationProvider inventoryNotificationProvider = new InventoryNotificationProvider();
-    private final Map<PathArgument,List<PathArgument>> nodeToNodeConnectorsMap = new ConcurrentHashMap<>();
-    private List<IPluginOutInventoryService> inventoryPublisher = new CopyOnWriteArrayList<>();
-    private List<IPluginOutReadService> statisticsPublisher = new CopyOnWriteArrayList<>();
-    private Cache<String, TransactionNotificationList<? extends TransactionAware>> txCache;
-
-    private OpendaylightFlowTableStatisticsService flowTableStatisticsService;
-    private OpendaylightPortStatisticsService nodeConnectorStatisticsService;
-    private OpendaylightFlowStatisticsService flowStatisticsService;
-    private FlowTopologyDiscoveryService topologyDiscovery;
-    private DataProviderService dataProviderService;
-    private DataBrokerService dataService;
-
-    public DataBrokerService getDataService() {
-        return dataService;
-    }
-
-    public void setDataService(final DataBrokerService dataService) {
-        this.dataService = dataService;
-    }
-
-    public DataProviderService getDataProviderService() {
-        return dataProviderService;
-    }
-
-    public void setDataProviderService(final DataProviderService dataProviderService) {
-        this.dataProviderService = dataProviderService;
-    }
-
-    public OpendaylightFlowStatisticsService getFlowStatisticsService() {
-        return flowStatisticsService;
-    }
-
-    public void setFlowStatisticsService(final OpendaylightFlowStatisticsService flowStatisticsService) {
-        this.flowStatisticsService = flowStatisticsService;
-    }
-
-    public OpendaylightPortStatisticsService getNodeConnectorStatisticsService() {
-        return nodeConnectorStatisticsService;
-    }
-
-    public void setNodeConnectorStatisticsService(final OpendaylightPortStatisticsService nodeConnectorStatisticsService) {
-        this.nodeConnectorStatisticsService = nodeConnectorStatisticsService;
-    }
-
-    public OpendaylightFlowTableStatisticsService getFlowTableStatisticsService() {
-        return flowTableStatisticsService;
-    }
-
-    public void setFlowTableStatisticsService(final OpendaylightFlowTableStatisticsService flowTableStatisticsService) {
-        this.flowTableStatisticsService = flowTableStatisticsService;
-    }
-
-    public FlowTopologyDiscoveryService getTopologyDiscovery() {
-        return topologyDiscovery;
-    }
-
-    public void setTopologyDiscovery(final FlowTopologyDiscoveryService topologyDiscovery) {
-        this.topologyDiscovery = topologyDiscovery;
-    }
-
-    public List<IPluginOutReadService> getStatisticsPublisher() {
-        return statisticsPublisher;
-    }
-
-    public void setStatisticsPublisher(final List<IPluginOutReadService> statisticsPublisher) {
-        this.statisticsPublisher = statisticsPublisher;
-    }
-
-    public List<IPluginOutInventoryService> getInventoryPublisher() {
-        return inventoryPublisher;
-    }
-
-    public void setInventoryPublisher(final List<IPluginOutInventoryService> inventoryPublisher) {
-        this.inventoryPublisher = inventoryPublisher;
-    }
-
-    public void startAdapter() {
-        inventoryNotificationProvider.setDataProviderService(getDataProviderService());
-        inventoryNotificationProvider.setInventoryPublisher(getInventoryPublisher());
-        txCache = CacheBuilder.newBuilder().expireAfterWrite(60L, TimeUnit.SECONDS).maximumSize(10000).build();
-        // inventoryNotificationProvider.start();
-    }
-
-    public boolean setInventoryPublisher(final IPluginOutInventoryService listener) {
-        return getInventoryPublisher().add(listener);
-    }
-
-    public boolean unsetInventoryPublisher(final IPluginOutInventoryService listener) {
-        return getInventoryPublisher().remove(listener);
-    }
-
-    public boolean setReadPublisher(final IPluginOutReadService listener) {
-        return getStatisticsPublisher().add(listener);
-    }
-
-    public Boolean unsetReadPublisher(final IPluginOutReadService listener) {
-        if (listener != null) {
-            return getStatisticsPublisher().remove(listener);
-        }
-        return false;
-    }
-
-    protected DataModificationTransaction startChange() {
-        return getDataProviderService().beginTransaction();
-    }
-
-    @Override
-    public long getTransmitRate(final NodeConnector connector) {
-        final FlowCapableNodeConnector nodeConnector = this.readOperFlowCapableNodeConnector(NodeMapping.toNodeConnectorRef(connector));
-        return nodeConnector.getCurrentSpeed().longValue();
-    }
-
-    private FlowCapableNode readOperFlowCapableNode(final NodeRef ref) {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node =
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)getDataService().readOperationalData(ref.getValue());
-        if (node == null) {
-            return null;
-        }
-
-        return node.getAugmentation(FlowCapableNode.class);
-    }
-
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node readConfigNode(final Node node) {
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, InventoryMapping.toNodeKey(node))
-                .build();
-
-        return (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) startChange().readConfigurationData(nodeRef);
-    }
-
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector readConfigNodeConnector(final NodeConnector connector) {
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> nodeConnectorRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, InventoryMapping.toNodeKey(connector.getNode()))
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class, InventoryMapping.toNodeConnectorKey(connector))
-                .toInstance();
-
-        return((org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) startChange().readConfigurationData(nodeConnectorRef));
-    }
-
-    /**
-     * Read a table of a node from configuration data store.
-     *
-     * @param node Node id
-     * @param id Table id
-     * @return Table contents, or null if not present
-     */
-    private Table readOperationalTable(final Node node, final short id) {
-        final InstanceIdentifier<Table> tableRef = InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, NodeMapping.toNodeKey(node))
-                .augmentation(FlowCapableNode.class)
-                .child(Table.class, new TableKey(id))
-                .build();
-
-        return (Table) startChange().readOperationalData(tableRef);
-    }
-
-    @Override
-    public List<FlowOnNode> readAllFlow(final Node node, final boolean cached) {
-        final ArrayList<FlowOnNode> ret= new ArrayList<>();
-        if (cached) {
-            final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID);
-            if (table != null) {
-                final List<Flow> flows = table.getFlow();
-                LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size());
-
-                for (final Flow flow : flows) {
-                    final FlowStatisticsData statsFromDataStore = flow.getAugmentation(FlowStatisticsData.class);
-                    if (statsFromDataStore != null) {
-                        final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flow, node));
-                        ret.add(addFlowStats(it, statsFromDataStore.getFlowStatistics()));
-                    }
-                }
-            }
-        } else {
-            LOG.debug("readAllFlow cached:{}", cached);
-            GetAllFlowStatisticsFromFlowTableInput input =
-                new GetAllFlowStatisticsFromFlowTableInputBuilder()
-                    .setNode(NodeMapping.toNodeRef(node))
-                    .setTableId(new TableId(OPENFLOWV10_TABLE_ID))
-                    .build();
-
-            Future<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> future =
-                getFlowStatisticsService().getAllFlowStatisticsFromFlowTable(input);
-
-            RpcResult<GetAllFlowStatisticsFromFlowTableOutput> result = null;
-            try {
-                // having a blocking call is fine here, as we need to join
-                // the notifications and return the result
-                result = future.get();
-            } catch (Exception e) {
-               LOG.error("Exception in getAllFlowStatisticsFromFlowTable ", e);
-               return ret;
-            }
-
-            GetAllFlowStatisticsFromFlowTableOutput output = result.getResult();
-            if (output == null) {
-                return ret;
-            }
-
-            TransactionId transactionId = output.getTransactionId();
-            String cacheKey = buildCacheKey(transactionId, NodeMapping.toNodeId(node));
-            LOG.info("readAllFlow transactionId:{} cacheKey:{}", transactionId, cacheKey);
-
-            // insert an entry in tempcache, will get updated when notification is received
-            txCache.put(cacheKey, new TransactionNotificationList<FlowsStatisticsUpdate>(
-                transactionId, node.getNodeIDString()));
-
-            TransactionNotificationList<FlowsStatisticsUpdate> txnList =
-                (TransactionNotificationList<FlowsStatisticsUpdate>) txCache.getIfPresent(cacheKey);
-
-            // this loop would not be infinite as the cache will remove an entry
-            // after defined time if not written to
-            while (txnList != null && !txnList.areAllNotificationsGathered()) {
-                LOG.debug("readAllFlow waiting for notification...");
-                waitForNotification();
-                txnList = (TransactionNotificationList<FlowsStatisticsUpdate>) txCache.getIfPresent(cacheKey);
-            }
-
-            if (txnList == null) {
-                return ret;
-            }
-
-            List<FlowsStatisticsUpdate> notifications = txnList.getNotifications();
-            for (FlowsStatisticsUpdate flowsStatisticsUpdate : notifications) {
-                List<FlowAndStatisticsMapList> flowAndStatisticsMapList = flowsStatisticsUpdate.getFlowAndStatisticsMapList();
-                if (flowAndStatisticsMapList != null) {
-                    for (FlowAndStatisticsMapList flowAndStatistics : flowAndStatisticsMapList) {
-                        final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flowAndStatistics, node));
-                        ret.add(addFlowStats(it, flowAndStatistics));
-                    }
-                }
-            }
-        }
-        return ret;
-    }
-
-    private String buildCacheKey(final TransactionId id, final NodeId nodeId) {
-        return String.valueOf(id.getValue()) + "-" + nodeId.getValue();
-    }
-
-    private void waitForNotification() {
-        try {
-            // going for a simple sleep approach,as wait-notify on a monitor would require
-            // us to maintain monitors per txn-node combo
-            Thread.sleep(SLEEP_FOR_NOTIFICATIONS_MILLIS);
-            LOG.trace("statCollector is waking up from a wait stat Response sleep");
-        } catch (final InterruptedException e) {
-            LOG.warn("statCollector has been interrupted waiting stat Response sleep", e);
-        }
-    }
-
-    @Override
-    public List<NodeConnectorStatistics> readAllNodeConnector(final Node node, final boolean cached) {
-        final ArrayList<NodeConnectorStatistics> ret = new ArrayList<>();
-
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node dsNode = readConfigNode(node);
-        if (dsNode != null) {
-            for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector dsNodeConnector : dsNode.getNodeConnector()) {
-                final FlowCapableNodeConnectorStatistics stats = (dsNodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class));
-                if (stats != null) {
-                    try {
-                        ret.add(toNodeConnectorStatistics(stats.getFlowCapableNodeConnectorStatistics(), dsNode.getId(), dsNodeConnector.getId()));
-                    } catch (ConstructionException e) {
-                        LOG.warn("Failed to instantiate node connector statistics for node {} connector {}, ignoring it",
-                                dsNode.getId(), dsNodeConnector.getId(), e);
-                    }
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        getNodeConnectorStatisticsService().getAllNodeConnectorsStatistics(
-                new GetAllNodeConnectorsStatisticsInputBuilder().setNode(NodeMapping.toNodeRef(node)).build());
-        return ret;
-    }
-
-    @Override
-    public List<NodeTableStatistics> readAllNodeTable(final Node node, final boolean cached) {
-        final NodeRef nodeRef = NodeMapping.toNodeRef(node);
-
-        final ArrayList<NodeTableStatistics> ret = new ArrayList<>();
-        final FlowCapableNode dsFlowCapableNode = this.readOperFlowCapableNode(nodeRef);
-        if (dsFlowCapableNode != null) {
-            for (final Table table : dsFlowCapableNode.getTable()) {
-                final FlowTableStatisticsData tableStats = table.getAugmentation(FlowTableStatisticsData.class);
-                if (tableStats != null) {
-                    try {
-                        ret.add(toNodeTableStatistics(tableStats.getFlowTableStatistics(), table.getId(), node));
-                    } catch (ConstructionException e) {
-                        LOG.warn("Failed to instantiate table statistics for node {} table {}, ignoring it", node, table.getId(), e);
-                    }
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        getFlowTableStatisticsService().getFlowTablesStatistics(new GetFlowTablesStatisticsInputBuilder().setNode(nodeRef).build());
-        return ret;
-    }
-
-    @Override
-    public NodeDescription readDescription(final Node node, final boolean cached) {
-        return this.toNodeDescription(NodeMapping.toNodeRef(node));
-    }
-
-    @Override
-    public FlowOnNode readFlow(final Node node, final org.opendaylight.controller.sal.flowprogrammer.Flow targetFlow, final boolean cached) {
-        FlowOnNode ret = null;
-        final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID);
-        if (table != null) {
-            final List<Flow> flows = table.getFlow();
-            InventoryAndReadAdapter.LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size());
-
-            for (final Flow mdsalFlow : flows) {
-                if(FromSalConversionsUtils.flowEquals(mdsalFlow, MDFlowMapping.toMDSalflow(targetFlow))) {
-                    final FlowStatisticsData statsFromDataStore = mdsalFlow.getAugmentation(FlowStatisticsData.class);
-                    if (statsFromDataStore != null) {
-                        InventoryAndReadAdapter.LOG.debug("Found matching flow in the data store flow table ");
-                        ret = addFlowStats(new FlowOnNode(targetFlow), statsFromDataStore.getFlowStatistics());
-
-                        // FIXME: break; ?
-                    }
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        final GetFlowStatisticsFromFlowTableInputBuilder input = new GetFlowStatisticsFromFlowTableInputBuilder().setNode(NodeMapping.toNodeRef(node));
-        input.fieldsFrom(MDFlowMapping.toMDSalflow(targetFlow));
-        getFlowStatisticsService().getFlowStatisticsFromFlowTable(input.build());
-        return ret;
-    }
-
-    @Override
-    public NodeConnectorStatistics readNodeConnector(final NodeConnector connector, final boolean cached) {
-        final NodeConnectorId ncId = InventoryMapping.toNodeConnectorKey(connector).getId();
-
-        NodeConnectorStatistics ret = null;
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nodeConnectorFromDS = readConfigNodeConnector(connector);
-        if (nodeConnectorFromDS != null) {
-            final FlowCapableNodeConnectorStatistics stats = nodeConnectorFromDS.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
-            if (stats != null) {
-                try {
-                    ret = toNodeConnectorStatistics(stats.getFlowCapableNodeConnectorStatistics(),
-                            InventoryMapping.toNodeKey(connector.getNode()).getId(), ncId);
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to instantiate node connector statistics for connector {}, ignoring it",
-                            connector, e);
-                }
-            }
-        }
-
-        getNodeConnectorStatisticsService().getNodeConnectorStatistics(
-                new GetNodeConnectorStatisticsInputBuilder().setNode(NodeMapping.toNodeRef(connector.getNode())).setNodeConnectorId(ncId).build());
-        return ret;
-    }
-
-    @Override
-    public NodeTableStatistics readNodeTable(final NodeTable nodeTable, final boolean cached) {
-        NodeTableStatistics nodeStats = null;
-        final Table table = readOperationalTable(nodeTable.getNode(), (short) nodeTable.getID());
-        if (table != null) {
-            final FlowTableStatisticsData tableStats = table.getAugmentation(FlowTableStatisticsData.class);
-            if (tableStats != null) {
-                try {
-                    nodeStats = toNodeTableStatistics(tableStats.getFlowTableStatistics(), table.getId(), nodeTable.getNode());
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to instantiate table statistics for node {} table {}, ignoring it",
-                            nodeTable.getNode(), table.getId(), e);
-                }
-            }
-        }
-
-        //TODO: Refer TODO (main)
-        getFlowTableStatisticsService().getFlowTablesStatistics(
-                new GetFlowTablesStatisticsInputBuilder().setNode(NodeMapping.toNodeRef(nodeTable.getNode())).build());
-        return nodeStats;
-    }
-
-    public void onNodeConnectorRemovedInternal(final NodeConnectorRemoved update) {
-        // Never received
-    }
-
-    public void onNodeRemovedInternal(final NodeRemoved notification) {
-        this.removeNodeConnectors(notification.getNodeRef().getValue());
-        try {
-            final Node aDNode = NodeMapping.toADNode(notification.getNodeRef());
-            this.publishNodeUpdate(aDNode, UpdateType.REMOVED, Collections.<Property>emptySet());
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, not propagating update", notification.getNodeRef(), e);
-        }
-    }
-
-    public void onNodeConnectorUpdatedInternal(final NodeConnectorUpdated update) {
-        final NodeConnectorRef ref = update.getNodeConnectorRef();
-        final UpdateType updateType;
-        if (!this.isKnownNodeConnector(ref.getValue())) {
-            this.recordNodeConnector(ref.getValue());
-            updateType = UpdateType.ADDED;
-        } else {
-            updateType = UpdateType.CHANGED;
-        }
-
-        try {
-            final NodeConnector nodeConnector;
-            nodeConnector = NodeMapping.toADNodeConnector(ref);
-            this.publishNodeConnectorUpdate(nodeConnector, updateType, NodeMapping.toADNodeConnectorProperties(update));
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node connector for {}, not reporting the update", ref, e);
-        }
-    }
-
-    public void onNodeUpdatedInternal(final NodeUpdated notification) {
-        final NodeRef ref = notification.getNodeRef();
-
-        final UpdateType updateType;
-        if (dataService.readOperationalData(ref.getValue()) == null) {
-            updateType = UpdateType.ADDED;
-        } else {
-            updateType = UpdateType.CHANGED;
-        }
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(ref);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, not reporting the update", ref, e);
-            return;
-        }
-
-        this.publishNodeUpdate(aDNode, updateType, NodeMapping.toADNodeProperties(notification));
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            final NodeDescription description = this.toNodeDescription(ref);
-            if (description != null) {
-                final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                        InstanceIdentifier.builder(Nodes.class)
-                        .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                        .toInstance();
-                try {
-                    statsPublisher.descriptionStatisticsUpdated(NodeMapping.toADNode(nodeRef), description);
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to construct node for {}, not reporting the update to publisher {}", nodeRef, statsPublisher, e);
-                }
-            }
-        }
-    }
-
-    @Override
-    public ConcurrentMap<Node,Map<String,Property>> getNodeProps() {
-        final ConcurrentHashMap<Node,Map<String,Property>> props = new ConcurrentHashMap<>();
-        final Nodes nodes = this.readOperAllMDNodes();
-        for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node : nodes.getNode()) {
-            final FlowCapableNode fcn = node.getAugmentation(FlowCapableNode.class);
-            if (fcn != null) {
-                final ConcurrentHashMap<String,Property> perNodePropMap = new ConcurrentHashMap<String, Property>();
-                final HashSet<Property> perNodeProps = NodeMapping.toADNodeProperties(fcn, node.getId());
-                if (perNodeProps != null) {
-                    for (final Property perNodeProp : perNodeProps) {
-                        perNodePropMap.put(perNodeProp.getName(), perNodeProp);
-                    }
-                }
-
-                try {
-                    final Node adNode = NodeMapping.toADNode(node.getId());
-                    props.put(adNode, perNodePropMap);
-                } catch (ConstructionException e) {
-                    LOG.warn("Failed to construct node for {}, skipping it", node, e);
-                }
-            }
-        }
-        return props;
-    }
-
-    private Nodes readOperAllMDNodes() {
-        final TypeSafeDataReader reader = TypeSafeDataReader.forReader(getDataService());
-        return reader.readOperationalData(InstanceIdentifier.builder(Nodes.class).build());
-    }
-
-    @Override
-    public ConcurrentMap<NodeConnector,Map<String,Property>> getNodeConnectorProps(final Boolean refresh) {
-        final ConcurrentHashMap<NodeConnector,Map<String,Property>> props = new ConcurrentHashMap<>();
-        for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node : this.readOperAllMDNodes().getNode()) {
-            for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc : node.getNodeConnector()) {
-                final FlowCapableNodeConnector fcnc = nc.getAugmentation(FlowCapableNodeConnector.class);
-                if (fcnc != null) {
-                    final ConcurrentHashMap<String,Property> ncpsm = new ConcurrentHashMap<>();
-                    final HashSet<Property> ncps = NodeMapping.toADNodeConnectorProperties(fcnc);
-                    if (ncps != null) {
-                        for (final Property p : ncps) {
-                            ncpsm.put(p.getName(), p);
-                        }
-                    }
-
-                    try {
-                        props.put(NodeMapping.toADNodeConnector(nc.getId(), node.getId()), ncpsm);
-                    } catch (ConstructionException e) {
-                        LOG.warn("Failed to instantiate node {} connector {}, not reporting it", node.getId(), nc.getId(), e);
-                    }
-                }
-            }
-        }
-        return props;
-    }
-
-    private FlowCapableNodeConnector readOperFlowCapableNodeConnector(final NodeConnectorRef ref) {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc =
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector)
-                getDataService().readOperationalData(ref.getValue());
-        return nc.getAugmentation(FlowCapableNodeConnector.class);
-    }
-
-    private static NodeConnectorStatistics toNodeConnectorStatistics(final org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.NodeConnectorStatistics nodeConnectorStatistics, final NodeId nodeId, final NodeConnectorId nodeConnectorId) throws ConstructionException {
-        final NodeConnectorStatistics it = new NodeConnectorStatistics();
-
-        final Packets packets = nodeConnectorStatistics.getPackets();
-        it.setReceivePacketCount(packets.getReceived().longValue());
-        it.setTransmitPacketCount(packets.getTransmitted().longValue());
-
-        final Bytes bytes = nodeConnectorStatistics.getBytes();
-        it.setReceiveByteCount(bytes.getReceived().longValue());
-        it.setTransmitByteCount(bytes.getTransmitted().longValue());
-
-        it.setReceiveDropCount(nodeConnectorStatistics.getReceiveDrops().longValue());
-        it.setTransmitDropCount(nodeConnectorStatistics.getTransmitDrops().longValue());
-        it.setReceiveErrorCount(nodeConnectorStatistics.getReceiveErrors().longValue());
-        it.setTransmitErrorCount(nodeConnectorStatistics.getTransmitErrors().longValue());
-        it.setReceiveFrameErrorCount(nodeConnectorStatistics.getReceiveFrameError().longValue());
-        it.setReceiveOverRunErrorCount(nodeConnectorStatistics.getReceiveOverRunError().longValue());
-        it.setReceiveCRCErrorCount(nodeConnectorStatistics.getReceiveCrcError().longValue());
-        it.setCollisionCount(nodeConnectorStatistics.getCollisionCount().longValue());
-
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> nodeConnectorRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(nodeId))
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class, new NodeConnectorKey(nodeConnectorId))
-                .build();
-        it.setNodeConnector(NodeMapping.toADNodeConnector(new NodeConnectorRef(nodeConnectorRef)));
-        return it;
-    }
-
-    private static NodeTableStatistics toNodeTableStatistics(final FlowTableStatistics tableStats, final Short tableId, final Node node) throws ConstructionException {
-        final NodeTableStatistics it = new NodeTableStatistics();
-        it.setActiveCount(tableStats.getActiveFlows().getValue().intValue());
-        it.setLookupCount(tableStats.getPacketsLookedUp().getValue().longValue());
-        it.setMatchedCount(tableStats.getPacketsMatched().getValue().longValue());
-        it.setName(tableId.toString());
-        it.setNodeTable(new NodeTable(NodeTableIDType.OPENFLOW, tableId.byteValue(), node));
-        return it;
-    }
-
-    private NodeDescription toNodeDescription(final NodeRef nodeRef) {
-        final FlowCapableNode capableNode = this.readOperFlowCapableNode(nodeRef);
-        if (capableNode == null) {
-            return null;
-        }
-
-        final NodeDescription it = new NodeDescription();
-        it.setManufacturer(capableNode.getManufacturer());
-        it.setSerialNumber(capableNode.getSerialNumber());
-        it.setSoftware(capableNode.getSoftware());
-        it.setDescription(capableNode.getDescription());
-        return it;
-    }
-
-    public Edge toADEdge(final Link link) throws ConstructionException {
-        NodeConnectorRef _source = link.getSource();
-        NodeConnector _aDNodeConnector = NodeMapping.toADNodeConnector(_source);
-        NodeConnectorRef _destination = link.getDestination();
-        NodeConnector _aDNodeConnector_1 = NodeMapping.toADNodeConnector(_destination);
-        Edge _edge = new Edge(_aDNodeConnector, _aDNodeConnector_1);
-        return _edge;
-    }
-
-    /**
-     * OpendaylightFlowStatisticsListener interface implementation
-     */
-    @Override
-    public void onAggregateFlowStatisticsUpdate(final AggregateFlowStatisticsUpdate notification) {
-        // Ignoring this notification as there does not seem to be a way to bubble this up to AD-SAL
-    }
-
-    @Override
-    public void onFlowsStatisticsUpdate(final FlowsStatisticsUpdate notification) {
-        final ArrayList<FlowOnNode> adsalFlowsStatistics = new ArrayList<>();
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                .build();
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(nodeRef);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, ignoring it", notification.getId(), e);
-            return;
-        }
-
-        for (final FlowAndStatisticsMapList flowStats : notification.getFlowAndStatisticsMapList()) {
-            if (flowStats.getTableId() == 0) {
-                adsalFlowsStatistics.add(InventoryAndReadAdapter.toFlowOnNode(flowStats, aDNode));
-            }
-        }
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            statsPublisher.nodeFlowStatisticsUpdated(aDNode, adsalFlowsStatistics);
-        }
-
-        updateTransactionCache(notification, notification.getId(), !notification.isMoreReplies());
-    }
-
-    /**
-     * OpendaylightFlowTableStatisticsListener interface implementation
-     */
-    @Override
-    public void onFlowTableStatisticsUpdate(final FlowTableStatisticsUpdate notification) {
-        ArrayList<NodeTableStatistics> adsalFlowTableStatistics = new ArrayList<>();
-        for (final FlowTableAndStatisticsMap stats : notification.getFlowTableAndStatisticsMap()) {
-            if (stats.getTableId().getValue() == 0) {
-                final NodeTableStatistics it = new NodeTableStatistics();
-                it.setActiveCount(stats.getActiveFlows().getValue().intValue());
-                it.setLookupCount(stats.getPacketsLookedUp().getValue().longValue());
-                it.setMatchedCount(stats.getPacketsMatched().getValue().longValue());
-                adsalFlowTableStatistics.add(it);
-            }
-        }
-
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                .build();
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(nodeRef);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, ignoring it", notification.getId(), e);
-            return;
-        }
-
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            statsPublisher.nodeTableStatisticsUpdated(aDNode, adsalFlowTableStatistics);
-        }
-    }
-
-    /**
-     * OpendaylightPortStatisticsUpdate interface implementation
-     */
-    @Override
-    public void onNodeConnectorStatisticsUpdate(final NodeConnectorStatisticsUpdate notification) {
-        final ArrayList<NodeConnectorStatistics> adsalPortStatistics = new ArrayList<NodeConnectorStatistics>();
-        for (final NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatistics : notification.getNodeConnectorStatisticsAndPortNumberMap()) {
-            try {
-                adsalPortStatistics.add(toNodeConnectorStatistics(
-                        nodeConnectorStatistics, notification.getId(), nodeConnectorStatistics.getNodeConnectorId()));
-            } catch (ConstructionException e) {
-                LOG.warn("Failed to create statistics for node {} connector {}, not updating them",
-                        notification.getId(), nodeConnectorStatistics.getNodeConnectorId(), e);
-            }
-        }
-
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef =
-                InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId()))
-                .build();
-
-        final Node aDNode;
-        try {
-            aDNode = NodeMapping.toADNode(nodeRef);
-        } catch (ConstructionException e) {
-            LOG.warn("Failed to construct node for {}, ignoring it", notification.getId(), e);
-            return;
-        }
-
-        for (final IPluginOutReadService statsPublisher : getStatisticsPublisher()) {
-            statsPublisher.nodeConnectorStatisticsUpdated(aDNode, adsalPortStatistics);
-        }
-    }
-
-    private static FlowOnNode toFlowOnNode(final FlowAndStatisticsMapList flowAndStatsMap, final Node node) {
-        final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flowAndStatsMap, node));
-        return addFlowStats(it, flowAndStatsMap);
-    }
-
-    private static FlowOnNode addFlowStats(final FlowOnNode node, final GenericStatistics stats) {
-        node.setByteCount(stats.getByteCount().getValue().longValue());
-        node.setPacketCount(stats.getPacketCount().getValue().longValue());
-        node.setDurationSeconds(stats.getDuration().getSecond().getValue().intValue());
-        node.setDurationNanoseconds(stats.getDuration().getNanosecond().getValue().intValue());
-        return node;
-    }
-
-    @Override
-    public Set<Node> getConfiguredNotConnectedNodes() {
-        return Collections.emptySet();
-    }
-
-    private void publishNodeUpdate(final Node node, final UpdateType updateType, final Set<Property> properties) {
-        for (final IPluginOutInventoryService publisher : getInventoryPublisher()) {
-            publisher.updateNode(node, updateType, properties);
-        }
-    }
-
-    private void publishNodeConnectorUpdate(final NodeConnector nodeConnector, final UpdateType updateType, final Set<Property> properties) {
-        for (final IPluginOutInventoryService publisher : getInventoryPublisher()) {
-            publisher.updateNodeConnector(nodeConnector, updateType, properties);
-        }
-    }
-
-    private boolean isKnownNodeConnector(final InstanceIdentifier<? extends Object> nodeConnectorIdentifier) {
-        final Iterator<PathArgument> it = nodeConnectorIdentifier.getPathArguments().iterator();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodePath = it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodeConnectorPath = it.next();
-
-        final List<PathArgument> nodeConnectors = nodeToNodeConnectorsMap.get(nodePath);
-        return nodeConnectors == null ? false :
-            nodeConnectors.contains(nodeConnectorPath);
-    }
-
-    private boolean recordNodeConnector(final InstanceIdentifier<? extends Object> nodeConnectorIdentifier) {
-        final Iterator<PathArgument> it = nodeConnectorIdentifier.getPathArguments().iterator();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodePath = it.next();
-
-        if (!it.hasNext()) {
-            return false;
-        }
-        final PathArgument nodeConnectorPath = it.next();
-
-        synchronized (this) {
-            List<PathArgument> nodeConnectors = this.nodeToNodeConnectorsMap.get(nodePath);
-            if (nodeConnectors == null) {
-                nodeConnectors = new ArrayList<>();
-                this.nodeToNodeConnectorsMap.put(nodePath, nodeConnectors);
-            }
-
-            return nodeConnectors.add(nodeConnectorPath);
-        }
-    }
-
-    private List<PathArgument> removeNodeConnectors(final InstanceIdentifier<? extends Object> nodeIdentifier) {
-        return this.nodeToNodeConnectorsMap.remove(Iterables.get(nodeIdentifier.getPathArguments(), 1));
-    }
-
-    private <T extends TransactionAware> void updateTransactionCache(T notification, NodeId nodeId, boolean lastNotification) {
-
-        String cacheKey = buildCacheKey(notification.getTransactionId(), nodeId);
-        TransactionNotificationList<T> txnList = (TransactionNotificationList<T>) txCache.getIfPresent(cacheKey);
-        final Optional<TransactionNotificationList<T>> optional = Optional.<TransactionNotificationList<T>>fromNullable(txnList);
-        if (optional.isPresent()) {
-            LOG.info("updateTransactionCache cacheKey:{}, lastNotification:{}, txnList-present:{}", cacheKey, lastNotification, optional.isPresent());
-            TransactionNotificationList<T> txn = optional.get();
-            txn.addNotification(notification);
-            txn.setAllNotificationsGathered(lastNotification);
-        }
-    }
-
-    private class TransactionNotificationList<T extends TransactionAware> {
-        private TransactionId id;
-        private String nId;
-        private List<T> notifications;
-        private boolean allNotificationsGathered;
-
-        public TransactionNotificationList(TransactionId id, String nId) {
-            this.nId = nId;
-            this.id = id;
-            notifications = new ArrayList<T>();
-        }
-
-        public void addNotification(T notification) {
-            notifications.add(notification);
-        }
-
-        public void setAllNotificationsGathered(boolean allNotificationsGathered) {
-            this.allNotificationsGathered = allNotificationsGathered;
-        }
-
-        public boolean areAllNotificationsGathered() {
-            return allNotificationsGathered;
-        }
-
-        public List<T> getNotifications() {
-            return notifications;
-        }
-
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryMapping.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryMapping.java
deleted file mode 100644 (file)
index 1e4d974..0000000
+++ /dev/null
@@ -1,99 +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
- */
-package org.opendaylight.controller.sal.compatibility;
-
-import java.util.Iterator;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-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.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-
-import com.google.common.base.Splitter;
-
-public final class InventoryMapping {
-    private static final String NODE_TYPE_STRING = "::";
-    private static final Splitter NODE_TYPE_SPLITTER = Splitter.on(NODE_TYPE_STRING);
-
-    private InventoryMapping() {
-        throw new UnsupportedOperationException("Utility class");
-    }
-
-    public static org.opendaylight.controller.sal.core.NodeConnector toAdNodeConnector(final InstanceIdentifier<NodeConnector> identifier) {
-        @SuppressWarnings("unchecked")
-        final NodeConnectorKey tpKey = ((KeyedInstanceIdentifier<NodeConnector, NodeConnectorKey>) identifier).getKey();
-        return InventoryMapping.nodeConnectorFromId(tpKey.getId().getValue());
-    }
-
-    public static org.opendaylight.controller.sal.core.Node toAdNode(final InstanceIdentifier<Node> identifier) {
-        @SuppressWarnings("unchecked")
-        final NodeKey tpKey = ((KeyedInstanceIdentifier<Node,NodeKey>)identifier).getKey();
-        return InventoryMapping.nodeFromNodeId(tpKey.getId().getValue());
-    }
-
-    public static NodeRef toNodeRef(final org.opendaylight.controller.sal.core.Node node) {
-        final NodeKey nodeKey = new NodeKey(new NodeId(InventoryMapping.toNodeId(node)));
-        final InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class)
-                .child(Node.class, nodeKey).toInstance();
-        return new NodeRef(path);
-    }
-
-    public static NodeKey toNodeKey(final org.opendaylight.controller.sal.core.Node node) {
-        final NodeId nodeId = new NodeId(InventoryMapping.toNodeId(node));
-        return new NodeKey(nodeId);
-    }
-
-    public static NodeConnectorKey toNodeConnectorKey(final org.opendaylight.controller.sal.core.NodeConnector nc) {
-        final NodeConnectorId nodeConnectorId = new NodeConnectorId(InventoryMapping.toNodeConnectorId(nc));
-        return new NodeConnectorKey(nodeConnectorId);
-    }
-
-    private static StringBuilder nodeIdBulder(final org.opendaylight.controller.sal.core.Node node) {
-        final StringBuilder sb = new StringBuilder();
-        sb.append("ad-sal:");
-        sb.append(node.getType());
-        sb.append(NODE_TYPE_STRING);
-        sb.append(node.getNodeIDString());
-        return sb;
-    }
-
-    public static String toNodeId(final org.opendaylight.controller.sal.core.Node node) {
-        return nodeIdBulder(node).toString();
-    }
-
-    public static String toNodeConnectorId(final org.opendaylight.controller.sal.core.NodeConnector nc) {
-        final StringBuilder sb = nodeIdBulder(nc.getNode());
-        sb.append(NODE_TYPE_STRING);
-        sb.append(nc.getNodeConnectorIDString());
-        return sb.toString();
-    }
-
-    public static org.opendaylight.controller.sal.core.Node nodeFromNodeId(final String nodeId) {
-        return InventoryMapping.nodeFromStrings(NODE_TYPE_SPLITTER.split(nodeId).iterator());
-    }
-
-    public static org.opendaylight.controller.sal.core.NodeConnector nodeConnectorFromId(final String invId) {
-        return InventoryMapping.nodeConnectorFromString(NODE_TYPE_SPLITTER.split(invId).iterator());
-    }
-
-    private static org.opendaylight.controller.sal.core.NodeConnector nodeConnectorFromString(final Iterator<String> it) {
-        final org.opendaylight.controller.sal.core.Node node = InventoryMapping.nodeFromStrings(it);
-        return org.opendaylight.controller.sal.core.NodeConnector.fromStringNoNode(it.next(), node);
-    }
-
-    private static org.opendaylight.controller.sal.core.Node nodeFromStrings(final Iterator<String> it) {
-        final String type = it.next().substring(6);
-        return org.opendaylight.controller.sal.core.Node.fromString(type, it.next());
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryNotificationProvider.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/InventoryNotificationProvider.java
deleted file mode 100644 (file)
index 6a9db37..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.opendaylight.controller.sal.compatibility;
-
-import java.util.List;
-
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class InventoryNotificationProvider implements AutoCloseable{
-
-    private ListenerRegistration<DataChangeListener> nodeConnectorDataChangeListenerRegistration;
-
-    private NodeConnectorDataChangeListener nodeConnectorDataChangeListener;
-
-    private DataProviderService dataProviderService;
-
-    private List<IPluginOutInventoryService> inventoryPublisher;
-
-    private final static Logger LOG = LoggerFactory.getLogger(NodeConnectorDataChangeListener.class);
-
-    public void start(){
-
-        LOG.info("InventoryNotificationProvider started");
-
-        if(dataProviderService != null
-                && inventoryPublisher!= null){
-
-            if(nodeConnectorDataChangeListener == null){
-                InstanceIdentifier<NodeConnector> nodeConnectorPath = InstanceIdentifier.builder(Nodes.class).child(Node.class).child(NodeConnector.class).build();
-                nodeConnectorDataChangeListener = new NodeConnectorDataChangeListener();
-                nodeConnectorDataChangeListener.setInventoryPublisher(inventoryPublisher);
-                nodeConnectorDataChangeListenerRegistration = dataProviderService.registerDataChangeListener(nodeConnectorPath, nodeConnectorDataChangeListener);
-            }
-
-        }
-    }
-
-    @Override
-    public void close() throws Exception {
-        if(nodeConnectorDataChangeListenerRegistration != null){
-            nodeConnectorDataChangeListenerRegistration.close();
-        }
-    }
-
-    public void setDataProviderService(DataProviderService dataProviderService) {
-        this.dataProviderService = dataProviderService;
-    }
-
-    public void setInventoryPublisher(List<IPluginOutInventoryService> inventoryPublisher) {
-        this.inventoryPublisher = inventoryPublisher;
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.java
deleted file mode 100644 (file)
index d3b96d0..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * 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.Preconditions;
-import com.google.common.net.InetAddresses;
-import org.opendaylight.controller.sal.action.Action;
-import org.opendaylight.controller.sal.action.Controller;
-import org.opendaylight.controller.sal.action.Drop;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.Output;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.action._case.FloodActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.hw.path.action._case.HwPathActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.loopback.action._case.LoopbackActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.vlan.action._case.PopVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
-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.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.OriginalFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.UpdatedFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-
-import java.math.BigInteger;
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public final class MDFlowMapping {
-    private MDFlowMapping() {
-        throw new UnsupportedOperationException("Utility class");
-    }
-
-    private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> toMDActions(final List<Action> actions) {
-        final ArrayList<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> ret =
-                new ArrayList<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action>(actions.size());
-        int action = 0;
-        for (final Action sourceAction : actions) {
-            ret.add(toAction(sourceAction, action));
-            action++;
-        }
-
-        return ret;
-    }
-
-    public static FlowAdded flowAdded(final Flow sourceFlow) {
-        Preconditions.checkArgument(sourceFlow != null);
-
-        return new FlowAddedBuilder()
-        .setHardTimeout(Integer.valueOf(sourceFlow.getHardTimeout()))
-        .setIdleTimeout(Integer.valueOf(sourceFlow.getIdleTimeout()))
-        .setCookie(new FlowCookie(BigInteger.valueOf(sourceFlow.getId())))
-        .setPriority(Integer.valueOf(sourceFlow.getPriority()))
-        .setInstructions(MDFlowMapping.toApplyInstruction(toMDActions(sourceFlow.getActions())))
-        .setMatch(FromSalConversionsUtils.toMatch(sourceFlow.getMatch()))
-        .setTableId((short)0)
-        .build();
-    }
-
-    private static FlowBuilder internalToMDFlow(final Flow sourceFlow) {
-        Preconditions.checkArgument(sourceFlow != null);
-
-        return new FlowBuilder()
-        .setHardTimeout(Integer.valueOf(sourceFlow.getHardTimeout()))
-        .setIdleTimeout(Integer.valueOf(sourceFlow.getIdleTimeout()))
-        .setCookie(new FlowCookie(BigInteger.valueOf(sourceFlow.getId())))
-        .setPriority(Integer.valueOf((sourceFlow.getPriority())))
-        .setInstructions(MDFlowMapping.toApplyInstruction(toMDActions(sourceFlow.getActions())))
-        .setMatch(FromSalConversionsUtils.toMatch(sourceFlow.getMatch()));
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow toMDFlow(final Flow sourceFlow, final String flowId) {
-        return internalToMDFlow(sourceFlow)
-                .setTableId((short)0)
-                .setId(new FlowId(flowId))
-                .build();
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow toMDSalflow(final Flow sourceFlow) {
-        return internalToMDFlow(sourceFlow).build();
-    }
-
-    public static Instructions toApplyInstruction(final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions) {
-        return new InstructionsBuilder()
-        .setInstruction(
-                Collections.singletonList(
-                        new InstructionBuilder()
-                        .setOrder(0)
-                        .setInstruction(
-                                new ApplyActionsCaseBuilder()
-                                .setApplyActions(new ApplyActionsBuilder().setAction(actions).build())
-                                .build()
-                                ).build())
-                ).build();
-    }
-
-    public static RemoveFlowInput removeFlowInput(final Node sourceNode, final Flow sourceFlow) {
-        final FlowAdded source = MDFlowMapping.flowAdded(sourceFlow);
-        return new RemoveFlowInputBuilder((org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow) source)
-        .setNode(NodeMapping.toNodeRef(sourceNode))
-        .build();
-    }
-
-    public static AddFlowInput addFlowInput(final Node sourceNode, final Flow sourceFlow) {
-        final FlowAdded source = MDFlowMapping.flowAdded(sourceFlow);
-        return new AddFlowInputBuilder(((org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow) source))
-        .setNode(NodeMapping.toNodeRef(sourceNode))
-        .build();
-    }
-
-    public static UpdateFlowInput updateFlowInput(final Node sourceNode, final Flow oldFlow, final Flow newFlow) {
-        return new UpdateFlowInputBuilder()
-        .setOriginalFlow(new OriginalFlowBuilder(MDFlowMapping.flowAdded(newFlow)).build())
-        .setUpdatedFlow(new UpdatedFlowBuilder(MDFlowMapping.flowAdded(newFlow)).build())
-        .setNode(NodeMapping.toNodeRef(sourceNode))
-        .build();
-    }
-
-    private static ControllerActionCase _toAction(final Controller sourceAction) {
-        return new ControllerActionCaseBuilder().setControllerAction(new ControllerActionBuilder().build()).build();
-    }
-
-    private static DropActionCase _toAction(final Drop sourceAction) {
-        return new DropActionCaseBuilder().setDropAction(new DropActionBuilder().build()).build();
-    }
-
-    private static FloodActionCase _toAction(final Flood sourceAction) {
-        return new FloodActionCaseBuilder().setFloodAction(new FloodActionBuilder().build()).build();
-    }
-
-    private static FloodAllActionCase _toAction(final FloodAll sourceAction) {
-        return new FloodAllActionCaseBuilder().setFloodAllAction(new FloodAllActionBuilder().build()).build();
-    }
-
-    private static HwPathActionCase _toAction(final HwPath sourceAction) {
-        return new HwPathActionCaseBuilder().setHwPathAction(new HwPathActionBuilder().build()).build();
-    }
-
-    private static LoopbackActionCase _toAction(final Loopback sourceAction) {
-        return new LoopbackActionCaseBuilder().setLoopbackAction( new LoopbackActionBuilder().build()).build();
-    }
-
-    private static OutputActionCase _toAction(final Output sourceAction) {
-        return new OutputActionCaseBuilder()
-        .setOutputAction(
-                new OutputActionBuilder().setOutputNodeConnector(MDFlowMapping.toUri(sourceAction.getPort())).build()
-                ).build();
-    }
-
-    private static PopVlanActionCase _toAction(final PopVlan sourceAction) {
-        PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
-        return new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build();
-    }
-
-    private static PushVlanActionCase _toAction(final PushVlan sourceAction) {
-        return new PushVlanActionCaseBuilder()
-        .setPushVlanAction(
-                new PushVlanActionBuilder()
-                .setEthernetType(Integer.valueOf(sourceAction.getTag()))
-                .build()
-                ).build();
-    }
-
-    private static SetDlDstActionCase _toAction(final SetDlDst sourceAction) {
-        return new SetDlDstActionCaseBuilder()
-        .setSetDlDstAction(new SetDlDstActionBuilder().setAddress(MDFlowMapping.toMacAddress(sourceAction.getDlAddress())).build())
-        .build();
-    }
-
-    private static SetDlSrcActionCase _toAction(final SetDlSrc sourceAction) {
-        return new SetDlSrcActionCaseBuilder()
-        .setSetDlSrcAction(new SetDlSrcActionBuilder().setAddress(MDFlowMapping.toMacAddress(sourceAction.getDlAddress())).build())
-        .build();
-    }
-
-    private static SetDlTypeActionCase _toAction(final SetDlType sourceAction) {
-        return new SetDlTypeActionCaseBuilder()
-        .setSetDlTypeAction(new SetDlTypeActionBuilder().setDlType(new EtherType(Long.valueOf(sourceAction.getDlType()))).build())
-        .build();
-    }
-
-    private static SetNextHopActionCase _toAction(final SetNextHop sourceAction) {
-        return new SetNextHopActionCaseBuilder()
-        .setSetNextHopAction(new SetNextHopActionBuilder().setAddress(MDFlowMapping.toInetAddress(sourceAction.getAddress())).build())
-        .build();
-    }
-
-    private static SetNwDstActionCase _toAction(final SetNwDst sourceAction) {
-        return new SetNwDstActionCaseBuilder()
-        .setSetNwDstAction(new SetNwDstActionBuilder().setAddress(MDFlowMapping.toInetAddress(sourceAction.getAddress())).build())
-        .build();
-    }
-
-    private static SetNwSrcActionCase _toAction(final SetNwSrc sourceAction) {
-        return new SetNwSrcActionCaseBuilder()
-        .setSetNwSrcAction(new SetNwSrcActionBuilder().setAddress(MDFlowMapping.toInetAddress(sourceAction.getAddress())).build())
-        .build();
-    }
-
-    private static SetNwTosActionCase _toAction(final SetNwTos sourceAction) {
-        return new SetNwTosActionCaseBuilder()
-        .setSetNwTosAction(new SetNwTosActionBuilder().setTos(FromSalConversionsUtils.dscpToTos(sourceAction.getNwTos())).build())
-        .build();
-    }
-
-    private static SetTpDstActionCase _toAction(final SetTpDst sourceAction) {
-        return new SetTpDstActionCaseBuilder()
-        .setSetTpDstAction(new SetTpDstActionBuilder().setPort(new PortNumber(sourceAction.getPort())).build())
-        .build();
-    }
-
-    private static SetTpSrcActionCase _toAction(final SetTpSrc sourceAction) {
-        return new SetTpSrcActionCaseBuilder()
-        .setSetTpSrcAction(new SetTpSrcActionBuilder().setPort(new PortNumber(sourceAction.getPort())).build())
-        .build();
-    }
-
-    private static SetVlanCfiActionCase _toAction(final SetVlanCfi sourceAction) {
-        return new SetVlanCfiActionCaseBuilder()
-        .setSetVlanCfiAction(new SetVlanCfiActionBuilder().setVlanCfi(new VlanCfi(sourceAction.getCfi())).build())
-        .build();
-    }
-
-    private static SetVlanIdActionCase _toAction(final SetVlanId sourceAction) {
-        return new SetVlanIdActionCaseBuilder()
-        .setSetVlanIdAction(new SetVlanIdActionBuilder().setVlanId(new VlanId(sourceAction.getVlanId())).build())
-        .build();
-    }
-
-    private static SetVlanPcpActionCase _toAction(final SetVlanPcp sourceAction) {
-        return new SetVlanPcpActionCaseBuilder()
-        .setSetVlanPcpAction(new SetVlanPcpActionBuilder().setVlanPcp(new VlanPcp((short) sourceAction.getPcp())).build())
-        .build();
-    }
-
-    private static SwPathActionCase _toAction(final SwPath sourceAction) {
-        return new SwPathActionCaseBuilder().setSwPathAction(new SwPathActionBuilder().build()).build();
-    }
-
-    public static Uri toUri(final NodeConnector connector) {
-        return new NodeConnectorId(NodeMapping.OPENFLOW_ID_PREFIX + connector.getNode().getID() + ":" + (connector.getID()));
-    }
-
-    public static MacAddress toMacAddress(final byte[] bytes) {
-        final StringBuilder sb = new StringBuilder(18);
-        boolean first = true;
-
-        for (final byte b : bytes) {
-            if (first) {
-                first = false;
-            } else {
-                sb.append(':');
-            }
-            sb.append(String.format("%02x", Byte.valueOf(b)));
-        }
-        return new MacAddress(sb.toString());
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action toAction(final Action sourceAction, final int order) {
-        final ActionBuilder ret = new ActionBuilder().setOrder(order);
-
-        if (sourceAction instanceof Controller) {
-            ret.setAction(_toAction((Controller)sourceAction));
-        } else if (sourceAction instanceof Drop) {
-            ret.setAction(_toAction((Drop)sourceAction));
-        } else if (sourceAction instanceof Flood) {
-            ret.setAction(_toAction((Flood)sourceAction));
-        } else if (sourceAction instanceof FloodAll) {
-            ret.setAction(_toAction((FloodAll)sourceAction));
-        } else if (sourceAction instanceof HwPath) {
-            ret.setAction(_toAction((HwPath)sourceAction));
-        } else if (sourceAction instanceof Loopback) {
-            ret.setAction(_toAction((Loopback)sourceAction));
-        } else if (sourceAction instanceof Output) {
-            ret.setAction(_toAction((Output)sourceAction));
-        } else if (sourceAction instanceof PopVlan) {
-            ret.setAction(_toAction((PopVlan)sourceAction));
-        } else if (sourceAction instanceof PushVlan) {
-            ret.setAction(_toAction((PushVlan)sourceAction));
-        } else if (sourceAction instanceof SetDlDst) {
-            ret.setAction(_toAction((SetDlDst)sourceAction));
-        } else if (sourceAction instanceof SetDlSrc) {
-            ret.setAction(_toAction((SetDlSrc)sourceAction));
-        } else if (sourceAction instanceof SetDlType) {
-            ret.setAction(_toAction((SetDlType)sourceAction));
-        } else if (sourceAction instanceof SetNextHop) {
-            ret.setAction(_toAction((SetNextHop)sourceAction));
-        } else if (sourceAction instanceof SetNwDst) {
-            ret.setAction(_toAction((SetNwDst)sourceAction));
-        } else if (sourceAction instanceof SetNwSrc) {
-            ret.setAction(_toAction((SetNwSrc)sourceAction));
-        } else if (sourceAction instanceof SetNwTos) {
-            ret.setAction(_toAction((SetNwTos)sourceAction));
-        } else if (sourceAction instanceof SetTpDst) {
-            ret.setAction(_toAction((SetTpDst)sourceAction));
-        } else if (sourceAction instanceof SetTpSrc) {
-            ret.setAction(_toAction((SetTpSrc)sourceAction));
-        } else if (sourceAction instanceof SetVlanCfi) {
-            ret.setAction(_toAction((SetVlanCfi)sourceAction));
-        } else if (sourceAction instanceof SetVlanId) {
-            ret.setAction(_toAction((SetVlanId)sourceAction));
-        } else if (sourceAction instanceof SetVlanPcp) {
-            ret.setAction(_toAction((SetVlanPcp)sourceAction));
-        } else if (sourceAction instanceof SwPath) {
-            ret.setAction(_toAction((SwPath)sourceAction));
-        } else {
-            throw new IllegalArgumentException(String.format("Unhandled action class %s", sourceAction.getClass()));
-        }
-
-        return ret.build();
-    }
-
-    public static Address toInetAddress(final InetAddress address) {
-        if (address instanceof Inet4Address) {
-            return new Ipv4Builder()
-            .setIpv4Address(new Ipv4Prefix(InetAddresses.toAddrString(address) + "/32"))
-            .build();
-        }
-        if (address instanceof Inet6Address) {
-            return new Ipv6Builder()
-            .setIpv6Address(new Ipv6Prefix(InetAddresses.toAddrString(address) + "/128"))
-            .build();
-        }
-
-        throw new IllegalArgumentException(String.format("Unhandled address class %s", address.getClass()));
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDSalNodeConnectorFactory.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDSalNodeConnectorFactory.java
deleted file mode 100644 (file)
index 9aba23a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.utils.INodeConnectorFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MDSalNodeConnectorFactory implements INodeConnectorFactory{
-    private Logger logger = LoggerFactory.getLogger(MDSalNodeConnectorFactory.class);
-
-    @Override
-    public NodeConnector fromStringNoNode(String type, String id, Node node) {
-        try {
-            return new NodeConnector(type, id, node);
-        } catch (ConstructionException e) {
-            logger.error("Could not construct NodeConnector", e);
-        }
-        return null;
-
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDSalNodeFactory.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDSalNodeFactory.java
deleted file mode 100644 (file)
index dc83403..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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 org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.utils.INodeFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MDSalNodeFactory implements INodeFactory{
-    private Logger logger = LoggerFactory.getLogger(MDSalNodeFactory.class);
-
-    @Override
-    public Node fromString(String type, String id) {
-
-        try {
-            return new Node(type, id);
-        } catch (ConstructionException e) {
-            logger.error("Could not construct Node", e);
-        }
-        return null;
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NCDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NCDataChangeListener.java
deleted file mode 100644 (file)
index d93d40d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * 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 org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NCDataChangeListener extends AbstractDataChangeListener<NodeConnector> {
-    private static final Logger LOG = LoggerFactory.getLogger(NodeDataChangeListener.class);
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-    public NCDataChangeListener (final InventoryAndReadAdapter adapter, final DataBroker db) {
-        super(adapter,db,NodeConnector.class);
-    }
-
-    @Override
-    protected void add(InstanceIdentifier<NodeConnector> createKeyIdent, NodeConnector node) {
-        FlowCapableNodeConnector fcnc = node.getAugmentation(FlowCapableNodeConnector.class);
-        if(fcnc != null) {
-            FlowCapableNodeConnectorUpdatedBuilder fcncub = new FlowCapableNodeConnectorUpdatedBuilder(fcnc);
-            NodeConnectorUpdatedBuilder builder = new NodeConnectorUpdatedBuilder();
-            builder.setId(node.getId());
-            builder.setNodeConnectorRef(new NodeConnectorRef(createKeyIdent));
-            builder.addAugmentation(FlowCapableNodeConnectorUpdated.class, fcncub.build());
-            adapter.onNodeConnectorUpdatedInternal(builder.build());
-        }
-    }
-
-    @Override
-    protected void update(InstanceIdentifier<NodeConnector> updateKeyIdent, NodeConnector original,
-            NodeConnector update) {
-        add(updateKeyIdent,update);
-    }
-
-    @Override
-    protected void remove(InstanceIdentifier<NodeConnector> ident, NodeConnector removeValue) {
-        NodeConnectorRemovedBuilder builder = new NodeConnectorRemovedBuilder();
-        builder.setNodeConnectorRef(new NodeConnectorRef(ident));
-        adapter.onNodeConnectorRemovedInternal(builder.build());
-    }
-
-    protected InstanceIdentifier<NodeConnector> getWildCardPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class).child(NodeConnector.class);
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeConnectorDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeConnectorDataChangeListener.java
deleted file mode 100644 (file)
index eebba74..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.opendaylight.controller.sal.compatibility;
-
-import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.inventory.IPluginOutInventoryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-// org.opendaylight.controller.sal.compatibility.NodeConnectorDataChangeListener
-public class NodeConnectorDataChangeListener implements DataChangeListener{
-    private final static Logger LOG = LoggerFactory.getLogger(NodeConnectorDataChangeListener.class);
-
-    private List<IPluginOutInventoryService> inventoryPublisher;
-
-    public List<IPluginOutInventoryService> getInventoryPublisher() {
-      return this.inventoryPublisher;
-    }
-
-    public void setInventoryPublisher(final List<IPluginOutInventoryService> inventoryPublisher) {
-      this.inventoryPublisher = inventoryPublisher;
-    }
-
-    @Override
-    public void onDataChanged(DataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
-        final Map<InstanceIdentifier<?>,DataObject> createdOperationalData = change.getCreatedOperationalData();
-        final Map<InstanceIdentifier<?>,DataObject> updatedOperationalData = change.getUpdatedOperationalData();
-
-        final Set<Map.Entry<InstanceIdentifier<?>,DataObject>> createdEntries = createdOperationalData.entrySet();
-        final Set<Map.Entry<InstanceIdentifier<?>,DataObject>> updatedEntries = new HashSet<>();
-
-        updatedEntries.addAll(updatedOperationalData.entrySet());
-        updatedEntries.removeAll(createdEntries);
-
-        for(final Map.Entry<InstanceIdentifier<?>,DataObject> entry : createdEntries){
-            publishNodeConnectorUpdate(entry, UpdateType.ADDED);
-        }
-
-        for(final Map.Entry<InstanceIdentifier<?>,DataObject> entry : updatedEntries){
-            publishNodeConnectorUpdate(entry, UpdateType.CHANGED);
-        }
-    }
-
-    private void publishNodeConnectorUpdate(final Map.Entry<InstanceIdentifier<?>,DataObject> entry, final UpdateType updateType) {
-        if (entry.getKey().getTargetType().equals(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class)) {
-            NodeConnectorRef nodeConnectorRef = new NodeConnectorRef(entry.getKey());
-            NodeConnector nodeConnector = null;
-            try {
-                nodeConnector = NodeMapping.toADNodeConnector(nodeConnectorRef);
-            } catch (ConstructionException e) {
-                e.printStackTrace();
-            }
-            HashSet<Property> _aDNodeConnectorProperties = NodeMapping.toADNodeConnectorProperties((org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector) entry.getValue());
-            this.publishNodeConnectorUpdate(nodeConnector, updateType, _aDNodeConnectorProperties);
-        }
-    }
-
-    private void publishNodeConnectorUpdate(final NodeConnector nodeConnector, final UpdateType updateType, final Set<Property> properties) {
-      LOG.debug("Publishing NodeConnector " + updateType.toString() + " nodeConnector Id = " + nodeConnector.getNodeConnectorIdAsString());
-
-      List<IPluginOutInventoryService> _inventoryPublisher = getInventoryPublisher();
-      for (final IPluginOutInventoryService publisher : _inventoryPublisher) {
-        publisher.updateNodeConnector(nodeConnector, updateType, properties);
-      }
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeDataChangeListener.java
deleted file mode 100644 (file)
index cdb2616..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * 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 org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdatedBuilder;
-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.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NodeDataChangeListener extends AbstractDataChangeListener<Node> {
-    private static final Logger LOG = LoggerFactory.getLogger(NodeDataChangeListener.class);
-
-
-    public NodeDataChangeListener (final InventoryAndReadAdapter adapter, final DataBroker db) {
-        super(adapter,db,Node.class);
-    }
-
-    protected void add(InstanceIdentifier<Node> createKeyIdent, Node node) {
-        FlowCapableNode fcn = node.getAugmentation(FlowCapableNode.class);
-        if(fcn != null) {
-            FlowCapableNodeUpdatedBuilder fcbnu = new FlowCapableNodeUpdatedBuilder(fcn);
-            NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
-            builder.setId(node.getId());
-            builder.setNodeRef(new NodeRef(createKeyIdent));
-            builder.setNodeConnector(node.getNodeConnector());
-            builder.addAugmentation(FlowCapableNodeUpdated.class, fcbnu.build());
-            adapter.onNodeUpdatedInternal(builder.build());
-        }
-    }
-
-    protected void update(InstanceIdentifier<Node> updateKeyIdent, Node original,
-            Node update) {
-        this.add(updateKeyIdent, update);
-    }
-
-    protected void remove(InstanceIdentifier<Node> ident, Node removeValue) {
-        NodeRemovedBuilder builder = new NodeRemovedBuilder();
-        builder.setNodeRef(new NodeRef(ident));
-        adapter.onNodeRemovedInternal(builder.build());
-    }
-
-    protected InstanceIdentifier<Node> getWildCardPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class);
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
deleted file mode 100644 (file)
index 2bc3e60..0000000
+++ /dev/null
@@ -1,509 +0,0 @@
-/**
- * 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.annotations.VisibleForTesting;
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.sal.common.util.Arguments;
-import org.opendaylight.controller.sal.core.AdvertisedBandwidth;
-import org.opendaylight.controller.sal.core.Bandwidth;
-import org.opendaylight.controller.sal.core.Buffers;
-import org.opendaylight.controller.sal.core.Capabilities;
-import org.opendaylight.controller.sal.core.Config;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Description;
-import org.opendaylight.controller.sal.core.MacAddress;
-import org.opendaylight.controller.sal.core.Name;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.core.PeerBandwidth;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.SupportedBandwidth;
-import org.opendaylight.controller.sal.core.Tables;
-import org.opendaylight.controller.sal.core.TimeStamp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityArpMatchIp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityFlowStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityIpReasm;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityPortStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityQueueStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityStp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityTableStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-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.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.math.BigInteger;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.regex.Pattern;
-
-public final class NodeMapping {
-
-    private static final Logger LOG = LoggerFactory
-            .getLogger(NodeMapping.class);
-
-    /**
-     * openflow id prefix
-     */
-    public static final String OPENFLOW_ID_PREFIX = "openflow:";
-
-    public final static String MD_SAL_TYPE = "MD_SAL_DEPRECATED";
-
-    private final static Class<Node> NODE_CLASS = Node.class;
-
-    private final static Class<NodeConnector> NODECONNECTOR_CLASS = NodeConnector.class;
-
-    private final static Pattern COLON_NUMBERS_EOL = Pattern.compile(":[0-9]+$");
-
-    private final static Pattern NUMBERS_ONLY = Pattern.compile("[0-9]+");
-
-    private final static Pattern ALL_CHARS_TO_COLON = Pattern.compile("^.*:");
-
-    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) throws ConstructionException {
-        String nodeId = NodeMapping.toADNodeId(id);
-        String nodeIdasNumber = nodeId.replaceFirst("^.*:", "");
-        if (isInteger(nodeIdasNumber)) {
-            Long aDNodeId = openflowFullNodeIdToLong(nodeIdasNumber);
-            return new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, aDNodeId);
-        } else {
-            return new org.opendaylight.controller.sal.core.Node(NodeIDType.PRODUCTION, nodeId);
-        }
-    }
-
-    /**
-     * @param adNodeId
-     * @return nodeId as long
-     */
-    @VisibleForTesting
-    public static Long openflowFullNodeIdToLong(String adNodeId) {
-        if (adNodeId == null) {
-            return null;
-        }
-        return new BigInteger(adNodeId).longValue();
-    }
-
-    public static NodeId toNodeId(final InstanceIdentifier<?> id) {
-        final NodeKey key = id.firstKeyOf(Node.class, NodeKey.class);
-        Preconditions.checkArgument(key != null, "No node identifier found in %s", id);
-        return key.getId();
-    }
-
-    /**
-     * @param nodeId containing "&lt;NodeTypeString&gt;:&lt;plainIntegerId&gt;"
-     * @return adNodeId form
-     */
-    public static String toADNodeId(final NodeId nodeId) {
-        if (nodeId == null) {
-            return null;
-        }
-        return nodeId.getValue();
-    }
-
-    public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorRef source) throws ConstructionException {
-        final InstanceIdentifier<?> id = Preconditions.checkNotNull(source.getValue());
-        final NodeConnectorKey key = id.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
-        return NodeMapping.toADNodeConnector(key.getId(), NodeMapping.toNodeId(id));
-    }
-
-    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);
-    }
-
-    /**
-     * @param ncid   nodeConnector identifier, e.g.: OF:21 or CTRL
-     * @param aDNode
-     * @return nodeConnector attached to given node
-     * @throws ConstructionException
-     */
-    public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(
-            final NodeConnectorId ncid, final org.opendaylight.controller.sal.core.Node aDNode) throws ConstructionException {
-        NodeId nid = NodeMapping.toNodeId(aDNode);
-        String nodeConnectorType = NodeMapping.toNodeConnectorType(ncid, nid);
-        Object aDNodeConnectorId = NodeMapping.toADNodeConnectorId(ncid, nid);
-        return new org.opendaylight.controller.sal.core.NodeConnector(nodeConnectorType, aDNodeConnectorId, aDNode);
-    }
-
-    /**
-     * @param aDNode
-     * @return
-     */
-    public static NodeId toNodeId(org.opendaylight.controller.sal.core.Node aDNode) {
-        String targetPrefix = null;
-        if (NodeIDType.OPENFLOW.equals(aDNode.getType())) {
-                targetPrefix = OPENFLOW_ID_PREFIX;
-        } else {
-            targetPrefix = aDNode.getType() + ":";
-        }
-
-        return new NodeId(targetPrefix + String.valueOf(aDNode.getID()));
-    }
-
-    /**
-     * @param aDNode
-     * @return md-sal {@link NodeKey}
-     */
-    public static NodeKey toNodeKey(org.opendaylight.controller.sal.core.Node aDNode) {
-        return new NodeKey(toNodeId(aDNode));
-    }
-
-    public static String toNodeConnectorType(final NodeConnectorId ncId, final NodeId nodeId) {
-        if (ncId.equals(toLocalNodeConnectorId(nodeId))) {
-            return NodeConnectorIDType.SWSTACK;
-        } else if (ncId.equals(toNormalNodeConnectorId(nodeId))) {
-            return NodeConnectorIDType.HWPATH;
-        } else if (ncId.equals(toControllerNodeConnectorId(nodeId))) {
-            return NodeConnectorIDType.CONTROLLER;
-        }
-        return NodeConnectorIDType.OPENFLOW;
-    }
-
-    public static Object toADNodeConnectorId(final NodeConnectorId nodeConnectorId, final NodeId nodeId) {
-        if (nodeConnectorId.equals(toLocalNodeConnectorId(nodeId)) ||
-                nodeConnectorId.equals(toNormalNodeConnectorId(nodeId)) ||
-                nodeConnectorId.equals(toControllerNodeConnectorId(nodeId))) {
-            return org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID;
-        }
-
-        String nodeConnectorIdStripped = ALL_CHARS_TO_COLON.matcher(nodeConnectorId.getValue()).replaceFirst("");
-
-        if (NUMBERS_ONLY.matcher(nodeConnectorIdStripped).matches()) {
-            Short nodeConnectorIdVal = null;
-            try {
-                nodeConnectorIdVal = Short.valueOf(nodeConnectorIdStripped);
-                return nodeConnectorIdVal;
-            } catch (NumberFormatException e) {
-                LOG.warn("nodeConnectorId not supported (long): {}", nodeConnectorIdStripped, e);
-            }
-        }
-        return nodeConnectorIdStripped;
-    }
-
-    public static NodeId toAdNodeId(final NodeConnectorId nodeConnectorId) {
-        NodeId nodeId = null;
-        if (nodeConnectorId != null) {
-            nodeId = new NodeId(COLON_NUMBERS_EOL.matcher(nodeConnectorId.getValue()).replaceFirst(""));
-        }
-        return nodeId;
-    }
-
-    public static NodeConnectorId toControllerNodeConnectorId(final NodeId node) {
-        return new NodeConnectorId(node.getValue() + ":" + OutputPortValues.CONTROLLER.toString());
-    }
-
-    public static NodeConnectorId toLocalNodeConnectorId(final NodeId node) {
-        return new NodeConnectorId(node.getValue() + ":" + OutputPortValues.LOCAL.toString());
-    }
-
-    public static NodeConnectorId toNormalNodeConnectorId(final NodeId node) {
-        return new NodeConnectorId(node.getValue() + ":" + OutputPortValues.NORMAL.toString());
-    }
-
-    public static NodeRef toNodeRef(final org.opendaylight.controller.sal.core.Node node) {
-        Preconditions.checkArgument(NodeIDType.OPENFLOW.equals(node.getType()));
-        final Long nodeId = Arguments.<Long>checkInstanceOf(node.getID(), Long.class);
-        final NodeKey nodeKey = new NodeKey(new NodeId(OPENFLOW_ID_PREFIX + nodeId));
-        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());
-        @SuppressWarnings("unchecked")
-        final InstanceIdentifier<Node> nodePath = ((InstanceIdentifier<Node>) node.getValue());
-        NodeConnectorId nodeConnectorId = null;
-
-        if (nodeConnector.getID().equals(org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID)) {
-            final NodeId nodeId = toNodeId(nodePath);
-            final String nodeConnectorType = nodeConnector.getType();
-            if (nodeConnectorType.equals(NodeConnectorIDType.SWSTACK)) {
-                nodeConnectorId = toLocalNodeConnectorId(nodeId);
-            } else if (nodeConnectorType.equals(NodeConnectorIDType.HWPATH)) {
-                nodeConnectorId = toNormalNodeConnectorId(nodeId);
-            } else if (nodeConnectorType.equals(NodeConnectorIDType.CONTROLLER)) {
-                nodeConnectorId = toControllerNodeConnectorId(nodeId);
-            }
-        } else {
-            nodeConnectorId = new NodeConnectorId(OPENFLOW_ID_PREFIX
-                    + Arguments.<Short>checkInstanceOf(nodeConnector.getID(), Short.class));
-        }
-        final NodeConnectorKey connectorKey = new NodeConnectorKey(nodeConnectorId);
-        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)) {
-            HashSet<Property> adNodeConnectorProperties = NodeMapping.toADNodeConnectorProperties(fcncu);
-            return adNodeConnectorProperties;
-        }
-        return new HashSet<Property>();
-    }
-
-    /**
-     * @param nodeRef
-     * @return node description in AD form, e.g.: OF|00:00:00:...:01
-     */
-    private static Description toADDescription(NodeRef nodeRef) {
-        Description desc;
-        try {
-            desc = new Description(toADNode(nodeRef).toString());
-        } catch (ConstructionException e) {
-            desc = new Description("none");
-            LOG.warn("node description extraction failed: {}", nodeRef);
-        }
-        return desc;
-    }
-
-    public static HashSet<Property> toADNodeConnectorProperties(final NodeConnector nc) {
-        final FlowCapableNodeConnector fcnc = nc.<FlowCapableNodeConnector>getAugmentation(FlowCapableNodeConnector.class);
-        if (!Objects.equal(fcnc, null)) {
-            return NodeMapping.toADNodeConnectorProperties(fcnc);
-        }
-        return new HashSet<Property>();
-    }
-
-    public static HashSet<Property> toADNodeConnectorProperties(final FlowNodeConnector fcncu) {
-
-        final HashSet<org.opendaylight.controller.sal.core.Property> props = new HashSet<>();
-        if (fcncu != null) {
-            if (fcncu.getCurrentFeature() != null && toAdBandwidth(fcncu.getCurrentFeature()) != null) {
-                props.add(toAdBandwidth(fcncu.getCurrentFeature()));
-            }
-            if (fcncu.getAdvertisedFeatures() != null && toAdAdvertizedBandwidth(fcncu.getAdvertisedFeatures()) != null) {
-                props.add(toAdAdvertizedBandwidth(fcncu.getAdvertisedFeatures()));
-            }
-            if (fcncu.getSupported() != null && toAdSupportedBandwidth(fcncu.getSupported()) != null) {
-                props.add(toAdSupportedBandwidth(fcncu.getSupported()));
-            }
-            if (fcncu.getPeerFeatures() != null && toAdPeerBandwidth(fcncu.getPeerFeatures()) != null) {
-                props.add(toAdPeerBandwidth(fcncu.getPeerFeatures()));
-            }
-            if (fcncu.getName() != null && toAdName(fcncu.getName()) != null) {
-                props.add(toAdName(fcncu.getName()));
-            }
-            if (fcncu.getConfiguration() != null && toAdConfig(fcncu.getConfiguration()) != null) {
-                props.add(toAdConfig(fcncu.getConfiguration()));
-            }
-            if (fcncu.getState() != null && toAdState(fcncu.getState()) != null) {
-                props.add(toAdState(fcncu.getState()));
-            }
-        }
-        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()) {
-            config = new Config(Config.ADMIN_DOWN);
-        } else {
-            config = new Config(Config.ADMIN_UP);
-        }
-        return config;
-    }
-
-    public static org.opendaylight.controller.sal.core.State toAdState(final State s) {
-
-        org.opendaylight.controller.sal.core.State state = null;
-        if (s.isLinkDown()) {
-            state = new org.opendaylight.controller.sal.core.State(org.opendaylight.controller.sal.core.State.EDGE_DOWN);
-        } else {
-            state = new org.opendaylight.controller.sal.core.State(org.opendaylight.controller.sal.core.State.EDGE_UP);
-        }
-        return state;
-    }
-
-    public static Bandwidth toAdBandwidth(final PortFeatures pf) {
-        Bandwidth bw = null;
-        if (pf.isTenMbHd() || pf.isTenMbFd()) {
-            bw = new Bandwidth(Bandwidth.BW10Mbps);
-        } else if (pf.isHundredMbHd() || pf.isHundredMbFd()) {
-            bw = new Bandwidth(Bandwidth.BW100Mbps);
-        } else if (pf.isOneGbHd() || pf.isOneGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW1Gbps);
-        } else if (pf.isOneGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW10Gbps);
-        } else if (pf.isTenGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW10Gbps);
-        } else if (pf.isFortyGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW40Gbps);
-        } else if (pf.isHundredGbFd()) {
-            bw = new Bandwidth(Bandwidth.BW100Gbps);
-        } else if (pf.isOneTbFd()) {
-            bw = new Bandwidth(Bandwidth.BW1Tbps);
-        }
-        return bw;
-    }
-
-    public static AdvertisedBandwidth toAdAdvertizedBandwidth(final PortFeatures pf) {
-        AdvertisedBandwidth abw = null;
-        final Bandwidth bw = toAdBandwidth(pf);
-        if (bw != null) {
-            abw = new AdvertisedBandwidth(bw.getValue());
-        }
-        return abw;
-    }
-
-    public static SupportedBandwidth toAdSupportedBandwidth(final PortFeatures pf) {
-        SupportedBandwidth sbw = null;
-        final Bandwidth bw = toAdBandwidth(pf);
-        if (bw != null) {
-            sbw = new SupportedBandwidth(bw.getValue());
-        }
-        return sbw;
-    }
-
-    public static PeerBandwidth toAdPeerBandwidth(final PortFeatures pf) {
-        PeerBandwidth pbw = null;
-        final Bandwidth bw = toAdBandwidth(pf);
-        if (bw != null) {
-            pbw = new PeerBandwidth(bw.getValue());
-        }
-        return pbw;
-    }
-
-    public static HashSet<Property> toADNodeProperties(final NodeUpdated nu) {
-        final FlowCapableNodeUpdated fcnu = nu.getAugmentation(FlowCapableNodeUpdated.class);
-        if (fcnu != null) {
-            HashSet<Property> adNodeProperties = toADNodeProperties(fcnu, nu.getId());
-            adNodeProperties.add(toADDescription(nu.getNodeRef()));
-            return adNodeProperties;
-        }
-        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<>();
-
-        if (fcnu != null) {
-            props.add(toADTimestamp());
-
-            // props.add(fcnu.supportedActions.toADActions) - TODO
-            if (id != null) {
-                props.add(toADMacAddress(id));
-            }
-            SwitchFeatures switchFeatures = fcnu.getSwitchFeatures();
-            if (switchFeatures != null) {
-                if (switchFeatures.getMaxTables() != null) {
-                    props.add(toADTables(switchFeatures.getMaxTables()));
-                }
-                if (switchFeatures.getCapabilities() != null) {
-                    props.add(toADCapabiliities(switchFeatures.getCapabilities()));
-                }
-                if (switchFeatures.getMaxBuffers() != null) {
-                    props.add(toADBuffers(switchFeatures.getMaxBuffers()));
-                }
-            }
-        }
-        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_ID_PREFIX, "");
-        BigInteger nodeIdRaw = new BigInteger(nodeId);
-        long lNodeId = nodeIdRaw.longValue();
-        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;
-        for (Class<? extends FeatureCapability> capability : capabilities) {
-            if (capability.equals(FlowFeatureCapabilityFlowStats.class)) {
-                b = Capabilities.CapabilitiesType.FLOW_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityTableStats.class)) {
-                b = Capabilities.CapabilitiesType.TABLE_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityPortStats.class)) {
-                b = Capabilities.CapabilitiesType.PORT_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityStp.class)) {
-                b = Capabilities.CapabilitiesType.STP_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityIpReasm.class)) {
-                b = Capabilities.CapabilitiesType.IP_REASSEM_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityQueueStats.class)) {
-                b = Capabilities.CapabilitiesType.QUEUE_STATS_CAPABILITY.getValue() | b;
-            } else if (capability.equals(FlowFeatureCapabilityArpMatchIp.class)) {
-                b = Capabilities.CapabilitiesType.ARP_MATCH_IP_CAPABILITY.getValue() | b;
-            }
-        }
-        return new Capabilities(b);
-    }
-
-    public static Buffers toADBuffers(final Long buffers) {
-        return new Buffers(buffers.intValue());
-    }
-
-
-    private static final boolean isInteger(String value) {
-        if (value.isEmpty()) return false;
-        for (int i = 0; i < value.length(); i++) {
-            if (i == 0 && value.charAt(i) == '-') {
-                if (value.length() == 1) return false;
-                else continue;
-            }
-            if (Character.digit(value.charAt(i), 10) < 0) return false;
-        }
-        return true;
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ProtocolConstants.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ProtocolConstants.java
deleted file mode 100644 (file)
index 5315782..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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;
-
-public class ProtocolConstants {
-    // source: http://en.wikipedia.org/wiki/Ethertype
-    public static final short ETHERNET_ARP = (short) 0x0806;
-
-    // source: http://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
-    public static final byte TCP = (byte) 0x06;
-    public static final byte UDP = (byte) 0x11;
-    public static final byte CRUDP = (byte) 0x7F;
-
-    private ProtocolConstants() {
-
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/SalCompatibilityProvider.java
deleted file mode 100644 (file)
index 75e63f1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * 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 org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.compatibility.adsal.DataPacketServiceAdapter;
-import org.opendaylight.controller.sal.compatibility.topology.TopologyAdapter;
-import org.opendaylight.controller.sal.compatibility.topology.TopologyProvider;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-
-import com.google.common.base.Preconditions;
-
-class SalCompatibilityProvider implements BindingAwareProvider {
-    private final ComponentActivator activator;
-
-    public SalCompatibilityProvider(final ComponentActivator cmpAct) {
-        this.activator = Preconditions.checkNotNull(cmpAct);
-    }
-
-    @Override
-    public void onSessionInitiated(final ProviderContext session) {
-        final NotificationService subscribe = session.getSALService(NotificationService.class);
-
-        final FlowProgrammerAdapter flow = activator.getFlow();
-        flow.setDelegate(session.getRpcService(SalFlowService.class));
-        flow.setDataBrokerService(session.getSALService(DataBrokerService.class));
-        // FIXME: remember registration for clean shutdown
-        subscribe.registerNotificationListener(flow);
-
-        final InventoryAndReadAdapter inv = activator.getInventory();
-        inv.setDataService(session.getSALService(DataBrokerService.class));
-        inv.setFlowStatisticsService(session.getRpcService(OpendaylightFlowStatisticsService.class));
-        inv.setFlowTableStatisticsService(session.getRpcService(OpendaylightFlowTableStatisticsService.class));
-        inv.setNodeConnectorStatisticsService(session.getRpcService(OpendaylightPortStatisticsService.class));
-        inv.setTopologyDiscovery(session.getRpcService(FlowTopologyDiscoveryService.class));
-        inv.setDataProviderService(session.getSALService(DataProviderService.class));
-
-        final NodeDataChangeListener ndcl = new NodeDataChangeListener(inv,session.getSALService(DataBroker.class));
-        final NCDataChangeListener ncdcl = new NCDataChangeListener(inv,session.getSALService(DataBroker.class));
-
-        // FIXME: remember registration for clean shutdown
-        subscribe.registerNotificationListener(inv);
-
-        final DataPacketServiceAdapter dps = activator.getDataPacketService();
-        dps.setDelegate(session.getRpcService(PacketProcessingService.class));
-
-        final TopologyAdapter topo = activator.getTopology();
-        topo.setDataService(session.getSALService(DataProviderService.class));
-
-        final TopologyProvider tpp = activator.getTpProvider();
-        tpp.setDataService(session.getSALService(DataProviderService.class));
-
-        inv.startAdapter();
-        tpp.startAdapter();
-
-        subscribe.registerNotificationListener(activator.getDataPacket());
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java
deleted file mode 100644 (file)
index 99e5a80..0000000
+++ /dev/null
@@ -1,661 +0,0 @@
-/*
- * 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 static org.opendaylight.controller.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.UDP;
-import static org.opendaylight.controller.sal.match.MatchType.DL_DST;
-import static org.opendaylight.controller.sal.match.MatchType.DL_SRC;
-import static org.opendaylight.controller.sal.match.MatchType.DL_TYPE;
-import static org.opendaylight.controller.sal.match.MatchType.DL_VLAN;
-import static org.opendaylight.controller.sal.match.MatchType.DL_VLAN_PR;
-import static org.opendaylight.controller.sal.match.MatchType.NW_DST;
-import static org.opendaylight.controller.sal.match.MatchType.NW_PROTO;
-import static org.opendaylight.controller.sal.match.MatchType.NW_SRC;
-import static org.opendaylight.controller.sal.match.MatchType.NW_TOS;
-import static org.opendaylight.controller.sal.match.MatchType.TP_DST;
-import static org.opendaylight.controller.sal.match.MatchType.TP_SRC;
-
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opendaylight.controller.sal.action.Controller;
-import org.opendaylight.controller.sal.action.Drop;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.Output;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.match.Match;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.GenericFlowAttributes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.MacAddressFilter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanId;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.net.InetAddresses;
-
-public class ToSalConversionsUtils {
-
-    private static final Logger LOG = LoggerFactory.getLogger(ToSalConversionsUtils.class);
-
-    private ToSalConversionsUtils() {
-        throw new IllegalAccessError("forcing no instance for factory");
-    }
-
-    public static Flow toFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow source, Node node) {
-        final Flow target = new Flow();
-        genericFlowToAdFlow(source, target);
-
-        target.setMatch(toMatch(source.getMatch()));
-
-        List<Action> actions = getAction(source);
-        if (actions != null) {
-            target.setActions(actionFrom(actions, node));
-        }
-
-        return target;
-    }
-
-    /**
-     * @param source notification, missing instructions
-     * @param node corresponding node where the flow change occured
-     * @return ad-sal node, build from given data
-     */
-    public static Flow toFlow(SwitchFlowRemoved source, Node node) {
-        final Flow target = new Flow();
-        genericFlowToAdFlow(source, target);
-
-        target.setMatch(toMatch(source.getMatch()));
-
-        return target;
-    }
-
-    /**
-     * @param source
-     * @param target
-     */
-    private static void genericFlowToAdFlow(GenericFlowAttributes source,
-            final Flow target) {
-        Integer hardTimeout = source.getHardTimeout();
-        if (hardTimeout != null) {
-            target.setHardTimeout(hardTimeout.shortValue());
-        }
-
-        Integer idleTimeout = source.getIdleTimeout();
-        if (idleTimeout != null) {
-            target.setIdleTimeout(idleTimeout.shortValue());
-        }
-
-        Integer priority = source.getPriority();
-        if (priority != null) {
-            target.setPriority(priority.shortValue());
-        }
-        target.setId(source.getCookie().getValue().longValue());
-    }
-
-    public static List<Action> getAction(
-            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow source) {
-        if (source.getInstructions() != null) {
-            for (Instruction instruction : source.getInstructions().getInstruction()) {
-                if (instruction.getInstruction() instanceof ApplyActionsCase) {
-                    return (((ApplyActionsCase) instruction.getInstruction()).getApplyActions().getAction());
-                }
-            }
-        }
-        // TODO Auto-generated method stub
-        return Collections.emptyList();
-    }
-
-    public static List<org.opendaylight.controller.sal.action.Action> actionFrom(List<Action> actions, Node node) {
-        List<org.opendaylight.controller.sal.action.Action> targetAction = new ArrayList<>();
-        for (Action action : actions) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action sourceAction = action
-                    .getAction();
-
-            if (sourceAction instanceof ControllerActionCase) {
-                targetAction.add(new Controller());
-            } else if (sourceAction instanceof OutputActionCase) {
-
-                Uri nodeConnector = ((OutputActionCase) sourceAction).getOutputAction().getOutputNodeConnector();
-                if (nodeConnector != null) {
-                    // TODO: We should really have a bi-directional map from AD-SAL node types to
-                    //       MD-SAL node types, but lets fix that later.
-                    String type = node.getType();
-                    if( type.equals(NodeIDType.OPENFLOW) ){
-                        type = NodeMapping.OPENFLOW_ID_PREFIX;
-                    }else{
-                        type = type + ":";
-                    }
-                    Uri fullNodeConnector = new Uri(type+node.getID()+":"+nodeConnector.getValue());
-                        targetAction.add(new Output(fromNodeConnectorRef(fullNodeConnector, node)));
-                }
-            } else if (sourceAction instanceof PopMplsActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof PushMplsActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof PushPbbActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof SetMplsTtlActionCase) {
-                // TODO: define maping
-                // targetAction = //no action to map
-            } else if (sourceAction instanceof SetNwTtlActionCase) {
-                // TODO: define maping
-            } else if (sourceAction instanceof SetQueueActionCase) {
-                // TODO: define maping
-                // targetAction = //no action to map
-            } else if (sourceAction instanceof DropActionCase) {
-                targetAction.add(new Drop());
-            } else if (sourceAction instanceof FloodActionCase) {
-                targetAction.add(new Flood());
-            } else if (sourceAction instanceof FloodAllActionCase) {
-                targetAction.add(new FloodAll());
-            } else if (sourceAction instanceof HwPathActionCase) {
-                targetAction.add(new HwPath());
-            } else if (sourceAction instanceof LoopbackActionCase) {
-                targetAction.add(new Loopback());
-            } else if (sourceAction instanceof PopVlanActionCase) {
-                targetAction.add(new PopVlan());
-            } else if (sourceAction instanceof PushVlanActionCase) {
-                PushVlanActionCase pushVlanAction = (PushVlanActionCase) sourceAction;
-                PushVlan pushVlan = pushVlanFrom(pushVlanAction.getPushVlanAction());
-                if (pushVlan != null) {
-                    targetAction.add(pushVlan);
-                }
-            } else if (sourceAction instanceof SetDlDstActionCase) {
-                MacAddress addressL2Dest = ((SetDlDstActionCase) sourceAction).getSetDlDstAction().getAddress();
-                if (addressL2Dest != null) {
-                    targetAction.add(new SetDlDst(bytesFrom(addressL2Dest)));
-                }
-            } else if (sourceAction instanceof SetDlSrcActionCase) {
-                MacAddress addressL2Src = ((SetDlSrcActionCase) sourceAction).getSetDlSrcAction().getAddress();
-                if (addressL2Src != null) {
-                    targetAction.add(new SetDlSrc(bytesFrom(addressL2Src)));
-
-                }
-            } else if (sourceAction instanceof SetDlTypeActionCase) {
-                EtherType dlType = ((SetDlTypeActionCase) sourceAction).getSetDlTypeAction().getDlType();
-                if (dlType != null) {
-                    Long dlTypeValue = dlType.getValue();
-                    if (dlTypeValue != null) {
-                        targetAction.add(new SetDlType(dlTypeValue.intValue()));
-                    }
-                }
-            } else if (sourceAction instanceof SetNextHopActionCase) {
-                Address addressL3 = ((SetNextHopActionCase) sourceAction).getSetNextHopAction().getAddress();
-
-                InetAddress inetAddress = inetAddressFrom(addressL3);
-                if (inetAddress != null) {
-                    targetAction.add(new SetNextHop(inetAddress));
-                }
-            } else if (sourceAction instanceof SetNwDstActionCase) {
-                Address addressL3 = ((SetNwDstActionCase) sourceAction).getSetNwDstAction().getAddress();
-
-                InetAddress inetAddress = inetAddressFrom(addressL3);
-                if (inetAddress != null) {
-                    targetAction.add(new SetNwDst(inetAddress));
-                }
-            } else if (sourceAction instanceof SetNwSrcActionCase) {
-                Address addressL3 = ((SetNwSrcActionCase) sourceAction).getSetNwSrcAction().getAddress();
-
-                InetAddress inetAddress = inetAddressFrom(addressL3);
-                if (inetAddress != null) {
-                    targetAction.add(new SetNwSrc(inetAddress));
-                }
-            } else if (sourceAction instanceof SetNwTosActionCase) {
-                Integer tos = ((SetNwTosActionCase) sourceAction).getSetNwTosAction().getTos();
-                if (tos != null) {
-                    targetAction.add(new SetNwTos(ToSalConversionsUtils.tosToNwDscp(tos)));
-                }
-            } else if (sourceAction instanceof SetTpDstActionCase) {
-                PortNumber port = ((SetTpDstActionCase) sourceAction).getSetTpDstAction().getPort();
-                if (port != null) {
-                    Integer portValue = port.getValue();
-                    if (port.getValue() != null) {
-                        targetAction.add(new SetTpDst(portValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetTpSrcActionCase) {
-                PortNumber port = ((SetTpSrcActionCase) sourceAction).getSetTpSrcAction().getPort();
-                if (port != null) {
-                    Integer portValue = port.getValue();
-                    if (port.getValue() != null) {
-                        targetAction.add(new SetTpSrc(portValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetVlanCfiActionCase) {
-                VlanCfi vlanCfi = ((SetVlanCfiActionCase) sourceAction).getSetVlanCfiAction().getVlanCfi();
-                if (vlanCfi != null) {
-                    Integer vlanCfiValue = vlanCfi.getValue();
-                    if (vlanCfiValue != null) {
-                        targetAction.add(new SetVlanCfi(vlanCfiValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetVlanIdActionCase) {
-                org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanID = ((SetVlanIdActionCase) sourceAction).getSetVlanIdAction()
-                        .getVlanId();
-                if (vlanID != null) {
-                    Integer vlanIdValue = vlanID.getValue();
-                    if (vlanIdValue != null) {
-                        targetAction.add(new SetVlanId(vlanIdValue));
-                    }
-                }
-            } else if (sourceAction instanceof SetVlanPcpActionCase) {
-                VlanPcp vlanPcp = ((SetVlanPcpActionCase) sourceAction).getSetVlanPcpAction().getVlanPcp();
-                if (vlanPcp != null) {
-                    Short vlanPcpValue = vlanPcp.getValue();
-                    if (vlanPcpValue != null) {
-                        targetAction.add(new SetVlanPcp(vlanPcpValue));
-                    }
-                }
-            } else if (sourceAction instanceof SwPathActionCase) {
-                targetAction.add(new SwPath());
-            }
-        }
-
-        return targetAction;
-    }
-
-    private static InetAddress inetAddressFrom(Address addressL3) {
-        if (addressL3 != null) {
-            if (addressL3 instanceof Ipv4) {
-                Ipv4Prefix addressL3Ipv4 = ((Ipv4) addressL3).getIpv4Address();
-                if (addressL3Ipv4 != null) {
-                    return inetAddressFrom(addressL3Ipv4);
-                }
-            } else if (addressL3 instanceof Ipv6) {
-                Ipv6Prefix addressL3Ipv6 = ((Ipv6) addressL3).getIpv6Address();
-                if (addressL3Ipv6 != null) {
-                    return inetAddressFrom(addressL3Ipv6);
-                }
-            }
-        }
-        return null;
-    }
-
-    private static PushVlan pushVlanFrom(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanAction pushVlanAction) {
-        Integer tag = pushVlanAction.getTag();
-        if (tag != null) {
-            return new PushVlan(tag.intValue());
-        }
-        return null;
-    }
-
-    /**
-     * @param openflow nodeConnector uri
-     * @param node
-     * @return assembled nodeConnector
-     */
-    public static NodeConnector fromNodeConnectorRef(Uri uri, Node node) {
-        NodeConnector nodeConnector = null;
-        try {
-            NodeConnectorId nodeConnectorId = new NodeConnectorId(uri.getValue());
-            nodeConnector = NodeMapping.toADNodeConnector(nodeConnectorId, node);
-        } catch (ConstructionException e) {
-            LOG.warn("nodeConnector creation failed at node: {} with nodeConnectorUri: {}",
-                    node, uri.getValue());
-        }
-        return nodeConnector;
-    }
-
-    public static Match toMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match source) {
-        Match target = new Match();
-        if (source != null) {
-            fillFrom(target, source.getVlanMatch());
-            fillFrom(target, source.getEthernetMatch());
-            fillFrom(target, source.getLayer3Match());
-            fillFrom(target, source.getLayer4Match());
-            fillFrom(target, source.getIpMatch());
-            fillFrom(target, source.getInPort());
-        }
-
-        return target;
-    }
-
-    /**
-     * @param target
-     * @param inPort
-     */
-    private static void fillFrom(Match target, NodeConnectorId inPort) {
-        if (inPort != null) {
-            String inPortValue = inPort.getValue();
-            if (inPortValue != null) {
-                try {
-                    target.setField(MatchType.IN_PORT, NodeMapping.toADNodeConnector(inPort,
-                            NodeMapping.toAdNodeId(inPort)));
-                } catch (ConstructionException e) {
-                    LOG.warn("nodeConnector construction failed", e);
-                }
-            }
-        }
-    }
-
-    private static void fillFrom(Match target, VlanMatch vlanMatch) {
-        if (vlanMatch != null) {
-            VlanId vlanId = vlanMatch.getVlanId();
-            if (vlanId != null) {
-                if (Boolean.TRUE.equals(vlanId.isVlanIdPresent())) {
-                    org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanIdInner = vlanId
-                            .getVlanId();
-                    if (vlanIdInner != null) {
-                        Integer vlanValue = vlanIdInner.getValue();
-                        if (vlanValue != null) {
-                            target.setField(DL_VLAN, vlanValue.shortValue());
-                        }
-                    }
-                } else {
-                    target.setField(DL_VLAN, MatchType.DL_VLAN_NONE);
-                }
-            }
-            VlanPcp vlanPcp = vlanMatch.getVlanPcp();
-            if (vlanPcp != null) {
-                Short vlanPcpValue = vlanPcp.getValue();
-                if (vlanPcpValue != null) {
-                    target.setField(DL_VLAN_PR, vlanPcpValue.byteValue());
-                }
-            }
-        }
-    }
-
-    private static void fillFrom(Match target, IpMatch ipMatch) {
-        if (ipMatch != null) {
-            Short ipProtocol = ipMatch.getIpProtocol();
-
-            if (ipProtocol != null && target.getField(NW_PROTO) == null) {
-                target.setField(NW_PROTO, ipProtocol.byteValue());
-            }
-            Dscp dscp = ipMatch.getIpDscp();
-            if (dscp != null) {
-                Short dscpValue = dscp.getValue();
-                if (dscpValue != null) {
-                    target.setField(NW_TOS, dscpValue.byteValue());
-                }
-            }
-        }
-    }
-
-    private static void fillFrom(Match target, Layer4Match layer4Match) {
-        if (layer4Match == null) {
-            return;
-        }
-        if (layer4Match instanceof SctpMatch) {
-            fillTransportLayer(target, (SctpMatch) layer4Match);
-        } else if (layer4Match instanceof TcpMatch) {
-            fillTransportLayer(target, (TcpMatch) layer4Match);
-        } else if (layer4Match instanceof UdpMatch) {
-            fillTransportLayer(target, (UdpMatch) layer4Match);
-        }
-    }
-
-    private static void fillTransportLayer(Match target, UdpMatch source) {
-        PortNumber udpSourcePort = source.getUdpSourcePort();
-        if (udpSourcePort != null) {
-            Integer udpSourcePortValue = udpSourcePort.getValue();
-            if (udpSourcePortValue != null) {
-                target.setField(TP_SRC, udpSourcePortValue.shortValue());
-            }
-        }
-
-        PortNumber udpDestPort = source.getUdpDestinationPort();
-        if (udpDestPort != null) {
-            Integer udpDestPortValue = udpDestPort.getValue();
-            if (udpDestPortValue != null) {
-                target.setField(TP_DST, udpDestPortValue.shortValue());
-            }
-        }
-
-        target.setField(NW_PROTO, UDP);
-    }
-
-    private static void fillTransportLayer(Match target, TcpMatch source) {
-        PortNumber tcpSourcePort = source.getTcpSourcePort();
-        if (tcpSourcePort != null) {
-            Integer tcpSourcePortValue = tcpSourcePort.getValue();
-            if (tcpSourcePortValue != null) {
-                target.setField(TP_SRC, tcpSourcePortValue.shortValue());
-            }
-        }
-
-        PortNumber tcpDestPort = source.getTcpDestinationPort();
-        if (tcpDestPort != null) {
-            Integer tcpDestPortValue = tcpDestPort.getValue();
-            if (tcpDestPortValue != null) {
-                target.setField(TP_DST, tcpDestPortValue.shortValue());
-            }
-        }
-
-        target.setField(NW_PROTO, TCP);
-    }
-
-    private static void fillTransportLayer(Match target, SctpMatch source) {
-        PortNumber sctpSourcePort = source.getSctpSourcePort();
-        if (sctpSourcePort != null) {
-            Integer sctpSourcePortValue = sctpSourcePort.getValue();
-            if (sctpSourcePortValue != null) {
-                target.setField(TP_SRC, sctpSourcePortValue.shortValue());
-            }
-        }
-        PortNumber sctpDestPort = source.getSctpDestinationPort();
-        if (sctpDestPort != null) {
-            Integer sctpDestPortValue = sctpDestPort.getValue();
-            if (sctpDestPortValue != null) {
-                target.setField(TP_DST, sctpDestPortValue.shortValue());
-            }
-        }
-
-        target.setField(NW_PROTO, CRUDP);
-
-    }
-
-    private static void fillFrom(Match target, Layer3Match source) {
-        if (source == null)
-            return;
-        if (source instanceof Ipv4Match) {
-            fillFromIpv4(target, (Ipv4Match) source);
-        } else if (source instanceof Ipv6Match) {
-            fillFromIpv6(target, (Ipv6Match) source);
-        } else if (source instanceof ArpMatch) {
-            fillFromArp(target, (ArpMatch) source);
-        }
-    }
-
-    private static void fillFromArp(Match target, ArpMatch source) {
-        Ipv4Prefix sourceAddress = source.getArpSourceTransportAddress();
-        if (sourceAddress != null) {
-            target.setField(NW_SRC, inetAddressFrom(sourceAddress), null);
-        }
-        Ipv4Prefix destAddress = source.getArpTargetTransportAddress();
-        if (destAddress != null) {
-            target.setField(NW_DST, inetAddressFrom(destAddress), null);
-        }
-        ArpSourceHardwareAddress sourceHwAddress = source.getArpSourceHardwareAddress();
-        if (sourceHwAddress != null) {
-            target.setField(DL_SRC, bytesFrom(sourceHwAddress.getAddress()));
-        }
-        ArpTargetHardwareAddress targetHwAddress = source.getArpTargetHardwareAddress();
-        if (targetHwAddress != null) {
-            target.setField(DL_DST, bytesFrom(targetHwAddress.getAddress()));
-        }
-
-        target.setField(DL_TYPE, new Short(ETHERNET_ARP));
-
-    }
-
-    private static void fillFromIpv6(Match target, Ipv6Match source) {
-        Ipv6Prefix sourceAddress = source.getIpv6Source();
-        if (sourceAddress != null) {
-            target.setField(NW_SRC, inetAddressFrom(sourceAddress), null);
-        }
-        Ipv6Prefix destAddress = source.getIpv6Destination();
-        if (destAddress != null) {
-            target.setField(NW_DST, inetAddressFrom(destAddress), null);
-        }
-    }
-
-    private static void fillFromIpv4(Match target, Ipv4Match source) {
-        Ipv4Prefix sourceAddress = source.getIpv4Source();
-        if (sourceAddress != null) {
-            target.setField(NW_SRC, inetAddressFrom(sourceAddress), null);
-        }
-        Ipv4Prefix destAddress = source.getIpv4Destination();
-        if (destAddress != null) {
-            target.setField(NW_DST, inetAddressFrom(destAddress), null);
-        }
-    }
-
-    private static InetAddress inetAddressFrom(Ipv4Prefix source) {
-        if (source != null) {
-            String[] parts = source.getValue().split("/");
-            return InetAddresses.forString(parts[0]);
-        }
-        return null;
-    }
-
-    private static InetAddress inetAddressFrom(Ipv6Prefix source) {
-        if (source != null) {
-            String[] parts = source.getValue().split("/");
-            return InetAddresses.forString(parts[0]);
-        }
-        return null;
-    }
-
-    private static void fillFrom(Match target, EthernetMatch source) {
-        if (source == null)
-            return;
-        EthernetType ethType = source.getEthernetType();
-        if (ethType != null) {
-            EtherType ethInnerType = ethType.getType();
-            if (ethInnerType != null && target.getField(DL_TYPE) == null) {
-                Long value = ethInnerType.getValue();
-                target.setField(DL_TYPE, value.shortValue());
-            }
-        }
-
-        MacAddressFilter ethSource = source.getEthernetSource();
-        if (ethSource != null) {
-            target.setField(DL_SRC, bytesFrom(ethSource.getAddress()));
-        }
-
-        MacAddressFilter ethDest = source.getEthernetDestination();
-        if (ethDest != null) {
-            target.setField(DL_DST, bytesFrom(ethDest.getAddress()));
-        }
-    }
-
-    public static byte[] bytesFrom(MacAddress address) {
-        String[] mac = address.getValue().split(":");
-        byte[] macAddress = new byte[6]; // mac.length == 6 bytes
-        for (int i = 0; i < mac.length; i++) {
-            macAddress[i] = Integer.decode("0x" + mac[i]).byteValue();
-        }
-        return macAddress;
-    }
-
-    public static byte[] bytesFromDpid(long dpid) {
-        byte[] mac = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-
-        for (short i = 0; i < 6; i++) {
-            mac[5 - i] = (byte) dpid;
-            dpid >>= 8;
-        }
-
-        return mac;
-    }
-
-    /**
-     * @param nwTos NW-TOS
-     * @return shifted to NW-DSCP
-     */
-    public static int tosToNwDscp(int nwTos) {
-        return (short) (nwTos >>> FromSalConversionsUtils.ENC_FIELD_BIT_SIZE);
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/DataPacketServiceAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/DataPacketServiceAdapter.java
deleted file mode 100644 (file)
index c4aaf64..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.adsal;
-
-import org.opendaylight.controller.sal.compatibility.NodeMapping;
-import org.opendaylight.controller.sal.packet.IPluginInDataPacketService;
-import org.opendaylight.controller.sal.packet.RawPacket;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInputBuilder;
-
-public class DataPacketServiceAdapter implements IPluginInDataPacketService {
-
-    PacketProcessingService delegate;
-
-    @Override
-    public void transmitDataPacket(RawPacket outPkt) {
-        TransmitPacketInput packet = toTransmitPacketInput(outPkt);
-        delegate.transmitPacket(packet);
-    }
-
-    private TransmitPacketInput toTransmitPacketInput(RawPacket rawPacket) {
-        TransmitPacketInputBuilder builderTPIB = new TransmitPacketInputBuilder();
-
-        builderTPIB.setNode(NodeMapping.toNodeRef(rawPacket.getOutgoingNodeConnector().getNode()));
-
-        NodeConnectorRef egress = rawPacket.getOutgoingNodeConnector() == null ? null :
-                NodeMapping.toNodeConnectorRef(rawPacket.getOutgoingNodeConnector());
-        NodeConnectorRef ingress = rawPacket.getIncomingNodeConnector() == null ? null :
-                NodeMapping.toNodeConnectorRef(rawPacket.getIncomingNodeConnector());
-        byte[] payload = rawPacket.getPacketData();
-
-        builderTPIB.setEgress(egress);
-        builderTPIB.setIngress(ingress);
-        builderTPIB.setPayload(payload);
-
-        return builderTPIB.build();
-    }
-
-    public PacketProcessingService getDelegate() {
-        return delegate;
-    }
-
-    public void setDelegate(PacketProcessingService delegate) {
-        this.delegate = delegate;
-    }
-
-
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowServiceAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowServiceAdapter.java
deleted file mode 100644 (file)
index 56c7afb..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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.adsal;
-
-import java.math.BigInteger;
-
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.compatibility.InventoryMapping;
-import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerListener;
-import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerService;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public class FlowServiceAdapter implements SalFlowService, IFlowProgrammerListener {
-
-    private static final Logger LOG = LoggerFactory.getLogger(FlowServiceAdapter.class);
-
-    private IFlowProgrammerService delegate;
-
-    private NotificationProviderService publish;
-
-    @Override
-    public void flowRemoved(org.opendaylight.controller.sal.core.Node node, Flow flow) {
-        FlowRemovedBuilder flowRemovedBuilder = new FlowRemovedBuilder();
-        flowRemovedBuilder.setNode(InventoryMapping.toNodeRef(node));
-        publish.publish(flowRemovedBuilder.build());
-    }
-
-    @Override
-    public void flowErrorReported(org.opendaylight.controller.sal.core.Node node, long rid, Object err) {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
-
-        Flow flow = ToSalConversionsUtils.toFlow(input, null);
-        @SuppressWarnings("unchecked")
-        org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
-                .getNode().getValue());
-        Status status = delegate.addFlowAsync(node, flow);
-        AddFlowOutputBuilder builder = new AddFlowOutputBuilder();
-        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
-        AddFlowOutput rpcResultType = builder.build();
-        return Futures.immediateFuture(RpcResultBuilder.<AddFlowOutput>status(status.isSuccess())
-                .withResult(rpcResultType).build());
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
-
-        Flow flow = ToSalConversionsUtils.toFlow(input, null);
-        @SuppressWarnings("unchecked")
-        org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
-                .getNode().getValue());
-        Status status = delegate.removeFlowAsync(node, flow);
-        RemoveFlowOutputBuilder builder = new RemoveFlowOutputBuilder();
-        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
-        RemoveFlowOutput rpcResultType = builder.build();
-        return Futures.immediateFuture(RpcResultBuilder.<RemoveFlowOutput>status(status.isSuccess())
-                                                         .withResult(rpcResultType).build());
-
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
-        @SuppressWarnings("unchecked")
-        org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
-                .getNode().getValue());
-        Flow originalFlow = ToSalConversionsUtils.toFlow(input.getOriginalFlow(), null);
-        Flow updatedFlow = ToSalConversionsUtils.toFlow(input.getUpdatedFlow(), null);
-        Status status = delegate.modifyFlowAsync(node, originalFlow, updatedFlow);
-        UpdateFlowOutputBuilder builder = new UpdateFlowOutputBuilder();
-        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
-        UpdateFlowOutput rpcResultType = builder.build();
-        throw new UnsupportedOperationException("Need to translate AD-SAL status to MD-SAL UpdateFlowOuptut - eaw@cisco.com");
-        // return Futures.immediateFuture(Rpcs.getRpcResult(status.isSuccess(), rpcResultType, null));
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowStatisticsAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowStatisticsAdapter.java
deleted file mode 100644 (file)
index e63cb54..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * 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.adsal;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.compatibility.FromSalConversionsUtils;
-import org.opendaylight.controller.sal.compatibility.InventoryMapping;
-import org.opendaylight.controller.sal.compatibility.NodeMapping;
-import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.reader.FlowOnNode;
-import org.opendaylight.controller.sal.reader.IReadService;
-import org.opendaylight.controller.sal.reader.IReadServiceListener;
-import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
-import org.opendaylight.controller.sal.reader.NodeDescription;
-import org.opendaylight.controller.sal.reader.NodeTableStatistics;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter32;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter64;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.DurationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Bytes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.BytesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.Packets;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.node.connector.statistics.PacketsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public class FlowStatisticsAdapter implements OpendaylightFlowStatisticsService, IReadServiceListener{
-
-    private static final Logger LOG = LoggerFactory.getLogger(FlowStatisticsAdapter.class);
-    private IReadService readDelegate;
-    private NotificationProviderService notifier;
-
-    @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> getAggregateFlowStatisticsFromFlowTableForAllFlows(
-            GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
-        //TODO: No supported API exist in AD-SAL, it can either be implemented by fetching all the stats of the flows and
-        // generating aggregate flow statistics out of those individual flow stats.
-        return null;
-    }
-
-    @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> getAggregateFlowStatisticsFromFlowTableForGivenMatch(
-            GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
-        //TODO: No supported API exist in AD-SAL, it can either be implemented by fetching all the stats of the flows and
-        // generating aggregate flow statistics out of those individual flow stats.
-        return null;
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> getAllFlowStatisticsFromFlowTable(
-            GetAllFlowStatisticsFromFlowTableInput input) {
-        GetAllFlowStatisticsFromFlowTableOutput rpcResultType = null;
-        boolean rpcResultBool = false;
-
-        try {
-            Node adNode = NodeMapping.toADNode(input.getNode());
-            List<FlowOnNode> flowsOnNode = readDelegate.readAllFlows(adNode);
-            List<FlowAndStatisticsMapList> flowsStatistics = toOdFlowsStatistics(flowsOnNode);
-            GetAllFlowStatisticsFromFlowTableOutputBuilder builder = new GetAllFlowStatisticsFromFlowTableOutputBuilder();
-            builder.setTransactionId(new TransactionId(new BigInteger("0")));
-            rpcResultType = builder.setFlowAndStatisticsMapList(flowsStatistics).build();
-
-            rpcResultBool = true;
-        } catch (ConstructionException e) {
-            LOG.error(e.getMessage());
-        }
-
-        return Futures.immediateFuture(RpcResultBuilder.<GetAllFlowStatisticsFromFlowTableOutput>
-                                                status(rpcResultBool).withResult(rpcResultType).build());
-    }
-
-    /**
-     * Essentially this API will return the same result as getAllFlowStatisticsFromFlowTable
-     */
-    @Override
-    public ListenableFuture<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>> getAllFlowsStatisticsFromAllFlowTables(
-            GetAllFlowsStatisticsFromAllFlowTablesInput input) {
-
-        GetAllFlowsStatisticsFromAllFlowTablesOutput rpcResultType = null;
-        boolean rpcResultBool = false;
-
-        try {
-            Node adNode = NodeMapping.toADNode(input.getNode());
-            List<FlowOnNode> flowsOnNode = readDelegate.readAllFlows(adNode);
-            List<FlowAndStatisticsMapList> flowsStatistics = toOdFlowsStatistics(flowsOnNode);
-            GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder builder = new GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder();
-            builder.setTransactionId(new TransactionId(new BigInteger("0")));
-            rpcResultType = builder.setFlowAndStatisticsMapList(flowsStatistics).build();
-
-            rpcResultBool = true;
-        } catch (ConstructionException e) {
-            LOG.error(e.getMessage());
-        }
-
-        return Futures.immediateFuture(RpcResultBuilder.<GetAllFlowsStatisticsFromAllFlowTablesOutput>
-                                               status(rpcResultBool).withResult(rpcResultType).build());
-    }
-
-    @Override
-    public ListenableFuture<RpcResult<GetFlowStatisticsFromFlowTableOutput>> getFlowStatisticsFromFlowTable(
-            GetFlowStatisticsFromFlowTableInput input) {
-        GetFlowStatisticsFromFlowTableOutput rpcResultType = null;
-        boolean rpcResultBool = false;
-
-        try {
-            Node node = NodeMapping.toADNode(input.getNode());
-            Flow flow = ToSalConversionsUtils.toFlow(input, null);
-            FlowOnNode readFlow = readDelegate.readFlow(node, flow);
-            List<FlowAndStatisticsMapList> flowOnNodeToFlowStatistics = new ArrayList<FlowAndStatisticsMapList>();
-            flowOnNodeToFlowStatistics.add(toOdFlowStatistics(readFlow));
-            rpcResultType = new GetFlowStatisticsFromFlowTableOutputBuilder().setFlowAndStatisticsMapList(flowOnNodeToFlowStatistics).build();
-            rpcResultBool = true;
-        } catch (ConstructionException e) {
-            LOG.error(e.getMessage());
-        }
-
-        return Futures.immediateFuture(RpcResultBuilder.<GetFlowStatisticsFromFlowTableOutput>
-                                              status(rpcResultBool).withResult(rpcResultType).build());
-    }
-
-    @Override
-    public void nodeFlowStatisticsUpdated(Node node, List<FlowOnNode> flowStatsList) {
-        List<FlowAndStatisticsMapList> flowStatistics = toOdFlowsStatistics(flowStatsList);
-        FlowsStatisticsUpdateBuilder flowsStatisticsUpdateBuilder = new FlowsStatisticsUpdateBuilder();
-        flowsStatisticsUpdateBuilder.setFlowAndStatisticsMapList(flowStatistics);
-        flowsStatisticsUpdateBuilder.setMoreReplies(false);
-        flowsStatisticsUpdateBuilder.setTransactionId(null);
-        flowsStatisticsUpdateBuilder.setId(InventoryMapping.toNodeKey(node).getId());
-        notifier.publish(flowsStatisticsUpdateBuilder.build());
-    }
-
-    @Override
-    public void nodeConnectorStatisticsUpdated(Node node, List<NodeConnectorStatistics> ncStatsList) {
-        NodeConnectorStatisticsUpdateBuilder nodeConnectorStatisticsUpdateBuilder = new NodeConnectorStatisticsUpdateBuilder();
-        List<NodeConnectorStatisticsAndPortNumberMap> nodeConnectorStatistics = toOdNodeConnectorStatistics(ncStatsList);
-
-        nodeConnectorStatisticsUpdateBuilder.setNodeConnectorStatisticsAndPortNumberMap(nodeConnectorStatistics);
-        nodeConnectorStatisticsUpdateBuilder.setMoreReplies(false);
-        nodeConnectorStatisticsUpdateBuilder.setTransactionId(null);
-        nodeConnectorStatisticsUpdateBuilder.setId(InventoryMapping.toNodeKey(node).getId());
-        notifier.publish(nodeConnectorStatisticsUpdateBuilder.build());
-    }
-
-    @Override
-    public void nodeTableStatisticsUpdated(Node node, List<NodeTableStatistics> tableStatsList) {
-
-        FlowTableStatisticsUpdateBuilder flowTableStatisticsUpdateBuilder = new FlowTableStatisticsUpdateBuilder();
-
-        List<FlowTableAndStatisticsMap>  flowTableStatistics = toOdFlowTableStatistics(tableStatsList);
-        flowTableStatisticsUpdateBuilder.setFlowTableAndStatisticsMap(flowTableStatistics);
-        flowTableStatisticsUpdateBuilder.setMoreReplies(false);
-        flowTableStatisticsUpdateBuilder.setTransactionId(null);
-        flowTableStatisticsUpdateBuilder.setId(InventoryMapping.toNodeKey(node).getId());
-        notifier.publish(flowTableStatisticsUpdateBuilder.build());
-}
-
-        @Override
-    public void descriptionStatisticsUpdated(Node node, NodeDescription nodeDescription) {
-            // TODO which *StatisticsUpdated interface should be used?
-
-    }
-
-    private List<FlowAndStatisticsMapList> toOdFlowsStatistics(List<FlowOnNode> flowsOnNode) {
-        List<FlowAndStatisticsMapList> flowsStatistics = new ArrayList<>();
-        for (FlowOnNode flowOnNode : flowsOnNode) {
-            flowsStatistics.add(toOdFlowStatistics(flowOnNode));
-        }
-        return flowsStatistics;
-    }
-
-    private FlowAndStatisticsMapList toOdFlowStatistics(FlowOnNode flowOnNode) {
-        FlowAndStatisticsMapListBuilder builder = new FlowAndStatisticsMapListBuilder();
-
-        builder.setByteCount(toCounter64(flowOnNode.getByteCount()));
-        builder.setPacketCount(toCounter64(flowOnNode.getPacketCount()));
-        builder.setDuration(extractDuration(flowOnNode));
-        builder.setMatch(FromSalConversionsUtils.toMatch(flowOnNode.getFlow().getMatch()));
-        builder.setPriority((int)flowOnNode.getFlow().getPriority());
-        builder.setHardTimeout((int)flowOnNode.getFlow().getHardTimeout());
-        builder.setIdleTimeout((int)flowOnNode.getFlow().getIdleTimeout());
-        //TODO: actions to instruction conversion
-        builder.setInstructions(null);
-        return builder.build();
-    }
-
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.Duration extractDuration(FlowOnNode flowOnNode) {
-        DurationBuilder builder = new DurationBuilder();
-        builder.setNanosecond(new Counter32((long)flowOnNode.getDurationNanoseconds()));
-        builder.setSecond(new Counter32((long)flowOnNode.getDurationSeconds()));
-        return builder.build();
-    }
-
-    private Counter64 toCounter64(long num) {
-        String byteCountStr = String.valueOf(num);
-        BigInteger byteCountBigInt = new BigInteger(byteCountStr);
-        return new Counter64(byteCountBigInt);
-    }
-
-    private List<FlowTableAndStatisticsMap> toOdFlowTableStatistics(List<NodeTableStatistics> tableStatsList) {
-
-        List<FlowTableAndStatisticsMap> flowTableStatsMap = new ArrayList<FlowTableAndStatisticsMap>();
-        for (NodeTableStatistics nodeTableStatistics : tableStatsList) {
-            FlowTableAndStatisticsMapBuilder flowTableAndStatisticsMapBuilder = new FlowTableAndStatisticsMapBuilder();
-            flowTableAndStatisticsMapBuilder.setActiveFlows(new Counter32((long) nodeTableStatistics.getActiveCount()));
-            flowTableAndStatisticsMapBuilder.setPacketsLookedUp(toCounter64(nodeTableStatistics.getLookupCount()));
-            flowTableAndStatisticsMapBuilder.setPacketsMatched(toCounter64(nodeTableStatistics.getMatchedCount()));
-            flowTableAndStatisticsMapBuilder.setActiveFlows(new Counter32((long) nodeTableStatistics.getActiveCount()));
-            flowTableAndStatisticsMapBuilder.setTableId(new TableId((short)nodeTableStatistics.getNodeTable().getID()));
-            flowTableStatsMap.add(flowTableAndStatisticsMapBuilder.build());
-        }
-
-        return flowTableStatsMap;
-    }
-
-    private List<NodeConnectorStatisticsAndPortNumberMap> toOdNodeConnectorStatistics(
-            List<NodeConnectorStatistics> ncStatsList) {
-        List<NodeConnectorStatisticsAndPortNumberMap> nodeConnectorStatisticsList = new ArrayList<NodeConnectorStatisticsAndPortNumberMap>();
-        for(NodeConnectorStatistics ofNodeConnectorStatistics : ncStatsList){
-            NodeConnectorStatisticsAndPortNumberMapBuilder nodeConnectorStatisticsAndPortNumberMapBuilder = new NodeConnectorStatisticsAndPortNumberMapBuilder();
-
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setBytes(extractBytes(ofNodeConnectorStatistics));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setCollisionCount(toBI(ofNodeConnectorStatistics.getCollisionCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setDuration(null);
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setPackets(extractPackets(ofNodeConnectorStatistics));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveCrcError(toBI(ofNodeConnectorStatistics.getReceiveCRCErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveDrops(toBI(ofNodeConnectorStatistics.getReceiveDropCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveErrors(toBI(ofNodeConnectorStatistics.getReceiveErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveFrameError(toBI(ofNodeConnectorStatistics.getReceiveFrameErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setReceiveOverRunError(toBI(ofNodeConnectorStatistics.getReceiveOverRunErrorCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setTransmitDrops(toBI(ofNodeConnectorStatistics.getTransmitDropCount()));
-            nodeConnectorStatisticsAndPortNumberMapBuilder.setTransmitErrors(toBI(ofNodeConnectorStatistics.getTransmitErrorCount()));
-            nodeConnectorStatisticsList.add(nodeConnectorStatisticsAndPortNumberMapBuilder.build());
-        }
-
-        return nodeConnectorStatisticsList;
-    }
-
-    private BigInteger toBI(long num) {
-        String numStr = String.valueOf(num);
-        return new BigInteger(numStr);
-    }
-
-    private Packets extractPackets(NodeConnectorStatistics nodeConnectorStatistics) {
-        long receivePacketCount = nodeConnectorStatistics.getReceivePacketCount();
-        long transmitPacketCount = nodeConnectorStatistics.getTransmitPacketCount();
-
-        PacketsBuilder builder = new PacketsBuilder();
-        builder.setReceived(toBI(receivePacketCount));
-        builder.setTransmitted(toBI(transmitPacketCount));
-
-        return builder.build();
-    }
-
-    private Bytes extractBytes(NodeConnectorStatistics nodeConnectorStatistics) {
-        long transmitByteCount = nodeConnectorStatistics.getTransmitByteCount();
-        long receiveByteCount = nodeConnectorStatistics.getReceiveByteCount();
-
-        BytesBuilder builder = new BytesBuilder();
-        builder.setReceived(toBI(receiveByteCount));
-        builder.setTransmitted(toBI(transmitByteCount));
-
-        return builder.build();
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyAdapter.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyAdapter.java
deleted file mode 100644 (file)
index 4e3cf69..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.topology;
-
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.topology.IPluginInTopologyService;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import com.google.common.base.Preconditions;
-
-public class TopologyAdapter implements IPluginInTopologyService {
-    private final InstanceIdentifier<Topology> topology = InstanceIdentifier.builder(NetworkTopology.class)
-            .child(Topology.class, new TopologyKey(new TopologyId("flow:1"))).toInstance();
-
-    // Injected via Apache DM
-    private IPluginOutTopologyService topologyPublisher;
-
-
-    private DataProviderService dataService;
-
-    public void setDataService(final DataProviderService dataService) {
-        this.dataService = Preconditions.checkNotNull(dataService);
-    }
-
-    @Override
-    public void sollicitRefresh() {
-        final TypeSafeDataReader reader = TypeSafeDataReader.forReader(dataService);
-        final Topology t = reader.readOperationalData(topology);
-        topologyPublisher.edgeUpdate(TopologyMapping.toADEdgeUpdates(t, reader));
-    }
-
-    public IPluginOutTopologyService getTopologyPublisher() {
-        return topologyPublisher;
-    }
-
-    public void setTopologyPublisher(final IPluginOutTopologyService topologyPublisher) {
-        this.topologyPublisher = topologyPublisher;
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyCommitHandler.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyCommitHandler.java
deleted file mode 100644 (file)
index e798b68..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.topology;
-
-import static org.opendaylight.controller.sal.compatibility.topology.TopologyMapping.toAdEdge;
-import static org.opendaylight.controller.sal.compatibility.topology.TopologyMapping.toTopoEdgeUpdate;
-
-import java.util.Map.Entry;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-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.DataProviderService;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TopologyCommitHandler implements DataChangeListener {
-    private static final Logger LOG = LoggerFactory.getLogger(TopologyCommitHandler.class);
-
-    private IPluginOutTopologyService topologyPublisher;
-
-    private final DataProviderService dataService;
-
-    public TopologyCommitHandler(final DataProviderService dataService, final IPluginOutTopologyService topologyPub) {
-        this.topologyPublisher = topologyPub;
-        this.dataService = dataService;
-    }
-
-    @Override
-    public void onDataChanged(final DataChangeEvent<InstanceIdentifier<?>, DataObject> modification) {
-        CopyOnWriteArrayList<TopoEdgeUpdate> msg = new CopyOnWriteArrayList<TopoEdgeUpdate>();
-        try {
-            TypeSafeDataReader reader = TypeSafeDataReader.forReader(dataService);
-            InstanceIdentifier<Topology> topologyPath = InstanceIdentifier.builder(NetworkTopology.class)
-                    .child(Topology.class, new TopologyKey(new TopologyId("flow:1"))).build();
-            Topology topology = reader.readOperationalData(topologyPath);
-
-            for (Entry<InstanceIdentifier<? extends DataObject>, DataObject> entry : modification
-                    .getCreatedOperationalData().entrySet()) {
-                if (entry.getValue() instanceof Link
-                        && modification.getCreatedOperationalData().containsKey(entry.getKey())) {
-                    msg.add(toTopoEdgeUpdate(toAdEdge((Link) entry.getValue(), topology), UpdateType.ADDED, reader));
-                }
-            }
-
-            for (Entry<InstanceIdentifier<? extends DataObject>, DataObject> entry : modification
-                    .getUpdatedOperationalData().entrySet()) {
-                if (entry.getValue() instanceof Link) {
-                    msg.add(toTopoEdgeUpdate(toAdEdge((Link) entry.getValue(), topology), UpdateType.CHANGED, reader));
-                }
-            }
-            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.REMOVED, reader));
-                }
-
-            }
-
-            if (topologyPublisher != null && msg != null && !msg.isEmpty()) {
-                topologyPublisher.edgeUpdate(msg);
-            }
-
-        } catch (Exception e) {
-            LOG.error("Exception caught", e);
-        }
-    }
-
-    protected IPluginOutTopologyService getTopologyPublisher() {
-        return topologyPublisher;
-    }
-
-    protected void setTopologyPublisher(final IPluginOutTopologyService topologyPublisher) {
-        this.topologyPublisher = topologyPublisher;
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyMapping.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyMapping.java
deleted file mode 100644 (file)
index ae723a3..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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.topology;
-
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
-import org.opendaylight.controller.md.sal.binding.util.TypeSafeDataReader;
-import org.opendaylight.controller.sal.compatibility.NodeMapping;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Edge;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.regex.Pattern;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public final class TopologyMapping {
-    private static final Logger LOG = LoggerFactory.getLogger(TopologyMapping.class);
-    private final static Pattern NUMBERS_ONLY = Pattern.compile("[0-9]+");
-
-    private TopologyMapping() {
-        throw new UnsupportedOperationException("Utility class. Instantiation is not allowed.");
-    }
-
-    public static List<TopoEdgeUpdate> toADEdgeUpdates(final Topology topology,final TypeSafeDataReader reader) {
-        final List<TopoEdgeUpdate> result = new CopyOnWriteArrayList<>();
-        return FluentIterable.from(topology.getLink()).transform(
-                new Function<Link, TopoEdgeUpdate>() {
-                    @Override
-                    public TopoEdgeUpdate apply(final Link input) {
-                        try {
-                            return toTopoEdgeUpdate(toAdEdge(input, topology), reader);
-                        } catch (ConstructionException e) {
-                            throw new IllegalArgumentException(String.format("Failed to construct edge update for {}", input), e);
-                        }
-                    }}
-                ).copyInto(result);
-    }
-
-    public static Edge toAdEdge(final Link link, final Topology topology) throws ConstructionException {
-        final NodeConnector adSrc = toADNodeConnector(link.getSource().getSourceTp(), link.getSource().getSourceNode());
-        final NodeConnector adDst = toADNodeConnector(link.getDestination().getDestTp(), link.getDestination().getDestNode());
-        return new Edge(adSrc, adDst);
-    }
-
-    public static TopoEdgeUpdate toTopoEdgeUpdate(final Edge e, final TypeSafeDataReader reader) {
-        return toTopoEdgeUpdate(e, UpdateType.ADDED, reader);
-    }
-
-    public static TopoEdgeUpdate toTopoEdgeUpdate(final Edge e,final UpdateType type,final TypeSafeDataReader reader) {
-        return new TopoEdgeUpdate(e, toAdEdgeProperties(e, reader), type);
-    }
-
-    public static Set<Property> toAdEdgeProperties(final Edge e,final TypeSafeDataReader reader) {
-        final NodeConnectorRef ncref = NodeMapping.toNodeConnectorRef(e.getTailNodeConnector());
-        if(ncref == null) {
-            LOG.debug("Edge {} ncref {}",e,ncref);
-            return null;
-        }
-
-        @SuppressWarnings("unchecked")
-        final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> ncInstanceId =
-        (InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector>) ncref.getValue();
-        if(ncInstanceId == null) {
-            LOG.debug("Edge {} ncref {}",e,ncref);
-            return null;
-        }
-
-        final  org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc = reader.readOperationalData(ncInstanceId);
-        if(nc == null) {
-            return null;
-        }
-        return NodeMapping.toADNodeConnectorProperties(nc);
-    }
-
-    public static String toADNodeId(final NodeId nodeId) {
-        return nodeId.getValue().replaceFirst("^.*:", "");
-    }
-
-    public static NodeConnector toADNodeConnector(final TpId source, final NodeId nodeId) throws ConstructionException {
-        checkNotNull(source);
-        String nodeConnectorIdStripped = toADNodeConnectorId(source);
-        if (NUMBERS_ONLY.matcher(nodeConnectorIdStripped).matches()) {
-            return new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf(nodeConnectorIdStripped), toADNode(nodeId));
-        }
-        LOG.debug("NodeConnectorId does not match openflow id type, using " + NodeMapping.MD_SAL_TYPE +  "instead");
-        NodeConnectorIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class, NodeMapping.MD_SAL_TYPE);
-        return new NodeConnector(NodeMapping.MD_SAL_TYPE, nodeConnectorIdStripped, toADNode(nodeId));
-    }
-
-    public static String toADNodeConnectorId(final TpId nodeConnectorId) {
-        return nodeConnectorId.getValue().replaceFirst("^.*:", "");
-    }
-
-    public static Node toADNode(final NodeId nodeId) throws ConstructionException {
-        checkNotNull(nodeId);
-        String nodeIdStripped = toADNodeId(nodeId);
-        if (NUMBERS_ONLY.matcher(nodeIdStripped).matches()) {
-            return new Node(NodeIDType.OPENFLOW, Long.valueOf(nodeIdStripped));
-        }
-        LOG.debug("NodeId does not match openflow id type, using " + NodeMapping.MD_SAL_TYPE +  "instead");
-        NodeIDType.registerIDType(NodeMapping.MD_SAL_TYPE, String.class);
-        return new Node(NodeMapping.MD_SAL_TYPE, nodeId.getValue());
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyProvider.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/topology/TopologyProvider.java
deleted file mode 100644 (file)
index d78bce4..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.topology;
-
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-public class TopologyProvider implements AutoCloseable{
-    private static final Logger LOG = LoggerFactory.getLogger(TopologyProvider.class);
-    private static final InstanceIdentifier<Link> PATH = InstanceIdentifier.builder(NetworkTopology.class)
-            .child(Topology.class ,new TopologyKey(new TopologyId("flow:1")))
-            .child(Link.class)
-            .toInstance();
-    private TopologyCommitHandler commitHandler;
-
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-    private IPluginOutTopologyService topologyPublisher;
-    private DataProviderService dataService;
-
-    public void startAdapter() {
-        if(dataService == null){
-            LOG.error("dataService not set");
-            return;
-        }
-        commitHandler = new TopologyCommitHandler(dataService,topologyPublisher);
-        listenerRegistration = dataService.registerDataChangeListener(PATH, commitHandler);
-        LOG.info("TopologyProvider started");
-    }
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            listenerRegistration.close();
-        }
-    }
-
-    void setTopologyPublisher(final IPluginOutTopologyService topologyPublisher) {
-        this.topologyPublisher = topologyPublisher;
-        if (commitHandler != null) {
-            commitHandler.setTopologyPublisher(topologyPublisher);
-        }
-    }
-
-    public void setDataService(final DataProviderService dataService) {
-        this.dataService = Preconditions.checkNotNull(dataService);
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/FromSalConversionsUtilsTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/FromSalConversionsUtilsTest.java
deleted file mode 100644 (file)
index b09e816..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.controller.sal.compatibility.FromSalConversionsUtils;
-
-/**
- * test of {@link FromSalConversionsUtils}
- */
-public class FromSalConversionsUtilsTest {
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.FromSalConversionsUtils#dscpToTos(int)}.
-     */
-    @Test
-    public void testDscpToTos() {
-        Assert.assertEquals(0, FromSalConversionsUtils.dscpToTos(0));
-        Assert.assertEquals(4, FromSalConversionsUtils.dscpToTos(1));
-        Assert.assertEquals(252, FromSalConversionsUtils.dscpToTos(63));
-        Assert.assertEquals(256, FromSalConversionsUtils.dscpToTos(64));
-        Assert.assertEquals(-4, FromSalConversionsUtils.dscpToTos(-1));
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/MDFlowMappingTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/MDFlowMappingTest.java
deleted file mode 100644 (file)
index 2490ace..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.controller.sal.action.Action;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.compatibility.MDFlowMapping;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.utils.EtherTypes;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-
-/**
- * test for {@link MDFlowMapping}
- */
-public class MDFlowMappingTest {
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.MDFlowMapping#toUri(org.opendaylight.controller.sal.core.NodeConnector)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToUri() throws ConstructionException {
-        Node node = new Node(NodeIDType.OPENFLOW, 41L);
-        NodeConnector connector = new NodeConnector(NodeConnectorIDType.OPENFLOW, (short) 42, node);
-        Uri observed = MDFlowMapping.toUri(connector );
-
-        Assert.assertEquals("openflow:41:42", observed.getValue());
-    }
-
-    /**
-     * Test method for {@link MDFlowMapping#toAction(Action, int)}.
-     */
-    @Test
-    public void testToAction() {
-        // PUSH_VLAN test.
-        EtherTypes[] tags = {EtherTypes.VLANTAGGED, EtherTypes.QINQ};
-        int order = 0;
-        for (EtherTypes tag: tags) {
-            Action action = new PushVlan(tag);
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.
-                rev131112.action.list.Action mdActionList =
-                MDFlowMapping.toAction(action, order);
-            Assert.assertEquals(order, mdActionList.getOrder().intValue());
-
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.
-                rev131112.action.Action mdAction = mdActionList.getAction();
-            Assert.assertTrue(mdAction instanceof PushVlanActionCase);
-            PushVlanActionCase pushVlan = (PushVlanActionCase)mdAction;
-            Assert.assertEquals(tag.intValue(),
-                                pushVlan.getPushVlanAction().getEthernetType().
-                                intValue());
-            order++;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/NodeMappingTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/NodeMappingTest.java
deleted file mode 100644 (file)
index 759e69f..0000000
+++ /dev/null
@@ -1,228 +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
- */
-package org.opendaylight.controller.sal.compatibility.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.controller.sal.compatibility.NodeMapping;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.MacAddress;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-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.yang.binding.InstanceIdentifier;
-
-/**
- * test of {@link NodeMapping} utility class
- */
-public class NodeMappingTest {
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toADMacAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)}
-     * .
-     */
-    @Test
-    public void testToADMacAddress() {
-        NodeId[] nodeIds = new NodeId[] {
-                // 0x0000|0000 0000002a (answer to the ultimate question of life, universe and everything)
-                new NodeId("42"),
-                // 0x7fff|ffff ffffffff (max long -> 2**63 - 1)
-                new NodeId("9223372036854775807"),
-                // 0x7fff|7fff ffffffff
-                new NodeId("9223231299366420479"),
-                // 0x8fff|7fff ffffffff (more than biggest positive long)
-                new NodeId("10376152803973267455"),
-                // 0xca13|764a e9ace65a (BUG-770)
-                new NodeId("14561112084339025498")
-        };
-
-        byte[][] expectedMacs = new byte[][] {
-                {0, 0, 0, 0, 0, 0x2a},
-                {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff},
-                {(byte) 0x7f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff},
-                {(byte) 0x7f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff},
-                {(byte) 0x76, (byte) 0x4a, (byte) 0xe9, (byte) 0xac, (byte) 0xe6, (byte) 0x5a}
-        };
-
-        Assert.assertEquals(expectedMacs.length, nodeIds.length);
-
-        for (int i = 0; i < expectedMacs.length; i++) {
-            NodeId nodeId = nodeIds[i];
-            MacAddress mac = NodeMapping.toADMacAddress(nodeId);
-            Assert.assertArrayEquals(expectedMacs[i], mac.getMacAddress());
-        }
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toAdNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)}
-     * .
-     */
-    @Test
-    public void testToAdNodeId() {
-        NodeId observed;
-        observed = NodeMapping.toAdNodeId(null);
-        Assert.assertNull(observed);
-
-        observed = NodeMapping.toAdNodeId(new NodeConnectorId("openflow:5:2"));
-        Assert.assertEquals("openflow:5", observed.getValue());
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toADNode(NodeId)}
-     * .
-     */
-    @Test
-    public void testToAdNode1() {
-        org.opendaylight.controller.sal.core.Node observed;
-        try {
-            observed = NodeMapping.toADNode((NodeId) null);
-        } catch (NullPointerException | ConstructionException e) {
-            //expected
-        }
-
-        NodeId nodeId = new NodeId("openflow:1");
-        try {
-            observed = NodeMapping.toADNode(nodeId);
-            Assert.assertEquals("OF|00:00:00:00:00:00:00:01", observed.toString());
-        } catch (ConstructionException e) {
-            Assert.fail("should succeed to construct Node: "+e.getMessage());
-        }
-
-        final String nodeUriPrefix = "opendaylight-inventory:nodes/node/";
-        nodeId = new NodeId(nodeUriPrefix + "iosv-2");
-        try {
-            observed = NodeMapping.toADNode(nodeId);
-            Assert.assertEquals("PR|opendaylight-inventory:nodes/node/iosv-2", observed.toString());
-        } catch (ConstructionException e) {
-            Assert.fail("should succeed to construct Node: "+e.getMessage());
-        }
-
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toNodeConnectorType(NodeConnectorId, NodeId)}
-     * .
-     */
-    @Test
-    public void testToNodeConnectorType() {
-        NodeConnectorId ncId;
-        NodeId nodeId = buildNodeId("1");
-
-        ncId = buildNodeConnectorId("1", "42");
-        Assert.assertEquals(NodeConnectorIDType.OPENFLOW, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-
-        ncId = buildNodeConnectorId("1", OutputPortValues.CONTROLLER.toString());
-        Assert.assertEquals(NodeConnectorIDType.CONTROLLER, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-
-        ncId = buildNodeConnectorId("1", OutputPortValues.NORMAL.toString());
-        Assert.assertEquals(NodeConnectorIDType.HWPATH, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-
-        ncId = buildNodeConnectorId("1", OutputPortValues.LOCAL.toString());
-        Assert.assertEquals(NodeConnectorIDType.SWSTACK, NodeMapping.toNodeConnectorType(ncId, nodeId ));
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toADNodeConnectorId(NodeConnectorId, NodeId)}
-     * .
-     */
-    @Test
-    public void testToAdNodeConnectorId() {
-        NodeConnectorId nodeConnectorId = buildNodeConnectorId("1", "2");
-        NodeId nodeId = buildNodeId("1");
-        Assert.assertEquals(Short.valueOf((short) 2), NodeMapping.toADNodeConnectorId(nodeConnectorId , nodeId));
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toNodeRef(Node)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToNodeRef() throws ConstructionException {
-        org.opendaylight.controller.sal.core.Node node = new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, 42L);
-        InstanceIdentifier<?> nodePath = NodeMapping.toNodeRef(node).getValue();
-
-        String observedId = nodePath.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
-        Assert.assertEquals("openflow:42", observedId);
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toNodeConnectorRef(org.opendaylight.controller.sal.core.NodeConnector)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToNodeConnectorRef() throws ConstructionException {
-        org.opendaylight.controller.sal.core.Node node = new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, 42L);
-        org.opendaylight.controller.sal.core.NodeConnector nodeConnector =
-                new org.opendaylight.controller.sal.core.NodeConnector(
-                        NodeConnectorIDType.OPENFLOW, (short) 1, node);
-
-        InstanceIdentifier<?> nodeConnectorPath = NodeMapping.toNodeConnectorRef(nodeConnector ).getValue();
-        String observedNodeId = nodeConnectorPath.firstKeyOf(Node.class, NodeKey.class).getId().getValue();
-        Assert.assertEquals("openflow:42", observedNodeId);
-
-        String observedNodeConnectorId = nodeConnectorPath.firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue();
-        Assert.assertEquals("openflow:1", observedNodeConnectorId);
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#openflowFullNodeIdToLong(String)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testOpenflowFullNodeIdToLong() throws ConstructionException {
-        Assert.assertEquals(42L, NodeMapping.openflowFullNodeIdToLong("42").longValue());
-        Assert.assertEquals(0xCC4E241C4A000000L, NodeMapping.openflowFullNodeIdToLong("14721743935839928320").longValue());
-    }
-
-    /**
-     * Test method for
-     * {@link org.opendaylight.controller.sal.compatibility.NodeMapping#toNodeKey(org.opendaylight.controller.sal.core.Node)}
-     * .
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToNodeKey() throws ConstructionException {
-        org.opendaylight.controller.sal.core.Node aDNode = new org.opendaylight.controller.sal.core.Node(NodeIDType.OPENFLOW, 42L);
-        NodeKey nodeKey = NodeMapping.toNodeKey(aDNode);
-        Assert.assertEquals("openflow:42", nodeKey.getId().getValue());
-    }
-
-    /**
-     * @param nodeId
-     * @param portId
-     * @return nodeConnectorId
-     */
-    public static NodeConnectorId buildNodeConnectorId(String nodeId, String portId) {
-        return new NodeConnectorId(NodeConnectorIDType.OPENFLOW+"|" + nodeId + ":" + portId);
-    }
-
-    /**
-     * @param id
-     * @return nodeId
-     */
-    public static NodeId buildNodeId(String id) {
-        return new NodeId(NodeConnectorIDType.OPENFLOW+"|" + id);
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java
deleted file mode 100644 (file)
index 35555da..0000000
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2013-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.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.UDP;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.action.Action;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.compatibility.MDFlowMapping;
-import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.match.Match;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
-
-import com.google.common.net.InetAddresses;
-
-public class TestFromSalConversionsUtils {
-    private enum MtchType {
-        other, untagged, ipv4, ipv6, arp, sctp, tcp, udp
-    }
-
-    @Test
-    public void testFromSalConversion() throws ConstructionException {
-
-        Flow salFlow = prepareSalFlowCommon();
-        NodeFlow odNodeFlow = MDFlowMapping.flowAdded(salFlow);
-
-        checkOdFlow(odNodeFlow);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.other));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.other);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.untagged));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.untagged);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.arp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.arp);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.ipv4));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.ipv4);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.ipv6));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.ipv6);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.sctp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.sctp);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.tcp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.tcp);
-
-        odNodeFlow = MDFlowMapping.flowAdded(prepareSalMatch(salFlow, MtchType.udp));
-        checkOdMatch(odNodeFlow.getMatch(), MtchType.udp);
-    }
-
-    private void checkOdMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match match,
-            MtchType mt) {
-        switch (mt) {
-        case arp:
-            assertEquals("Ether type is incorrect.", ETHERNET_ARP, (long) match.getEthernetMatch().getEthernetType()
-                    .getType().getValue());
-            Layer3Match layer3Match = match.getLayer3Match();
-            boolean arpFound = false;
-            if (layer3Match instanceof ArpMatch) {
-                assertEquals("Source IP address is wrong.", "192.168.100.100/32", ((ArpMatch) layer3Match)
-                        .getArpSourceTransportAddress().getValue());
-                assertEquals("Destination IP address is wrong.", "192.168.100.101/32", ((ArpMatch) layer3Match)
-                        .getArpTargetTransportAddress().getValue());
-                assertEquals("Source MAC address is wrong.", "ff:ee:dd:cc:bb:aa", ((ArpMatch) layer3Match)
-                        .getArpSourceHardwareAddress().getAddress().getValue());
-                assertEquals("Destination MAC address is wrong.", "ff:ee:dd:cc:bb:aa", ((ArpMatch) layer3Match)
-                        .getArpTargetHardwareAddress().getAddress().getValue());
-                arpFound = true;
-            }
-            assertNotNull("Arp wasn't found", arpFound);
-            break;
-        case ipv4:
-            assertEquals("Ether type is incorrect.", 0xffff, (long) match.getEthernetMatch().getEthernetType()
-                    .getType().getValue());
-            boolean ipv4Found = false;
-            layer3Match = match.getLayer3Match();
-            if (layer3Match instanceof Ipv4Match) {
-                assertEquals("Source IP address is wrong.", "192.168.100.102/32", ((Ipv4Match) layer3Match)
-                        .getIpv4Source().getValue());
-                assertEquals("Destination IP address is wrong.", "192.168.100.103/32", ((Ipv4Match) layer3Match)
-                        .getIpv4Destination().getValue());
-            }
-            assertNotNull("Ipv4 wasn't found", ipv4Found);
-            break;
-        case ipv6:
-            assertEquals("Ether type is incorrect.", 0xffff, (long) match.getEthernetMatch().getEthernetType()
-                    .getType().getValue());
-            boolean ipv6Found = false;
-            layer3Match = match.getLayer3Match();
-            if (layer3Match instanceof Ipv6Match) {
-                assertEquals("Source IP address is wrong.", "2001:db8:85a3::8a2e:370:7335/128", ((Ipv6Match) layer3Match)
-                        .getIpv6Source().getValue());
-                assertEquals("Destination IP address is wrong.", "2001:db8:85a3::8a2e:370:7336/128",
-                        ((Ipv6Match) layer3Match).getIpv6Destination().getValue());
-            }
-            assertNotNull("Ipv6 wasn't found", ipv6Found);
-            break;
-        case other:
-            assertEquals("Incoming port is wrong.", "openflow:12345:10", match.getInPort().getValue());
-            assertEquals("Source MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetSource().getAddress().getValue());
-            assertEquals("Destinatio MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetDestination().getAddress().getValue());
-            assertEquals("Vlan ID is not present.", Boolean.TRUE, match.getVlanMatch().getVlanId().isVlanIdPresent());
-            assertEquals("Vlan ID is wrong.", (Integer) 0xfff, match.getVlanMatch().getVlanId().getVlanId().getValue());
-            assertEquals("Vlan ID priority is wrong.", (short) 0x7, (short) match.getVlanMatch().getVlanPcp()
-                    .getValue());
-            assertEquals("DCSP is wrong.", (short) 0x3f, (short) match.getIpMatch().getIpDscp().getValue());
-            break;
-        case untagged:
-            assertEquals("Source MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetSource().getAddress().getValue());
-            assertEquals("Destinatio MAC address is wrong.", "ff:ee:dd:cc:bb:aa", match.getEthernetMatch()
-                    .getEthernetDestination().getAddress().getValue());
-            assertEquals("Vlan ID is present.", Boolean.FALSE, match.getVlanMatch().getVlanId().isVlanIdPresent());
-            assertEquals("Vlan ID is wrong.", Integer.valueOf(0), match.getVlanMatch().getVlanId().getVlanId().getValue());
-            assertEquals("DCSP is wrong.", (short) 0x3f, (short) match.getIpMatch().getIpDscp().getValue());
-            break;
-        case sctp:
-            boolean sctpFound = false;
-            assertEquals("Wrong protocol", CRUDP, match.getIpMatch().getIpProtocol().byteValue());
-            Layer4Match layer4Match = match.getLayer4Match();
-            if (layer4Match instanceof SctpMatch) {
-                assertEquals("Sctp source port is incorrect.", 0xffff, (int) ((SctpMatch) layer4Match)
-                        .getSctpSourcePort().getValue());
-                assertEquals("Sctp dest port is incorrect.", 0xfffe, (int) ((SctpMatch) layer4Match)
-                        .getSctpDestinationPort().getValue());
-                sctpFound = true;
-            }
-            assertNotNull("Sctp wasn't found", sctpFound);
-            break;
-        case tcp:
-            boolean tcpFound = false;
-            assertEquals("Wrong protocol", TCP, match.getIpMatch().getIpProtocol().byteValue());
-            layer4Match = match.getLayer4Match();
-            if (layer4Match instanceof TcpMatch) {
-                assertEquals("Tcp source port is incorrect.", 0xabcd, (int) ((TcpMatch) layer4Match)
-                        .getTcpSourcePort().getValue());
-                assertEquals("Tcp dest port is incorrect.", 0xdcba, (int) ((TcpMatch) layer4Match)
-                        .getTcpDestinationPort().getValue());
-                sctpFound = true;
-            }
-            assertNotNull("Tcp wasn't found", tcpFound);
-            break;
-        case udp:
-            boolean udpFound = false;
-            assertEquals("Wrong protocol", UDP, match.getIpMatch().getIpProtocol().byteValue());
-            layer4Match = match.getLayer4Match();
-            if (layer4Match instanceof UdpMatch) {
-                assertEquals("Udp source port is incorrect.", 0xcdef, (int) ((UdpMatch) layer4Match)
-                        .getUdpSourcePort().getValue());
-                assertEquals("Udp dest port is incorrect.", 0xfedc, (int) ((UdpMatch) layer4Match)
-                        .getUdpDestinationPort().getValue());
-                sctpFound = true;
-            }
-            assertNotNull("Udp wasn't found", udpFound);
-            break;
-        }
-
-    }
-
-    private void checkOdFlow(NodeFlow odNodeFlow) {
-        assertEquals("Cookie is incorrect.", 9223372036854775807L, odNodeFlow.getCookie().getValue().longValue());
-        assertEquals("Hard timeout is incorrect.", 32765, odNodeFlow.getHardTimeout().shortValue());
-        assertEquals("Iddle timeout is incorrect.", 32766, odNodeFlow.getIdleTimeout().shortValue());
-        assertEquals("Priority is incorrect.", 32767, odNodeFlow.getPriority().shortValue());
-
-        checkOdActions(ToSalConversionsUtils.getAction(odNodeFlow));
-    }
-
-    private void checkOdActions(
-            List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions) {
-        checkOdAction(actions, FloodActionCase.class);
-        checkOdAction(actions, FloodAllActionCase.class);
-        checkOdAction(actions, HwPathActionCase.class);
-        checkOdAction(actions, LoopbackActionCase.class);
-        checkOdAction(actions, PopVlanActionCase.class);
-        checkOdAction(actions, PushVlanActionCase.class);
-        checkOdAction(actions, SetDlDstActionCase.class);
-        checkOdAction(actions, SetDlSrcActionCase.class);
-        checkOdAction(actions, SetDlTypeActionCase.class);
-        checkOdAction(actions, SetNwTosActionCase.class);
-        checkOdAction(actions, SetNwDstActionCase.class);
-        checkOdAction(actions, SetNwSrcActionCase.class);
-        checkOdAction(actions, SetNextHopActionCase.class);
-        checkOdAction(actions, SetTpDstActionCase.class);
-        checkOdAction(actions, SetTpSrcActionCase.class);
-        checkOdAction(actions, SetVlanCfiActionCase.class);
-        checkOdAction(actions, SetVlanIdActionCase.class);
-        checkOdAction(actions, SetVlanPcpActionCase.class);
-        checkOdAction(actions, SwPathActionCase.class);
-    }
-
-    private void checkOdAction(
-            List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions, Class<?> cl) {
-        int numOfFoundActions = 0;
-        for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action action : actions) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action innerAction = action
-                    .getAction();
-            if (cl.isInstance(innerAction)) {
-                numOfFoundActions++;
-                if (innerAction instanceof PushVlanActionCase) {
-                    assertEquals("Wrong value of tag in PushVlanAction.", (Integer) 0x8100,
-                            ((PushVlanActionCase) innerAction).getPushVlanAction().getEthernetType());
-                } else if (innerAction instanceof SetDlDstActionCase) {
-                    assertEquals("Wrong MAC destination address in SetDlDstAction.", "ff:ee:dd:cc:bb:aa",
-                            ((SetDlDstActionCase) innerAction).getSetDlDstAction().getAddress().getValue());
-                } else if (innerAction instanceof SetDlSrcActionCase) {
-                    assertEquals("Wrong MAC source address in SetDlDstAction.", "ff:ee:dd:cc:bb:aa",
-                            ((SetDlSrcActionCase) innerAction).getSetDlSrcAction().getAddress().getValue());
-                } else if (innerAction instanceof SetDlTypeActionCase) {
-                    assertEquals("Wrong data link type in SetDlTypeAction.", 513,
-                            (long) ((SetDlTypeActionCase) innerAction).getSetDlTypeAction().getDlType().getValue());
-                } else if (innerAction instanceof SetNextHopActionCase) {
-                    Address address = ((SetNextHopActionCase) innerAction).getSetNextHopAction().getAddress();
-                    boolean ipv4AddressFound = false;
-                    if (address instanceof Ipv4) {
-                        ipv4AddressFound = true;
-                        assertEquals("Wrong IP address type in SetNextHopAction.", "192.168.100.100/32", ((Ipv4) address)
-                                .getIpv4Address().getValue());
-                    }
-                    assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
-                } else if (innerAction instanceof SetNwTosActionCase) {
-                    assertEquals("Wrong TOS in SetNwTosAction.", (Integer) 252, ((SetNwTosActionCase) innerAction).getSetNwTosAction().getTos());
-                } else if (innerAction instanceof SetNwDstActionCase) {
-                    Address address = ((SetNwDstActionCase) innerAction).getSetNwDstAction().getAddress();
-                    boolean ipv4AddressFound = false;
-                    if (address instanceof Ipv4) {
-                        ipv4AddressFound = true;
-                        assertEquals("Wrong IP address type in SetNwDstAction.", "192.168.100.101/32", ((Ipv4) address)
-                                .getIpv4Address().getValue());
-                    }
-                    assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
-                } else if (innerAction instanceof SetNwSrcActionCase) {
-                    Address address = ((SetNwSrcActionCase) innerAction).getSetNwSrcAction().getAddress();
-                    boolean ipv4AddressFound = false;
-                    if (address instanceof Ipv4) {
-                        ipv4AddressFound = true;
-                        assertEquals("Wrong IP address type in SetNwSrcAction.", "192.168.100.102/32", ((Ipv4) address)
-                                .getIpv4Address().getValue());
-                    }
-                    assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
-                } else if (innerAction instanceof SetTpDstActionCase) {
-                    assertEquals("Port number is incorrect in SetTpDstAction.", (Integer) 65534,
-                            ((SetTpDstActionCase) innerAction).getSetTpDstAction().getPort().getValue());
-                } else if (innerAction instanceof SetTpSrcActionCase) {
-                    assertEquals("Port number is incorrect in SetTpSrcAction.", (Integer) 65535,
-                            ((SetTpSrcActionCase) innerAction).getSetTpSrcAction().getPort().getValue());
-                } else if (innerAction instanceof SetVlanCfiActionCase) {
-                    assertEquals("Vlan cfi number is incorrect in SetVlanCfiAction.", (Integer) 1,
-                            ((SetVlanCfiActionCase) innerAction).getSetVlanCfiAction().getVlanCfi().getValue());
-                } else if (innerAction instanceof SetVlanIdActionCase) {
-                    assertEquals("Vlan id number is incorrect in SetVlanIdAction.", (Integer) 4095,
-                            ((SetVlanIdActionCase) innerAction).getSetVlanIdAction().getVlanId().getValue());
-                } else if (innerAction instanceof SetVlanPcpActionCase) {
-                    assertEquals("Vlan pcp number is incorrect in SetVlanPcpAction.", new Short((short) 7),
-                            ((SetVlanPcpActionCase) innerAction).getSetVlanPcpAction().getVlanPcp().getValue());
-                }
-            }
-        }
-        assertEquals("Incorrrect number of action " + cl.getName() + ".", 1, numOfFoundActions);
-
-    }
-
-    private Flow prepareSalFlowCommon() {
-        Flow salFlow = new Flow();
-        salFlow.setId(9223372036854775807L);
-        salFlow.setHardTimeout((short) 32765);
-        salFlow.setIdleTimeout((short) 32766);
-        salFlow.setPriority((short) 32767);
-        salFlow.setActions(prepareSalActions());
-        salFlow.setMatch(new Match());
-
-        return salFlow;
-    }
-
-    private Flow prepareSalMatch(Flow salFlow, MtchType mt) throws ConstructionException {
-        Match salMatch = new Match();
-        switch (mt) {
-        case arp:
-            salMatch.setField(MatchType.DL_TYPE, ETHERNET_ARP);
-            salMatch.setField(MatchType.NW_SRC, InetAddresses.forString("192.168.100.100"));
-            salMatch.setField(MatchType.NW_DST, InetAddresses.forString("192.168.100.101"));
-            salMatch.setField(MatchType.DL_SRC, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_DST, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            break;
-        case ipv4:
-            salMatch.setField(MatchType.DL_TYPE, (short) 0xffff);
-            salMatch.setField(MatchType.NW_SRC, InetAddresses.forString("192.168.100.102"));
-            salMatch.setField(MatchType.NW_DST, InetAddresses.forString("192.168.100.103"));
-            break;
-        case ipv6:
-            salMatch.setField(MatchType.DL_TYPE, (short) 0xffff);
-            salMatch.setField(MatchType.NW_SRC, InetAddresses.forString("2001:0db8:85a3:0000:0000:8a2e:0370:7335"));
-            salMatch.setField(MatchType.NW_DST, InetAddresses.forString("2001:0db8:85a3:0000:0000:8a2e:0370:7336"));
-            break;
-        case other:
-            Node node = new Node(NodeIDType.OPENFLOW, 12345L);
-            NodeConnector port = new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf((short)10), node);
-            salMatch.setField(MatchType.IN_PORT, port);
-            salMatch.setField(MatchType.DL_SRC, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_DST, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_VLAN, (short) 0xfff);
-            salMatch.setField(MatchType.DL_VLAN_PR, (byte) 0x7);
-            salMatch.setField(MatchType.NW_TOS, (byte) 0x3f);
-            break;
-        case untagged:
-            salMatch.setField(MatchType.DL_SRC, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_DST, new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa});
-            salMatch.setField(MatchType.DL_VLAN, MatchType.DL_VLAN_NONE);
-            salMatch.setField(MatchType.NW_TOS, (byte) 0x3f);
-            break;
-        case sctp:
-            salMatch.setField(MatchType.NW_PROTO, CRUDP);
-            salMatch.setField(MatchType.TP_SRC, (short) 0xffff);
-            salMatch.setField(MatchType.TP_DST, (short) 0xfffe);
-            break;
-        case tcp:
-            salMatch.setField(MatchType.NW_PROTO, TCP);
-            salMatch.setField(MatchType.TP_SRC, (short) 0xabcd);
-            salMatch.setField(MatchType.TP_DST, (short) 0xdcba);
-            break;
-        case udp:
-            salMatch.setField(MatchType.NW_PROTO, UDP);
-            salMatch.setField(MatchType.TP_SRC, (short) 0xcdef);
-            salMatch.setField(MatchType.TP_DST, (short) 0xfedc);
-            break;
-        default:
-            break;
-
-        }
-
-        salFlow.setMatch(salMatch);
-        return salFlow;
-    }
-
-    private List<Action> prepareSalActions() {
-        List<Action> salActions = new ArrayList<>();
-        salActions.add(new Flood());
-        salActions.add(new FloodAll());
-        salActions.add(new HwPath());
-        salActions.add(new Loopback());
-        // salActions.add(new Output //TODO: mapping is missing
-        salActions.add(new PopVlan());
-        salActions.add(new PushVlan(0x8100));
-        salActions.add(new SetDlDst(new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa}));
-        salActions.add(new SetDlSrc(new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa}));
-        salActions.add(new SetDlType(513));
-        salActions.add(new SetNextHop(InetAddresses.forString("192.168.100.100")));
-        salActions.add(new SetNwDst(InetAddresses.forString("192.168.100.101")));
-        salActions.add(new SetNwSrc(InetAddresses.forString("192.168.100.102")));
-        salActions.add(new SetNwTos(63));
-        salActions.add(new SetTpDst(65534));
-        salActions.add(new SetTpSrc(65535));
-        salActions.add(new SetVlanCfi(1));
-        salActions.add(new SetVlanId(4095));
-        salActions.add(new SetVlanPcp(7));
-        salActions.add(new SwPath());
-
-        return salActions;
-    }
-
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java
deleted file mode 100644 (file)
index 7c20c24..0000000
+++ /dev/null
@@ -1,751 +0,0 @@
-/*
- * Copyright (c) 2013-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.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.CRUDP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.ETHERNET_ARP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.TCP;
-import static org.opendaylight.controller.sal.compatibility.ProtocolConstants.UDP;
-
-import java.math.BigInteger;
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.Output;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
-import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
-import org.opendaylight.controller.sal.flowprogrammer.Flow;
-import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestination;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSource;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
-
-import com.google.common.net.InetAddresses;
-
-public class TestToSalConversionsUtils {
-    // prefix:
-    // od|Od = Open Daylight
-    private enum MtchType {
-        other, untagged, ipv4, ipv6, arp, sctp, tcp, udp
-    }
-
-    @Test
-    public void testToSalConversion() throws ConstructionException {
-        FlowAddedBuilder odNodeFlowBuilder = new FlowAddedBuilder();
-        odNodeFlowBuilder = prepareOdFlowCommon();
-
-        Node node = new Node(NodeIDType.OPENFLOW,(long)1);
-
-        Flow salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.other), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.other);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.untagged), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.untagged);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.ipv4), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.ipv4);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.ipv6), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.ipv6);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.arp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.arp);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.sctp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.sctp);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.tcp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.tcp);
-
-        salFlow = ToSalConversionsUtils.toFlow(prepareOdFlow(odNodeFlowBuilder, MtchType.udp), node);
-        checkSalMatch(salFlow.getMatch(), MtchType.udp);
-
-        checkSalFlow(salFlow);
-    }
-
-    /**
-     * test of {@link ToSalConversionsUtils#fromNodeConnectorRef(Uri, Node)}
-     * @throws ConstructionException
-     */
-    @Test
-    public void testFromNodeConnectorRef() throws ConstructionException {
-        Node node = new Node(NodeIDType.OPENFLOW, 42L);
-        NodeConnector nodeConnector = ToSalConversionsUtils.fromNodeConnectorRef(new Uri("1"), node);
-        assertEquals("OF|1@OF|00:00:00:00:00:00:00:2a", nodeConnector.toString());
-    }
-
-    @Test
-    public void testActionFrom() throws ConstructionException {
-        // Bug 2021: Convert AD-SAL notation into MD-SAL notation before calling NodeConnector
-        Node node = new Node(NodeIDType.OPENFLOW, 42L);
-        List<Action> odActions = new ArrayList<>();
-
-        OutputActionBuilder outputActionBuilder = new OutputActionBuilder();
-        outputActionBuilder.setOutputNodeConnector(new Uri("CONTROLLER"));
-        OutputActionCaseBuilder outputActionCaseBuilder = new OutputActionCaseBuilder();
-        outputActionCaseBuilder.setOutputAction(outputActionBuilder.build());
-        odActions.add(new ActionBuilder().setAction(outputActionCaseBuilder.build()).build());
-
-        List<org.opendaylight.controller.sal.action.Action> targetAction =
-                ToSalConversionsUtils.actionFrom(odActions, node);
-        assertNotNull(targetAction);
-        assertTrue( Output.class.isInstance(targetAction.get(0)) );
-        Output targetActionOutput = (Output) targetAction.get(0);
-        NodeConnector port = targetActionOutput.getPort();
-        assertNotNull(port);
-        assertEquals(port.getType(), NodeConnectorIDType.CONTROLLER);
-        assertEquals(port.getID(), org.opendaylight.controller.sal.core.NodeConnector.SPECIALNODECONNECTORID);
-    }
-
-    private void checkSalMatch(org.opendaylight.controller.sal.match.Match match, MtchType mt) throws ConstructionException {
-        switch (mt) {
-        case other:
-            /*assertNotNull("DL_DST isn't equal.", "3C:A9:F4:00:E0:C8",
-                    new String((byte[]) match.getField(MatchType.DL_DST).getValue()));
-            assertEquals("DL_SRC isn't equal.", "24:77:03:7C:C5:F1",
-                    new String((byte[]) match.getField(MatchType.DL_SRC).getValue()));
-            */
-            Node node = new Node(NodeIDType.OPENFLOW, 12L);
-            NodeConnector port = new NodeConnector(NodeConnectorIDType.OPENFLOW, Short.valueOf((short)345), node);
-            assertEquals("IN_PORT isn't equal.", port, match.getField(MatchType.IN_PORT).getValue());
-            assertEquals("DL_TYPE isn't equal.", (short) 0xffff, (short) match.getField(MatchType.DL_TYPE).getValue());
-            assertEquals("NW_TOS isn't equal.", (byte) 0x33, (byte) match.getField(MatchType.NW_TOS).getValue());
-            assertEquals("NW_PROTO isn't equal.", (byte) 0x3f, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            assertEquals("DL_VLAN isn't equal.", (short) 0xfff, (short) match.getField(MatchType.DL_VLAN).getValue());
-            assertEquals("DL_VLAN_PR isn't equal.", (byte) 0x7, (byte) match.getField(MatchType.DL_VLAN_PR).getValue());
-            break;
-        case untagged:
-            assertEquals("DL_TYPE isn't equal.", (short) 0xffff, (short) match.getField(MatchType.DL_TYPE).getValue());
-            assertEquals("NW_TOS isn't equal.", (byte) 0x33, (byte) match.getField(MatchType.NW_TOS).getValue());
-            assertEquals("NW_PROTO isn't equal.", (byte) 0x3f, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            assertEquals("DL_VLAN isn't equal.", MatchType.DL_VLAN_NONE, (short) match.getField(MatchType.DL_VLAN).getValue());
-            break;
-        case arp:
-            /*
-            assertEquals("DL_SRC isn't equal.", "22:44:66:88:AA:CC",
-                    new String((byte[]) match.getField(MatchType.DL_SRC).getValue()));
-            assertEquals("DL_DST isn't equal.", "11:33:55:77:BB:DD",
-                    new String((byte[]) match.getField(MatchType.DL_DST).getValue()));
-            */
-            assertEquals("NW_SRC isn't equal.", "192.168.1.101",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_SRC).getValue()));
-            assertEquals("NW_DST isn't equal.", "192.168.1.102",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_DST).getValue()));
-            assertEquals("DL_TYPE isn't equal.", ETHERNET_ARP, match.getField(MatchType.DL_TYPE).getValue());
-            break;
-        case ipv4:
-            assertEquals("NW_SRC isn't equal.", "192.168.1.104",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_SRC).getValue()));
-            assertEquals("NW_DST isn't equal.", "192.168.1.105",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_DST).getValue()));
-            break;
-        case ipv6:
-            assertEquals("NW_SRC isn't equal.", "3001:db8:85a3::8a2e:370:7334",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_SRC).getValue()));
-            assertEquals("NW_DST isn't equal.", "3001:db8:85a3::8a2e:370:7335",
-                    InetAddresses.toAddrString((InetAddress) match.getField(MatchType.NW_DST).getValue()));
-            break;
-        case sctp:
-            assertEquals("TP_SRC isn't equal.", 31, (short) match.getField(MatchType.TP_SRC).getValue());
-            assertEquals("TP_DST isn't equal.", 32, (short) match.getField(MatchType.TP_DST).getValue());
-            assertEquals("NW_PROTO isn't equal.", CRUDP, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            break;
-        case tcp:
-            assertEquals("TP_SRC isn't equal.", 21, (short) match.getField(MatchType.TP_SRC).getValue());
-            assertEquals("TP_DST isn't equal.", 22, (short) match.getField(MatchType.TP_DST).getValue());
-            assertEquals("NW_PROTO isn't equal.", TCP, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            break;
-        case udp:
-            assertEquals("TP_SRC isn't equal.", 11, (short) match.getField(MatchType.TP_SRC).getValue());
-            assertEquals("TP_DST isn't equal.", 12, (short) match.getField(MatchType.TP_DST).getValue());
-            assertEquals("NW_PROTO isn't equal.", UDP, (byte) match.getField(MatchType.NW_PROTO).getValue());
-            break;
-        default:
-            break;
-
-        }
-
-    }
-
-    private void checkSalFlow(Flow salFlow) {
-        assertTrue("Id value is incorrect.", salFlow.getId() == 9223372036854775807L);
-        assertTrue("Hard timeout is incorrect.", salFlow.getHardTimeout() == 32767);
-        assertTrue("Iddle timeout is incorrect.", salFlow.getIdleTimeout() == 32767);
-        assertTrue("Priority value is incorrect.", salFlow.getPriority() == 32767);
-
-        checkSalActions(salFlow.getActions());
-    }
-
-    private void checkSalActions(List<org.opendaylight.controller.sal.action.Action> actions) {
-        checkSalAction(actions, Flood.class, 1);
-        checkSalAction(actions, FloodAll.class, 1);
-        checkSalAction(actions, HwPath.class, 1);
-        checkSalAction(actions, Loopback.class, 1);
-        checkSalAction(actions, Output.class, 1, true);
-        checkSalAction(actions, PopVlan.class, 1);
-        checkSalAction(actions, PushVlan.class, 1, true);
-        checkSalAction(actions, SetDlDst.class, 1, true);
-        checkSalAction(actions, SetDlSrc.class, 1, true);
-        checkSalAction(actions, SetDlType.class, 1, true);
-        checkSalAction(actions, SetNextHop.class, 2, true);
-        checkSalAction(actions, SetNwDst.class, 2, true);
-        checkSalAction(actions, SetNwSrc.class, 2, true);
-        checkSalAction(actions, SetNwTos.class, 1, true);
-        checkSalAction(actions, SetTpDst.class, 1, true);
-        checkSalAction(actions, SetTpSrc.class, 1, true);
-        checkSalAction(actions, SetVlanCfi.class, 1, true);
-        checkSalAction(actions, SetVlanId.class, 1, true);
-        checkSalAction(actions, SetVlanPcp.class, 1, true);
-        checkSalAction(actions, SwPath.class, 1);
-    }
-
-    private void checkSalAction(List<org.opendaylight.controller.sal.action.Action> actions, Class<?> cls,
-            int numOfActions) {
-        checkSalAction(actions, cls, numOfActions, false);
-    }
-
-    private void checkSalAction(List<org.opendaylight.controller.sal.action.Action> actions, Class<?> cls,
-            int numOfActions, boolean additionalCheck) {
-        int numOfEqualClass = 0;
-        for (org.opendaylight.controller.sal.action.Action action : actions) {
-            if (action.getClass().equals(cls)) {
-                if (additionalCheck) {
-                    additionalActionCheck(action);
-                }
-                numOfEqualClass++;
-            }
-        }
-        assertEquals("Incorrect number of actions of type " + cls.getName() + " was found.", numOfActions,
-                numOfEqualClass);
-    }
-
-    // implement special checks
-    private void additionalActionCheck(org.opendaylight.controller.sal.action.Action action) {
-        if (action instanceof Output) {
-            // ((Output)action).getPort() //TODO finish check when mapping will
-            // be defined
-        } else if (action instanceof PushVlan) {
-            assertEquals("Wrong value for action PushVlan for tag.", 0x8100, ((PushVlan) action).getTag());
-        } else if (action instanceof SetDlDst) {
-            //assertEquals("Wrong value for action SetDlDst for MAC address.", "3C:A9:F4:00:E0:C8", new String(
-            //        ((SetDlDst) action).getDlAddress()));
-        } else if (action instanceof SetDlSrc) {
-            //assertEquals("Wrong value for action SetDlSrc for MAC address.", "24:77:03:7C:C5:F1", new String(
-            //      ((SetDlSrc) action).getDlAddress()));
-        } else if (action instanceof SetDlType) {
-            assertEquals("Wrong value for action SetDlType for.", 513L, ((SetDlType) action).getDlType());
-        } else if (action instanceof SetNextHop) {
-            InetAddress inetAddress = ((SetNextHop) action).getAddress();
-            checkIpAddresses(inetAddress, "192.168.100.100", "2001:db8:85a3::8a2e:370:7334");
-        } else if (action instanceof SetNwDst) {
-            InetAddress inetAddress = ((SetNwDst) action).getAddress();
-            checkIpAddresses(inetAddress, "192.168.100.101", "2001:db8:85a3::8a2e:370:7335");
-        } else if (action instanceof SetNwSrc) {
-            InetAddress inetAddress = ((SetNwSrc) action).getAddress();
-            checkIpAddresses(inetAddress, "192.168.100.102", "2001:db8:85a3::8a2e:370:7336");
-        } else if (action instanceof SetNwTos) {
-            assertEquals("Wrong value for action SetNwTos for tos.", 63, ((SetNwTos) action).getNwTos());
-        } else if (action instanceof SetTpDst) {
-            assertEquals("Wrong value for action SetTpDst for port.", 65535, ((SetTpDst) action).getPort());
-        } else if (action instanceof SetTpSrc) {
-            assertEquals("Wrong value for action SetTpSrc for port.", 65535, ((SetTpSrc) action).getPort());
-        } else if (action instanceof SetVlanCfi) {
-            assertEquals("Wrong value for action SetVlanCfi for port.", 1, ((SetVlanCfi) action).getCfi());
-        } else if (action instanceof SetVlanId) {
-            assertEquals("Wrong value for action SetVlanId for vlan ID.", 4095, ((SetVlanId) action).getVlanId());
-        } else if (action instanceof SetVlanPcp) {
-            assertEquals("Wrong value for action SetVlanPcp for vlan ID.", 7, ((SetVlanPcp) action).getPcp());
-        }
-    }
-
-    private void checkIpAddresses(InetAddress inetAddress, String ipv4, String ipv6) {
-        if (inetAddress instanceof Inet4Address) {
-            assertEquals("Wrong value for IP address.", ipv4, InetAddresses.toAddrString(inetAddress));
-        } else if (inetAddress instanceof Inet6Address) {
-            assertEquals("Wrong value for IP address.", ipv6, InetAddresses.toAddrString(inetAddress));
-        }
-    }
-
-    private FlowAddedBuilder prepareOdFlowCommon() {
-        FlowAddedBuilder odNodeFlowBuilder = new FlowAddedBuilder();
-
-        odNodeFlowBuilder.setCookie(new FlowCookie(new BigInteger("9223372036854775807")));
-        odNodeFlowBuilder.setHardTimeout(32767);
-        odNodeFlowBuilder.setIdleTimeout(32767);
-        odNodeFlowBuilder.setPriority(32767);
-        odNodeFlowBuilder.setInstructions(prepareOdActions());
-        return odNodeFlowBuilder;
-    }
-
-    private NodeFlow prepareOdFlow(FlowAddedBuilder odNodeFlowBuilder, MtchType mt) {
-        odNodeFlowBuilder.setMatch(prepOdMatch(mt));
-        return odNodeFlowBuilder.build();
-    }
-
-    private Instructions prepareOdActions() {
-        List<Action> odActions = new ArrayList<>();
-
-        ControllerActionCaseBuilder controllerActionBuilder = new ControllerActionCaseBuilder();
-        DropActionCaseBuilder dropActionBuilder = new DropActionCaseBuilder();
-        FloodActionCaseBuilder floodActionBuilder = new FloodActionCaseBuilder();
-        FloodAllActionCaseBuilder floodAllActionBuilder = new FloodAllActionCaseBuilder();
-        HwPathActionCaseBuilder hwPathActionBuilder = new HwPathActionCaseBuilder();
-        LoopbackActionCaseBuilder loopbackActionBuilder = new LoopbackActionCaseBuilder();
-        OutputActionCaseBuilder outputActionBuilder = new OutputActionCaseBuilder();
-        PopMplsActionCaseBuilder popMplsActionBuilder = new PopMplsActionCaseBuilder();
-        PopVlanActionCaseBuilder popVlanActionBuilder = new PopVlanActionCaseBuilder();
-        PushMplsActionCaseBuilder pushMplsActionBuilder = new PushMplsActionCaseBuilder();
-        PushPbbActionCaseBuilder pushPbbActionBuilder = new PushPbbActionCaseBuilder();
-        PushVlanActionCaseBuilder pushVlanActionBuilder = new PushVlanActionCaseBuilder();
-        SetDlDstActionCaseBuilder setDlDstActionBuilder = new SetDlDstActionCaseBuilder();
-        SetDlSrcActionCaseBuilder setDlSrcActionBuilder = new SetDlSrcActionCaseBuilder();
-        SetDlTypeActionCaseBuilder setDlTypeActionBuilder = new SetDlTypeActionCaseBuilder();
-        SetMplsTtlActionCaseBuilder setMplsTtlActionBuilder = new SetMplsTtlActionCaseBuilder();
-        SetNwTosActionCaseBuilder setNwTosActionBuilder = new SetNwTosActionCaseBuilder();
-        SetNwTtlActionCaseBuilder setNwTtlActionBuilder = new SetNwTtlActionCaseBuilder();
-        SetQueueActionCaseBuilder setQueueActionBuilder = new SetQueueActionCaseBuilder();
-        SetTpDstActionCaseBuilder setTpDstActionBuilder = new SetTpDstActionCaseBuilder();
-        SetTpSrcActionCaseBuilder setTpSrcActionBuilder = new SetTpSrcActionCaseBuilder();
-        SetVlanCfiActionCaseBuilder setVlanCfiActionBuilder = new SetVlanCfiActionCaseBuilder();
-        SetVlanIdActionCaseBuilder setVlanIdActionBuilder = new SetVlanIdActionCaseBuilder();
-        SetVlanPcpActionCaseBuilder setVlanPcpActionBuilder = new SetVlanPcpActionCaseBuilder();
-        SwPathActionCaseBuilder swPathActionBuilder = new SwPathActionCaseBuilder();
-
-        prepareActionOutput(outputActionBuilder);
-        prepareActionPushVlan(pushVlanActionBuilder);
-        prepareActionSetDlDst(setDlDstActionBuilder);
-        prepareActionSetDlSrc(setDlSrcActionBuilder);
-        prepareActionSetDlType(setDlTypeActionBuilder);
-        prepareActionNextHop(odActions);
-        prepareActionSetNwDst(odActions);
-        prepareActionSetNwSrc(odActions);
-        prepareActionSetNwTos(setNwTosActionBuilder);
-        prepareActionSetTpDst(setTpDstActionBuilder);
-        prepareActionSetTpSrc(setTpSrcActionBuilder);
-        prepareActionSetVlanCfi(setVlanCfiActionBuilder);
-        prepareActionSetVladId(setVlanIdActionBuilder);
-        prepareActionSetVlanPcp(setVlanPcpActionBuilder);
-
-        odActions.add(new ActionBuilder().setAction(controllerActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(dropActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(floodActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(floodAllActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(hwPathActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(loopbackActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(outputActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(popMplsActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(popVlanActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(pushMplsActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(pushPbbActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(pushVlanActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setDlDstActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setDlSrcActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setDlTypeActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setMplsTtlActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setNwTosActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setNwTtlActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setQueueActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setTpDstActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setTpSrcActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setVlanCfiActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setVlanIdActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(setVlanPcpActionBuilder.build()).build());
-        odActions.add(new ActionBuilder().setAction(swPathActionBuilder.build()).build());
-
-
-        ApplyActionsCase innerInst = new ApplyActionsCaseBuilder().setApplyActions(new ApplyActionsBuilder().setAction(odActions).build()).build();
-        Instruction applyActions = new InstructionBuilder().setInstruction(innerInst).build();
-        List<Instruction> instructions = Collections.singletonList(applyActions );
-        InstructionsBuilder instBuilder = new InstructionsBuilder();
-
-        instBuilder.setInstruction(instructions);
-
-        return instBuilder.build();
-    }
-
-    private void prepareActionSetVlanPcp(SetVlanPcpActionCaseBuilder wrapper) {
-        SetVlanPcpActionBuilder setVlanPcpActionBuilder = new SetVlanPcpActionBuilder();
-        setVlanPcpActionBuilder.setVlanPcp(new VlanPcp((short) 7));
-        wrapper.setSetVlanPcpAction(setVlanPcpActionBuilder.build());
-    }
-
-    private void prepareActionSetVladId(SetVlanIdActionCaseBuilder wrapper) {
-        SetVlanIdActionBuilder setVlanIdActionBuilder = new SetVlanIdActionBuilder();
-        setVlanIdActionBuilder.setVlanId(new VlanId(4095));
-        wrapper.setSetVlanIdAction(setVlanIdActionBuilder.build());
-    }
-
-    private void prepareActionSetVlanCfi(SetVlanCfiActionCaseBuilder wrapper) {
-        SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
-        setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(1));
-        wrapper.setSetVlanCfiAction(setVlanCfiActionBuilder.build());
-    }
-
-    private void prepareActionSetTpDst(SetTpDstActionCaseBuilder wrapper) {
-        SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
-        setTpDstActionBuilder.setPort(new PortNumber(65535));
-        wrapper.setSetTpDstAction(setTpDstActionBuilder.build());
-    }
-
-    private void prepareActionSetTpSrc(SetTpSrcActionCaseBuilder wrapper) {
-        SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
-        setTpSrcActionBuilder.setPort(new PortNumber(65535));
-        wrapper.setSetTpSrcAction(setTpSrcActionBuilder.build());
-    }
-
-    private void prepareActionSetNwTos(SetNwTosActionCaseBuilder wrapper) {
-        SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
-        setNwTosActionBuilder.setTos(252);
-        wrapper.setSetNwTosAction(setNwTosActionBuilder.build());
-    }
-
-    private void prepareActionSetNwSrc(List<Action> odActions) {
-        // test case for IPv4
-        SetNwSrcActionBuilder setNwSrcActionBuilderIpv4 = new SetNwSrcActionBuilder();
-        setNwSrcActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.102"));
-        odActions.add(new ActionBuilder().setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwSrcActionBuilderIpv4.build()).build()).build());
-
-        // test case for IPv6
-        SetNwSrcActionBuilder setNwSrcActionBuilderIpv6 = new SetNwSrcActionBuilder();
-        setNwSrcActionBuilderIpv6.setAddress(prapareIpv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7336"));
-        odActions.add(new ActionBuilder().setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwSrcActionBuilderIpv6.build()).build()).build());
-    }
-
-    private void prepareActionSetNwDst(List<Action> odActions) {
-        // test case for IPv4
-
-        SetNwDstActionBuilder setNwDstActionBuilderIpv4 = new SetNwDstActionBuilder();
-        setNwDstActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.101"));
-        odActions.add(new ActionBuilder().setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilderIpv4.build()).build()).build());
-
-        // test case for IPv6
-        SetNwDstActionBuilder setNwDstActionBuilderIpv6 = new SetNwDstActionBuilder();
-        setNwDstActionBuilderIpv6.setAddress(prapareIpv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7335"));
-        odActions.add(new ActionBuilder().setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilderIpv6.build()).build()).build());
-    }
-
-    private void prepareActionNextHop(List<Action> odActions) {
-        // test case for IPv4
-        SetNextHopActionBuilder setNextHopActionBuilderIpv4 = new SetNextHopActionBuilder();
-        setNextHopActionBuilderIpv4.setAddress(prapareIpv4Address("192.168.100.100"));
-        odActions.add(new ActionBuilder().setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilderIpv4.build()).build()).build());
-
-        // test case for IPv6
-        SetNextHopActionBuilder setNextHopActionBuilderIpv6 = new SetNextHopActionBuilder();
-        setNextHopActionBuilderIpv6.setAddress(prapareIpv6Address("2001:0db8:85a3:0000:0000:8a2e:0370:7334"));
-        odActions.add(new ActionBuilder().setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilderIpv6.build()).build()).build());
-    }
-
-    private Address prapareIpv4Address(String ipv4Address) {
-        Ipv4Builder ipv4Builder = new Ipv4Builder();
-        ipv4Builder.setIpv4Address(new Ipv4Prefix(ipv4Address + "/32"));
-        return ipv4Builder.build();
-    }
-
-    private Address prapareIpv6Address(String ipv6Address) {
-        Ipv6Builder ipv6Builder = new Ipv6Builder();
-        ipv6Builder.setIpv6Address(new Ipv6Prefix(ipv6Address));
-        return ipv6Builder.build();
-    }
-
-    private void prepareActionSetDlType(SetDlTypeActionCaseBuilder wrapper) {
-        SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
-        setDlTypeActionBuilder.setDlType(new EtherType(513L));
-        wrapper.setSetDlTypeAction(setDlTypeActionBuilder.build());
-    }
-
-    private void prepareActionSetDlSrc(SetDlSrcActionCaseBuilder wrapper) {
-        SetDlSrcActionBuilder setDlSrcActionBuilder = new SetDlSrcActionBuilder();
-        setDlSrcActionBuilder.setAddress(new MacAddress("24:77:03:7C:C5:F1"));
-        wrapper.setSetDlSrcAction(setDlSrcActionBuilder.build());
-    }
-
-    private void prepareActionSetDlDst(SetDlDstActionCaseBuilder wrapper) {
-        SetDlDstActionBuilder setDlDstActionBuilder = new SetDlDstActionBuilder();
-        setDlDstActionBuilder.setAddress(new MacAddress("3C:A9:F4:00:E0:C8"));
-        wrapper.setSetDlDstAction(setDlDstActionBuilder.build());
-    }
-
-    private void prepareActionPushVlan(PushVlanActionCaseBuilder wrapper) {
-        PushVlanActionBuilder pushVlanActionBuilder = new PushVlanActionBuilder();
-        pushVlanActionBuilder.setTag(0x8100); // 12 bit
-        wrapper.setPushVlanAction(pushVlanActionBuilder.build());
-    }
-
-    private void prepareActionOutput(OutputActionCaseBuilder wrapper) {
-        OutputActionBuilder outputActionBuilder = new OutputActionBuilder();
-        outputActionBuilder.setOutputNodeConnector(new Uri("1"));
-        wrapper.setOutputAction(outputActionBuilder.build());
-    }
-
-    private Match prepOdMatch(MtchType mt) {
-        MatchBuilder odMatchBuilder = new MatchBuilder();
-        switch (mt) {
-        case other:
-            odMatchBuilder.setInPort(new NodeConnectorId("openflow:12:345"));
-            odMatchBuilder.setEthernetMatch(prepEthernetMatch());
-            odMatchBuilder.setIpMatch(prepIpMatch());
-            odMatchBuilder.setVlanMatch(prepVlanMatch());
-            break;
-        case untagged:
-            odMatchBuilder.setEthernetMatch(prepEthernetMatch());
-            odMatchBuilder.setIpMatch(prepIpMatch());
-            odMatchBuilder.setVlanMatch(prepVlanNoneMatch());
-            break;
-        case ipv4:
-            odMatchBuilder.setLayer3Match(prepLayer3MatchIpv4());
-            break;
-        case ipv6:
-            odMatchBuilder.setLayer3Match(prepLayer3MatchIpv6());
-            break;
-        case arp:
-            odMatchBuilder.setLayer3Match(prepLayer3MatchArp());
-            break;
-        case sctp:
-            odMatchBuilder.setLayer4Match(prepLayer4MatchSctp());
-            break;
-        case tcp:
-            odMatchBuilder.setLayer4Match(prepLayer4MatchTcp());
-            break;
-        case udp:
-            odMatchBuilder.setLayer4Match(prepLayer4MatchUdp());
-            break;
-        }
-        return odMatchBuilder.build();
-    }
-
-    private Layer4Match prepLayer4MatchUdp() {
-        UdpMatchBuilder udpMatchBuilder = new UdpMatchBuilder();
-
-        udpMatchBuilder.setUdpSourcePort(new PortNumber(11));
-        udpMatchBuilder.setUdpDestinationPort(new PortNumber(12));
-
-        return udpMatchBuilder.build();
-    }
-
-    private Layer4Match prepLayer4MatchTcp() {
-        TcpMatchBuilder tcpMatchBuilder = new TcpMatchBuilder();
-
-        tcpMatchBuilder.setTcpSourcePort(new PortNumber(21));
-        tcpMatchBuilder.setTcpDestinationPort(new PortNumber(22));
-
-        return tcpMatchBuilder.build();
-    }
-
-    private Layer4Match prepLayer4MatchSctp() {
-        SctpMatchBuilder sctpMatchBuilder = new SctpMatchBuilder();
-
-        sctpMatchBuilder.setSctpSourcePort(new PortNumber(31));
-        sctpMatchBuilder.setSctpDestinationPort(new PortNumber(32));
-
-        return sctpMatchBuilder.build();
-    }
-
-    private Layer3Match prepLayer3MatchIpv4() {
-        Ipv4MatchBuilder ipv4MatchBuilder = new Ipv4MatchBuilder();
-        ipv4MatchBuilder.setIpv4Source(new Ipv4Prefix("192.168.1.104/32"));
-        ipv4MatchBuilder.setIpv4Destination(new Ipv4Prefix("192.168.1.105/32"));
-        return ipv4MatchBuilder.build();
-    }
-
-    private Layer3Match prepLayer3MatchIpv6() {
-        Ipv6MatchBuilder ipv6MatchBuilder = new Ipv6MatchBuilder();
-        ipv6MatchBuilder.setIpv6Source(new Ipv6Prefix("3001:0db8:85a3:0000:0000:8a2e:0370:7334"));
-        ipv6MatchBuilder.setIpv6Destination(new Ipv6Prefix("3001:0db8:85a3:0000:0000:8a2e:0370:7335"));
-        return ipv6MatchBuilder.build();
-    }
-
-    private Layer3Match prepLayer3MatchArp() {
-        ArpMatchBuilder arpMatchBuilder = new ArpMatchBuilder();
-        arpMatchBuilder.setArpSourceTransportAddress(new Ipv4Prefix("192.168.1.101/32"));
-        arpMatchBuilder.setArpTargetTransportAddress(new Ipv4Prefix("192.168.1.102/32"));
-
-        ArpSourceHardwareAddressBuilder arpSourAddressBuild = new ArpSourceHardwareAddressBuilder();
-        arpSourAddressBuild.setAddress(new MacAddress("22:44:66:88:AA:CC"));
-        arpMatchBuilder.setArpSourceHardwareAddress(arpSourAddressBuild.build());
-
-        ArpTargetHardwareAddressBuilder arpTarAddressBuild = new ArpTargetHardwareAddressBuilder();
-        arpTarAddressBuild.setAddress(new MacAddress("11:33:55:77:BB:DD"));
-        arpMatchBuilder.setArpTargetHardwareAddress(arpTarAddressBuild.build());
-        return arpMatchBuilder.build();
-    }
-
-    private VlanMatch prepVlanMatch() {
-        VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
-
-        VlanIdBuilder vlanIdBuilder = new VlanIdBuilder().setVlanId(new VlanId(0xfff));
-        vlanMatchBuilder.setVlanId(vlanIdBuilder.setVlanIdPresent(true).build());
-        vlanMatchBuilder.setVlanPcp(new VlanPcp((short) 0x7));
-
-        return vlanMatchBuilder.build();
-    }
-
-    private VlanMatch prepVlanNoneMatch() {
-        VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
-
-        VlanIdBuilder vlanIdBuilder = new VlanIdBuilder().
-            setVlanIdPresent(false);
-        vlanMatchBuilder.setVlanId(vlanIdBuilder.build());
-
-        return vlanMatchBuilder.build();
-    }
-
-    private IpMatch prepIpMatch() {
-        IpMatchBuilder ipMatchBuilder = new IpMatchBuilder();
-        ipMatchBuilder.setIpDscp(new Dscp((short) 0x33));
-        ipMatchBuilder.setIpProtocol((short) 0x3f);
-        return ipMatchBuilder.build();
-    }
-
-    private EthernetMatch prepEthernetMatch() {
-        EthernetMatchBuilder odEthernetMatchBuilder = new EthernetMatchBuilder();
-        odEthernetMatchBuilder.setEthernetDestination(prepEthDest());
-        odEthernetMatchBuilder.setEthernetSource(prepEthSour());
-        odEthernetMatchBuilder.setEthernetType(prepEthType());
-        return odEthernetMatchBuilder.build();
-    }
-
-    private EthernetType prepEthType() {
-        EthernetTypeBuilder ethTypeBuild = new EthernetTypeBuilder();
-        ethTypeBuild.setType(new EtherType(0xffffL));
-        return ethTypeBuild.build();
-    }
-
-    private EthernetSource prepEthSour() {
-        EthernetSourceBuilder ethSourBuild = new EthernetSourceBuilder();
-        ethSourBuild.setAddress(new MacAddress("24:77:03:7C:C5:F1"));
-        return ethSourBuild.build();
-    }
-
-    private EthernetDestination prepEthDest() {
-        EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder();
-        ethDestBuild.setAddress(new MacAddress("3C:A9:F4:00:E0:C8"));
-        return ethDestBuild.build();
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/ToSalConversionsUtilsTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/ToSalConversionsUtilsTest.java
deleted file mode 100644 (file)
index aa25c18..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
-
-/**
- * test of {@link ToSalConversionsUtils}
- */
-public class ToSalConversionsUtilsTest {
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils#tosToNwDscp(int)}.
-     */
-    @Test
-    public void testTosToNwDscp() {
-        Assert.assertEquals(0, ToSalConversionsUtils.tosToNwDscp(0));
-        Assert.assertEquals(0, ToSalConversionsUtils.tosToNwDscp(1));
-        Assert.assertEquals(1, ToSalConversionsUtils.tosToNwDscp(4));
-        Assert.assertEquals(63, ToSalConversionsUtils.tosToNwDscp(252));
-        Assert.assertEquals(63, ToSalConversionsUtils.tosToNwDscp(253));
-        Assert.assertEquals(-1, ToSalConversionsUtils.tosToNwDscp(-1));
-    }
-}
diff --git a/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java b/opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java
deleted file mode 100644 (file)
index 2a0d47e..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * 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.topology.test;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.opendaylight.controller.sal.compatibility.topology.TopologyMapping;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-
-/**
- * test for {@link TopologyMapping}
- */
-public class TopologyMappingTest {
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     */
-    @Test
-    public void testToADNodeId() {
-        NodeId nodeId = new NodeId("openflow:1");
-        String observedNodeId = TopologyMapping.toADNodeId(nodeId);
-
-        assertEquals("1", observedNodeId);
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNodeConnector(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToADNodeConnector() throws ConstructionException {
-        NodeId nodeId = new NodeId("openflow:1");
-        TpId source = new TpId("foo:2");
-        NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
-
-        assertEquals("OF|2@OF|00:00:00:00:00:00:00:01", observedNodeConnector.toString());
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNodeConnectorId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId)}.
-     */
-    @Test
-    public void testToADNodeConnectorId() {
-        TpId source = new TpId("foo:2");
-        String observedNodeConnectorId = TopologyMapping.toADNodeConnectorId(source);
-
-        assertEquals("2", observedNodeConnectorId);
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void testToADNode() throws ConstructionException {
-        NodeId nodeId = new NodeId("openflow:1");
-        Node observedNode = TopologyMapping.toADNode(nodeId);
-
-        assertEquals("OF|00:00:00:00:00:00:00:01", observedNode.toString());
-    }
-
-    /**
-     * Test method for {@link org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNodeConnector(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
-     * @throws ConstructionException
-     */
-    @Test
-    public void bug1309ToADNodeConnector() throws ConstructionException {
-        NodeId nodeId = new NodeId("some_unknown_node");
-        TpId source = new TpId("192.168.0.1");
-        NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
-
-        assertEquals("MD_SAL_DEPRECATED|192.168.0.1@MD_SAL_DEPRECATED|some_unknown_node", observedNodeConnector.toString());
-    }
-
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/pom.xml b/opendaylight/md-sal/forwardingrules-manager/pom.xml
deleted file mode 100644 (file)
index 12458f5..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-  </parent>
-  <groupId>org.opendaylight.controller.md</groupId>
-  <artifactId>forwardingrules-manager</artifactId>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>yang-common</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-broker-impl</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-Activator>org.opendaylight.controller.frm.FRMActivator</Bundle-Activator>
-          </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:MD-SAL</url>
-  </scm>
-</project>
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/FRMActivator.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/FRMActivator.java
deleted file mode 100644 (file)
index 9878d16..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * 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.frm;
-
-import org.opendaylight.controller.frm.impl.ForwardingRulesManagerImpl;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Forwarding Rules Manager Activator
- *
- * Activator {@link ForwardingRulesManager}.
- * It registers all listeners (DataChangeEvent, ReconcilNotification)
- * in the Session Initialization phase.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- * *
- */
-public class FRMActivator extends AbstractBindingAwareProvider {
-
-    private final static Logger LOG = LoggerFactory.getLogger(FRMActivator.class);
-
-    private ForwardingRulesManager  manager;
-
-    @Override
-    public void onSessionInitiated(ProviderContext session) {
-        LOG.info("FRMActivator initialization.");
-        try {
-            final DataBroker dataBroker = session.getSALService(DataBroker.class);
-            this.manager = new ForwardingRulesManagerImpl(dataBroker, session);
-            this.manager.start();
-            LOG.info("FRMActivator initialization successfull.");
-        }
-        catch (Exception e) {
-            LOG.error("Unexpected error by FRM initialization!", e);
-            this.stopImpl(null);
-        }
-    }
-
-    @Override
-    protected void stopImpl(final BundleContext context) {
-        if (manager != null) {
-            try {
-                manager.close();
-            } catch (Exception e) {
-                LOG.error("Unexpected error by stopping FRMActivator", e);
-            }
-            manager = null;
-            LOG.info("FRMActivator stopped.");
-        }
-    }
-  }
\ No newline at end of file
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/FlowNodeReconciliation.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/FlowNodeReconciliation.java
deleted file mode 100644 (file)
index fb3178d..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * 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.frm;
-
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * forwardingrules-manager
- * org.opendaylight.controller.frm
- *
- * FlowNodeReconciliation
- * It represent Reconciliation functionality for every new device.
- * So we have to read all possible pre-configured Flows, Meters and Groups from
- * Config/DS and add all to new device.
- * New device is represented by new {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
- * in Operational/DS. So we have to add listener for Wildcarded path in base data change scope.
- *
- * WildCarded InstanceIdentifier:
- * {@code
- *
- * InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)
- *
- * }
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 26, 2014
- */
-public interface FlowNodeReconciliation extends DataChangeListener, AutoCloseable {
-
-    /**
-     * Method contains Node registration to {@link ForwardingRulesManager} functionality
-     * as a prevention to use a validation check to the Operational/DS for identify
-     * pre-configure transaction and serious device commit in every transaction.
-     *
-     * Second part of functionality is own reconciliation pre-configure
-     * Flows, Meters and Groups.
-     *
-     * @param connectedNode - {@link org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier} to new Node
-     */
-    void flowNodeConnected(InstanceIdentifier<FlowCapableNode> connectedNode);
-
-    /**
-     * Method contains functionality for registered Node {@FlowCapableNode} removing
-     * from {@Link ForwardingRulesManager}
-     *
-     * @param disconnectedNode - {@link org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier} to removed Node
-     */
-    void flowNodeDisconnected(InstanceIdentifier<FlowCapableNode> disconnectedNode);
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/ForwardingRulesCommiter.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/ForwardingRulesCommiter.java
deleted file mode 100644 (file)
index 2228785..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * 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.frm;
-
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * forwardingrules-manager
- * org.opendaylight.controller.frm
- *
- * ForwardingRulesCommiter
- * It represent a contract between DataStore DataChangeEvent and relevant
- * SalRpcService for device. Every implementation has to be registered for
- * Configurational/DS tree path.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 25, 2014
- */
-public interface ForwardingRulesCommiter <D extends DataObject> extends AutoCloseable, DataChangeListener {
-
-    /**
-     * Method removes DataObject which is identified by InstanceIdentifier
-     * from device.
-     *
-     * @param InstanceIdentifier identifier - the whole path to DataObject
-     * @param DataObject remove - DataObject for removing
-     * @param InstanceIdentifier<FlowCapableNode> parent Node InstanceIdentifier
-     */
-    void remove(InstanceIdentifier<D> identifier, D del,
-            InstanceIdentifier<FlowCapableNode> nodeIdent);
-
-    /**
-     * Method updates the original DataObject to the update DataObject
-     * in device. Both are identified by same InstanceIdentifier
-     *
-     * @param InstanceIdentifier identifier - the whole path to DataObject
-     * @param DataObject original - original DataObject (for update)
-     * @param DataObject update - changed DataObject (contain updates)
-     */
-    void update(InstanceIdentifier<D> identifier, D original, D update,
-            InstanceIdentifier<FlowCapableNode> nodeIdent);
-
-    /**
-     * Method adds the DataObject which is identified by InstanceIdentifier
-     * to device.
-     *
-     * @param InstanceIdentifier identifier - the whole path to new DataObject
-     * @param DataObject add - new DataObject
-     */
-    void add(InstanceIdentifier<D> identifier, D add,
-            InstanceIdentifier<FlowCapableNode> nodeIdent);
-
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/ForwardingRulesManager.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/ForwardingRulesManager.java
deleted file mode 100644 (file)
index 504c108..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * 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.frm;
-
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * forwardingrules-manager
- * org.opendaylight.controller.frm
- *
- * ForwardingRulesManager
- * It represent a central point for whole modul. Implementation
- * Flow Provider registers the link FlowChangeListener} and it holds all needed
- * services for link FlowChangeListener}.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 25, 2014
- */
-public interface ForwardingRulesManager extends AutoCloseable {
-
-    public void start();
-
-    /**
-     * Method returns information :
-     * "is Node with send InstanceIdentifier connected"?
-     *
-     * @param InstanceIdentifier<FlowCapableNode> ident - the key of the node
-     * @return boolean - is device connected
-     */
-    public boolean isNodeActive(InstanceIdentifier<FlowCapableNode> ident);
-
-    /**
-     * Method add new {@link FlowCapableNode} to active Node Holder.
-     * ActiveNodeHolder prevent unnecessary Operational/DS read for identify
-     * pre-configure and serious Configure/DS transactions.
-     *
-     * @param InstanceIdentifier<FlowCapableNode> ident - the key of the node
-     */
-    public void registrateNewNode(InstanceIdentifier<FlowCapableNode> ident);
-
-    /**
-     * Method remove disconnected {@link FlowCapableNode} from active Node
-     * Holder. And all next flows or groups or meters will stay in Config/DS
-     * only.
-     *
-     * @param InstanceIdentifier<FlowCapableNode> ident - the key of the node
-     */
-    public void unregistrateNode(InstanceIdentifier<FlowCapableNode> ident);
-
-    /**
-     * Method returns generated transaction ID, which is unique for
-     * every transaction. ID is composite from prefix ("DOM") and unique number.
-     *
-     * @return String transactionID for RPC transaction identification
-     */
-    public String getNewTransactionId();
-
-    /**
-     * Method returns Read Transacion. It is need for Node reconciliation only.
-     *
-     * @return ReadOnlyTransaction
-     */
-    public ReadOnlyTransaction getReadTranaction();
-
-    /**
-     * Flow RPC service
-     *
-     * @return
-     */
-    public SalFlowService getSalFlowService();
-
-    /**
-     * Group RPC service
-     *
-     * @return
-     */
-    public SalGroupService getSalGroupService();
-
-    /**
-     * Meter RPC service
-     *
-     * @return
-     */
-    public SalMeterService getSalMeterService();
-
-    /**
-     * Content definition method and prevent code duplicity in Reconcil
-     * @return ForwardingRulesCommiter<Flow>
-     */
-    public ForwardingRulesCommiter<Flow> getFlowCommiter();
-
-    /**
-     * Content definition method and prevent code duplicity in Reconcil
-     * @return ForwardingRulesCommiter<Group>
-     */
-    public ForwardingRulesCommiter<Group> getGroupCommiter();
-
-    /**
-     * Content definition method and prevent code duplicity
-     * @return ForwardingRulesCommiter<Meter>
-     */
-    public ForwardingRulesCommiter<Meter> getMeterCommiter();
-
-    /**
-     * Content definition method
-     * @return FlowNodeReconciliation
-     */
-    public FlowNodeReconciliation getFlowNodeReconciliation();
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/AbstractListeningCommiter.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/AbstractListeningCommiter.java
deleted file mode 100644 (file)
index ec49e61..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * 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.frm.impl;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.frm.ForwardingRulesCommiter;
-import org.opendaylight.controller.frm.ForwardingRulesManager;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * AbstractChangeListner implemented basic {@link AsyncDataChangeEvent} processing for
- * flow node subDataObject (flows, groups and meters).
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public abstract class AbstractListeningCommiter <T extends DataObject> implements ForwardingRulesCommiter<T> {
-
-    protected ForwardingRulesManager provider;
-
-    protected final Class<T> clazz;
-
-    public AbstractListeningCommiter (ForwardingRulesManager provider, Class<T> clazz) {
-        this.provider = Preconditions.checkNotNull(provider, "ForwardingRulesManager can not be null!");
-        this.clazz = Preconditions.checkNotNull(clazz, "Class can not be null!");
-    }
-
-    @Override
-    public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changeEvent) {
-        Preconditions.checkNotNull(changeEvent,"Async ChangeEvent can not be null!");
-
-        /* All DataObjects for create */
-        final Map<InstanceIdentifier<?>, DataObject> createdData = changeEvent.getCreatedData() != null
-                ? changeEvent.getCreatedData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        /* All DataObjects for remove */
-        final Set<InstanceIdentifier<?>> removeData = changeEvent.getRemovedPaths() != null
-                ? changeEvent.getRemovedPaths() : Collections.<InstanceIdentifier<?>> emptySet();
-        /* All DataObjects for updates */
-        final Map<InstanceIdentifier<?>, DataObject> updateData = changeEvent.getUpdatedData() != null
-                ? changeEvent.getUpdatedData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-        /* All Original DataObjects */
-        final Map<InstanceIdentifier<?>, DataObject> originalData = changeEvent.getOriginalData() != null
-                ? changeEvent.getOriginalData() : Collections.<InstanceIdentifier<?>, DataObject> emptyMap();
-
-        this.createData(createdData);
-        this.updateData(updateData, originalData);
-        this.removeData(removeData, originalData);
-    }
-
-    /**
-     * Method return wildCardPath for Listener registration
-     * and for identify the correct KeyInstanceIdentifier from data;
-     */
-    protected abstract InstanceIdentifier<T> getWildCardPath();
-
-
-
-    @SuppressWarnings("unchecked")
-    private void createData(final Map<InstanceIdentifier<?>, DataObject> createdData) {
-        final Set<InstanceIdentifier<?>> keys = createdData.keySet() != null
-                ? createdData.keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-        for (InstanceIdentifier<?> key : keys) {
-            if (clazz.equals(key.getTargetType())) {
-                final InstanceIdentifier<FlowCapableNode> nodeIdent =
-                        key.firstIdentifierOf(FlowCapableNode.class);
-                if (preConfigurationCheck(nodeIdent)) {
-                    InstanceIdentifier<T> createKeyIdent = key.firstIdentifierOf(clazz);
-                    final Optional<DataObject> value = Optional.of(createdData.get(key));
-                    if (value.isPresent()) {
-                        this.add(createKeyIdent, (T)value.get(), nodeIdent);
-                    }
-                }
-            }
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private void updateData(final Map<InstanceIdentifier<?>, DataObject> updateData,
-            final Map<InstanceIdentifier<?>, DataObject> originalData) {
-
-        final Set<InstanceIdentifier<?>> keys = updateData.keySet() != null
-                ? updateData.keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-        for (InstanceIdentifier<?> key : keys) {
-            if (clazz.equals(key.getTargetType())) {
-                final InstanceIdentifier<FlowCapableNode> nodeIdent =
-                        key.firstIdentifierOf(FlowCapableNode.class);
-                if (preConfigurationCheck(nodeIdent)) {
-                    InstanceIdentifier<T> updateKeyIdent = key.firstIdentifierOf(clazz);
-                    final Optional<DataObject> value = Optional.of(updateData.get(key));
-                    final Optional<DataObject> original = Optional.of(originalData.get(key));
-                    if (value.isPresent() && original.isPresent()) {
-                        this.update(updateKeyIdent, (T)original.get(), (T)value.get(), nodeIdent);
-                    }
-                }
-            }
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private void removeData(final Set<InstanceIdentifier<?>> removeData,
-            final Map<InstanceIdentifier<?>, DataObject> originalData) {
-
-        for (InstanceIdentifier<?> key : removeData) {
-            if (clazz.equals(key.getTargetType())) {
-                final InstanceIdentifier<FlowCapableNode> nodeIdent =
-                        key.firstIdentifierOf(FlowCapableNode.class);
-                if (preConfigurationCheck(nodeIdent)) {
-                    final InstanceIdentifier<T> ident = key.firstIdentifierOf(clazz);
-                    final DataObject removeValue = originalData.get(key);
-                    this.remove(ident, (T)removeValue, nodeIdent);
-                }
-            }
-        }
-    }
-
-    private boolean preConfigurationCheck(final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-        Preconditions.checkNotNull(nodeIdent, "FlowCapableNode ident can not be null!");
-        return provider.isNodeActive(nodeIdent);
-    }
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowForwarder.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowForwarder.java
deleted file mode 100644 (file)
index 0d973d6..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * 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.frm.impl;
-
-import org.opendaylight.controller.frm.ForwardingRulesManager;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-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.service.rev130819.AddFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowTableRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.OriginalFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.UpdatedFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-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.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-/**
- * GroupForwarder
- * It implements {@link org.opendaylight.controller.md.sal.binding.api.DataChangeListener}}
- * for WildCardedPath to {@link Flow} and ForwardingRulesCommiter interface for methods:
- *  add, update and remove {@link Flow} processing for
- *  {@link org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent}.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class FlowForwarder extends AbstractListeningCommiter<Flow> {
-
-    private static final Logger LOG = LoggerFactory.getLogger(FlowForwarder.class);
-
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-
-    public FlowForwarder (final ForwardingRulesManager manager, final DataBroker db) {
-        super(manager, Flow.class);
-        Preconditions.checkNotNull(db, "DataBroker can not be null!");
-        registrationListener(db, 5);
-    }
-
-    private void registrationListener(final DataBroker db, int i) {
-        try {
-            listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
-                    getWildCardPath(), FlowForwarder.this, DataChangeScope.SUBTREE);
-        } catch (final Exception e) {
-            if (i >= 1) {
-                try {
-                    Thread.sleep(100);
-                } catch (InterruptedException e1) {
-                    LOG.error("Thread interrupted '{}'", e1);
-                    Thread.currentThread().interrupt();
-                }
-                registrationListener(db, --i);
-            } else {
-                LOG.error("FRM Flow DataChange listener registration fail!", e);
-                throw new IllegalStateException("FlowForwarder registration Listener fail! System needs restart.", e);
-            }
-        }
-    }
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (final Exception e) {
-                LOG.error("Error by stop FRM FlowChangeListener.", e);
-            }
-            listenerRegistration = null;
-        }
-    }
-
-    @Override
-    public void remove(final InstanceIdentifier<Flow> identifier,
-                       final Flow removeDataObj,
-                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
-        if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
-            final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
-            builder.setFlowRef(new FlowRef(identifier));
-            builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-            builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey)));
-
-            // This method is called only when a given flow object has been
-            // removed from datastore. So FRM always needs to set strict flag
-            // into remove-flow input so that only a flow entry associated with
-            // a given flow object is removed.
-            builder.setTransactionUri(new Uri(provider.getNewTransactionId())).
-                setStrict(Boolean.TRUE);
-            provider.getSalFlowService().removeFlow(builder.build());
-        }
-    }
-
-    @Override
-    public void update(final InstanceIdentifier<Flow> identifier,
-                       final Flow original, final Flow update,
-                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
-        if (tableIdValidationPrecondition(tableKey, update)) {
-            final UpdateFlowInputBuilder builder = new UpdateFlowInputBuilder();
-
-            builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-            builder.setFlowRef(new FlowRef(identifier));
-            builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-
-            // This method is called only when a given flow object in datastore
-            // has been updated. So FRM always needs to set strict flag into
-            // update-flow input so that only a flow entry associated with
-            // a given flow object is updated.
-            builder.setUpdatedFlow((new UpdatedFlowBuilder(update)).setStrict(Boolean.TRUE).build());
-            builder.setOriginalFlow((new OriginalFlowBuilder(original)).setStrict(Boolean.TRUE).build());
-
-            provider.getSalFlowService().updateFlow(builder.build());
-        }
-    }
-
-    @Override
-    public void add(final InstanceIdentifier<Flow> identifier,
-                    final Flow addDataObj,
-                    final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
-        if (tableIdValidationPrecondition(tableKey, addDataObj)) {
-            final AddFlowInputBuilder builder = new AddFlowInputBuilder(addDataObj);
-
-            builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-            builder.setFlowRef(new FlowRef(identifier));
-            builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey)));
-            builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-            provider.getSalFlowService().addFlow(builder.build());
-        }
-    }
-
-    @Override
-    protected InstanceIdentifier<Flow> getWildCardPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class)
-                .augmentation(FlowCapableNode.class).child(Table.class).child(Flow.class);
-    }
-
-    private boolean tableIdValidationPrecondition (final TableKey tableKey, final Flow flow) {
-        Preconditions.checkNotNull(tableKey, "TableKey can not be null or empty!");
-        Preconditions.checkNotNull(flow, "Flow can not be null or empty!");
-        if (! tableKey.getId().equals(flow.getTableId())) {
-            LOG.error("TableID in URI tableId={} and in palyload tableId={} is not same.",
-                    flow.getTableId(), tableKey.getId());
-            return false;
-        }
-        return true;
-    }
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowNodeReconciliationImpl.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/FlowNodeReconciliationImpl.java
deleted file mode 100644 (file)
index f1e8dfe..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * 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.frm.impl;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import org.opendaylight.controller.frm.FlowNodeReconciliation;
-import org.opendaylight.controller.frm.ForwardingRulesManager;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey;
-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.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
-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.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * forwardingrules-manager
- * org.opendaylight.controller.frm
- *
- * FlowNode Reconciliation Listener
- * Reconciliation for a new FlowNode
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Jun 13, 2014
- */
-public class FlowNodeReconciliationImpl implements FlowNodeReconciliation {
-
-    private static final Logger LOG = LoggerFactory.getLogger(FlowNodeReconciliationImpl.class);
-
-    private final ForwardingRulesManager provider;
-
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-
-    public FlowNodeReconciliationImpl (final ForwardingRulesManager manager, final DataBroker db) {
-        this.provider = Preconditions.checkNotNull(manager, "ForwardingRulesManager can not be null!");
-        Preconditions.checkNotNull(db, "DataBroker can not be null!");
-        /* Build Path */
-        InstanceIdentifier<FlowCapableNode> flowNodeWildCardIdentifier = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class).augmentation(FlowCapableNode.class);
-        this.listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                flowNodeWildCardIdentifier, FlowNodeReconciliationImpl.this, DataChangeScope.BASE);
-    }
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (Exception e) {
-                LOG.error("Error by stop FRM FlowNodeReconilListener.", e);
-            }
-            listenerRegistration = null;
-        }
-    }
-
-    @Override
-    public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changeEvent) {
-        Preconditions.checkNotNull(changeEvent,"Async ChangeEvent can not be null!");
-        /* All DataObjects for create */
-        final Set<InstanceIdentifier<?>>  createdData = changeEvent.getCreatedData() != null
-                ? changeEvent.getCreatedData().keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-        /* All DataObjects for remove */
-        final Set<InstanceIdentifier<?>> removeData = changeEvent.getRemovedPaths() != null
-                ? changeEvent.getRemovedPaths() : Collections.<InstanceIdentifier<?>> emptySet();
-
-        for (InstanceIdentifier<?> entryKey : removeData) {
-            final InstanceIdentifier<FlowCapableNode> nodeIdent = entryKey
-                    .firstIdentifierOf(FlowCapableNode.class);
-            if ( ! nodeIdent.isWildcarded()) {
-                flowNodeDisconnected(nodeIdent);
-            }
-        }
-        for (InstanceIdentifier<?> entryKey : createdData) {
-            final InstanceIdentifier<FlowCapableNode> nodeIdent = entryKey
-                    .firstIdentifierOf(FlowCapableNode.class);
-            if ( ! nodeIdent.isWildcarded()) {
-                flowNodeConnected(nodeIdent);
-            }
-        }
-    }
-
-    @Override
-    public void flowNodeDisconnected(InstanceIdentifier<FlowCapableNode> disconnectedNode) {
-        provider.unregistrateNode(disconnectedNode);
-    }
-
-    @Override
-    public void flowNodeConnected(InstanceIdentifier<FlowCapableNode> connectedNode) {
-        if ( ! provider.isNodeActive(connectedNode)) {
-            provider.registrateNewNode(connectedNode);
-            reconciliation(connectedNode);
-        }
-    }
-
-    private void reconciliation(final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        ReadOnlyTransaction trans = provider.getReadTranaction();
-        Optional<FlowCapableNode> flowNode = Optional.absent();
-
-        try {
-            flowNode = trans.read(LogicalDatastoreType.CONFIGURATION, nodeIdent).get();
-        }
-        catch (Exception e) {
-            LOG.error("Fail with read Config/DS for Node {} !", nodeIdent, e);
-        }
-
-        if (flowNode.isPresent()) {
-            /* Groups - have to be first */
-            List<Group> groups = flowNode.get().getGroup() != null
-                    ? flowNode.get().getGroup() : Collections.<Group> emptyList();
-            for (Group group : groups) {
-                final KeyedInstanceIdentifier<Group, GroupKey> groupIdent =
-                        nodeIdent.child(Group.class, group.getKey());
-                this.provider.getGroupCommiter().add(groupIdent, group, nodeIdent);
-            }
-            /* Meters */
-            List<Meter> meters = flowNode.get().getMeter() != null
-                    ? flowNode.get().getMeter() : Collections.<Meter> emptyList();
-            for (Meter meter : meters) {
-                final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent =
-                        nodeIdent.child(Meter.class, meter.getKey());
-                this.provider.getMeterCommiter().add(meterIdent, meter, nodeIdent);
-            }
-            /* Flows */
-            List<Table> tables = flowNode.get().getTable() != null
-                    ? flowNode.get().getTable() : Collections.<Table> emptyList();
-            for (Table table : tables) {
-                final KeyedInstanceIdentifier<Table, TableKey> tableIdent =
-                        nodeIdent.child(Table.class, table.getKey());
-                List<Flow> flows = table.getFlow() != null ? table.getFlow() : Collections.<Flow> emptyList();
-                for (Flow flow : flows) {
-                    final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent =
-                            tableIdent.child(Flow.class, flow.getKey());
-                    this.provider.getFlowCommiter().add(flowIdent, flow, nodeIdent);
-                }
-            }
-        }
-        /* clean transaction */
-        trans.close();
-    }
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/ForwardingRulesManagerImpl.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/ForwardingRulesManagerImpl.java
deleted file mode 100644 (file)
index 7cb7acf..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/**
- * 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.frm.impl;
-
-import java.util.Collections;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.opendaylight.controller.frm.FlowNodeReconciliation;
-import org.opendaylight.controller.frm.ForwardingRulesCommiter;
-import org.opendaylight.controller.frm.ForwardingRulesManager;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Sets;
-
-/**
- * forwardingrules-manager
- * org.opendaylight.controller.frm.impl
- *
- * Manager and middle point for whole module.
- * It contains ActiveNodeHolder and provide all RPC services.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 25, 2014
- */
-public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
-
-    private static final Logger LOG = LoggerFactory.getLogger(ForwardingRulesManagerImpl.class);
-
-    private final AtomicLong txNum = new AtomicLong();
-    private final Object lockObj = new Object();
-    private Set<InstanceIdentifier<FlowCapableNode>> activeNodes = Collections.emptySet();
-
-    private final DataBroker dataService;
-    private final SalFlowService salFlowService;
-    private final SalGroupService salGroupService;
-    private final SalMeterService salMeterService;
-
-    private ForwardingRulesCommiter<Flow> flowListener;
-    private ForwardingRulesCommiter<Group> groupListener;
-    private ForwardingRulesCommiter<Meter> meterListener;
-    private FlowNodeReconciliation nodeListener;
-
-    public ForwardingRulesManagerImpl(final DataBroker dataBroker,
-            final RpcConsumerRegistry rpcRegistry) {
-        this.dataService = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
-
-        Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry can not be null !");
-
-        this.salFlowService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalFlowService.class),
-                "RPC SalFlowService not found.");
-        this.salGroupService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalGroupService.class),
-                "RPC SalGroupService not found.");
-        this.salMeterService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalMeterService.class),
-                "RPC SalMeterService not found.");
-    }
-
-    @Override
-    public void start() {
-        this.flowListener = new FlowForwarder(this, dataService);
-        this.groupListener = new GroupForwarder(this, dataService);
-        this.meterListener = new MeterForwarder(this, dataService);
-        this.nodeListener = new FlowNodeReconciliationImpl(this, dataService);
-        LOG.info("ForwardingRulesManager has started successfull.");
-    }
-
-    @Override
-    public void close() throws Exception {
-        if(this.flowListener != null) {
-            this.flowListener.close();
-            this.flowListener = null;
-        }
-        if (this.groupListener != null) {
-            this.groupListener.close();
-            this.groupListener = null;
-        }
-        if (this.meterListener != null) {
-            this.meterListener.close();
-            this.meterListener = null;
-        }
-        if (this.nodeListener != null) {
-            this.nodeListener.close();
-            this.nodeListener = null;
-        }
-    }
-
-    @Override
-    public ReadOnlyTransaction getReadTranaction() {
-        return dataService.newReadOnlyTransaction();
-    }
-
-    @Override
-    public String getNewTransactionId() {
-        return "DOM-" + txNum.getAndIncrement();
-    }
-
-    @Override
-    public boolean isNodeActive(InstanceIdentifier<FlowCapableNode> ident) {
-        return activeNodes.contains(ident);
-    }
-
-    @Override
-    public void registrateNewNode(InstanceIdentifier<FlowCapableNode> ident) {
-        if ( ! activeNodes.contains(ident)) {
-            synchronized (lockObj) {
-                if ( ! activeNodes.contains(ident)) {
-                    Set<InstanceIdentifier<FlowCapableNode>> set =
-                            Sets.newHashSet(activeNodes);
-                    set.add(ident);
-                    activeNodes = Collections.unmodifiableSet(set);
-                }
-            }
-        }
-    }
-
-    @Override
-    public void unregistrateNode(InstanceIdentifier<FlowCapableNode> ident) {
-        if (activeNodes.contains(ident)) {
-            synchronized (lockObj) {
-                if (activeNodes.contains(ident)) {
-                    Set<InstanceIdentifier<FlowCapableNode>> set =
-                            Sets.newHashSet(activeNodes);
-                    set.remove(ident);
-                    activeNodes = Collections.unmodifiableSet(set);
-                }
-            }
-        }
-    }
-
-    @Override
-    public SalFlowService getSalFlowService() {
-        return salFlowService;
-    }
-
-    @Override
-    public SalGroupService getSalGroupService() {
-        return salGroupService;
-    }
-
-    @Override
-    public SalMeterService getSalMeterService() {
-        return salMeterService;
-    }
-
-    @Override
-    public ForwardingRulesCommiter<Flow> getFlowCommiter() {
-        return flowListener;
-    }
-
-    @Override
-    public ForwardingRulesCommiter<Group> getGroupCommiter() {
-        return groupListener;
-    }
-
-    @Override
-    public ForwardingRulesCommiter<Meter> getMeterCommiter() {
-        return meterListener;
-    }
-
-    @Override
-    public FlowNodeReconciliation getFlowNodeReconciliation() {
-        return nodeListener;
-    }
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/GroupForwarder.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/GroupForwarder.java
deleted file mode 100644 (file)
index 1b2c532..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * 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.frm.impl;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.frm.ForwardingRulesManager;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-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.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * GroupForwarder
- * It implements {@link org.opendaylight.controller.md.sal.binding.api.DataChangeListener}}
- * for WildCardedPath to {@link Group} and ForwardingRulesCommiter interface for methods:
- *  add, update and remove {@link Group} processing for
- *  {@link org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent}.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class GroupForwarder extends AbstractListeningCommiter<Group> {
-
-    private static final Logger LOG = LoggerFactory.getLogger(GroupForwarder.class);
-
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-
-    public GroupForwarder (final ForwardingRulesManager manager, final DataBroker db) {
-        super(manager, Group.class);
-        Preconditions.checkNotNull(db, "DataBroker can not be null!");
-        this.listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
-                getWildCardPath(), GroupForwarder.this, DataChangeScope.SUBTREE);
-    }
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (Exception e) {
-                LOG.error("Error by stop FRM GroupChangeListener.", e);
-            }
-            listenerRegistration = null;
-        }
-    }
-
-    @Override
-    protected InstanceIdentifier<Group> getWildCardPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class)
-                .augmentation(FlowCapableNode.class).child(Group.class);
-    }
-
-    @Override
-    public void remove(final InstanceIdentifier<Group> identifier, final Group removeDataObj,
-                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final Group group = (removeDataObj);
-        final RemoveGroupInputBuilder builder = new RemoveGroupInputBuilder(group);
-
-        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-        builder.setGroupRef(new GroupRef(identifier));
-        builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        this.provider.getSalGroupService().removeGroup(builder.build());
-    }
-
-    @Override
-    public void update(final InstanceIdentifier<Group> identifier,
-                       final Group original, final Group update,
-                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final Group originalGroup = (original);
-        final Group updatedGroup = (update);
-        final UpdateGroupInputBuilder builder = new UpdateGroupInputBuilder();
-
-        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-        builder.setGroupRef(new GroupRef(identifier));
-        builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        builder.setUpdatedGroup((new UpdatedGroupBuilder(updatedGroup)).build());
-        builder.setOriginalGroup((new OriginalGroupBuilder(originalGroup)).build());
-
-        this.provider.getSalGroupService().updateGroup(builder.build());
-    }
-
-    @Override
-    public void add(final InstanceIdentifier<Group> identifier, final Group addDataObj,
-                    final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final Group group = (addDataObj);
-        final AddGroupInputBuilder builder = new AddGroupInputBuilder(group);
-
-        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-        builder.setGroupRef(new GroupRef(identifier));
-        builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        this.provider.getSalGroupService().addGroup(builder.build());
-    }
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/MeterForwarder.java b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/impl/MeterForwarder.java
deleted file mode 100644 (file)
index 2f3de2a..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * 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.frm.impl;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.frm.ForwardingRulesManager;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-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.meter.service.rev130918.AddMeterInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.meter.update.OriginalMeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.meter.update.UpdatedMeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * MeterForwarder
- * It implements {@link org.opendaylight.controller.md.sal.binding.api.DataChangeListener}}
- * for WildCardedPath to {@link Meter} and ForwardingRulesCommiter interface for methods:
- *  add, update and remove {@link Meter} processing for
- *  {@link org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent}.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class MeterForwarder extends AbstractListeningCommiter<Meter> {
-
-    private static final Logger LOG = LoggerFactory.getLogger(MeterForwarder.class);
-
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-
-    public MeterForwarder (final ForwardingRulesManager manager, final DataBroker db) {
-        super(manager, Meter.class);
-        Preconditions.checkNotNull(db, "DataBroker can not be null!");
-        this.listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
-                getWildCardPath(), MeterForwarder.this, DataChangeScope.SUBTREE);
-    }
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (Exception e) {
-                LOG.error("Error by stop FRM MeterChangeListener.", e);
-            }
-            listenerRegistration = null;
-        }
-    }
-
-    @Override
-    protected InstanceIdentifier<Meter> getWildCardPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class)
-                .augmentation(FlowCapableNode.class).child(Meter.class);
-    }
-
-    @Override
-    public void remove(final InstanceIdentifier<Meter> identifier, final Meter removeDataObj,
-                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final RemoveMeterInputBuilder builder = new RemoveMeterInputBuilder(removeDataObj);
-
-        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-        builder.setMeterRef(new MeterRef(identifier));
-        builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        this.provider.getSalMeterService().removeMeter(builder.build());
-    }
-
-    @Override
-    public void update(final InstanceIdentifier<Meter> identifier,
-                       final Meter original, final Meter update,
-                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final UpdateMeterInputBuilder builder = new UpdateMeterInputBuilder();
-
-        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-        builder.setMeterRef(new MeterRef(identifier));
-        builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        builder.setUpdatedMeter((new UpdatedMeterBuilder(update)).build());
-        builder.setOriginalMeter((new OriginalMeterBuilder(original)).build());
-
-        this.provider.getSalMeterService().updateMeter(builder.build());
-    }
-
-    @Override
-    public void add(final InstanceIdentifier<Meter> identifier, final Meter addDataObj,
-                    final InstanceIdentifier<FlowCapableNode> nodeIdent) {
-
-        final AddMeterInputBuilder builder = new AddMeterInputBuilder(addDataObj);
-
-        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
-        builder.setMeterRef(new MeterRef(identifier));
-        builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        this.provider.getSalMeterService().addMeter(builder.build());
-    }
-}
-
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/FlowListenerTest.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/FlowListenerTest.java
deleted file mode 100644 (file)
index 91904cf..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/**
- * 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 test.mock;
-
-import org.junit.Test;
-import org.opendaylight.controller.frm.impl.ForwardingRulesManagerImpl;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-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.TableBuilder;
-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.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
-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.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import test.mock.util.FRMTest;
-import test.mock.util.RpcProviderRegistryMock;
-import test.mock.util.SalFlowServiceMock;
-
-import java.util.Collections;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-public class FlowListenerTest extends FRMTest {
-    RpcProviderRegistry rpcProviderRegistryMock = new RpcProviderRegistryMock();
-    NodeKey s1Key = new NodeKey(new NodeId("S1"));
-    TableKey tableKey = new TableKey((short) 2);
-
-    @Test
-    public void addTwoFlowsTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
-        InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
-        InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
-        Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
-        Flow flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
-        assertCommit(writeTx.submit());
-        SalFlowServiceMock salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        List<AddFlowInput> addFlowCalls = salFlowService.getAddFlowCalls();
-        assertEquals(1, addFlowCalls.size());
-        assertEquals("DOM-0", addFlowCalls.get(0).getTransactionUri().getValue());
-
-        flowKey = new FlowKey(new FlowId("test_Flow2"));
-        flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
-        flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
-        assertCommit(writeTx.submit());
-        salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        addFlowCalls = salFlowService.getAddFlowCalls();
-        assertEquals(2, addFlowCalls.size());
-        assertEquals("DOM-1", addFlowCalls.get(1).getTransactionUri().getValue());
-        assertEquals(2, addFlowCalls.get(1).getTableId().intValue());
-        assertEquals(flowII, addFlowCalls.get(1).getFlowRef().getValue());
-
-        forwardingRulesManager.close();
-    }
-
-    @Test
-    public void updateFlowTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
-        InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
-        InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
-        Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
-        Flow flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
-        assertCommit(writeTx.submit());
-        SalFlowServiceMock salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        List<AddFlowInput> addFlowCalls = salFlowService.getAddFlowCalls();
-        assertEquals(1, addFlowCalls.size());
-        assertEquals("DOM-0", addFlowCalls.get(0).getTransactionUri().getValue());
-
-        flowKey = new FlowKey(new FlowId("test_Flow"));
-        flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
-        flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).setOutGroup((long) 5).build();
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
-        assertCommit(writeTx.submit());
-        salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        List<UpdateFlowInput> updateFlowCalls = salFlowService.getUpdateFlowCalls();
-        assertEquals(1, updateFlowCalls.size());
-        assertEquals("DOM-1", updateFlowCalls.get(0).getTransactionUri().getValue());
-        assertEquals(flowII, updateFlowCalls.get(0).getFlowRef().getValue());
-        assertEquals(Boolean.TRUE, updateFlowCalls.get(0).getOriginalFlow().isStrict());
-        assertEquals(Boolean.TRUE, updateFlowCalls.get(0).getUpdatedFlow().isStrict());
-
-        forwardingRulesManager.close();
-    }
-
-    @Test
-    public void updateFlowScopeTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
-        InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
-        InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
-        Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
-        IpMatch ipMatch = new IpMatchBuilder().setIpDscp(new Dscp((short)4)).build();
-        Match match = new MatchBuilder().setIpMatch(ipMatch).build();
-        Flow flow = new FlowBuilder().setMatch(match).setKey(flowKey).setTableId((short) 2).build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
-        assertCommit(writeTx.submit());
-        SalFlowServiceMock salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        List<AddFlowInput> addFlowCalls = salFlowService.getAddFlowCalls();
-        assertEquals(1, addFlowCalls.size());
-        assertEquals("DOM-0", addFlowCalls.get(0).getTransactionUri().getValue());
-
-        flowKey = new FlowKey(new FlowId("test_Flow"));
-        flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
-        ipMatch = new IpMatchBuilder().setIpDscp(new Dscp((short)5)).build();
-        match = new MatchBuilder().setIpMatch(ipMatch).build();
-        flow = new FlowBuilder().setMatch(match).setKey(flowKey).setTableId((short) 2).build();
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
-        assertCommit(writeTx.submit());
-        salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        List<UpdateFlowInput> updateFlowCalls = salFlowService.getUpdateFlowCalls();
-        assertEquals(1, updateFlowCalls.size());
-        assertEquals("DOM-1", updateFlowCalls.get(0).getTransactionUri().getValue());
-        assertEquals(flowII, updateFlowCalls.get(0).getFlowRef().getValue());
-        assertEquals(ipMatch, updateFlowCalls.get(0).getUpdatedFlow().getMatch().getIpMatch());
-        forwardingRulesManager.close();
-    }
-
-    @Test
-    public void deleteFlowTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        FlowKey flowKey = new FlowKey(new FlowId("test_Flow"));
-        InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
-        InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
-        Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
-        Flow flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
-        assertCommit(writeTx.submit());
-        SalFlowServiceMock salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        List<AddFlowInput> addFlowCalls = salFlowService.getAddFlowCalls();
-        assertEquals(1, addFlowCalls.size());
-        assertEquals("DOM-0", addFlowCalls.get(0).getTransactionUri().getValue());
-
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.delete(LogicalDatastoreType.CONFIGURATION, flowII);
-        assertCommit(writeTx.submit());
-        salFlowService = (SalFlowServiceMock) forwardingRulesManager.getSalFlowService();
-        List<RemoveFlowInput> removeFlowCalls = salFlowService.getRemoveFlowCalls();
-        assertEquals(1, removeFlowCalls.size());
-        assertEquals("DOM-1", removeFlowCalls.get(0).getTransactionUri().getValue());
-        assertEquals(flowII, removeFlowCalls.get(0).getFlowRef().getValue());
-        assertEquals(Boolean.TRUE, removeFlowCalls.get(0).isStrict());
-
-        forwardingRulesManager.close();
-    }
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/GroupListenerTest.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/GroupListenerTest.java
deleted file mode 100644 (file)
index 97eb899..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * 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 test.mock;
-
-import org.junit.Test;
-import org.opendaylight.controller.frm.impl.ForwardingRulesManagerImpl;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
-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.yang.binding.InstanceIdentifier;
-import test.mock.util.FRMTest;
-import test.mock.util.RpcProviderRegistryMock;
-import test.mock.util.SalGroupServiceMock;
-
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-public class GroupListenerTest extends FRMTest {
-    RpcProviderRegistry rpcProviderRegistryMock = new RpcProviderRegistryMock();
-    NodeKey s1Key = new NodeKey(new NodeId("S1"));
-
-    @Test
-    public void addTwoGroupsTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        GroupKey groupKey = new GroupKey(new GroupId((long) 255));
-        InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
-        Group group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
-        assertCommit(writeTx.submit());
-        SalGroupServiceMock salGroupService = (SalGroupServiceMock) forwardingRulesManager.getSalGroupService();
-        List<AddGroupInput> addGroupCalls = salGroupService.getAddGroupCalls();
-        assertEquals(1, addGroupCalls.size());
-        assertEquals("DOM-0", addGroupCalls.get(0).getTransactionUri().getValue());
-
-        groupKey = new GroupKey(new GroupId((long) 256));
-        groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
-        group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
-        assertCommit(writeTx.submit());
-        salGroupService = (SalGroupServiceMock) forwardingRulesManager.getSalGroupService();
-        addGroupCalls = salGroupService.getAddGroupCalls();
-        assertEquals(2, addGroupCalls.size());
-        assertEquals("DOM-1", addGroupCalls.get(1).getTransactionUri().getValue());
-
-        forwardingRulesManager.close();
-    }
-
-    @Test
-    public void updateGroupTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        GroupKey groupKey = new GroupKey(new GroupId((long) 255));
-        InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
-        Group group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
-        assertCommit(writeTx.submit());
-        SalGroupServiceMock salGroupService = (SalGroupServiceMock) forwardingRulesManager.getSalGroupService();
-        List<AddGroupInput> addGroupCalls = salGroupService.getAddGroupCalls();
-        assertEquals(1, addGroupCalls.size());
-        assertEquals("DOM-0", addGroupCalls.get(0).getTransactionUri().getValue());
-
-        group = new GroupBuilder().setKey(groupKey).setGroupName("Group2").build();
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
-        assertCommit(writeTx.submit());
-        salGroupService = (SalGroupServiceMock) forwardingRulesManager.getSalGroupService();
-        List<UpdateGroupInput> updateGroupCalls = salGroupService.getUpdateGroupCalls();
-        assertEquals(1, updateGroupCalls.size());
-        assertEquals("DOM-1", updateGroupCalls.get(0).getTransactionUri().getValue());
-
-        forwardingRulesManager.close();
-    }
-
-    @Test
-    public void removeGroupTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        GroupKey groupKey = new GroupKey(new GroupId((long) 255));
-        InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
-        Group group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
-        assertCommit(writeTx.submit());
-        SalGroupServiceMock salGroupService = (SalGroupServiceMock) forwardingRulesManager.getSalGroupService();
-        List<AddGroupInput> addGroupCalls = salGroupService.getAddGroupCalls();
-        assertEquals(1, addGroupCalls.size());
-        assertEquals("DOM-0", addGroupCalls.get(0).getTransactionUri().getValue());
-
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.delete(LogicalDatastoreType.CONFIGURATION, groupII);
-        assertCommit(writeTx.submit());
-        salGroupService = (SalGroupServiceMock) forwardingRulesManager.getSalGroupService();
-        List<RemoveGroupInput> removeGroupCalls = salGroupService.getRemoveGroupCalls();
-        assertEquals(1, removeGroupCalls.size());
-        assertEquals("DOM-1", removeGroupCalls.get(0).getTransactionUri().getValue());
-
-        forwardingRulesManager.close();
-    }
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/MeterListenerTest.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/MeterListenerTest.java
deleted file mode 100644 (file)
index 0d32f9f..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * 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 test.mock;
-
-import org.junit.Test;
-import org.opendaylight.controller.frm.impl.ForwardingRulesManagerImpl;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey;
-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.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import test.mock.util.FRMTest;
-import test.mock.util.RpcProviderRegistryMock;
-import test.mock.util.SalMeterServiceMock;
-
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-public class MeterListenerTest extends FRMTest {
-    RpcProviderRegistry rpcProviderRegistryMock = new RpcProviderRegistryMock();
-    NodeKey s1Key = new NodeKey(new NodeId("S1"));
-
-    @Test
-    public void addTwoMetersTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
-        InstanceIdentifier<Meter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
-        Meter meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_one").build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
-        assertCommit(writeTx.submit());
-        SalMeterServiceMock salMeterService = (SalMeterServiceMock) forwardingRulesManager.getSalMeterService();
-        List<AddMeterInput> addMeterCalls = salMeterService.getAddMeterCalls();
-        assertEquals(1, addMeterCalls.size());
-        assertEquals("DOM-0", addMeterCalls.get(0).getTransactionUri().getValue());
-
-        meterKey = new MeterKey(new MeterId((long) 2001));
-        meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
-        meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_two").setBarrier(true).build();
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
-        assertCommit(writeTx.submit());
-        salMeterService = (SalMeterServiceMock) forwardingRulesManager.getSalMeterService();
-        addMeterCalls = salMeterService.getAddMeterCalls();
-        assertEquals(2, addMeterCalls.size());
-        assertEquals("DOM-1", addMeterCalls.get(1).getTransactionUri().getValue());
-        assertEquals(meterII, addMeterCalls.get(1).getMeterRef().getValue());
-
-        forwardingRulesManager.close();
-    }
-
-    @Test
-    public void updateMeterTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
-        InstanceIdentifier<Meter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
-        Meter meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_one").setBarrier(false).build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
-        assertCommit(writeTx.submit());
-        SalMeterServiceMock salMeterService = (SalMeterServiceMock) forwardingRulesManager.getSalMeterService();
-        List<AddMeterInput> addMeterCalls = salMeterService.getAddMeterCalls();
-        assertEquals(1, addMeterCalls.size());
-        assertEquals("DOM-0", addMeterCalls.get(0).getTransactionUri().getValue());
-
-        meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_two").setBarrier(true).build();
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
-        assertCommit(writeTx.submit());
-        salMeterService = (SalMeterServiceMock) forwardingRulesManager.getSalMeterService();
-        List<UpdateMeterInput> updateMeterCalls = salMeterService.getUpdateMeterCalls();
-        assertEquals(1, updateMeterCalls.size());
-        assertEquals("DOM-1", updateMeterCalls.get(0).getTransactionUri().getValue());
-        assertEquals(meterII, updateMeterCalls.get(0).getMeterRef().getValue());
-
-        forwardingRulesManager.close();
-    }
-
-    @Test
-    public void removeMeterTest() throws Exception {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
-        InstanceIdentifier<Meter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
-        Meter meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_one").build();
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
-        assertCommit(writeTx.submit());
-        SalMeterServiceMock salMeterService = (SalMeterServiceMock) forwardingRulesManager.getSalMeterService();
-        List<AddMeterInput> addMeterCalls = salMeterService.getAddMeterCalls();
-        assertEquals(1, addMeterCalls.size());
-        assertEquals("DOM-0", addMeterCalls.get(0).getTransactionUri().getValue());
-
-        writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.delete(LogicalDatastoreType.CONFIGURATION, meterII);
-        assertCommit(writeTx.submit());
-        salMeterService = (SalMeterServiceMock) forwardingRulesManager.getSalMeterService();
-        List<RemoveMeterInput> removeMeterCalls = salMeterService.getRemoveMeterCalls();
-        assertEquals(1, removeMeterCalls.size());
-        assertEquals("DOM-1", removeMeterCalls.get(0).getTransactionUri().getValue());
-        assertEquals(meterII, removeMeterCalls.get(0).getMeterRef().getValue());
-
-        forwardingRulesManager.close();
-    }
-
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/NodeListenerTest.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/NodeListenerTest.java
deleted file mode 100644 (file)
index 3cf2e93..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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 test.mock;
-
-import org.junit.Test;
-import org.opendaylight.controller.frm.impl.ForwardingRulesManagerImpl;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-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.yang.binding.InstanceIdentifier;
-import test.mock.util.FRMTest;
-import test.mock.util.RpcProviderRegistryMock;
-
-import java.util.concurrent.ExecutionException;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class NodeListenerTest extends FRMTest {
-
-    RpcProviderRegistry rpcProviderRegistryMock = new RpcProviderRegistryMock();
-    NodeKey s1Key = new NodeKey(new NodeId("S1"));
-
-    @Test
-    public void addRemoveNodeTest() throws ExecutionException, InterruptedException {
-        ForwardingRulesManagerImpl forwardingRulesManager = new ForwardingRulesManagerImpl(getDataBroker(), rpcProviderRegistryMock);
-        forwardingRulesManager.start();
-
-        addFlowCapableNode(s1Key);
-
-        InstanceIdentifier<FlowCapableNode> nodeII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class);
-
-        boolean nodeActive = forwardingRulesManager.isNodeActive(nodeII);
-        assertTrue(nodeActive);
-
-        removeNode(s1Key);
-
-        nodeActive = forwardingRulesManager.isNodeActive(nodeII);
-        assertFalse(nodeActive);
-    }
-
-
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/AbstractDataBrokerTest.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/AbstractDataBrokerTest.java
deleted file mode 100644 (file)
index f9efa51..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-public class AbstractDataBrokerTest extends AbstractSchemaAwareTest {
-
-    private DataBrokerTestCustomizer testCustomizer;
-    private DataBroker dataBroker;
-    private DOMDataBroker domBroker;
-
-
-    @Override
-    protected void setupWithSchema(final SchemaContext context) {
-        testCustomizer = createDataBrokerTestCustomizer();
-        dataBroker = testCustomizer.createDataBroker();
-        domBroker = testCustomizer.createDOMDataBroker();
-        testCustomizer.updateSchema(context);
-        setupWithDataBroker(dataBroker);
-    }
-
-    protected void setupWithDataBroker(final DataBroker dataBroker) {
-        // Intentionally left No-op, subclasses may customize it
-    }
-
-   protected DataBrokerTestCustomizer createDataBrokerTestCustomizer() {
-        return new DataBrokerTestCustomizer();
-    }
-
-    public DataBroker getDataBroker() {
-        return dataBroker;
-    }
-
-    public DOMDataBroker getDomBroker() {
-        return domBroker;
-    }
-
-    protected static final void assertCommit(final ListenableFuture<Void> commit) {
-        try {
-            commit.get(500, TimeUnit.MILLISECONDS);
-        } catch (InterruptedException | ExecutionException | TimeoutException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/AbstractSchemaAwareTest.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/AbstractSchemaAwareTest.java
deleted file mode 100644 (file)
index d520d59..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import org.junit.Before;
-import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-public abstract class AbstractSchemaAwareTest {
-
-    private Iterable<YangModuleInfo> moduleInfos;
-    private SchemaContext schemaContext;
-
-
-    protected Iterable<YangModuleInfo> getModuleInfos() {
-        return BindingReflections.loadModuleInfos();
-    }
-
-
-    @Before
-    public final void setup() {
-        moduleInfos = getModuleInfos();
-        ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create();
-        moduleContext.addModuleInfos(moduleInfos);
-        schemaContext = moduleContext.tryToCreateSchemaContext().get();
-        setupWithSchema(schemaContext);
-    }
-
-    /**
-     * Setups test with Schema context.
-     * This method is called before {@link #setupWithSchemaService(SchemaService)}
-     *
-     * @param context
-     */
-    protected abstract void setupWithSchema(SchemaContext context);
-
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java
deleted file mode 100644 (file)
index de7d33e..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import javassist.ClassPool;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.binding.impl.ForwardedBackwardsCompatibleDataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.ForwardedBindingDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.yangtools.sal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
-import org.opendaylight.yangtools.sal.binding.generator.util.JavassistUtils;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-public class DataBrokerTestCustomizer {
-
-    private DOMDataBroker domDataBroker;
-    private final RuntimeGeneratedMappingServiceImpl mappingService;
-    private final MockSchemaService schemaService;
-    private ImmutableMap<LogicalDatastoreType, DOMStore> datastores;
-    private final BindingToNormalizedNodeCodec bindingToNormalized ;
-
-    public ImmutableMap<LogicalDatastoreType, DOMStore> createDatastores() {
-        return ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
-                .put(LogicalDatastoreType.OPERATIONAL, createOperationalDatastore())
-                .put(LogicalDatastoreType.CONFIGURATION,createConfigurationDatastore())
-                .build();
-    }
-
-    public DataBrokerTestCustomizer() {
-        schemaService = new MockSchemaService();
-        ClassPool pool = ClassPool.getDefault();
-        mappingService = new RuntimeGeneratedMappingServiceImpl(pool);
-        DataObjectSerializerGenerator generator = StreamWriterGenerator.create(JavassistUtils.forClassPool(pool));
-        BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(generator);
-        GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
-        bindingToNormalized = new BindingToNormalizedNodeCodec(loading, mappingService, codecRegistry);
-        schemaService.registerSchemaContextListener(bindingToNormalized);
-    }
-
-    public DOMStore createConfigurationDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
-        schemaService.registerSchemaContextListener(store);
-        return store;
-    }
-
-    public DOMStore createOperationalDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
-        schemaService.registerSchemaContextListener(store);
-        return store;
-    }
-
-    public DOMDataBroker createDOMDataBroker() {
-        return new SerializedDOMDataBroker(getDatastores(), getCommitCoordinatorExecutor());
-    }
-
-    public ListeningExecutorService getCommitCoordinatorExecutor() {
-        return MoreExecutors.sameThreadExecutor();
-    }
-
-    public DataBroker createDataBroker() {
-        return new ForwardedBindingDataBroker(getDOMDataBroker(), bindingToNormalized, schemaService );
-    }
-
-    public ForwardedBackwardsCompatibleDataBroker createBackwardsCompatibleDataBroker() {
-        return new ForwardedBackwardsCompatibleDataBroker(getDOMDataBroker(), bindingToNormalized, getSchemaService(), MoreExecutors.sameThreadExecutor());
-    }
-
-    private SchemaService getSchemaService() {
-        return schemaService;
-    }
-
-    private DOMDataBroker getDOMDataBroker() {
-        if(domDataBroker == null) {
-            domDataBroker = createDOMDataBroker();
-        }
-        return domDataBroker;
-    }
-
-    private synchronized ImmutableMap<LogicalDatastoreType, DOMStore> getDatastores() {
-        if (datastores == null) {
-            datastores = createDatastores();
-        }
-        return datastores;
-    }
-
-    public void updateSchema(final SchemaContext ctx) {
-        schemaService.changeSchema(ctx);
-        mappingService.onGlobalContextUpdated(ctx);
-    }
-
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/FRMTest.java
deleted file mode 100644 (file)
index 811d6ca..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import java.util.Collections;
-import java.util.concurrent.ExecutionException;
-
-public abstract class FRMTest extends AbstractDataBrokerTest{
-
-    public void addFlowCapableNode(NodeKey nodeKey) throws ExecutionException, InterruptedException {
-        Nodes nodes = new NodesBuilder().setNode(Collections.<Node>emptyList()).build();
-        InstanceIdentifier<Node> flowNodeIdentifier = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, nodeKey);
-
-        FlowCapableNodeBuilder fcnBuilder = new FlowCapableNodeBuilder();
-        NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setKey(nodeKey);
-        nodeBuilder.addAugmentation(FlowCapableNode.class, fcnBuilder.build());
-
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class), nodes);
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, flowNodeIdentifier, nodeBuilder.build());
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Nodes.class), nodes);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowNodeIdentifier, nodeBuilder.build());
-        assertCommit(writeTx.submit());
-    }
-
-    public void removeNode(NodeKey nodeKey) throws ExecutionException, InterruptedException {
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.delete(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey));
-        writeTx.submit().get();
-    }
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/MockSchemaService.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/MockSchemaService.java
deleted file mode 100644 (file)
index f6f594b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.util.ListenerRegistry;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
-
-public final class MockSchemaService implements SchemaService, SchemaContextProvider {
-
-    private SchemaContext schemaContext;
-
-    ListenerRegistry<SchemaContextListener> listeners = ListenerRegistry.create();
-
-    @Override
-    public void addModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public synchronized SchemaContext getGlobalContext() {
-        return schemaContext;
-    }
-
-    @Override
-    public synchronized SchemaContext getSessionContext() {
-        return schemaContext;
-    }
-
-    @Override
-    public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
-            final SchemaContextListener listener) {
-        return listeners.register(listener);
-    }
-
-    @Override
-    public void removeModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public synchronized SchemaContext getSchemaContext() {
-        return schemaContext;
-    }
-
-    public synchronized void changeSchema(final SchemaContext newContext) {
-        schemaContext = newContext;
-        for (ListenerRegistration<SchemaContextListener> listener : listeners) {
-            listener.getInstance().onGlobalContextUpdated(schemaContext);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/RpcProviderRegistryMock.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/RpcProviderRegistryMock.java
deleted file mode 100644 (file)
index ff17a0c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-
-public class RpcProviderRegistryMock implements RpcProviderRegistry {
-    @Override
-    public <T extends RpcService> BindingAwareBroker.RpcRegistration<T> addRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
-        return null;
-    }
-
-    @Override
-    public <T extends RpcService> BindingAwareBroker.RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
-        return null;
-    }
-
-    @Override
-    public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(L listener) {
-        return null;
-    }
-
-    @Override
-    public <T extends RpcService> T getRpcService(Class<T> serviceInterface) {
-        if (serviceInterface.equals(SalFlowService.class)) {
-            return (T) new SalFlowServiceMock();
-        } else if (serviceInterface.equals(SalGroupService.class)) {
-            return (T) new SalGroupServiceMock();
-        } else if (serviceInterface.equals(SalMeterService.class)) {
-            return (T) new SalMeterServiceMock();
-        } else {
-            return null;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalFlowServiceMock.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalFlowServiceMock.java
deleted file mode 100644 (file)
index 4bddc69..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-
-public class SalFlowServiceMock implements SalFlowService{
-    private List<AddFlowInput> addFlowCalls = new ArrayList<>();
-    private List<RemoveFlowInput> removeFlowCalls = new ArrayList<>();
-    private List<UpdateFlowInput> updateFlowCalls = new ArrayList<>();
-
-    @Override
-    public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
-        addFlowCalls.add(input);
-        return null;
-    }
-
-
-    @Override
-    public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
-        removeFlowCalls.add(input);
-        return null;
-    }
-
-    @Override
-    public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
-        updateFlowCalls.add(input);
-        return null;
-    }
-
-    public List<AddFlowInput> getAddFlowCalls() {
-        return addFlowCalls;
-    }
-
-    public List<RemoveFlowInput> getRemoveFlowCalls() {
-        return removeFlowCalls;
-    }
-
-    public List<UpdateFlowInput> getUpdateFlowCalls() {
-        return updateFlowCalls;
-    }
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalGroupServiceMock.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalGroupServiceMock.java
deleted file mode 100644 (file)
index 9fa7b76..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-
-public class SalGroupServiceMock implements SalGroupService {
-    private List<AddGroupInput> addGroupCalls = new ArrayList<>();
-    private List<RemoveGroupInput> removeGroupCalls = new ArrayList<>();
-    private List<UpdateGroupInput> updateGroupCalls = new ArrayList<>();
-
-    @Override
-    public Future<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
-        addGroupCalls.add(input);
-        return null;
-    }
-
-    @Override
-    public Future<RpcResult<RemoveGroupOutput>> removeGroup(RemoveGroupInput input) {
-        removeGroupCalls.add(input);
-        return null;
-    }
-
-    @Override
-    public Future<RpcResult<UpdateGroupOutput>> updateGroup(UpdateGroupInput input) {
-        updateGroupCalls.add(input);
-        return null;
-    }
-
-    public List<AddGroupInput> getAddGroupCalls() {
-        return addGroupCalls;
-    }
-
-    public List<RemoveGroupInput> getRemoveGroupCalls() {
-        return removeGroupCalls;
-    }
-
-    public List<UpdateGroupInput> getUpdateGroupCalls() {
-        return updateGroupCalls;
-    }
-}
diff --git a/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalMeterServiceMock.java b/opendaylight/md-sal/forwardingrules-manager/src/test/java/test/mock/util/SalMeterServiceMock.java
deleted file mode 100644 (file)
index fb053cb..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterOutput;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-
-public class SalMeterServiceMock implements SalMeterService {
-    private List<AddMeterInput> addMeterCalls = new ArrayList<>();
-    private List<RemoveMeterInput> removeMeterCalls = new ArrayList<>();
-    private List<UpdateMeterInput> updateMeterCalls = new ArrayList<>();
-
-    @Override
-    public Future<RpcResult<AddMeterOutput>> addMeter(AddMeterInput input) {
-        addMeterCalls.add(input);
-        return null;
-    }
-
-    @Override
-    public Future<RpcResult<RemoveMeterOutput>> removeMeter(RemoveMeterInput input) {
-        removeMeterCalls.add(input);
-        return null;
-    }
-
-    @Override
-    public Future<RpcResult<UpdateMeterOutput>> updateMeter(UpdateMeterInput input) {
-        updateMeterCalls.add(input);
-        return null;
-    }
-
-    public List<AddMeterInput> getAddMeterCalls() {
-        return addMeterCalls;
-    }
-
-    public List<RemoveMeterInput> getRemoveMeterCalls() {
-        return removeMeterCalls;
-    }
-
-    public List<UpdateMeterInput> getUpdateMeterCalls() {
-        return updateMeterCalls;
-    }
-}
diff --git a/opendaylight/md-sal/inventory-manager/pom.xml b/opendaylight/md-sal/inventory-manager/pom.xml
deleted file mode 100644 (file)
index 77e4203..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-  </parent>
-  <groupId>org.opendaylight.controller.md</groupId>
-  <artifactId>inventory-manager</artifactId>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-Activator>org.opendaylight.controller.md.inventory.manager.InventoryActivator</Bundle-Activator>
-            <Private-Package>org.opendaylight.controller.md.inventory.manager</Private-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:MD-SAL</url>
-  </scm>
-</project>
diff --git a/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.java b/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/FlowCapableInventoryProvider.java
deleted file mode 100644 (file)
index 618fcfc..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * 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.inventory.manager;
-
-import java.util.ArrayList;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingDeque;
-
-import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-class FlowCapableInventoryProvider implements AutoCloseable, Runnable, TransactionChainListener {
-    private static final Logger LOG = LoggerFactory.getLogger(FlowCapableInventoryProvider.class);
-    private static final int QUEUE_DEPTH = 500;
-    private static final int MAX_BATCH = 100;
-
-    private final BlockingQueue<InventoryOperation> queue = new LinkedBlockingDeque<>(QUEUE_DEPTH);
-    private final NotificationProviderService notificationService;
-
-    private final DataBroker dataBroker;
-    private BindingTransactionChain txChain;
-    private ListenerRegistration<?> listenerRegistration;
-    private Thread thread;
-
-    FlowCapableInventoryProvider(final DataBroker dataBroker, final NotificationProviderService notificationService) {
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        this.notificationService = Preconditions.checkNotNull(notificationService);
-    }
-
-    void start() {
-        final NodeChangeCommiter changeCommiter = new NodeChangeCommiter(FlowCapableInventoryProvider.this);
-        this.listenerRegistration = this.notificationService.registerNotificationListener(changeCommiter);
-
-        this.txChain = (dataBroker.createTransactionChain(this));
-        thread = new Thread(this);
-        thread.setDaemon(true);
-        thread.setName("FlowCapableInventoryProvider");
-        thread.start();
-
-        LOG.info("Flow Capable Inventory Provider started.");
-    }
-
-    void enqueue(final InventoryOperation op) {
-        try {
-            queue.put(op);
-        } catch (final InterruptedException e) {
-            LOG.warn("Failed to enqueue operation {}", op, e);
-        }
-    }
-
-    @Override
-    public void run() {
-        try {
-            for (; ; ) {
-                InventoryOperation op = queue.take();
-                int ops = 0;
-                final ArrayList<InventoryOperation> opsToApply = new ArrayList<>(MAX_BATCH);
-                do {
-                    opsToApply.add(op);
-                    ops++;
-                    if (ops < MAX_BATCH) {
-                        op = queue.poll();
-                    } else {
-                        op = null;
-                    }
-                } while (op != null);
-                submitOperations(opsToApply);
-            }
-        } catch (final InterruptedException e) {
-            LOG.info("Processing interrupted, terminating", e);
-        }
-
-        // Drain all events, making sure any blocked threads are unblocked
-        while (!queue.isEmpty()) {
-            queue.poll();
-        }
-    }
-
-    /**
-     * Starts new empty transaction, custimizes it with submitted operations
-     * and submit it to data broker.
-     *
-     * If transaction chain failed during customization of transaction
-     * it allocates new chain and empty transaction and  customizes it
-     * with submitted operations.
-     *
-     * This does not retry failed transaction. It only retries it when
-     * chain failed during customization of transaction chain.
-     *
-     * @param opsToApply
-     */
-    private void submitOperations(final ArrayList<InventoryOperation> opsToApply) {
-        final ReadWriteTransaction tx = createCustomizedTransaction(opsToApply);
-        LOG.debug("Processed {} operations, submitting transaction {}", opsToApply.size(), tx.getIdentifier());
-        try {
-            tx.submit();
-        } catch (final IllegalStateException e) {
-            /*
-             * Transaction chain failed during doing batch, so we need to null
-             * tx chain and continue processing queue.
-             *
-             * We fail current txChain which was allocated with createTransaction.
-             */
-            failCurrentChain(txChain);
-            /*
-             * We will retry transaction once in order to not loose any data.
-             *
-             */
-            final ReadWriteTransaction retryTx = createCustomizedTransaction(opsToApply);
-            retryTx.submit();
-        }
-    }
-
-    /**
-     * Creates new empty ReadWriteTransaction. If transaction chain
-     * was failed, it will allocate new transaction chain
-     * and assign it with this Operation Executor.
-     *
-     * This call is synchronized to prevent reace with {@link #failCurrentChain(TransactionChain)}.
-     *
-     * @return New Empty ReadWrite transaction, which continues this chain or starts new transaction
-     *          chain.
-     */
-    private synchronized ReadWriteTransaction newEmptyTransaction() {
-        try {
-            if(txChain == null) {
-                // Chain was broken so we need to replace it.
-                txChain = dataBroker.createTransactionChain(this);
-            }
-            return txChain.newReadWriteTransaction();
-        } catch (final IllegalStateException e) {
-            LOG.debug("Chain is broken, need to allocate new transaction chain.",e);
-            /*
-             *  Chain was broken by previous transaction,
-             *  but there was race between this.
-             *  Chain will be closed by #onTransactionChainFailed method.
-             */
-            txChain = dataBroker.createTransactionChain(this);
-            return txChain.newReadWriteTransaction();
-        }
-    }
-
-    /**
-     * Creates customized not-submitted transaction, which is ready to be submitted.
-     *
-     * @param opsToApply Operations which are used to customize transaction.
-     * @return Non-empty transaction.
-     */
-    private ReadWriteTransaction createCustomizedTransaction(final ArrayList<InventoryOperation> opsToApply) {
-        final ReadWriteTransaction tx = newEmptyTransaction();
-        for(final InventoryOperation op : opsToApply) {
-            op.applyOperation(tx);
-        }
-        return tx;
-    }
-
-    private synchronized void failCurrentChain(final TransactionChain<?, ?> chain) {
-        if(txChain == chain) {
-            txChain = null;
-        }
-    }
-
-    @Override
-    public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction,
-                                         final Throwable cause) {
-        LOG.error("Failed to export Flow Capable Inventory, Transaction {} failed.", transaction.getIdentifier(), cause);
-        chain.close();
-        if(txChain == chain) {
-            // Current chain is broken, so we will null it, in order to not use it.
-            failCurrentChain(chain);
-        }
-    }
-
-    @Override
-    public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
-        // NOOP
-    }
-
-    @Override
-    public void close() throws InterruptedException {
-        LOG.info("Flow Capable Inventory Provider stopped.");
-        if (this.listenerRegistration != null) {
-            try {
-                this.listenerRegistration.close();
-            } catch (final Exception e) {
-                LOG.error("Failed to stop inventory provider", e);
-            }
-            listenerRegistration = null;
-        }
-
-        if (thread != null) {
-            thread.interrupt();
-            thread.join();
-            thread = null;
-        }
-        if (txChain != null) {
-            try {
-                txChain.close();
-            } catch (final IllegalStateException e) {
-                // It is possible chain failed and was closed by #onTransactionChainFailed
-                LOG.debug("Chain was already closed.");
-            }
-            txChain = null;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryActivator.java b/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryActivator.java
deleted file mode 100644 (file)
index 991611a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * 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.inventory.manager;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class InventoryActivator extends AbstractBindingAwareProvider {
-    private static final Logger LOG = LoggerFactory.getLogger(InventoryActivator.class);
-    private FlowCapableInventoryProvider provider;
-
-    @Override
-    public void onSessionInitiated(final ProviderContext session) {
-        DataBroker dataBroker = session.getSALService(DataBroker.class);
-        NotificationProviderService salNotifiService =
-                session.getSALService(NotificationProviderService.class);
-
-        provider = new FlowCapableInventoryProvider(dataBroker, salNotifiService);
-        provider.start();
-    }
-
-    @Override
-    protected void stopImpl(final BundleContext context) {
-        if (provider != null) {
-            try {
-                provider.close();
-            } catch (InterruptedException e) {
-                LOG.warn("Interrupted while waiting for shutdown", e);
-            }
-            provider = null;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryMapping.java b/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryMapping.java
deleted file mode 100644 (file)
index 928ae76..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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.inventory.manager;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNodeConnector;
-
-public class InventoryMapping {
-
-    public static FlowCapableNodeConnector toInventoryAugment(final FlowNodeConnector updated) {
-        if ((updated instanceof FlowCapableNodeConnector)) {
-            return ((FlowCapableNodeConnector) updated);
-        }
-        final FlowCapableNodeConnectorBuilder builder = new FlowCapableNodeConnectorBuilder();
-        builder.setAdvertisedFeatures(updated.getAdvertisedFeatures());
-        builder.setConfiguration(updated.getConfiguration());
-        builder.setCurrentFeature(updated.getCurrentFeature());
-        builder.setCurrentSpeed(updated.getCurrentSpeed());
-        builder.setHardwareAddress(updated.getHardwareAddress());
-        builder.setMaximumSpeed(updated.getMaximumSpeed());
-        builder.setName(updated.getName());
-        builder.setPeerFeatures(updated.getPeerFeatures());
-        builder.setPortNumber(updated.getPortNumber());
-        builder.setState(updated.getState());
-        builder.setSupported(updated.getSupported());
-        return builder.build();
-    }
-
-    public static FlowCapableNode toInventoryAugment(final FlowNode source) {
-        if ((source instanceof FlowCapableNode)) {
-            return ((FlowCapableNode) source);
-        }
-        return (new FlowCapableNodeBuilder(source)).build();
-    }
-}
diff --git a/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryOperation.java b/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/InventoryOperation.java
deleted file mode 100644 (file)
index cfc9579..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * 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.inventory.manager;
-
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-
-interface InventoryOperation {
-
-    void applyOperation(ReadWriteTransaction tx);
-
-}
diff --git a/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/NodeChangeCommiter.java b/opendaylight/md-sal/inventory-manager/src/main/java/org/opendaylight/controller/md/inventory/manager/NodeChangeCommiter.java
deleted file mode 100644 (file)
index ec184ad..0000000
+++ /dev/null
@@ -1,160 +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
- */
-package org.opendaylight.controller.md.inventory.manager;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-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.TableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.OpendaylightInventoryListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class NodeChangeCommiter implements OpendaylightInventoryListener {
-    private static final Logger LOG = LoggerFactory.getLogger(NodeChangeCommiter.class);
-
-    private final FlowCapableInventoryProvider manager;
-
-    public NodeChangeCommiter(final FlowCapableInventoryProvider manager) {
-        this.manager = Preconditions.checkNotNull(manager);
-    }
-
-    @Override
-    public synchronized void onNodeConnectorRemoved(final NodeConnectorRemoved connector) {
-        LOG.debug("Node connector removed notification received.");
-        manager.enqueue(new InventoryOperation() {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                final NodeConnectorRef ref = connector.getNodeConnectorRef();
-                LOG.debug("removing node connector {} ", ref.getValue());
-                tx.delete(LogicalDatastoreType.OPERATIONAL, ref.getValue());
-            }
-        });
-    }
-
-    @Override
-    public synchronized void onNodeConnectorUpdated(final NodeConnectorUpdated connector) {
-        LOG.debug("Node connector updated notification received.");
-        manager.enqueue(new InventoryOperation() {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                final NodeConnectorRef ref = connector.getNodeConnectorRef();
-                final NodeConnectorBuilder data = new NodeConnectorBuilder(connector);
-                data.setKey(new NodeConnectorKey(connector.getId()));
-
-                final FlowCapableNodeConnectorUpdated flowConnector = connector
-                        .getAugmentation(FlowCapableNodeConnectorUpdated.class);
-                if (flowConnector != null) {
-                    final FlowCapableNodeConnector augment = InventoryMapping.toInventoryAugment(flowConnector);
-                    data.addAugmentation(FlowCapableNodeConnector.class, augment);
-                }
-                InstanceIdentifier<NodeConnector> value = (InstanceIdentifier<NodeConnector>) ref.getValue();
-                LOG.debug("updating node connector : {}.", value);
-                NodeConnector build = data.build();
-                tx.merge(LogicalDatastoreType.OPERATIONAL, value, build, true);
-            }
-        });
-    }
-
-    @Override
-    public synchronized void onNodeRemoved(final NodeRemoved node) {
-        LOG.debug("Node removed notification received.");
-        manager.enqueue(new InventoryOperation() {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                final NodeRef ref = node.getNodeRef();
-                LOG.debug("removing node : {}", ref.getValue());
-                tx.delete(LogicalDatastoreType.OPERATIONAL, ref.getValue());
-            }
-        });
-    }
-
-    @Override
-    public synchronized void onNodeUpdated(final NodeUpdated node) {
-        final FlowCapableNodeUpdated flowNode = node.getAugmentation(FlowCapableNodeUpdated.class);
-        if (flowNode == null) {
-            return;
-        }
-        LOG.debug("Node updated notification received.");
-        manager.enqueue(new InventoryOperation() {
-            @Override
-            public void applyOperation(ReadWriteTransaction tx) {
-                final NodeRef ref = node.getNodeRef();
-                @SuppressWarnings("unchecked")
-                InstanceIdentifierBuilder<Node> builder = ((InstanceIdentifier<Node>) ref.getValue()).builder();
-                InstanceIdentifierBuilder<FlowCapableNode> augmentation = builder.augmentation(FlowCapableNode.class);
-                final InstanceIdentifier<FlowCapableNode> path = augmentation.build();
-                CheckedFuture<Optional<FlowCapableNode>, ?> readFuture = tx.read(LogicalDatastoreType.OPERATIONAL, path);
-                Futures.addCallback(readFuture, new FutureCallback<Optional<FlowCapableNode>>() {
-                    @Override
-                    public void onSuccess(Optional<FlowCapableNode> optional) {
-                        enqueueWriteNodeDataTx(node, flowNode, path);
-                        if (!optional.isPresent()) {
-                            enqueuePutTable0Tx(ref);
-                        }
-                    }
-
-                    @Override
-                    public void onFailure(Throwable throwable) {
-                        LOG.debug(String.format("Can't retrieve node data for node %s. Writing node data with table0.", node));
-                        enqueueWriteNodeDataTx(node, flowNode, path);
-                        enqueuePutTable0Tx(ref);
-                    }
-                });
-            }
-        });
-    }
-
-    private void enqueueWriteNodeDataTx(final NodeUpdated node, final FlowCapableNodeUpdated flowNode, final InstanceIdentifier<FlowCapableNode> path) {
-        manager.enqueue(new InventoryOperation() {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                final FlowCapableNode augment = InventoryMapping.toInventoryAugment(flowNode);
-                LOG.debug("updating node :{} ", path);
-                tx.merge(LogicalDatastoreType.OPERATIONAL, path, augment, true);
-            }
-        });
-    }
-
-    private void enqueuePutTable0Tx(final NodeRef ref) {
-        manager.enqueue(new InventoryOperation() {
-            @Override
-            public void applyOperation(ReadWriteTransaction tx) {
-                final TableKey tKey = new TableKey((short) 0);
-                final InstanceIdentifier<Table> tableIdentifier =
-                        ((InstanceIdentifier<Node>) ref.getValue()).augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tKey));
-                TableBuilder tableBuilder = new TableBuilder();
-                Table table0 = tableBuilder.setId((short) 0).build();
-                LOG.debug("writing table :{} ", tableIdentifier);
-                tx.put(LogicalDatastoreType.OPERATIONAL, tableIdentifier, table0, true);
-            }
-        });
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/pom.xml b/opendaylight/md-sal/model/model-flow-base/pom.xml
deleted file mode 100644 (file)
index cad0e9e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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.model</groupId>
-    <artifactId>model-parent</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>model-flow-base</artifactId>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>model-inventory</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
-      <artifactId>opendaylight-l2-types</artifactId>
-    </dependency>
-  </dependencies>
-  <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/model/model-flow-base/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/flow/types/port/rev130925/PortNumberBuilder.java b/opendaylight/md-sal/model/model-flow-base/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/flow/types/port/rev130925/PortNumberBuilder.java
deleted file mode 100644 (file)
index ff78a74..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.CommonPort.PortNumber;
-
-
-public class PortNumberBuilder {
-
-    public static PortNumber getDefaultInstance(java.lang.String defaultValue) {
-        try {
-            long uint32 = Long.parseLong(defaultValue);
-            return new PortNumber(uint32);
-        } catch(NumberFormatException e){
-            return new PortNumber(defaultValue);
-        }
-    }
-
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-action-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-action-types.yang
deleted file mode 100644 (file)
index 041fc57..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-module opendaylight-action-types {
-    namespace "urn:opendaylight:action:types";
-    prefix action;
-
-    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    import opendaylight-l2-types {prefix l2t; revision-date "2013-08-27";}
-    import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
-    
-    revision "2013-11-12" {
-        description "Initial revision of action service";
-    }
-    
-    typedef vlan-cfi {
-        type int32;    
-    }
-
-    grouping address {
-        choice address {
-            case ipv4 {
-                leaf ipv4-address {
-                    type inet:ipv4-prefix;
-                }
-            }
-            case ipv6 {
-                leaf ipv6-address {
-                    type inet:ipv6-prefix;
-                }
-            }
-        }
-    }  
-    
-    container action-types {   
-       uses action-list;
-    }
-
-    grouping ordered {
-        leaf order {
-          type int32;
-        }
-    }
-    
-    grouping action-list {
-        list action {
-            key "order";
-            uses ordered;
-            uses action;
-        }
-    }
-    
-    grouping action {
-        choice action {
-            case output-action-case {
-                container output-action {
-                    leaf output-node-connector {
-                        type inet:uri;
-                    }
-                    
-                    leaf max-length {
-                        type uint16;
-                    }
-                }
-            }
-
-            case controller-action-case {
-                container controller-action {
-                 leaf max-length {
-                     type uint16;
-                 }
-             }
-            }
-             
-
-
-            case set-field-case {
-                container set-field {
-                     uses match:match;
-                 }
-             }
-             
-
-            case set-queue-action-case {
-                container set-queue-action {
-                 leaf queue {
-                     type string; 
-                 }
-                 leaf queue-id {
-                     type uint32; 
-                 }
-             }
-            }
-
-           case pop-mpls-action-case {
-                container pop-mpls-action {
-                 leaf ethernet-type {
-                     type uint16; // TODO: define ethertype type
-                 }
-             }
-            }
-
-            case set-mpls-ttl-action-case {
-                container set-mpls-ttl-action {
-                 leaf mpls-ttl {
-                     type uint8;
-                 }
-             }
-            }
-
-            case set-nw-ttl-action-case {
-                container set-nw-ttl-action {
-                 leaf nw-ttl {
-                     type uint8;
-                 }
-             }
-            }
-
-            case push-pbb-action-case {
-                container push-pbb-action {
-                 leaf ethernet-type {
-                     type uint16; // TODO: define ethertype type
-                 }
-             }
-            }
-
-            case pop-pbb-action-case {
-                container pop-pbb-action {
-                 
-             }
-            }
-             
-
-            case push-mpls-action-case {
-                container push-mpls-action {
-                 leaf ethernet-type {
-                     type uint16; // TODO: define ethertype type
-                 }
-             }
-            }
-             
-
-            case dec-mpls-ttl-case {
-                container dec-mpls-ttl {
-                }
-             }
-             
-
-            case dec-nw-ttl-case {
-                container dec-nw-ttl {
-                }
-             }
-             
-
-            case drop-action-case {
-                container drop-action {
-                }
-             }
-             
-
-            case flood-action-case {
-                container flood-action {
-                }
-             }
-             
-
-            case flood-all-action-case {
-                container flood-all-action {
-                }
-             }
-             
-
-            case hw-path-action-case {
-                container hw-path-action {
-                }
-             }
-             
-
-            case loopback-action-case {
-                container loopback-action {
-                }
-             }
-             
-
-            case pop-vlan-action-case {
-                container pop-vlan-action {
-                }
-             }
-             
-            
-            
-            case push-vlan-action-case {
-                container push-vlan-action {
-                 leaf ethernet-type {
-                     type uint16; // TODO: define ethertype type
-                 }
-                leaf tag {               // TPID - 16 bits
-                    type int32;
-                } 
-                leaf pcp {               // PCP - 3 bits
-                    type int32;
-                }
-                leaf cfi {               // CFI - 1 bit (drop eligible)
-                    type vlan-cfi;
-                }
-                leaf vlan-id {           // VID - 12 bits
-                    type l2t:vlan-id;
-                }
-//                leaf tci {               //TCI = [PCP + CFI + VID]
-//                }
-//                leaf header {            //header = [TPID + TCI] 
-//                }
-                }
-             }
-            
-            case copy-ttl-out-case {
-                container copy-ttl-out {
-                }
-             }
-             
-
-            case copy-ttl-in-case {
-                container copy-ttl-in {
-                }
-             }
-             
-
-            case set-dl-dst-action-case {
-                container set-dl-dst-action {
-                 leaf address {
-                     type yang:mac-address;
-                 }
-             }
-            }
-             
-
-            case set-dl-src-action-case {
-                container set-dl-src-action {
-                 leaf address {
-                     type yang:mac-address;
-                 }
-             }
-
-            }
-            case group-action-case {
-                container group-action {
-                 leaf group {
-                     type string;
-                 }
-                
-                leaf group-id {
-                    type uint32;
-                }
-             }
-            }
-            
-            case set-dl-type-action-case {
-                container set-dl-type-action {
-                 leaf dl-type {
-                     type l2t:ether-type;
-                 }
-             }
-            }
-             
-
-            case set-next-hop-action-case {
-                container set-next-hop-action {
-                 uses address;
-             }
-            }
-             
-
-            case set-nw-dst-action-case {
-                container set-nw-dst-action {
-                 uses address;            
-             }
-            }
-             
-
-            case set-nw-src-action-case {
-                container set-nw-src-action {
-                 uses address;            
-             }
-            }
-             
-
-            case set-nw-tos-action-case {
-                container set-nw-tos-action {
-                 leaf tos {
-                     type int32;
-                 }
-             }
-            }
-             
-
-            case set-tp-dst-action-case {
-                container set-tp-dst-action {
-                 leaf port {
-                     type inet:port-number;
-                 }                
-             }
-
-            }
-            case set-tp-src-action-case {
-                container set-tp-src-action {
-                 leaf port {
-                     type inet:port-number;
-                 }                
-             }
-
-            }
-            case set-vlan-cfi-action-case {
-                container set-vlan-cfi-action {
-                 leaf vlan-cfi {
-                     type vlan-cfi;
-                 }
-             }
-            }
-             
-
-            case set-vlan-id-action-case {
-                container set-vlan-id-action {
-                 leaf vlan-id {
-                     type l2t:vlan-id;
-                 } 
-             }
-            }
-             
-
-            case set-vlan-pcp-action-case {
-                container set-vlan-pcp-action {
-                 leaf vlan-pcp {
-                     type l2t:vlan-pcp;
-                 }            
-             }
-            }
-
-           case strip-vlan-action-case {
-                container strip-vlan-action {
-                }
-             }
-
-            case sw-path-action-case {            
-                container sw-path-action {
-                }  
-             }  
-         }
-     }
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-flow-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-flow-types.yang
deleted file mode 100644 (file)
index 5c97e14..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-module opendaylight-flow-types {
-    namespace "urn:opendaylight:flow:types";
-    prefix flow;
-
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}    
-    import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
-    import opendaylight-action-types {prefix action;}
-    import opendaylight-meter-types {prefix meter; revision-date "2013-09-18";}
-
-    revision "2013-10-26" {
-        description "Initial revision of flow service";
-    }
-    
-    typedef flow-ref {
-        type instance-identifier;
-    }
-    
-    typedef flow-cookie {
-        description "openflow specific type - flow cookie / flow cookie mask";
-        type uint64;
-    }
-    
-    typedef output-port-values {
-        type enumeration {
-            enum MAX {
-                value 1;
-            }
-            enum IN_PORT {
-                value 2;
-            }
-            enum TABLE {
-                value 3;
-            }
-            enum NORMAL {
-                value 4;
-            }
-            enum FLOOD {
-                value 5;
-            }
-            enum ALL {
-                value 6;
-            }
-            enum CONTROLLER {
-                value 7;
-            }
-            enum LOCAL {
-                value 8;
-            }
-            enum ANY {
-                value 9;
-            }
-            enum NONE {
-                value 10;
-            }
-
-        }
-    }
-    grouping instruction-list {
-        list instruction {
-            key "order";
-            uses action:ordered;
-            uses instruction;
-        }
-    }
-
-     grouping instruction {
-         choice instruction {
-            case go-to-table-case {
-                container go-to-table {
-                 leaf table_id {
-                     type uint8;
-                 }
-             }
-            }
-             
-            case write-metadata-case {
-                container write-metadata {
-                 leaf metadata {
-                     type uint64;
-                 }
-                 
-                 leaf metadata-mask {
-                     type uint64;
-                 }
-             }
-            }
-             
-            case write-actions-case {
-                container write-actions {
-                 uses action:action-list;
-             }
-            }
-             
-            case apply-actions-case {
-                container apply-actions {
-                 uses action:action-list;
-             }
-            }
-             
-            case clear-actions-case {
-                container clear-actions {
-                 uses action:action-list;
-             }
-            }
-             
-            case meter-case {
-                container meter {
-                     leaf meter-id {
-                        type meter:meter-id;
-                     } 
-                 }
-             }
-         }
-    }
-    
-    typedef flow-mod-flags {
-        type bits {
-            bit CHECK_OVERLAP;
-            bit RESET_COUNTS;
-            bit NO_PKT_COUNTS;
-            bit NO_BYT_COUNTS;
-            bit SEND_FLOW_REM;
-        }
-    }
-
-    typedef removed_reason_flags {
-        type bits {
-            bit IDLE_TIMEOUT;
-            bit HARD_TIMEOUT;
-            bit DELETE;
-            bit GROUP_DELETE;
-        }
-    }
-    
-    grouping generic_flow_attributes {
-        leaf priority {
-            type uint16;
-        }
-        
-        leaf idle-timeout {
-            type uint16;
-        }
-        
-        leaf hard-timeout {
-            type uint16;
-        }
-        
-        leaf cookie {
-            type flow-cookie;
-        }
-        
-        leaf table_id {
-            type uint8;
-        }
-    }
-    
-    grouping flow {
-        container match {
-            uses match:match;
-        }
-        
-        container instructions {
-            uses instruction-list;
-        }          
-         
-        uses generic_flow_attributes;
-        
-        leaf container-name {
-            type string; 
-        }
-        
-        leaf cookie_mask {
-            type flow-cookie;
-        }
-        
-        leaf buffer_id {
-            type uint32;
-        }
-        
-        leaf out_port {
-            type uint64;
-        }
-        
-        leaf out_group {
-            type uint32;
-        }
-        
-        leaf flags {
-            type flow-mod-flags;
-        }
-        
-        leaf flow-name {
-            type string;
-        }
-        
-        leaf installHw {
-            type boolean;
-        }
-
-        leaf barrier {
-            type boolean;
-        }
-
-        leaf strict {
-            type boolean;
-            default "false";
-        }
-
-    }
-
-    grouping flow-statistics {
-        leaf packet-count {
-            type yang:counter64;
-        }
-
-        leaf byte-count {
-            type yang:counter64;
-        }
-
-        container duration {
-            leaf second {
-                type yang:counter64;
-            }
-            leaf nanosecond {
-                type yang:counter64;
-            }
-        }
-    }
-
-    grouping flow-table-statistics {
-        leaf active {
-            type yang:counter64;
-        } 
-
-        leaf lookup {
-            type yang:counter64;
-        }
-
-        leaf matched {
-            type yang:counter64;   
-        }
-    }
-    
-    grouping flow-mod-removed {
-        uses generic_flow_attributes;
-        
-        leaf removed_reason {
-            type removed_reason_flags;
-        }
-
-        leaf duration_nsec {
-            type uint32;
-        }
-        
-        leaf duration_sec {
-            type uint32;
-        }
-
-        leaf packet_count {
-            type uint64;
-        }
-
-        leaf byte_count {
-            type uint64;
-        }
-               
-        container match {
-            uses match:match;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-group-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-group-types.yang
deleted file mode 100644 (file)
index ca64ae3..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-module opendaylight-group-types {
-    namespace "urn:opendaylight:group:types";
-    prefix group;
-
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}   
-    import opendaylight-action-types {prefix action;}
-
-    revision "2013-10-18" {
-        description "Initial revision of group service";
-    }
-
-    typedef group-id {
-        type uint32;
-    }
-    
-    typedef bucket-id {
-       type uint32;
-    }
-    
-    typedef group-types {        
-        type enumeration {
-            enum group-all;
-            enum group-select;
-            enum group-indirect;
-            enum group-ff;
-        }        
-    }
-    
-    typedef group-capabilities { 
-        type enumeration {
-            enum select-weight;
-            enum select-liveness;
-            enum chaining;
-            enum chaining-checks;
-        }   
-    }
-    
-    identity group-type {
-       description "Base identity for all the available group types"; 
-    }
-    
-    identity group-all {
-       base group-type;
-       description "All (multicast/broadcast) group";
-    }
-    
-    identity group-select {
-       base group-type;
-       description "Select group";
-    }
-    
-    identity group-indirect {
-       base group-type;
-       description "Indirect group";
-    }
-    
-    identity group-ff {
-       base group-type;
-       description "Fast failover group";
-    }
-    
-    identity group-capability {
-       description "Base identity for all the supported group capabilities";
-    }
-    
-    identity select-weight{
-       base group-capability;
-       description "Support weight for select groups";
-    }
-
-    identity select-liveness{
-       base group-capability;
-       description "Support liveness for select groups";
-    }
-
-    identity chaining{
-       base group-capability;
-       description "Support chaining groups";
-    }
-
-    identity chaining-checks{
-       base group-capability;
-       description "Check chaining for loops and delete";
-    }
-    
-    typedef group-ref {
-        type instance-identifier;
-    }
-    
-    grouping group {
-        
-        leaf group-type {
-            type group-types;
-        }
-        
-        leaf group-id {
-            type group-id;
-        }
-        
-        leaf group-name {
-            type string;
-        }
-        
-        leaf container-name {
-            type string; 
-        }
-        
-        leaf barrier {
-            type boolean; 
-        }       
-        
-        container buckets {
-            list bucket {
-                key "bucket-id";
-                leaf bucket-id {
-                    type bucket-id;
-                }
-                
-                leaf weight {
-                    type uint16;
-                }
-                
-                leaf watch_port {
-                    type uint32;
-                }
-                
-                leaf watch_group {
-                    type uint32;
-                }
-                
-                uses action:action-list;
-            }
-        }
-    }
-    
-    grouping group-statistics {
-            
-        leaf group-id {
-            type group-id;
-        }
-        
-        leaf ref-count {
-            type yang:counter32;
-        }
-        
-        leaf packet-count {
-            type yang:counter64;
-        } 
-        
-        leaf byte-count {
-            type yang:counter64;
-        }
-
-        container duration {
-            leaf second {
-                type yang:counter32;
-            }
-            leaf nanosecond {
-                type yang:counter32;
-            }
-        }
-        
-        container buckets {
-            list bucket-counter {
-                key "bucket-id";
-                leaf bucket-id {
-                    type bucket-id;
-                }
-                
-                leaf packet-count {
-                    type yang:counter64;
-                } 
-        
-                leaf byte-count {
-                    type yang:counter64;
-                }
-            }
-        }       
-    }
-
-    grouping group-features {
-    
-       leaf-list group-types-supported {
-               type identityref {
-                       base group-type;
-               }
-               }
-            
-       leaf-list group-capabilities-supported {
-               type identityref {
-                       base group-capability;
-               }
-               }
-
-        leaf-list max-groups {
-            type uint32;
-            description "Maximum number of groups for each type";
-            max-elements 4;
-        }
-            
-        leaf-list actions {
-            type uint32;
-            description "Bitmap number OFPAT_* that are supported";
-            max-elements 4;
-        }
-    }
-    
-    grouping group-statistics-request {
-        list group-stats {
-            key "group-id";         
-            leaf group-id {
-                type group-id;
-            }           
-        }
-    }
-    
-    
-    grouping group-statistics-reply {
-       
-        list group-stats {
-            key "group-id";
-            uses group-statistics;
-        }
-    }
-    
-    grouping group-desc-stats-reply {
-       
-        list group-desc-stats {
-            key "group-id";         
-            uses group;
-        }
-    }
-    
-    grouping group-features-reply {
-       uses group-features;
-    }
-    
-    grouping groups {
-        list group {
-            key "group-id";                  
-        
-            uses group;
-        }
-    }
-    
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-match-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-match-types.yang
deleted file mode 100644 (file)
index deff6f1..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-module opendaylight-match-types {
-    namespace "urn:opendaylight:model:match:types";
-    prefix "match";
-
-    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    import opendaylight-l2-types {prefix l2t;revision-date "2013-08-27";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-
-    revision "2013-10-26" {
-        description "Initial revision of match types";
-    }
-
-    grouping "mac-address-filter" {
-        leaf address {
-            mandatory true;
-            type yang:mac-address;
-        }
-        leaf mask {
-            type yang:mac-address;
-        }
-    }
-
-    grouping "of-metadata" {
-        leaf metadata {
-            type uint64;
-        }
-
-        leaf metadata-mask {
-            type uint64;
-        }
-    }
-
-     /** Match Groupings **/
-    grouping "ethernet-match-fields" {
-        container ethernet-source {
-            description "Ethernet source address.";
-            presence "Match field is active and set";
-            uses mac-address-filter;
-        }
-        container ethernet-destination {
-            description "Ethernet destination address.";
-            presence "Match field is active and set";
-            uses mac-address-filter;
-        }
-        container ethernet-type {
-            description "Ethernet frame type.";
-            presence "Match field is active and set";
-
-            leaf type {
-                mandatory true;
-                type l2t:ether-type; // Needs to define that as general model
-            }
-        }
-    }
-
-    grouping "vlan-match-fields" {
-        container vlan-id {
-            description "VLAN id.";
-            presence "Match field is active and set";
-
-            leaf vlan-id-present {
-                type boolean;
-            }
-
-            leaf vlan-id {
-                type l2t:vlan-id;
-            }
-        }
-        leaf vlan-pcp {
-            description "VLAN priority.";
-            type l2t:vlan-pcp;
-        }
-    }
-
-    grouping "ip-match-fields" {
-        leaf ip-protocol {
-                description "IP protocol.";
-                type uint8;
-        }
-
-        leaf ip-dscp {
-            description "IP DSCP (6 bits in ToS field).";
-            type inet:dscp;
-        }
-
-        leaf ip-ecn {
-            description "IP ECN (2 bits in ToS field).";
-            type uint8;
-        }
-
-        leaf ip-proto {
-           description "IP Proto (IPv4 or IPv6 Protocol Number).";
-              type inet:ip-version;
-               }
-    }
-
-    grouping "ipv4-match-fields" {
-        leaf ipv4-source {
-            description "IPv4 source address.";
-            type inet:ipv4-prefix;
-        }
-
-        leaf ipv4-destination {
-            description "IPv4 destination address.";
-            type inet:ipv4-prefix;
-        }
-
-    }
-
-    grouping "ipv6-match-fields" {
-        leaf ipv6-source {
-            description "IPv6 source address.";
-            type inet:ipv6-prefix;
-        }
-
-        leaf ipv6-destination {
-            description "IPv6 destination address.";
-            type inet:ipv6-prefix;
-        }
-
-        leaf ipv6-nd-target {
-            description "IPv6 target address for neighbour discovery message";
-            type inet:ipv6-address;
-        }
-
-        container "ipv6-label" {
-            leaf ipv6-flabel {
-                type inet:ipv6-flow-label;
-            }
-
-            leaf flabel-mask {
-                type inet:ipv6-flow-label;
-            }
-        }
-
-        leaf ipv6-nd-sll {
-            description "Link layer source address for neighbour discovery message";
-            type yang:mac-address;
-        }
-
-        leaf ipv6-nd-tll {
-            description "Link layer target address for neighbour discovery message";
-            type yang:mac-address;
-        }
-
-        container "ipv6-ext-header" {
-            leaf ipv6-exthdr {
-                description "IPv6 Extension Header field";
-                type uint16;
-            }
-
-            leaf ipv6-exthdr-mask {
-                type uint16 {
-                  range "0..512";
-                }
-            }
-        }
-    }
-
-    grouping "udp-match-fields" {
-        leaf udp-source-port {
-            description "UDP source port.";
-            type inet:port-number;
-        }
-        leaf udp-destination-port {
-            description "UDP destination port.";
-                type inet:port-number;
-        }
-    }
-
-    grouping "protocol-match-fields" {
-        leaf mpls-label {
-            description "Label in the first MPLS shim header";
-            type uint32;
-        }
-
-        leaf mpls-tc {
-            description "TC in the first MPLS shim header";
-            type uint8;
-        }
-
-        leaf mpls-bos {
-            description "BoS bit in the first MPLS shim header";
-            type uint8;
-        }
-
-        container "pbb" {
-            leaf pbb-isid {
-                description "I-SID in the first PBB service instance tag";
-                type uint32;
-            }
-
-            leaf pbb-mask {
-                type uint32 {
-                  range "0..16777216";
-                }
-            }
-        }
-    }
-
-    grouping "tcp-match-fields" {
-        leaf tcp-source-port {
-            description "TCP source port.";
-            type inet:port-number;
-        }
-        leaf tcp-destination-port {
-            description "TCP destination port.";
-            type inet:port-number;
-        }
-    }
-
-    grouping "sctp-match-fields" {
-        leaf sctp-source-port {
-            description "SCTP source port.";
-            type inet:port-number;
-        }
-        leaf sctp-destination-port {
-            description "SCTP destination port.";
-            type inet:port-number;
-        }
-    }
-
-    grouping "icmpv4-match-fields" {
-        leaf icmpv4-type {
-        description "ICMP type.";
-            type uint8; // Define ICMP Type
-        }
-        description "ICMP code.";
-        leaf icmpv4-code {
-            type uint8; // Define ICMP Code
-        }
-    }
-
-    grouping "icmpv6-match-fields" {
-        leaf icmpv6-type {
-        description "ICMP type.";
-            type uint8; // Define ICMP Type
-        }
-        description "ICMP code.";
-        leaf icmpv6-code {
-            type uint8; // Define ICMP Code
-        }
-    }
-
-    grouping "arp-match-fields" {
-        leaf arp-op {
-            type uint16;
-        }
-
-        leaf arp-source-transport-address {
-            description "ARP source IPv4 address.";
-            type inet:ipv4-prefix;
-        }
-
-        leaf arp-target-transport-address {
-            description "ARP target IPv4 address.";
-            type inet:ipv4-prefix;
-        }
-        container arp-source-hardware-address {
-            description "ARP source hardware address.";
-            presence "Match field is active and set";
-            uses mac-address-filter;
-        }
-        container arp-target-hardware-address {
-            description "ARP target hardware address.";
-            presence "Match field is active and set";
-            uses mac-address-filter;
-        }
-    }
-
-    grouping "tcp-flag-match-fields" {
-        leaf tcp-flag {
-            type uint16;
-        }
-    }
-
-    grouping "tunnel-ipv4-match-fields" {
-        leaf tunnel-ipv4-source {
-            description "IPv4 source tunnel endpoint address.";
-            type inet:ipv4-prefix;
-        }
-        leaf tunnel-ipv4-destination {
-            description "IPv4 destination tunnel endpoint address.";
-            type inet:ipv4-prefix;
-        }
-    }
-
-    grouping match {
-        leaf in-port {
-            type inv:node-connector-id;
-        }
-
-        leaf in-phy-port {
-            type inv:node-connector-id;
-        }
-
-        container "metadata" {
-            uses of-metadata;
-        }
-
-        container "tunnel" {
-            leaf tunnel-id {
-                description "Metadata associated in the logical port";
-                type uint64;
-            }
-
-            leaf tunnel-mask {
-                type uint64;
-            }
-        }
-
-        container "ethernet-match" {
-            uses "ethernet-match-fields";
-        }
-
-        container "vlan-match" {
-            uses "vlan-match-fields";
-        }
-
-        container "ip-match" {
-            uses "ip-match-fields";
-        }
-
-        choice layer-3-match {
-            case "ipv4-match" {
-                uses "ipv4-match-fields";
-            }
-            case "ipv6-match" {
-                uses "ipv6-match-fields";
-            }
-            case "arp-match" {
-                uses "arp-match-fields";
-            }
-            case "tunnel-ipv4-match" {
-                uses "tunnel-ipv4-match-fields";
-            }
-        }
-
-        choice layer-4-match {
-            case "udp-match" {
-                uses "udp-match-fields";
-            }
-            case "tcp-match" {
-                uses "tcp-match-fields";
-            }
-            case "sctp-match" {
-                uses "sctp-match-fields";
-            }
-        }
-
-        container "icmpv4-match" {
-            uses "icmpv4-match-fields";
-        }
-
-        container "icmpv6-match" {
-            uses "icmpv6-match-fields";
-        }
-
-        container "protocol-match-fields" {
-            uses "protocol-match-fields";
-        }
-
-        container tcp-flag-match {
-            uses "tcp-flag-match-fields";
-        }
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang
deleted file mode 100644 (file)
index 95f2b7c..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-module opendaylight-meter-types {
-    namespace "urn:opendaylight:meter:types";
-    prefix meter;
-
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-
-
-    revision "2013-09-18" {
-        description "Initial revision of meter service";
-    }
-
-    typedef meter-id {
-        type uint32;
-    }
-    typedef band-id {
-       type uint32;
-    }
-    
-    typedef meter-flags {        
-        type bits {
-            bit meter-kbps;
-            bit meter-pktps;
-            bit meter-burst;
-            bit meter-stats;
-        }        
-    }
-    
-    identity meter-capability {
-       description "Base identity for all the supported meter capabilities/flags";
-    }
-    identity meter-kbps {
-       base meter-capability;
-       description "Rate value in kb/s (kilo-bit per second)";
-    } 
-    identity meter-pktps {
-       base meter-capability;
-       description "Rate value in packet/sec.";
-    } 
-    identity meter-burst {
-       base meter-capability;
-       description "Do burst size.";
-    } 
-    identity meter-stats {
-       base meter-capability;
-       description "Collect statistics.";
-    } 
-    
-    typedef meter-band-type {
-        type bits {
-            bit ofpmbt-drop;
-            bit ofpmbt-dscp-remark;
-            bit ofpmbt-experimenter;               
-        }
-    }
-    
-    identity meter-band {
-       description "Base identity for all the band type available";
-    }
-    identity meter-band-drop {
-       base meter-band;
-       description "Drop packet";
-    }
-    identity meter-band-dscp-remark {
-       base meter-band;
-       description "Remark DSCP in the IP header";
-    }
-    identity meter-band-experimenter {
-       base meter-band;
-       description "Experimenter meter band";
-    }
-
-    grouping band-type {
-        choice band-type {
-            case drop {
-                leaf drop-rate {
-                    description "Rate for dropping packets";
-                    type uint32;
-                }
-                
-                leaf drop-burst-size {
-                    description "Size of bursts";
-                    type uint32;
-                }
-            }
-
-            case dscp-remark {
-                leaf dscp-remark-rate {
-                    description "Rate for remarking packets";
-                    type uint32;
-                }
-                
-                leaf dscp-remark-burst-size {
-                    description "Size of bursts";
-                    type uint32;
-                }
-                
-                leaf prec_level {
-                    description "Number of drop precedence level to add";
-                    type uint8;
-                }
-            }
-            
-            case experimenter {
-                leaf experimenter-rate {
-                    description "Rate for remarking packets";
-                    type uint32;
-                }
-                
-                leaf experimenter-burst-size {
-                    description "Size of bursts";
-                    type uint32;
-                }
-                
-                leaf experimenter {
-                    description "Experimenter id";
-                    type uint32;
-                }
-            }
-        }
-    }
-    
-    typedef meter-ref {
-        type instance-identifier;
-    }
-    
-    grouping meter {
-        
-        leaf flags {
-           description "Meter configuration flags";
-           type meter-flags;        
-        }
-        
-        leaf meter-id {
-            description "Meter instance";
-            type meter-id;
-        }       
-        
-        leaf barrier {
-            description "If true, barrier message is sent";
-            type boolean; 
-        }
-        
-        leaf meter-name {
-            description "Name of meter instance";
-            type string;
-        }
-        
-        leaf container-name {
-            description "Name of container";
-            type string; 
-        }
-        
-        container meter-band-headers {
-            list meter-band-header {
-                key "band-id";
-                leaf band-id {
-                    description "Meter band id";
-                    type band-id;
-                }
-                
-                container meter-band-types {
-                    leaf flags {
-                        description "Meter band flags";
-                        type meter-band-type;
-                    }
-                }
-            
-                leaf band-rate {
-                    description "Rate for this band";
-                    type uint32;
-                }
-        
-                leaf band-burst-size {
-                    description "Size of bursts";
-                    type uint32;
-                }
-                uses band-type;
-            }
-        }
-    }
-    
-    grouping meter-statistics {
-            
-        leaf meter-id {
-            type meter-id;
-        }
-        
-        leaf flow-count {
-            type yang:counter32;
-        }
-        
-        leaf packet-in-count {
-            type yang:counter64;
-        } 
-        
-        leaf byte-in-count {
-            type yang:counter64;
-        }
-
-        container duration {
-            leaf second {
-                type yang:counter32;
-            }
-            leaf nanosecond {
-                type yang:counter32;
-            }
-        }
-        
-        container meter-band-stats {
-            list band-stat {
-                key "band-id";
-                leaf band-id {
-                    type band-id;
-                }
-            
-                leaf packet-band-count {
-                    type yang:counter64;
-                } 
-        
-                leaf byte-band-count {
-                    type yang:counter64;
-                }
-            }       
-        }
-    }
-
-    grouping meter-features {
-                           
-        leaf max_meter {
-            type yang:counter32;
-        }
-           
-       leaf-list meter-band-supported {
-               type identityref {
-                       base meter-band;
-               }
-               }
-        
-       leaf-list meter-capabilities-supported {
-               type identityref {
-                       base meter-capability;
-               }
-               }
-        
-        leaf max_bands {
-            type uint8;
-        }
-        
-        leaf max_color {
-            type uint8;
-        }
-    }
-
-    grouping meter-stats-config-request {
-        list meter-stats {
-            key "meter-id";         
-            leaf meter-id {
-                type meter-id;
-            }           
-        }
-    }
-    
-    grouping meter-statistics-reply {
-        list meter-stats {
-            key "meter-id";
-            uses meter-statistics;
-        }
-    }
-    
-    grouping meter-config-stats-reply {
-        list meter-config-stats {
-            key "meter-id";
-            uses meter;
-        } 
-    }
-    
-    grouping meter-features-reply {
-       uses meter-features;
-    }
-    
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang
deleted file mode 100644 (file)
index 9e88098..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-module opendaylight-port-types {
-    namespace "urn:opendaylight:flow:types:port";
-    prefix port-types;
-
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    import opendaylight-queue-types {prefix queue-types; revision-date "2013-09-25";}
-    
-    revision "2013-09-25" {
-        description "Initial revision of Port Inventory model";
-    }
-    
-    typedef port-reason {
-        type enumeration {
-            enum add;
-            enum delete;
-            enum update;
-        }
-    }
-    
-    typedef port-config {
-        type bits {
-            bit PORT-DOWN;
-            bit NO-RECV;
-            bit NO-FWD;
-            bit NO-PACKET-IN;
-        }
-    }
-    
-    grouping port-state {
-        leaf link-down {
-            type boolean;
-        }
-        leaf blocked {
-            type boolean;
-        }   
-        leaf live {
-            type boolean;
-        }
-    }
-    
-    typedef port-features {
-        type bits {
-            bit ten-mb-hd;
-            bit ten-mb-fd;
-            bit hundred-mb-hd;
-            bit hundred-mb-fd;
-            bit one-gb-hd;
-            bit one-gb-fd;
-            bit ten-gb-fd;
-            bit forty-gb-fd;
-            bit hundred-gb-fd;
-            bit one-tb-fd;
-            bit other;
-            bit copper;
-            bit fiber;
-            bit autoeng;
-            bit pause;
-            bit pause-asym;
-        }
-    }
-    
-    grouping common-port {
-
-        leaf port-number {
-            type union {
-                type uint32;
-                type string;
-            }
-        }
-        
-        leaf hardware-address {
-            type yang:mac-address;
-            description "MAC Address of the port";
-            
-        }
-        
-        leaf configuration {
-            type port-config;
-            description "Bit map of OFPPC-* flags";          
-        }
-        
-        leaf advertised-features {
-            type port-features;
-            description "Features being advertised by the port";            
-        }
-    }
-    
-    grouping flow-port-status {
-        leaf reason {
-            type port-reason;
-        }
-        
-        uses flow-capable-port;
-    }
-    
-    grouping queues {
-       list queue {
-               key "queue-id";
-               uses queue-types:queue-packet;
-       }
-    }
-    
-    grouping flow-capable-port {    
-                
-        uses common-port;
-        
-        leaf name {
-            type string;
-            description "Human readable name of the port";                    
-        }
-        
-        container state {
-            uses port-state;
-            description "Description of state of port";            
-        }
-        
-        leaf current-feature {
-            type port-features;
-            description "Bit map of OFPPF-* flags";            
-        }       
-        
-        leaf supported {
-            type port-features;
-            description "Features supported by the port";           
-        }
-        
-        leaf peer-features {
-            type port-features;
-            description "Features advertised by peer";            
-        }
-        
-        leaf current-speed {
-            type uint32;
-            units "kbps";
-            description "Current port bit rate in kbps";            
-        }
-        
-        leaf maximum-speed {
-            type uint32;
-            units "kbps";
-            description "Max port bit rate in kbps";            
-        }
-        
-        uses queues;
-    }    
-    
-    grouping port-mod {
-        container port {
-            list port {
-                key "port-mod-order";
-                leaf port-mod-order {
-                    type uint32;
-                }    
-                
-                uses common-port;
-                
-                leaf mask {
-                    type port-config;
-                    description "Bitmap of OFPPC-* flags to be changed";
-                }      
-                
-                leaf container-name {
-                    type string; 
-                }
-            
-                leaf port-name {
-                    type string; 
-                } 
-
-                leaf barrier {
-                    type boolean; 
-                } 
-            }            
-        }    
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-queue-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-queue-types.yang
deleted file mode 100644 (file)
index cdcf0ec..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-module opendaylight-queue-types {
-    namespace "urn:opendaylight:flow:types:queue";
-    prefix queue-types;
-
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    
-    revision "2013-09-25" {
-        description "Initial revision of Queue Inventory model";
-    }
-    
-    typedef queue-id {
-            type yang:counter32;
-            description "id for the specific queue.";  
-        }
-    
-    typedef queue-properties {
-        type enumeration {
-            enum min_rate;
-            enum max_rate;
-        }
-    }
-   
-    
-    grouping common-queue {
-
-        leaf property {
-            type uint16;
-            description "One of OFPQT_.";  
-        }
-           
-    }
-    
-     
-    grouping queue-prop-min-rate       {
-               
-               uses common-queue;
-               
-        leaf rate {
-            type uint16;
-            description "OFPQT_MIN, len: 16";  
-        }
-           
-    }
-      
-    grouping queue-prop-max-rate       {
-               
-               uses common-queue;
-               
-        leaf rate {
-            type uint16;
-            description "OFPQT_MAX, len: 16";  
-        }
-           
-    }
-     grouping queue-packet     {
-               
-               
-        leaf queue-id {
-            type queue-id;
-            description "id for the specific queue.";  
-        }
-        
-        leaf port {
-            type uint32;
-            description "Port this queue is attached to.";  
-        }
-        uses common-queue;
-    }
-    
-   grouping queue-config-request 
-   {
-           leaf port {
-            type uint32;
-            description "Port to be queried.";  
-        }
-        
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-table-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-table-types.yang
deleted file mode 100644 (file)
index 91224ef..0000000
+++ /dev/null
@@ -1,352 +0,0 @@
-module opendaylight-table-types {
-    namespace "urn:opendaylight:table:types";
-    prefix table;
-
-    import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";}
-    import opendaylight-action-types {prefix action;}
-
-    revision "2013-10-26" {
-        description "Initial revision of table service";
-    }
-
-    typedef table-id {
-       type uint8;
-    }
-
-    typedef table-ref {
-        type instance-identifier;
-    }
-    
-    typedef table-config {
-        type bits {
-            bit DEPRECATED-MASK;
-        }
-    }
-
-    // field types
-    identity match-field {
-        description "Base identity for match Fields";
-    }
-
-    identity in_port {
-        base match-field;
-        description "Match for Switch input port.";
-    }
-    identity in_phy_port {
-        base match-field;
-        description "Match for Switch physical input port.";
-    }
-    identity metadata {
-        base match-field;
-        description "Match for Metadata passed between tables.";
-    }
-    identity eth_dst {
-        base match-field;
-        description "Match for Ethernet destination address.";
-    }
-    identity eth_src {
-        base match-field;
-        description "Match for Ethernet source address.";
-    }
-    identity eth_type {
-        base match-field;
-        description "Match for Ethernet frame type.";
-    }
-    identity vlan_vid {
-        base match-field;
-        description "Match for VLAN id.";
-    }
-    identity vlan_pcp {
-        base match-field;
-        description "Match for VLAN priority.";
-    }
-    identity ip_dscp {
-        base match-field;
-        description "Match for IP DSCP (6 bits in ToS field).";
-    }
-    identity ip_ecn {
-        base match-field;
-        description "Match for IP ECN (2 bits in ToS field).";
-    }
-    identity ip_proto {
-        base match-field;
-        description "Match for IP protocol.";
-    }
-    identity ipv4_src {
-        base match-field;
-        description "Match for IPv4 source address.";
-    }
-    identity ipv4_dst {
-        base match-field;
-        description "Match for IPv4 destination address.";
-    }
-    identity tcp_src {
-        base match-field;
-        description "Match for TCP source port.";
-    }
-    identity tcp_dst {
-        base match-field;
-        description "Match for TCP destination port.";
-    }
-    identity udp_src {
-        base match-field;
-        description "Match for UDP source port.";
-    }
-    identity udp_dst {
-        base match-field;
-        description "Match for UDP destination port.";
-    }
-    identity sctp_src {
-        base match-field;
-        description "Match for SCTP source port.";
-    }
-    identity sctp_dst {
-        base match-field;
-        description "Match for SCTP destination port.";
-    }
-    identity icmpv4_type {
-        base match-field;
-        description "Match for ICMP type.";
-    }
-    identity icmpv4_code {
-        base match-field;
-        description "Match for ICMP code.";
-    }
-    identity arp_op {
-        base match-field;
-        description "Match for ARP opcode.";
-    }
-    identity arp_spa {
-        base match-field;
-        description "Match for ARP source IPv4 address.";
-    }
-    identity arp_tpa {
-        base match-field;
-        description "Match for ARP target IPv4 address.";
-    }
-    identity arp_sha {
-        base match-field;
-        description "Match for ARP source hardware address.";
-    }
-    identity arp_tha {
-        base match-field;
-        description "Match for ARP target hardware address.";
-    }
-    identity ipv6_src {
-        base match-field;
-        description "Match for IPv6 source address.";
-    }
-    identity ipv6_dst {
-        base match-field;
-        description "Match for IPv6 destination address.";
-    }
-    identity ipv6_flabel {
-        base match-field;
-        description "Match for IPv6 Flow Label";
-    }
-    identity icmpv6_type {
-        base match-field;
-        description "Match for ICMPv6 type.";
-    }
-    identity icmpv6_code {
-        base match-field;
-        description "Match for ICMPv6 code.";
-    }
-    identity ipv6_nd_target {
-        base match-field;
-        description "Match for Target address for ND.";
-    }
-    identity ipv6_nd_sll {
-        base match-field;
-        description "Match for Source link-layer for ND.";
-    }
-    identity ipv6_nd_tll {
-        base match-field;
-        description "Match for Target link-layer for ND.";
-    }
-    identity mpls_label {
-        base match-field;
-        description "Match for MPLS label.";
-    }
-    identity mpls_tc {
-        base match-field;
-        description "Match for MPLS TC.";
-    }
-    identity mpls_bos {
-        base match-field;
-        description "Match for MPLS BoS bit.";
-    }
-    identity pbb_isid {
-        base match-field;
-        description "Match for PBB I-SID.";
-    }
-    identity tunnel_id {
-        base match-field;
-        description "Match for Logical Port Metadata";
-    }
-    identity ipv6_exthdr {
-        base match-field;
-        description "Match for IPv6 Extension Header pseudo-field";
-    }
-    identity tcp_flag {
-        base match-field;
-        description "TCP Flag Match";
-    }
-    identity tunnel_ipv4_dst {
-        base match-field;
-        description "IPv4 destination tunnel endpoint address.";
-    }
-    identity tunnel_ipv4_src {
-        base match-field;
-        description "IPv4 source tunnel endpoint address.";
-    }
-        
-    grouping set-field-match {
-        list set-field-match {
-           key "match-type";
-            leaf match-type {
-                type identityref {
-                    base match-field;
-                }
-            }
-            leaf has-mask {
-                type boolean;
-            } 
-        }
-    }
-      
-    grouping table-feature-prop-type {
-        choice table-feature-prop-type {
-            case instructions { 
-                container instructions {
-                    uses flow:instruction-list;
-                } 
-            }
-            
-            case instructions-miss {   
-                container instructions-miss {
-                    uses flow:instruction-list;
-                } 
-            }
-
-            case next-table {   
-                container tables {
-                    leaf-list table-ids {
-                        type uint8;
-                    }
-                } 
-            }
-            
-            case next-table-miss {   
-                container tables-miss {
-                    leaf-list table-ids {
-                        type uint8;
-                    }
-                } 
-            }
-            
-            case write-actions {   
-                container write-actions {
-                    uses action:action-list;
-                } 
-            }
-            
-            case write-actions-miss {   
-                container write-actions-miss {
-                    uses action:action-list;
-                } 
-            }
-            
-            case apply-actions {   
-                container apply-actions {
-                    uses action:action-list;
-                } 
-            }
-            
-            case apply-actions-miss {   
-                container apply-actions-miss {
-                    uses action:action-list;
-                } 
-            }
-            
-            case match {
-                       container match-setfield {
-                           uses set-field-match; 
-                       }
-            }
-            
-            case wildcards {   
-                       container wildcard-setfield {
-                    uses set-field-match;
-                }
-            }
-            
-            case write-setfield {   
-                       container write-setfield {
-                    uses set-field-match;
-                }
-            }
-            
-            case write-setfield-miss {   
-                container write-setfield-miss {
-                    uses set-field-match;
-                }
-            }
-            
-            case apply-setfield {   
-                container apply-setfield {
-                    uses set-field-match; 
-                }
-            }
-            
-            case apply-setfield-miss {   
-                container apply-setfield-miss {
-                    uses set-field-match; 
-                }
-            }
-        }
-    } 
-    
-    grouping table-features {
-        list table-features {
-            key "table-id";
-            
-            leaf table-id {
-                type uint8;
-            }      
-            
-            leaf name {
-                description "Name of the table";
-                type string;               
-            }
-            
-            leaf metadata-match {
-                description "Bits of metadata table can match";
-                type uint64;                
-            }
-            
-            leaf metadata-write {
-                description "Bits of metadata table can write";
-                type uint64;                
-            }
-            
-            leaf max-entries {
-                description "Max number of entries supported";
-                type uint32;                
-            }
-            
-            leaf config {
-                description "Bitmap of OFPTC_ values";
-                type table-config;
-            }
-            
-            container table-properties {
-                list table-feature-properties {
-                     key "order";
-                     uses action:ordered;
-                     uses table-feature-prop-type;
-                }
-            }
-        }
-    }    
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/pom.xml b/opendaylight/md-sal/model/model-flow-service/pom.xml
deleted file mode 100644 (file)
index 0f735d7..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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.model</groupId>
-    <artifactId>model-parent</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>model-flow-service</artifactId>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>model-flow-base</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>model-inventory</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
-      <artifactId>opendaylight-l2-types</artifactId>
-    </dependency>
-  </dependencies>
-  <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/model/model-flow-service/src/main/yang/flow-capable-transaction.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-capable-transaction.yang
deleted file mode 100644 (file)
index 160291c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-module flow-capable-transaction {
-    namespace "urn:opendaylight:flow:transaction";
-    prefix type;
-
-    import opendaylight-inventory {prefix inv; revision-date "2013-08-19";}
-    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-
-    revision "2013-11-03" {
-        description "Initial revision";
-    }
-
-    typedef transaction-id {
-        type uint64;
-    }
-    // This refers to MD-SAL transaction reference.
-    grouping transaction-metadata {
-        leaf transaction-uri {
-            type inet:uri;
-        }
-    }
-
-    grouping transaction-aware {
-        leaf transaction-id {
-            type transaction-id;
-        }
-    }
-
-    grouping multipart-transaction-aware {
-        uses transaction-aware;
-
-        leaf moreReplies {
-            type boolean;
-            default false;
-        }
-    }
-
-    rpc get-next-transaction-id {
-        input {
-            leaf node {
-                ext:context-reference "inv:node-context";
-                type inv:node-ref;
-            }
-        }
-        output {
-            uses transaction-aware;
-        }
-    }
-
-    // Barier request?
-    rpc finish-transaction {
-        input {
-            leaf node {
-                ext:context-reference "inv:node-context";
-                type inv:node-ref;
-            }
-            leaf transaction-id {
-                type transaction-id;
-            }
-        }
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-errors.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-errors.yang
deleted file mode 100644 (file)
index 3e9d1ee..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-module flow-errors {
-       namespace "urn:opendaylight:flow:errors";
-    prefix error;
-    
-    revision "2013-11-16" {
-        description "Initial revision of error";
-    }
-
-    typedef error-type {
-        type enumeration {
-            enum hello-failed;
-            enum bad-request;
-            enum bad-action;
-            enum bad-instruction;
-            enum bad-match;
-            enum flow-mod-failed;
-            enum group-mod-failed;
-            enum port-mod-failed;
-            enum table-mod-failed;
-            enum queue-op-failed;
-            enum switch-config-failed;
-            enum role-request-failed;
-            enum meter-mod-failed;
-            enum table-features-failed;
-            enum experimenter {
-                value "65535";
-            }
-        }
-    }
-    
-    grouping error-message {
-        leaf type {
-            type error-type;
-        }
-        
-        leaf code {
-            type uint16;
-        }
-        
-        leaf data {
-            type string;
-        }
-    }
-    
-    grouping experimenter-error-message {
-        leaf type {
-            type error-type;
-        }
-        
-        leaf exp-type {
-            type uint16;
-        }
-        
-        leaf experimenter-id {
-            type uint32;
-        }
-        
-        leaf data {
-            type string;
-        }
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-node-inventory.yang
deleted file mode 100644 (file)
index fc0eb4c..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-module flow-node-inventory {
-    namespace "urn:opendaylight:flow:inventory";
-    prefix flownode;
-
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    import opendaylight-port-types {prefix port;revision-date "2013-09-25";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-table-types {prefix table;revision-date "2013-10-26";}
-    import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";}
-    import opendaylight-group-types {prefix group;revision-date "2013-10-18";}
-    import opendaylight-meter-types {prefix meter;revision-date "2013-09-18";}
-    
-    revision "2013-08-19" {
-        description "Flow Capable Node extensions to the Inventory model";
-    }
-    
-    identity feature-capability {
-    }
-    
-    identity flow-feature-capability-flow-stats {
-        description "Flow statistics"; 
-        base feature-capability;      
-    }
-    
-    identity flow-feature-capability-table-stats {
-        description "Table statistics";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-port-stats {
-        description "Port statistics";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-stp {
-        description "802.1d spanning tree";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-reserved {
-        description "Reserved, must be zero";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-ip-reasm {
-        description "Can reassemble IP fragments";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-queue-stats {
-        description "Queue statistics";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-arp-match-ip {
-        description "Match IP addresses in ARP pkts";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-group-stats {
-        description "Group statistics";
-        base feature-capability;        
-    }
-    
-    identity flow-feature-capability-port-blocked {
-        description "Switch will block looping ports";
-        base feature-capability;        
-    }
-    
-    grouping feature {
-        leaf support-state {
-            type inv:support-type;
-        }
-    }
-
-    grouping queue {
-         leaf queue-id {
-            type uint32;
-            description "id for the specific queue";
-            mandatory true; 
-        }
-        container properties {
-            leaf minimum-rate {
-                type uint32;
-            }
-            leaf maximum-rate{
-                type uint32;
-            }
-        }
-    }
-
-    typedef flow-id {
-        type inet:uri;
-    }
-
-    grouping tables {
-        list table {
-            key "id"; 
-    
-            leaf id {
-                    type uint8;
-            }            
-    
-            uses table:table-features;
-    
-            list flow {
-                key "id"; 
-    
-                leaf id {
-                    type flow-id;
-                }           
-    
-                uses flow:flow;
-            }
-        }
-    }
-    
-    grouping meters {
-        list meter {
-            key "meter-id";
-            uses meter:meter;
-        }
-    }
-
-    grouping ip-address-grouping {
-        leaf ip-address {
-            description "IP address of a flow capable node.";
-            type inet:ip-address;
-        }
-    }
-
-    grouping flow-node {
-        leaf manufacturer {
-            type string;
-        }
-        leaf hardware {
-            type string;
-        }
-        leaf software {
-            type string;
-        }
-        leaf serial-number {
-            type string;
-        }
-        leaf description {
-            type string;
-        }
-
-        uses tables;
-        uses group:groups;
-        uses meters;
-        uses ip-address-grouping;
-        // TODO: ports
-        
-        container supported-match-types {
-            list match-type {
-               key "match";
-                uses feature;
-                leaf match {
-                    type string; // FIXME: Add identity
-                }
-                
-            }
-        }
-        
-        container supported-instructions {
-            list instruction-type {
-               key "instruction";
-                uses feature;
-                leaf instruction {
-                    type string; // FIXME: Add identity
-                }
-            }
-        }
-
-        container supported-actions {
-            list action-type {
-               key "action";
-                uses feature;
-
-                leaf action {
-                    type string; // FIXME: Add identity
-                }
-            }
-        }
-        
-        container switch-features {
-            
-            leaf max_buffers {
-                type uint32;
-            }
-            
-            leaf max_tables {
-                type uint8;
-            }
-            
-            leaf-list capabilities {
-                type identityref {
-                    base feature-capability;
-                }
-            }
-            
-        }
-    }
-
-    grouping flow-node-connector {
-
-        uses port:flow-capable-port;
-    }
-
-    augment "/inv:nodes/inv:node" {
-        ext:augment-identifier "flow-capable-node";
-        uses flow-node;
-    }
-
-    augment "/inv:nodes/inv:node/inv:node-connector" {
-        ext:augment-identifier "flow-capable-node-connector";
-        uses flow-node-connector;
-    }
-
-    augment "/inv:node-updated" {
-        ext:augment-identifier "flow-capable-node-updated";
-        uses flow-node;
-    }
-
-    augment "/inv:node-updated/inv:node-connector" {
-        //ext:identical-augment "flow-capable-node-connector";
-        ext:augment-identifier "flow-capable-node-connector-update-fields";
-        uses flow-node-connector;
-    }
-    
-    augment "/inv:node-connector-updated" {
-        ext:augment-identifier "flow-capable-node-connector-updated";
-        uses flow-node-connector;
-    }
-
-    augment "/inv:nodes/inv:node/table" {
-        ext:augment-identifier "flow-hash-id-mapping";
-    description "Flow is identified by match and priority on device. So Operational/DS
-        has to simulate that behavior and contract between FlowId and match+priority
-        identification should represent Flow hashCode. Flow has to contain only
-        match priority and flowCookie for create a hashCode";
-        list flow-hash-id-map {
-            key "hash";
-            leaf hash {
-                type string;
-            }
-            leaf flow-id {
-                type flow-id;
-            }
-        }
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-topology-discovery.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-topology-discovery.yang
deleted file mode 100644 (file)
index 05c413d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-module flow-topology-discovery {
-    namespace "urn:opendaylight:flow:topology:discovery";
-    prefix flow-node-topo;
-
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    
-    revision "2013-08-19" {
-        description "Flow Capable Node extensions to the Inventory model";
-    }
-    
-
-    grouping link {
-        leaf source {
-            type inv:node-connector-ref;
-        }
-        leaf destination {
-            type inv:node-connector-ref;
-        }
-    }
-
-
-    notification link-discovered {
-        uses link;
-    }
-    
-    notification link-overutilized {
-        uses link;
-    }
-    
-    notification link-removed {
-        uses link;
-    }
-    
-    notification link-utilization-normal {
-        uses link;
-    }
-
-    rpc solicit-refresh {
-    
-    }
-
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/node-config.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/node-config.yang
deleted file mode 100644 (file)
index 98c3228..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-module node-config {
-    namespace "urn:opendaylight:module:config";
-    prefix node-config;
-
-    import flow-capable-transaction {prefix tr;}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-
-    revision "2014-10-15" {
-        description "Initial revision of node configuration service";
-    }
-
-    grouping node-ref {
-        uses "inv:node-context-ref";
-    }
-
-
-
-    /** Base configuration structure **/
-    grouping node-config {
-        leaf flag {
-            type string;
-            description "Switch config flag. Expected values FRAGNORMAL, OFPCFRAGDROP, OFPCFRAGREASM, OFPCFRAGMASK";
-        }
-        leaf miss-search-length{
-            type uint16;
-        }
-    }
-
-    rpc set-config {
-        input {
-            uses node-config;
-            uses tr:transaction-aware;
-            uses node-ref;
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/node-errors.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/node-errors.yang
deleted file mode 100644 (file)
index 69db856..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-module node-error {
-    namespace "urn:opendaylight:node:error:service";
-    prefix node-error;
-
-    import sal-flow {prefix flow; revision-date "2013-08-19";}
-    import flow-errors {prefix error;}
-    import flow-capable-transaction {prefix tr;}
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-flow-types {prefix types;revision-date "2013-10-26";}
-    import opendaylight-group-types {prefix group-type;revision-date 2013-10-18;}
-    import opendaylight-meter-types {prefix meter-type;revision-date "2013-09-18";}
-
-    revision "2014-04-10" {
-        description "Initial revision of errors received from a node";
-    }
-
-    notification hello-failed-error-notification {
-        description "Model for ofp_error-Type=0, Hello protocol failed";
-
-        uses error:error-message;
-        uses tr:transaction-aware;
-        uses tr:transaction-metadata;
-        uses flow:base-node-error-notification;
-        uses flow:node-error-reference;
-    }
-
-    notification bad-request-error-notification {
-        description "Model for ofp_error-Type=1, Request was not understood.";
-
-        uses error:error-message;
-        uses tr:transaction-aware;
-        uses tr:transaction-metadata;
-        uses flow:base-node-error-notification;
-        uses flow:node-error-reference;
-    }
-
-    notification bad-action-error-notification {
-        description "Model for ofp_error-Type=2, Error in action description.";
-
-        uses error:error-message;
-        uses tr:transaction-aware;
-        uses tr:transaction-metadata;
-        uses flow:base-node-error-notification;
-        uses flow:node-error-reference;
-    }
-
-    notification bad-instruction-error-notification {
-            description "Model for ofp_error-Type=3, Error in instruction list.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification bad-match-error-notification {
-            description "Model for ofp_error-Type=4, Error in match.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification flow-mod-error-notification {
-            description "Model for ofp_error-Type=5 - Problem modifying flow entry.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification group-mod-error-notification {
-            description "Model for ofp_error-Type=6 - Problem modifying group entry.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification port-mod-error-notification {
-            description "Model for ofp_error-Type=7 - Port mod request failed.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification table-mod-error-notification {
-            description "Model for ofp_error-Type=8 - Table mod request failed.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification queue-op-error-notification {
-            description "Model for ofp_error-Type=9 - Queue operation failed.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification switch-config-error-notification {
-            description "Model for ofp_error-Type=10 - Switch Config request failed.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification role-request-error-notification {
-            description "Model for ofp_error-Type=11 - Controller Role request failed.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification meter-mod-error-notification {
-            description "Model for ofp_error-Type=12 - Error in meter.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification table-features-error-notification {
-            description "Model for ofp_error-Type=13 - Setting table features failed.";
-
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-
-    notification experimenter-error-notification {
-            description "Model for ofp_error-Type=65535  - Experimenter Error Messages";
-            uses error:error-message;
-            uses tr:transaction-aware;
-            uses tr:transaction-metadata;
-            uses flow:base-node-error-notification;
-            uses flow:node-error-reference;
-        }
-}
-
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/packet-processing.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/packet-processing.yang
deleted file mode 100644 (file)
index 50368e4..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-module packet-processing {
-    namespace "urn:opendaylight:packet:service";
-    prefix flow;
-
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import ietf-yang-types {prefix yang;revision-date "2010-09-24";} 
-    import opendaylight-l2-types {prefix types;revision-date "2013-08-27";}
-    import opendaylight-match-types {prefix match-type;revision-date "2013-10-26";}
-    import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";}
-    import opendaylight-action-types {prefix action-type;revision-date "2013-11-12";}
-    import opendaylight-flow-types {prefix flow-type;revision-date "2013-10-26";}
-
-    
-    revision "2013-07-09" {
-        description "";
-    }
-
-    typedef connection-cookie {
-        type uint32;
-    }
-
-    grouping raw-packet {
-       leaf ingress {
-               type inv:node-connector-ref;
-       }
-        leaf payload {
-               type binary;
-       }
-    }
-
-    grouping ethernet-packet {
-       leaf source {
-               type yang:mac-address;
-       }
-
-       leaf destination {
-               type yang:mac-address;
-       }
-    }
-
-    identity packet-in-reason {
-       description "Base identity for all the available packet in reason"; 
-    }
-    
-    identity no-match {
-       base packet-in-reason;
-       description "No matching flow in the classifier";
-    }
-    
-    identity send-to-controller {
-       base packet-in-reason;
-       description "Explicit instruction to send packet to controller";
-    }
-    
-    identity invalid-ttl {
-       base packet-in-reason;
-       description "Packet with invalid TTL";
-    }
-
-    notification packet-received {
-       leaf connection-cookie {
-                type connection-cookie;
-        }
-        
-        leaf flow-cookie {
-            type flow-type:flow-cookie;
-        }
-        
-        leaf table-id {
-               type table-type:table-id;
-        }
-        
-        leaf packet-in-reason {
-               type identityref {
-                       base packet-in-reason;
-               }
-               }
-        
-        container match {
-                       uses match-type:match;
-        }
-        
-        uses raw-packet;
-    }
-
-    rpc transmit-packet {
-       input {
-            uses inv:node-context-ref;
-
-            leaf connection-cookie {
-                type connection-cookie;
-            }
-            
-               leaf egress {
-                       type inv:node-connector-ref;
-               }
-            leaf buffer-id {
-                  type uint32;
-            }
-
-               uses raw-packet;
-               uses action-type:action-list;
-       }
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-flow.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-flow.yang
deleted file mode 100644 (file)
index 4cb1d08..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-module sal-flow {
-    namespace "urn:opendaylight:flow:service";
-    prefix flow;
-
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-flow-types {prefix types;revision-date "2013-10-26";}    
-    import opendaylight-group-types {prefix group-type;revision-date 2013-10-18;}
-    import opendaylight-meter-types {prefix meter-type;revision-date "2013-09-18";}
-    import flow-capable-transaction {prefix tr;}
-    import flow-errors {prefix error;}
-
-    revision "2013-08-19" {
-        description "Initial revision of flow service";
-    }
-
-    typedef flow-table-ref {
-        type instance-identifier;
-    }
-    
-    grouping node-flow-removed {
-        leaf node {
-            ext:context-reference "inv:node-context";
-            type inv:node-ref;
-        }
-        leaf flow-table {
-            type flow-table-ref;
-        }
-        uses types:flow-mod-removed;
-    }
-    
-    grouping node-flow {
-        uses "inv:node-context-ref";
-
-        leaf flow-table {
-            type flow-table-ref;
-        }
-        uses types:flow;
-    }
-
-    grouping base-node-error-notification {
-        leaf node {
-            ext:context-reference "inv:node-context";
-                type inv:node-ref;
-        }
-    }
-
-    grouping node-error-reference {
-        choice object-reference {
-            case flow-ref{
-                leaf flow-ref {
-                        type types:flow-ref;
-                }
-            }
-            case group-ref{
-                leaf group-ref {
-                    type group-type:group-ref;
-                }
-            }
-            case meter-ref{
-                leaf meter-ref {
-                    type meter-type:meter-ref;
-                }
-            }
-        }
-    }
-
-    /** Base configuration structure **/
-    grouping flow-update {
-        uses "inv:node-context-ref";
-
-        container original-flow {
-            uses types:flow;
-        }
-        container updated-flow {
-            uses types:flow;
-        }
-    }
-
-    rpc add-flow {
-        input {
-            uses tr:transaction-metadata;
-            leaf flow-ref {
-                type types:flow-ref;
-            }
-            uses node-flow;            
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc remove-flow {
-        input {
-            uses tr:transaction-metadata;
-            leaf flow-ref {
-                type types:flow-ref;
-            }
-            uses node-flow;            
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc update-flow {
-        input {
-            uses tr:transaction-metadata;
-            leaf flow-ref {
-                type types:flow-ref;
-            }
-            uses flow-update;           
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-
-    notification flow-added {
-        uses tr:transaction-metadata;
-        leaf flow-ref {
-            type types:flow-ref;
-        }
-        uses node-flow;
-        uses tr:transaction-aware;
-    }
-
-    notification flow-updated {
-        uses tr:transaction-metadata;
-        leaf flow-ref {
-            type types:flow-ref;
-        }
-        uses node-flow;
-        uses tr:transaction-aware;        
-    }
-
-    notification flow-removed {
-        uses tr:transaction-metadata;
-        leaf flow-ref {
-            type types:flow-ref;
-        }
-        uses node-flow;
-        uses tr:transaction-aware;
-    }
-    
-    notification switch-flow-removed {
-        uses node-flow-removed;
-    }
-    
-    notification node-error-notification {
-        uses error:error-message;
-        uses tr:transaction-aware;
-        uses tr:transaction-metadata;
-        uses node-error-reference;
-        uses base-node-error-notification;
-    }
-    
-    notification node-experimenter-error-notification {
-        uses error:experimenter-error-message;
-        uses tr:transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-group.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-group.yang
deleted file mode 100644 (file)
index 7543bf4..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-module sal-group {
-    namespace "urn:opendaylight:group:service";
-    prefix group;
-
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-group-types {prefix group-type;revision-date 2013-10-18;}
-    import flow-capable-transaction {prefix tr;}
-
-    revision "2013-09-18" {
-        description "Initial revision of group service";
-    }        
-    
-    grouping node-group {
-        uses "inv:node-context-ref";        
-        uses group-type:group;
-    }
-
-    /** Base configuration structure **/
-    grouping group-update {
-        uses "inv:node-context-ref";
-        
-        container original-group {
-            uses group-type:group;
-        }
-        container updated-group {
-            uses group-type:group;
-        }
-    }
-
-    rpc add-group {
-        input {
-            uses tr:transaction-metadata;
-            leaf group-ref {
-                type group-type:group-ref;
-            }
-            uses node-group;            
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc remove-group {
-        input {
-            uses tr:transaction-metadata;
-            leaf group-ref {
-                type group-type:group-ref;
-            }
-            uses node-group;            
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc update-group {
-        input {
-            uses tr:transaction-metadata;
-            leaf group-ref {
-                type group-type:group-ref;
-            }
-            uses group-update;            
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    } 
-
-    notification group-added {
-        uses tr:transaction-metadata;
-        leaf group-ref {
-            type group-type:group-ref;
-        }
-        uses node-group;
-        uses tr:transaction-aware;
-    }
-
-    notification group-updated {
-        uses tr:transaction-metadata;
-        leaf group-ref {
-            type group-type:group-ref;
-        }
-        uses node-group;
-        uses tr:transaction-aware;
-    }
-
-    notification group-removed {
-        uses tr:transaction-metadata;
-        leaf group-ref {
-            type group-type:group-ref;
-        }
-        uses node-group;
-        uses tr:transaction-aware;
-    }    
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-meter.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-meter.yang
deleted file mode 100644 (file)
index 50f65df..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-module sal-meter {
-    namespace "urn:opendaylight:meter:service";
-    prefix meter;
-
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-meter-types {prefix meter-type;revision-date "2013-09-18";}
-    import flow-capable-transaction {prefix tr;}
-
-    revision "2013-09-18" {
-        description "Initial revision of meter service";
-    }        
-    
-    grouping node-meter {
-        uses "inv:node-context-ref";
-        
-        uses meter-type:meter;
-    }
-
-    /** Base configuration structure **/
-    grouping meter-update {
-        uses "inv:node-context-ref";
-
-        container original-meter {
-            uses meter-type:meter;
-        }
-        container updated-meter {
-            uses meter-type:meter;
-        }
-    }
-
-    rpc add-meter {
-        input {
-            uses tr:transaction-metadata;            
-            leaf meter-ref {
-                type meter-type:meter-ref;
-            }
-            uses node-meter;            
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc remove-meter {
-        input {
-            uses tr:transaction-metadata;            
-            leaf meter-ref {
-                type meter-type:meter-ref;
-            }
-            
-            uses node-meter;                       
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc update-meter {
-        input {
-            uses tr:transaction-metadata;            
-            leaf meter-ref {
-                type meter-type:meter-ref;
-            }
-            
-            uses meter-update;                       
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-        
-    notification meter-added {
-        uses tr:transaction-metadata;
-        leaf meter-ref {
-            type meter-type:meter-ref;
-        }
-        uses node-meter;
-        uses tr:transaction-aware;
-    }
-
-    notification meter-updated {
-        uses tr:transaction-metadata;
-        leaf meter-ref {
-            type meter-type:meter-ref;
-        }
-        uses node-meter;
-        uses tr:transaction-aware;
-    }
-
-    notification meter-removed {
-        uses tr:transaction-metadata;
-        leaf meter-ref {
-            type meter-type:meter-ref;
-        }
-        uses node-meter;
-        uses tr:transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-port.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-port.yang
deleted file mode 100644 (file)
index 047300a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-module sal-port {
-    namespace "urn:opendaylight:port:service";
-    prefix port;
-
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-port-types {prefix port-type;revision-date "2013-09-25";}
-    import flow-capable-transaction {prefix tr;}
-
-    revision "2013-11-07" {
-        description "Initial revision of port service";
-    }        
-    
-    grouping node-port {
-        uses "inv:node-context-ref";
-        
-        uses port-type:flow-port-status;
-    }
-
-    /** Base configuration structure **/
-    grouping port-update {
-        uses "inv:node-context-ref";
-
-        container original-port {
-            uses port-type:port-mod;
-        }
-        container updated-port {
-            uses port-type:port-mod;
-        }
-    }
-
-    rpc update-port {
-        input {
-            uses port-update;
-            uses tr:transaction-aware;
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-    
-    notification port-updated {
-        uses port-update;
-        uses tr:transaction-aware;
-    }
-    
-    notification port-removed {
-        uses node-port;       
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-queue.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-queue.yang
deleted file mode 100644 (file)
index 4fa9fb0..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-module sal-queue {
-    namespace "urn:opendaylight:queue:service";
-    prefix queue;
-
-    import opendaylight-inventory {prefix inv; revision-date "2013-08-19";}
-    import opendaylight-queue-types {prefix queue-type; revision-date "2013-09-25";}
-
-    revision "2013-11-07" {
-        description "Initial revision of queue service";
-    }        
-    
-    grouping node-queue {
-        uses "inv:node-context-ref";
-        
-        uses queue-type:queue-packet;
-    }
-
-     
-    rpc get-queue {
-        output {
-            uses queue-type:queue-packet;
-        }
-    }  
-    
-    notification queue-get-config-reply {
-        uses node-queue;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang
deleted file mode 100644 (file)
index b125116..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-module sal-table {
-    namespace "urn:opendaylight:table:service";
-    prefix table;
-
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";}
-    import flow-capable-transaction {prefix tr;}
-
-    revision "2013-10-26" {
-        description "Initial revision of table service";
-    }
-    
-    /** Base configuration structure **/
-    grouping table-update {
-        uses "inv:node-context-ref";
-        container original-table {
-            uses table-type:table-features;
-        }
-        container updated-table {
-            uses table-type:table-features;
-        }
-    }
-    
-    rpc update-table {
-        input {
-            uses table-update;
-            uses tr:transaction-aware;
-        }
-        output {
-            uses tr:transaction-aware;
-        }
-    }
-    
-    notification table-updated {
-        uses "inv:node-context-ref";
-        uses tr:multipart-transaction-aware;
-        uses table-type:table-features;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/pom.xml b/opendaylight/md-sal/model/model-flow-statistics/pom.xml
deleted file mode 100644 (file)
index 7a53f06..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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.model</groupId>
-    <artifactId>model-parent</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
-  </parent>
-  <artifactId>model-flow-statistics</artifactId>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>model-flow-service</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>model-inventory</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
-      <artifactId>opendaylight-l2-types</artifactId>
-    </dependency>
-  </dependencies>
-  <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/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang
deleted file mode 100644 (file)
index f7a0652..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-module opendaylight-flow-statistics {
-    namespace "urn:opendaylight:flow:statistics";
-    prefix flowstat;
-
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-flow-types {prefix flow-types;revision-date "2013-10-26";}
-    import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
-    import opendaylight-table-types {prefix table-types;revision-date "2013-10-26";}
-    import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
-    import flow-capable-transaction {prefix tr;}
-    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-
-
-    revision "2013-08-19" {
-        description "Initial revision of flow statistics service";
-    }
-
-    //Augment flow statistics data to the flow-capable-node->table->flow
-    augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" {
-        ext:augment-identifier "flow-statistics-data";
-        uses flow-statistics;
-    }
-
-    grouping flow-statistics {
-        container flow-statistics {
-            //config "false";
-            uses stat-types:generic-statistics;
-        }
-    }
-
-    typedef flow-id {
-        description "flow id";
-        type inet:uri;
-    }
-
-    grouping flow-and-statistics-map-list {
-        description "List of flow and statistics map";
-        list flow-and-statistics-map-list {
-            key "flow-id";
-            leaf flow-id {
-                type flow-id;
-            }
-            uses flow-and-statistics-map;
-        }
-    }
-
-    grouping flow-and-statistics-map{
-        description "Mapping between flow and its statistics";
-        uses flow-types:flow;
-        uses stat-types:generic-statistics;
-    }
-
-    // RPC calls to fetch flow statistics
-    rpc get-all-flows-statistics-from-all-flow-tables {
-        description "Fetch statistics of all the flow present in all the flow tables of the switch";
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses flow-and-statistics-map-list;
-            uses tr:transaction-aware;
-        }
-
-    }
-
-    rpc get-all-flow-statistics-from-flow-table {
-        description "Fetch statistics of all the flow present in the specific flow table of the switch";
-        input {
-            uses inv:node-context-ref;
-            leaf table-id {
-                type table-types:table-id;
-            }
-        }
-        output {
-            uses flow-and-statistics-map-list;
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc get-flow-statistics-from-flow-table {
-        description "Fetch statistics of the specific flow present in the specific flow table of the switch";
-        input {
-            uses inv:node-context-ref;
-            uses flow-types:flow;
-        }
-        output {
-            uses flow-and-statistics-map-list;
-            uses tr:transaction-aware;
-        }
-    }
-
-    notification flows-statistics-update {
-        description "Flows statistics sent by switch";
-        leaf moreReplies {
-            type boolean;
-        }
-        uses inv:node;
-        uses flow-and-statistics-map-list;
-        uses tr:transaction-aware;
-    }
-
-    //Models for aggregate flow statistics collection
-    augment "/inv:nodes/inv:node/flow-node:table" {
-        ext:augment-identifier "aggregate-flow-statistics-data";
-        uses aggregate-flow-statistics;
-    }
-
-    grouping aggregate-flow-statistics {
-        container aggregate-flow-statistics {
-            //config "false";
-            uses stat-types:aggregate-flow-statistics;
-        }
-    }
-
-    // RPC calls to fetch aggregate flow statistics
-    rpc get-aggregate-flow-statistics-from-flow-table-for-all-flows {
-        description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch";
-        input {
-            uses inv:node-context-ref;
-            leaf table-id {
-                type table-types:table-id;
-            }
-        }
-        output {
-            uses stat-types:aggregate-flow-statistics;
-            uses tr:transaction-aware;
-        }
-    }
-    rpc get-aggregate-flow-statistics-from-flow-table-for-given-match {
-        description "Fetch aggregate statistics for all the flow matches to the given match from the given table of the switch";
-        input {
-            uses inv:node-context-ref;
-            uses flow-types:flow;
-        }
-        output {
-            uses stat-types:aggregate-flow-statistics;
-            uses tr:transaction-aware;
-        }
-    }
-
-    notification aggregate-flow-statistics-update {
-        description "Aggregate flow statistics for a table, sent by switch";
-        uses inv:node;
-        uses stat-types:aggregate-flow-statistics;
-        uses tr:multipart-transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang
deleted file mode 100644 (file)
index 431ef50..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-module opendaylight-flow-table-statistics {
-    namespace "urn:opendaylight:flow:table:statistics";
-    prefix flowtablestat;
-
-    import flow-capable-transaction {prefix tr;}
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
-    import opendaylight-table-types {prefix table-types;revision-date "2013-10-26";}
-    import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
-    
-
-    contact
-        "Anilkumar Vishnoi
-        Email: avishnoi@in.ibm.com";
-
-    revision "2013-12-15" {
-        description "Initial revision of flow table statistics model";
-    }
-    
-    //Augment flow table statistics data to the table
-    augment "/inv:nodes/inv:node/flow-node:table" {
-        ext:augment-identifier "flow-table-statistics-data";
-        uses flow-table-statistics;
-    }
-    
-    grouping flow-table-statistics {
-        container flow-table-statistics {
-            //config "false";
-            uses stat-types:generic-table-statistics;
-        }
-    }    
-    
-    //RPC calls to fetch flow table statistics
-    grouping flow-table-and-statistics-map {
-        list flow-table-and-statistics-map {
-            key "table-id";
-            leaf table-id {
-                type table-types:table-id;
-            }
-            uses stat-types:generic-table-statistics;
-        }
-    }
-    
-    rpc get-flow-tables-statistics {
-        description "Fetch statistics of all the flow tables present on the tarnet node";
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses flow-table-and-statistics-map;
-            uses tr:transaction-aware;
-        }
-    }
-    
-    //Notification to receive table statistics update
-    
-    notification flow-table-statistics-update {
-        description "Receive flow table statistics update";
-        
-        uses inv:node;
-        uses flow-table-and-statistics-map;
-        uses tr:multipart-transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang
deleted file mode 100644 (file)
index 7779819..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-module opendaylight-group-statistics {
-    namespace "urn:opendaylight:group:statistics";
-    prefix groupstat;
-
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-group-types {prefix group-types;revision-date "2013-10-18";}
-    import flow-capable-transaction {prefix tr;}
-    import flow-node-inventory {prefix fni;}
-    
-    contact
-        "Anilkumar Vishnoi
-        Email: avishnoi@in.ibm.com";
-            
-    revision "2013-11-11" {
-        description "Initial revision of group statistics service";
-    }
-    
-    grouping group-statistics {
-        container group-statistics {
-            //config "false";
-            uses group-types:group-statistics;
-        }
-    }    
-    
-    augment "/inv:nodes/inv:node/fni:group" {
-        ext:augment-identifier "node-group-statistics";
-        uses group-statistics;
-    }
-
-    grouping group-desc {
-        container group-desc {
-            //config "false";
-            uses group-types:group;
-        }
-    }
-    
-    augment "/inv:nodes/inv:node/fni:group" {
-        ext:augment-identifier "node-group-desc-stats";
-        uses group-desc;
-    }
-
-    grouping group-features {
-            container group-features {
-            //config "false";
-            uses group-types:group-features-reply;
-        }
-    }
-        
-    augment "/inv:nodes/inv:node" {
-        ext:augment-identifier "node-group-features";
-        uses group-features;
-    }
-
-    // RPC calls
-    rpc get-all-group-statistics {
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses group-types:group-statistics-reply;
-            uses tr:transaction-aware;
-        }
-    
-    }
-    
-    rpc get-group-statistics {
-        input {
-            uses inv:node-context-ref;
-            leaf group-id{
-                type group-types:group-id;
-            }
-           
-        }
-        output {
-            uses group-types:group-statistics-reply;
-            uses tr:transaction-aware;
-        }
-    
-    }
-    
-    rpc get-group-description {
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses group-types:group-desc-stats-reply;
-            uses tr:transaction-aware;
-        }
-    }
-    
-    rpc get-group-features {
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses group-types:group-features-reply;
-            uses tr:transaction-aware;
-        }
-    }
-    
-
-    //Notification calls
-    
-    notification group-statistics-updated {
-        uses inv:node;
-        uses group-types:group-statistics-reply;
-        uses tr:multipart-transaction-aware;
-    }
-    
-    notification group-desc-stats-updated {
-        uses inv:node;
-        uses group-types:group-desc-stats-reply;
-        uses tr:multipart-transaction-aware;
-    }
-
-    notification group-features-updated {
-        uses inv:node;
-        uses group-types:group-features-reply;
-        uses tr:multipart-transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang
deleted file mode 100644 (file)
index 0055dc3..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-module opendaylight-meter-statistics {
-    namespace "urn:opendaylight:meter:statistics";
-    prefix meterstat;
-
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
-    import opendaylight-meter-types {prefix meter-types;revision-date "2013-09-18";}
-    import flow-capable-transaction {prefix tr;}
-    
-    contact
-        "Anilkumar Vishnoi
-        Email: avishnoi@in.ibm.com";
-
-    revision "2013-11-11" {
-        description "Initial revision of meter statistics service";
-    }
-
-    augment "/inv:nodes/inv:node/flow-node:meter" {
-        ext:augment-identifier "node-meter-statistics";
-        container meter-statistics {
-            //config "false";
-            uses meter-types:meter-statistics;
-        }
-    }
-
-    augment "/inv:nodes/inv:node/flow-node:meter" {
-        ext:augment-identifier "node-meter-config-stats";
-        container meter-config-stats {
-            //config "false";
-            uses meter-types:meter;
-        }
-    }
-    
-    augment "/inv:nodes/inv:node" {
-        ext:augment-identifier "node-meter-features";
-        container meter-features {
-            //config "false";
-            uses meter-types:meter-features-reply;
-        }
-    }
-
-    // RPC calls
-    rpc get-all-meter-statistics {
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses meter-types:meter-statistics-reply;
-            uses tr:transaction-aware;
-        }
-    
-    }
-    
-    rpc get-meter-statistics {
-        input {
-            uses inv:node-context-ref;
-            leaf meter-id{
-                type meter-types:meter-id;
-            }
-        }
-        output {
-            uses meter-types:meter-statistics-reply;
-            uses tr:transaction-aware;
-        }
-    
-    }
-    
-    rpc get-all-meter-config-statistics {
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-               uses meter-types:meter-config-stats-reply;
-            uses tr:transaction-aware;
-        }
-    }
-    
-    rpc get-meter-features {
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses meter-types:meter-features-reply;
-            uses tr:transaction-aware;
-        }
-    }
-    
-
-    //Notification calls
-    
-    notification meter-statistics-updated {
-        uses inv:node;
-        uses meter-types:meter-statistics-reply;
-        uses tr:multipart-transaction-aware;
-    }
-    
-    notification meter-config-stats-updated {
-        uses inv:node;
-        uses meter-types:meter-config-stats-reply;
-        uses tr:multipart-transaction-aware;
-    }
-
-    notification meter-features-updated {
-        uses inv:node;
-        uses meter-types:meter-features-reply;
-        uses tr:multipart-transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang
deleted file mode 100644 (file)
index e711877..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-module opendaylight-port-statistics {
-    namespace "urn:opendaylight:port:statistics";
-    prefix portstat;
-
-    import flow-capable-transaction {prefix tr;}
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
-
-    contact
-        "Anilkumar Vishnoi
-        Email: avishnoi@in.ibm.com";
-
-    revision "2013-12-14" {
-        description "Initial revision of port statistics model";
-    }
-
-    //Augment port statistics data to the flow-capable-node-connector
-    augment "/inv:nodes/inv:node/inv:node-connector" {
-        ext:augment-identifier "flow-capable-node-connector-statistics-data";
-        uses flow-capable-node-connector-statistics;
-    }
-    
-    grouping flow-capable-node-connector-statistics {
-        container flow-capable-node-connector-statistics {
-            //config "false";
-            uses stat-types:node-connector-statistics;
-        }
-    }
-    
-    // RPC calls
-    rpc get-all-node-connectors-statistics {
-        description "Get statistics for all node connectors from the node";
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses node-connector-statistics-and-port-number-map;
-            uses tr:transaction-aware;
-        }
-    }
-
-    rpc get-node-connector-statistics {
-        description "Get statistics for given node connector from the node";
-        input {
-            uses inv:node-context-ref;
-            leaf node-connector-id {
-                type inv:node-connector-id;
-            }
-        }
-        output {
-            uses stat-types:node-connector-statistics;
-            uses tr:transaction-aware;
-        }
-    }
-
-    //Notification for node connector statistics update
-    grouping node-connector-statistics-and-port-number-map {
-        description "List of map - node connectors and their statistics";
-        list node-connector-statistics-and-port-number-map {
-            key "node-connector-id";
-            leaf node-connector-id {
-                type inv:node-connector-id;
-            }
-            uses stat-types:node-connector-statistics;
-        }
-    }
-
-    notification node-connector-statistics-update {
-        uses inv:node;
-        uses node-connector-statistics-and-port-number-map;
-        uses tr:multipart-transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang
deleted file mode 100644 (file)
index caf52aa..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-module opendaylight-queue-statistics {
-    namespace "urn:opendaylight:queue:statistics";
-    prefix queuestat;
-
-    import flow-capable-transaction {prefix tr;}
-    import yang-ext {prefix ext; revision-date "2013-07-09";}
-    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
-    import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
-    import opendaylight-queue-types {prefix queue-types;revision-date "2013-09-25";}
-    import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
-
-    contact
-        "Anilkumar Vishnoi
-        Email: avishnoi@in.ibm.com";
-
-    revision "2013-12-16" {
-        description "Initial revision of queue statistics model";
-    }
-    
-    //Augment queue statistics data to the flow-capable-node-connector
-    augment "/inv:nodes/inv:node/inv:node-connector/flow-node:queue" {
-        ext:augment-identifier "flow-capable-node-connector-queue-statistics-data";
-        uses flow-capable-node-connector-queue-statistics;
-    }
-    
-    grouping flow-capable-node-connector-queue-statistics {
-        container flow-capable-node-connector-queue-statistics {
-            //config "false";
-            uses stat-types:generic-queue-statistics;
-        }
-    }    
-    
-    //RPC calls to fetch queue statistics
-    grouping queue-id-and-statistics-map {
-        list queue-id-and-statistics-map {
-            key "queue-id node-connector-id";
-            leaf queue-id {
-                type queue-types:queue-id;
-            }
-            leaf node-connector-id {
-                type inv:node-connector-id;
-            }
-            
-            uses stat-types:generic-queue-statistics;
-        }
-    }
-    
-    rpc get-all-queues-statistics-from-all-ports {
-        description "Get statistics for all the queues attached to all the ports from the node";
-        input {
-            uses inv:node-context-ref;
-        }
-        output {
-            uses queue-id-and-statistics-map;
-            uses tr:transaction-aware;
-        }
-    }
-    
-    rpc get-all-queues-statistics-from-given-port {
-        description "Get statistics for all queues for given port of the node";
-        input {
-            uses inv:node-context-ref;
-            leaf node-connector-id {
-                type inv:node-connector-id;
-            }
-        }
-        output {
-            uses queue-id-and-statistics-map;
-            uses tr:transaction-aware;
-        }
-    }
-    
-    rpc get-queue-statistics-from-given-port {
-        description "Get statistics for given queues from given port of the node";
-        input {
-            uses inv:node-context-ref;
-            leaf node-connector-id {
-                type inv:node-connector-id;
-            }
-            leaf queue-id {
-                type queue-types:queue-id;
-            }
-        }
-        output {
-            uses queue-id-and-statistics-map;
-            uses tr:transaction-aware;
-        }
-    }
-
-    //Notification for port statistics update
-
-    notification queue-statistics-update {
-        uses inv:node;
-        uses queue-id-and-statistics-map;
-        uses tr:multipart-transaction-aware;
-    }
-}
diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-statistics-types.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-statistics-types.yang
deleted file mode 100644 (file)
index 19d6eaf..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-module opendaylight-statistics-types {
-    namespace "urn:opendaylight:model:statistics:types";
-    prefix stat-types;
-
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    
-    revision "2013-09-25" {
-        description "Initial revision of flow service";
-    }
-    
-    grouping duration {
-        container duration {
-            leaf second {
-                type yang:counter32;
-            }
-            leaf nanosecond {
-                type yang:counter32;
-            }
-        }
-    }
-
-    grouping node-connector-statistics {
-       container packets {
-            leaf received {
-                type uint64;
-            }
-            leaf transmitted {
-                type uint64;
-            }
-        }
-        container bytes {
-            leaf received {
-                type uint64;
-            }
-            leaf transmitted {
-                type uint64;
-            }
-        }
-        leaf receive-drops {
-            type uint64;
-        }
-        leaf transmit-drops {
-            type uint64;
-        }
-        leaf receive-errors {
-            type uint64;
-        }
-        leaf transmit-errors {
-            type uint64;
-        }
-        leaf receive-frame-error {
-            type uint64;
-        }
-        leaf receive-over-run-error {
-            type uint64;
-        }
-        leaf receive-crc-error {
-            type uint64;
-        }
-        leaf collision-count {
-            type uint64;
-        }
-        uses duration;
-    }
-    
-    grouping generic-statistics {
-       description "Generic grouping for statistics";
-        leaf packet-count {
-            type yang:counter64;
-        }
-
-        leaf byte-count {
-            type yang:counter64;
-        }
-       uses duration;
-       }
-    
-    grouping generic-table-statistics {
-       description "Generic grouping holding generic statistics related to switch table";
-       leaf active-flows {
-            type yang:counter32;
-       }
-       leaf packets-looked-up {
-               type yang:counter64;
-       }
-       leaf packets-matched {
-               type yang:counter64;
-       }
-    }
-    
-    grouping aggregate-flow-statistics {
-       description "Aggregate flow statistics";
-        leaf packet-count {
-            type yang:counter64;
-        }
-
-        leaf byte-count {
-            type yang:counter64;
-        }
-        leaf flow-count {
-            type yang:counter32;
-        }
-    }
-    
-    grouping generic-queue-statistics {
-       description "Generic statistics of switch port attached queues.";
-       leaf transmitted-bytes {
-                       type yang:counter64;
-       }
-       
-       leaf transmitted-packets {
-                       type yang:counter64;
-       }
-       
-       leaf transmission-errors {
-                       type yang:counter64;
-       }
-               uses duration;          
-    }
-    
-}
index 3f389f32989a0d5cd9ef5128e7583a39848d2224..ffedadc770e091e4a4ce2f29591c30d4ce624124 100644 (file)
@@ -14,9 +14,6 @@
 
   <modules>
     <module>model-inventory</module>
-    <module>model-flow-base</module>
-    <module>model-flow-service</module>
-    <module>model-flow-statistics</module>
     <module>model-topology</module>
   </modules>
 
index bdeb8a65a8c2aeac617d34286bae46404767df35..eca5213905ada8dd8f96dbed7232fb22adde38d3 100644 (file)
     <module>sal-rest-connector-config</module>
     <module>sal-netconf-connector</module>
 
-    <module>inventory-manager</module>
-    <module>statistics-manager</module>
-    <module>statistics-manager-config</module>
-    <module>topology-manager</module>
-    <module>forwardingrules-manager</module>
-    <module>topology-lldp-discovery</module>
-
-    <!-- Compability Packages -->
-    <module>compatibility</module>
-
     <!-- Documentation -->
     <module>sal-rest-docgen</module>
     <module>sal-rest-docgen-maven</module>
index edcfcc979c1161f6094fecc50cd68be76bebbb62..ec3f375bdeb0fb940e4d08d14397ebd03f957853 100644 (file)
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
 import org.opendaylight.controller.cluster.DataPersistenceProvider;
 import org.opendaylight.controller.cluster.common.actor.AbstractUntypedPersistentActor;
 import org.opendaylight.controller.cluster.notifications.RoleChanged;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyJournalEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
@@ -160,7 +161,10 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
             } else if (message instanceof ReplicatedLogEntry) {
                 onRecoveredJournalLogEntry((ReplicatedLogEntry) message);
             } else if (message instanceof ApplyLogEntries) {
-                onRecoveredApplyLogEntries((ApplyLogEntries) message);
+                // Handle this message for backwards compatibility with pre-Lithium versions.
+                onRecoveredApplyLogEntries(((ApplyLogEntries) message).getToIndex());
+            } else if (message instanceof ApplyJournalEntries) {
+                onRecoveredApplyLogEntries(((ApplyJournalEntries) message).getToIndex());
             } else if (message instanceof DeleteEntries) {
                 replicatedLog.removeFrom(((DeleteEntries) message).getFromIndex());
             } else if (message instanceof UpdateElectionTerm) {
@@ -222,18 +226,18 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
         replicatedLog.append(logEntry);
     }
 
-    private void onRecoveredApplyLogEntries(ApplyLogEntries ale) {
+    private void onRecoveredApplyLogEntries(long toIndex) {
         if(LOG.isDebugEnabled()) {
             LOG.debug("{}: Received ApplyLogEntries for recovery, applying to state: {} to {}",
-                    persistenceId(), context.getLastApplied() + 1, ale.getToIndex());
+                    persistenceId(), context.getLastApplied() + 1, toIndex);
         }
 
-        for (long i = context.getLastApplied() + 1; i <= ale.getToIndex(); i++) {
+        for (long i = context.getLastApplied() + 1; i <= toIndex; i++) {
             batchRecoveredLogEntry(replicatedLog.get(i));
         }
 
-        context.setLastApplied(ale.getToIndex());
-        context.setCommitIndex(ale.getToIndex());
+        context.setLastApplied(toIndex);
+        context.setCommitIndex(toIndex);
     }
 
     private void batchRecoveredLogEntry(ReplicatedLogEntry logEntry) {
@@ -310,14 +314,14 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
             applyState(applyState.getClientActor(), applyState.getIdentifier(),
                 applyState.getReplicatedLogEntry().getData());
 
-        } else if (message instanceof ApplyLogEntries){
-            ApplyLogEntries ale = (ApplyLogEntries) message;
+        } else if (message instanceof ApplyJournalEntries){
+            ApplyJournalEntries applyEntries = (ApplyJournalEntries) message;
             if(LOG.isDebugEnabled()) {
-                LOG.debug("{}: Persisting ApplyLogEntries with index={}", persistenceId(), ale.getToIndex());
+                LOG.debug("{}: Persisting ApplyLogEntries with index={}", persistenceId(), applyEntries.getToIndex());
             }
-            persistence().persist(new ApplyLogEntries(ale.getToIndex()), new Procedure<ApplyLogEntries>() {
+            persistence().persist(applyEntries, new Procedure<ApplyJournalEntries>() {
                 @Override
-                public void apply(ApplyLogEntries param) throws Exception {
+                public void apply(ApplyJournalEntries param) throws Exception {
                 }
             });
 
@@ -437,9 +441,9 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
                             // Apply the state immediately
                             applyState(clientActor, identifier, data);
 
-                            // Send a ApplyLogEntries message so that we write the fact that we applied
+                            // Send a ApplyJournalEntries message so that we write the fact that we applied
                             // the state to durable storage
-                            self().tell(new ApplyLogEntries((int) replicatedLogEntry.getIndex()), self());
+                            self().tell(new ApplyJournalEntries(replicatedLogEntry.getIndex()), self());
 
                             // Check if the "real" snapshot capture has been initiated. If no then do the fake snapshot
                             if(!context.isSnapshotCaptureInitiated()){
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyJournalEntries.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyJournalEntries.java
new file mode 100644 (file)
index 0000000..ca251d2
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015 Brocade Communications 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.cluster.raft.base.messages;
+
+import java.io.Serializable;
+
+/**
+ * This is an internal message that is stored in the akka's persistent journal. During recovery, this
+ * message is used to apply recovered journal entries to the state whose indexes range from the context's
+ * current lastApplied index to "toIndex" contained in the message. This message is sent internally from a
+ * behavior to the RaftActor to persist.
+ *
+ * @author Thomas Pantelis
+ */
+public class ApplyJournalEntries implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private final long toIndex;
+
+    public ApplyJournalEntries(long toIndex) {
+        this.toIndex = toIndex;
+    }
+
+    public long getToIndex() {
+        return toIndex;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("ApplyJournalEntries [toIndex=").append(toIndex).append("]");
+        return builder.toString();
+    }
+}
index c395915a0fb5763ab733774b5a4680c97553afe0..744d0098419576696d289768e10d813ad09c4176 100644 (file)
@@ -18,9 +18,11 @@ import java.io.Serializable;
  * This class is also used as a internal message sent from Behaviour to
  * RaftActor to persist the ApplyLogEntries
  *
+ * @deprecated Deprecated in favor of ApplyJournalEntries whose type for toIndex is long instead of int.
+ *             This class was kept for backwards compatibility with Helium.
  */
+@Deprecated
 public class ApplyLogEntries implements Serializable {
-    private static final long serialVersionUID = 1L;
     private final int toIndex;
 
     public ApplyLogEntries(int toIndex) {
diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/FollowerInitialSyncUpStatus.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/FollowerInitialSyncUpStatus.java
new file mode 100644 (file)
index 0000000..3ce1f5d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015 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.cluster.raft.base.messages;
+
+/**
+ * The FollowerInitialSyncUpStatus is sent by a Follower to inform any RaftActor subclass whether the Follower
+ * is at least at the same commitIndex as the Leader was when it sent the follower the very first heartbeat.
+ *
+ * This status can be used to determine if a Follower has caught up with the current Leader in an upgrade scenario
+ * for example.
+ *
+ */
+public class FollowerInitialSyncUpStatus {
+    private final boolean initialSyncDone;
+
+    public FollowerInitialSyncUpStatus(boolean initialSyncDone){
+        this.initialSyncDone = initialSyncDone;
+    }
+
+    public boolean isInitialSyncDone() {
+        return initialSyncDone;
+    }
+}
index 0b0b4c7cd642480f92dd600a4f8f10be07977dc4..ef5f11e37aef4fe7490887a27d91caedb0e50c51 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.controller.cluster.raft.RaftActorContext;
 import org.opendaylight.controller.cluster.raft.RaftState;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.SerializationUtils;
-import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyJournalEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
 import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
@@ -393,7 +393,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
         // will be used during recovery
         //in case if the above code throws an error and this message is not sent, it would be fine
         // as the  append entries received later would initiate add this message to the journal
-        actor().tell(new ApplyLogEntries((int) context.getLastApplied()), actor());
+        actor().tell(new ApplyJournalEntries(context.getLastApplied()), actor());
     }
 
     protected Object fromSerializableMessage(Object serializable){
index c799441d603597ea25d530db8dc6eddc9ced68b6..618865cb88eb8877cdcfdcfb29208c80707c2c0f 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.Snapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
+import org.opendaylight.controller.cluster.raft.base.messages.FollowerInitialSyncUpStatus;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
 import org.opendaylight.controller.cluster.raft.messages.InstallSnapshot;
@@ -36,12 +37,18 @@ import org.opendaylight.controller.cluster.raft.messages.RequestVoteReply;
  */
 public class Follower extends AbstractRaftActorBehavior {
 
+
+
     private SnapshotTracker snapshotTracker = null;
 
+    private final InitialSyncStatusTracker initialSyncStatusTracker;
+
     public Follower(RaftActorContext context) {
         super(context, RaftState.Follower);
 
         scheduleElection(electionDuration());
+
+        initialSyncStatusTracker = new InitialSyncStatusTracker(context.getActor());
     }
 
     private boolean isLogEntryPresent(long index){
@@ -71,6 +78,10 @@ public class Follower extends AbstractRaftActorBehavior {
         return -1;
     }
 
+    private void updateInitialSyncStatus(long currentLeaderCommit, String leaderId){
+        initialSyncStatusTracker.update(leaderId, currentLeaderCommit, context.getCommitIndex());
+    }
+
     @Override protected RaftActorBehavior handleAppendEntries(ActorRef sender,
                                                               AppendEntries appendEntries) {
 
@@ -97,6 +108,7 @@ public class Follower extends AbstractRaftActorBehavior {
         long prevLogTerm = getLogEntryTerm(appendEntries.getPrevLogIndex());
         boolean prevEntryPresent = isLogEntryPresent(appendEntries.getPrevLogIndex());
 
+        updateInitialSyncStatus(appendEntries.getLeaderCommit(), appendEntries.getLeaderId());
 
         boolean outOfSync = true;
 
@@ -280,7 +292,6 @@ public class Follower extends AbstractRaftActorBehavior {
 
     private void handleInstallSnapshot(ActorRef sender, InstallSnapshot installSnapshot) {
 
-
         LOG.debug("{}: InstallSnapshot received from leader {}, datasize: {} , Chunk: {}/{}",
                     logName(), installSnapshot.getLeaderId(), installSnapshot.getData().size(),
                     installSnapshot.getChunkIndex(), installSnapshot.getTotalChunks());
@@ -289,6 +300,8 @@ public class Follower extends AbstractRaftActorBehavior {
             snapshotTracker = new SnapshotTracker(LOG, installSnapshot.getTotalChunks());
         }
 
+        updateInitialSyncStatus(installSnapshot.getLastIncludedIndex(), installSnapshot.getLeaderId());
+
         try {
             if(snapshotTracker.addChunk(installSnapshot.getChunkIndex(), installSnapshot.getData(),
                     installSnapshot.getLastChunkHashCode())){
@@ -338,4 +351,36 @@ public class Follower extends AbstractRaftActorBehavior {
     SnapshotTracker getSnapshotTracker(){
         return snapshotTracker;
     }
+
+    private static class InitialSyncStatusTracker {
+
+        private static final long INVALID_LOG_INDEX = -2L;
+        private long initialLeaderCommit = INVALID_LOG_INDEX;
+        private boolean initialSyncUpDone = false;
+        private String syncedLeaderId = null;
+        private final ActorRef actor;
+
+        public InitialSyncStatusTracker(ActorRef actor) {
+            this.actor = actor;
+        }
+
+        public void update(String leaderId, long leaderCommit, long commitIndex){
+
+            if(!leaderId.equals(syncedLeaderId)){
+                initialSyncUpDone = false;
+                initialLeaderCommit = INVALID_LOG_INDEX;
+                syncedLeaderId = leaderId;
+            }
+
+            if(!initialSyncUpDone){
+                if(initialLeaderCommit == INVALID_LOG_INDEX){
+                    actor.tell(new FollowerInitialSyncUpStatus(false), ActorRef.noSender());
+                    initialLeaderCommit = leaderCommit;
+                } else if(commitIndex >= initialLeaderCommit){
+                    actor.tell(new FollowerInitialSyncUpStatus(true), ActorRef.noSender());
+                    initialSyncUpDone = true;
+                }
+            }
+        }
+    }
 }
index 56bfc21f23c2047a19d5a49c49861ae1bf6eca5e..c0bdc53c51f27907da2de0e2399d619cee8fdda1 100644 (file)
@@ -55,6 +55,7 @@ import org.junit.Test;
 import org.opendaylight.controller.cluster.DataPersistenceProvider;
 import org.opendaylight.controller.cluster.datastore.DataPersistenceProviderMonitor;
 import org.opendaylight.controller.cluster.notifications.RoleChanged;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyJournalEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
@@ -396,10 +397,11 @@ public class RaftActorTest extends AbstractActorTest {
 
             MockAkkaJournal.addToJournal(5, entry2);
             // 2 entries are applied to state besides the 4 entries in snapshot
-            MockAkkaJournal.addToJournal(6, new ApplyLogEntries(lastAppliedToState));
+            MockAkkaJournal.addToJournal(6, new ApplyJournalEntries(lastAppliedToState));
             MockAkkaJournal.addToJournal(7, entry3);
             MockAkkaJournal.addToJournal(8, entry4);
 
+
             // kill the actor
             followerActor.tell(PoisonPill.getInstance(), null);
             expectMsgClass(duration("5 seconds"), Terminated.class);
@@ -423,6 +425,46 @@ public class RaftActorTest extends AbstractActorTest {
         }};
     }
 
+    @Test
+    public void testRaftActorRecoveryWithPreLithuimApplyLogEntries() throws Exception {
+        new JavaTestKit(getSystem()) {{
+            String persistenceId = factory.generateActorId("leader-");
+
+            DefaultConfigParamsImpl config = new DefaultConfigParamsImpl();
+            config.setHeartBeatInterval(new FiniteDuration(1, TimeUnit.DAYS));
+
+            // Setup the persisted journal with some entries
+            ReplicatedLogEntry entry0 = new MockRaftActorContext.MockReplicatedLogEntry(1, 0,
+                    new MockRaftActorContext.MockPayload("zero"));
+            ReplicatedLogEntry entry1 = new MockRaftActorContext.MockReplicatedLogEntry(1, 1,
+                    new MockRaftActorContext.MockPayload("oen"));
+            ReplicatedLogEntry entry2 = new MockRaftActorContext.MockReplicatedLogEntry(1, 2,
+                    new MockRaftActorContext.MockPayload("two"));
+
+            long seqNr = 1;
+            MockAkkaJournal.addToJournal(seqNr++, entry0);
+            MockAkkaJournal.addToJournal(seqNr++, entry1);
+            MockAkkaJournal.addToJournal(seqNr++, new ApplyLogEntries(1));
+            MockAkkaJournal.addToJournal(seqNr++, entry2);
+
+            int lastAppliedToState = 1;
+            int lastIndex = 2;
+
+            //reinstate the actor
+            TestActorRef<MockRaftActor> leaderActor = factory.createTestActor(
+                    MockRaftActor.props(persistenceId, Collections.<String, String>emptyMap(),
+                            Optional.<ConfigParams>of(config)));
+
+            leaderActor.underlyingActor().waitForRecoveryComplete();
+
+            RaftActorContext context = leaderActor.underlyingActor().getRaftActorContext();
+            assertEquals("Journal log size", 3, context.getReplicatedLog().size());
+            assertEquals("Last index", lastIndex, context.getReplicatedLog().lastIndex());
+            assertEquals("Last applied", lastAppliedToState, context.getLastApplied());
+            assertEquals("Commit index", lastAppliedToState, context.getCommitIndex());
+        }};
+    }
+
     /**
      * This test verifies that when recovery is applicable (typically when persistence is true) the RaftActor does
      * process recovery messages
@@ -471,7 +513,7 @@ public class RaftActorTest extends AbstractActorTest {
 
                 assertEquals("add replicated log entry", 2, replicatedLog.size());
 
-                mockRaftActor.onReceiveRecover(new ApplyLogEntries(1));
+                mockRaftActor.onReceiveRecover(new ApplyJournalEntries(1));
 
                 assertEquals("commit index 1", 1, mockRaftActor.getRaftActorContext().getCommitIndex());
 
@@ -538,7 +580,7 @@ public class RaftActorTest extends AbstractActorTest {
 
                 assertEquals("add replicated log entry", 0, replicatedLog.size());
 
-                mockRaftActor.onReceiveRecover(new ApplyLogEntries(1));
+                mockRaftActor.onReceiveRecover(new ApplyJournalEntries(1));
 
                 assertEquals("commit index -1", -1, mockRaftActor.getRaftActorContext().getCommitIndex());
 
@@ -641,7 +683,7 @@ public class RaftActorTest extends AbstractActorTest {
     }
 
     @Test
-    public void testApplyLogEntriesCallsDataPersistence() throws Exception {
+    public void testApplyJournalEntriesCallsDataPersistence() throws Exception {
         new JavaTestKit(getSystem()) {
             {
                 String persistenceId = factory.generateActorId("leader-");
@@ -659,7 +701,7 @@ public class RaftActorTest extends AbstractActorTest {
 
                 mockRaftActor.waitForInitializeBehaviorComplete();
 
-                mockRaftActor.onReceiveCommand(new ApplyLogEntries(10));
+                mockRaftActor.onReceiveCommand(new ApplyJournalEntries(10));
 
                 verify(dataPersistenceProvider, times(1)).persist(anyObject(), any(Procedure.class));
 
index 4e8e7fe11bad4fdeb085ffc1ac60450cbbfeda11..29fb613327f23b72755514ce6f2c256d447f8a83 100644 (file)
@@ -1,6 +1,8 @@
 package org.opendaylight.controller.cluster.raft.behaviors;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import akka.actor.ActorRef;
 import akka.actor.Props;
@@ -19,6 +21,7 @@ import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.Snapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
+import org.opendaylight.controller.cluster.raft.base.messages.FollowerInitialSyncUpStatus;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
 import org.opendaylight.controller.cluster.raft.messages.InstallSnapshot;
@@ -118,6 +121,178 @@ public class FollowerTest extends AbstractRaftActorBehaviorTest {
         assertEquals("isVoteGranted", false, reply.isVoteGranted());
     }
 
+
+    @Test
+    public void testHandleFirstAppendEntries() throws Exception {
+        logStart("testHandleFirstAppendEntries");
+
+        MockRaftActorContext context = createActorContext();
+
+        List<ReplicatedLogEntry> entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // The new commitIndex is 101
+        AppendEntries appendEntries = new AppendEntries(2, "leader-1", 100, 1, entries, 101, 100);
+
+        follower = createBehavior(context);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        FollowerInitialSyncUpStatus syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertFalse(syncStatus.isInitialSyncDone());
+    }
+
+    @Test
+    public void testHandleSyncUpAppendEntries() throws Exception {
+        logStart("testHandleSyncUpAppendEntries");
+
+        MockRaftActorContext context = createActorContext();
+
+        List<ReplicatedLogEntry> entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // The new commitIndex is 101
+        AppendEntries appendEntries = new AppendEntries(2, "leader-1", 100, 1, entries, 101, 100);
+
+        follower = createBehavior(context);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        FollowerInitialSyncUpStatus syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertFalse(syncStatus.isInitialSyncDone());
+
+        // Clear all the messages
+        followerActor.underlyingActor().clear();
+
+        context.setLastApplied(101);
+        context.setCommitIndex(101);
+        setLastLogEntry(context, 1, 101,
+                new MockRaftActorContext.MockPayload(""));
+
+        entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // The new commitIndex is 101
+        appendEntries = new AppendEntries(2, "leader-1", 101, 1, entries, 102, 101);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertTrue(syncStatus.isInitialSyncDone());
+
+        followerActor.underlyingActor().clear();
+
+        // Sending the same message again should not generate another message
+
+        follower.handleMessage(leaderActor, appendEntries);
+
+        syncStatus = MessageCollectorActor.getFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertNull(syncStatus);
+
+    }
+
+    @Test
+    public void testHandleAppendEntriesLeaderChangedBeforeSyncUpComplete() throws Exception {
+        logStart("testHandleAppendEntriesLeaderChangedBeforeSyncUpComplete");
+
+        MockRaftActorContext context = createActorContext();
+
+        List<ReplicatedLogEntry> entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // The new commitIndex is 101
+        AppendEntries appendEntries = new AppendEntries(2, "leader-1", 100, 1, entries, 101, 100);
+
+        follower = createBehavior(context);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        FollowerInitialSyncUpStatus syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertFalse(syncStatus.isInitialSyncDone());
+
+        // Clear all the messages
+        followerActor.underlyingActor().clear();
+
+        context.setLastApplied(100);
+        setLastLogEntry(context, 1, 100,
+                new MockRaftActorContext.MockPayload(""));
+
+        entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // leader-2 is becoming the leader now and it says the commitIndex is 45
+        appendEntries = new AppendEntries(2, "leader-2", 45, 1, entries, 46, 100);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        // We get a new message saying initial status is not done
+        assertFalse(syncStatus.isInitialSyncDone());
+
+    }
+
+
+    @Test
+    public void testHandleAppendEntriesLeaderChangedAfterSyncUpComplete() throws Exception {
+        logStart("testHandleAppendEntriesLeaderChangedAfterSyncUpComplete");
+
+        MockRaftActorContext context = createActorContext();
+
+        List<ReplicatedLogEntry> entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // The new commitIndex is 101
+        AppendEntries appendEntries = new AppendEntries(2, "leader-1", 100, 1, entries, 101, 100);
+
+        follower = createBehavior(context);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        FollowerInitialSyncUpStatus syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertFalse(syncStatus.isInitialSyncDone());
+
+        // Clear all the messages
+        followerActor.underlyingActor().clear();
+
+        context.setLastApplied(101);
+        context.setCommitIndex(101);
+        setLastLogEntry(context, 1, 101,
+                new MockRaftActorContext.MockPayload(""));
+
+        entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // The new commitIndex is 101
+        appendEntries = new AppendEntries(2, "leader-1", 101, 1, entries, 102, 101);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertTrue(syncStatus.isInitialSyncDone());
+
+        // Clear all the messages
+        followerActor.underlyingActor().clear();
+
+        context.setLastApplied(100);
+        setLastLogEntry(context, 1, 100,
+                new MockRaftActorContext.MockPayload(""));
+
+        entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // leader-2 is becoming the leader now and it says the commitIndex is 45
+        appendEntries = new AppendEntries(2, "leader-2", 45, 1, entries, 46, 100);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        // We get a new message saying initial status is not done
+        assertFalse(syncStatus.isInitialSyncDone());
+
+    }
+
+
     /**
      * This test verifies that when an AppendEntries RPC is received by a RaftActor
      * with a commitIndex that is greater than what has been applied to the
@@ -358,7 +533,7 @@ public class FollowerTest extends AbstractRaftActorBehaviorTest {
     }
 
     @Test
-    public void testHandleAppendAfterInstallingSnapshot(){
+    public void testHandleAppendEntriesAfterInstallingSnapshot(){
         logStart("testHandleAppendAfterInstallingSnapshot");
 
         MockRaftActorContext context = createActorContext();
@@ -449,7 +624,64 @@ public class FollowerTest extends AbstractRaftActorBehaviorTest {
             assertEquals("getFollowerId", context.getId(), reply.getFollowerId());
         }
 
-        Assert.assertNull("Expected null SnapshotTracker", ((Follower)follower).getSnapshotTracker());
+        assertNull("Expected null SnapshotTracker", ((Follower) follower).getSnapshotTracker());
+    }
+
+    @Test
+    public void testInitialSyncUpWithHandleInstallSnapshotFollowedByAppendEntries() throws Exception {
+        logStart("testInitialSyncUpWithHandleInstallSnapshot");
+
+        MockRaftActorContext context = createActorContext();
+
+        follower = createBehavior(context);
+
+        HashMap<String, String> followerSnapshot = new HashMap<>();
+        followerSnapshot.put("1", "A");
+        followerSnapshot.put("2", "B");
+        followerSnapshot.put("3", "C");
+
+        ByteString bsSnapshot  = toByteString(followerSnapshot);
+        int offset = 0;
+        int snapshotLength = bsSnapshot.size();
+        int chunkSize = 50;
+        int totalChunks = (snapshotLength / chunkSize) + ((snapshotLength % chunkSize) > 0 ? 1 : 0);
+        int lastIncludedIndex = 1;
+        int chunkIndex = 1;
+        InstallSnapshot lastInstallSnapshot = null;
+
+        for(int i = 0; i < totalChunks; i++) {
+            ByteString chunkData = getNextChunk(bsSnapshot, offset, chunkSize);
+            lastInstallSnapshot = new InstallSnapshot(1, "leader", lastIncludedIndex, 1,
+                    chunkData, chunkIndex, totalChunks);
+            follower.handleMessage(leaderActor, lastInstallSnapshot);
+            offset = offset + 50;
+            lastIncludedIndex++;
+            chunkIndex++;
+        }
+
+        FollowerInitialSyncUpStatus syncStatus =
+                MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertFalse(syncStatus.isInitialSyncDone());
+
+        // Clear all the messages
+        followerActor.underlyingActor().clear();
+
+        context.setLastApplied(101);
+        context.setCommitIndex(101);
+        setLastLogEntry(context, 1, 101,
+                new MockRaftActorContext.MockPayload(""));
+
+        List<ReplicatedLogEntry> entries = Arrays.asList(
+                newReplicatedLogEntry(2, 101, "foo"));
+
+        // The new commitIndex is 101
+        AppendEntries appendEntries = new AppendEntries(2, "leader", 101, 1, entries, 102, 101);
+        follower.handleMessage(leaderActor, appendEntries);
+
+        syncStatus = MessageCollectorActor.expectFirstMatching(followerActor, FollowerInitialSyncUpStatus.class);
+
+        assertTrue(syncStatus.isInitialSyncDone());
     }
 
     @Test
@@ -479,7 +711,7 @@ public class FollowerTest extends AbstractRaftActorBehaviorTest {
         assertEquals("getTerm", 1, reply.getTerm());
         assertEquals("getFollowerId", context.getId(), reply.getFollowerId());
 
-        Assert.assertNull("Expected null SnapshotTracker", ((Follower)follower).getSnapshotTracker());
+        assertNull("Expected null SnapshotTracker", ((Follower) follower).getSnapshotTracker());
     }
 
     public ByteString getNextChunk (ByteString bs, int offset, int chunkSize){
index c57fce1cd553d8c41dd786d9c4bb6f33e97791b6..6964db51f273f52ac0591b80cf75edf5997ec68c 100644 (file)
@@ -27,7 +27,7 @@ import org.opendaylight.controller.cluster.raft.RaftActorContext;
 import org.opendaylight.controller.cluster.raft.RaftState;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogImplEntry;
 import org.opendaylight.controller.cluster.raft.SerializationUtils;
-import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyJournalEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
 import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.IsolatedLeaderCheck;
@@ -929,12 +929,12 @@ public class LeaderTest extends AbstractLeaderTest {
 
         assertEquals(2, leaderActorContext.getCommitIndex());
 
-        ApplyLogEntries applyLogEntries = MessageCollectorActor.expectFirstMatching(
-                leaderActor, ApplyLogEntries.class);
+        ApplyJournalEntries applyJournalEntries = MessageCollectorActor.expectFirstMatching(
+                leaderActor, ApplyJournalEntries.class);
 
         assertEquals(2, leaderActorContext.getLastApplied());
 
-        assertEquals(2, applyLogEntries.getToIndex());
+        assertEquals(2, applyJournalEntries.getToIndex());
 
         List<ApplyState> applyStateList = MessageCollectorActor.getAllMatching(leaderActor,
                 ApplyState.class);
index 85edc07bc5c683a136d0bbb93f534ecc6f2e7103..47864be41161a060c71b35f52ce835dbd0064b61 100644 (file)
@@ -15,14 +15,13 @@ import akka.persistence.PersistentImpl;
 import akka.persistence.PersistentRepr;
 import akka.persistence.journal.japi.AsyncWriteJournal;
 import com.google.common.collect.Maps;
-import scala.concurrent.Future;
-
 import java.util.Map;
 import java.util.concurrent.Callable;
+import scala.concurrent.Future;
 
 public class MockAkkaJournal extends AsyncWriteJournal {
 
-    private static Map<Long, Object> journal = Maps.newHashMap();
+    private static Map<Long, Object> journal = Maps.newLinkedHashMap();
 
     public static void addToJournal(long sequenceNr, Object message) {
         journal.put(sequenceNr, message);
index 9346e223df1b0fcb5a0f298386a2912578503c30..0c55db1f44abc054160e00a44e93390c1d5b08bc 100644 (file)
       <artifactId>sal-core-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-base</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-statistics</artifactId>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-test-model</artifactId>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
index 7aed0dba39e1f27d086ed1aa9a4e433dbbcb42b1..ba58a6f213b2979cbea613fbc59cc02c474f7c77 100644 (file)
@@ -11,11 +11,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+
+import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
@@ -23,23 +24,18 @@ 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.controller.sal.binding.test.AugmentationVerifier;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter32;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter64;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-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.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.DurationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStatsKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeLeafOnlyAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeLeafOnlyAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ContainerWithUsesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ListViaUses;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ListViaUsesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ListViaUsesKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -50,24 +46,24 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 @Deprecated
 public class MultipleAugmentationPutsTest extends AbstractDataServiceTest implements DataChangeListener {
 
-    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
+    private static final QName NODE_ID_QNAME = QName.create(TopLevelList.QNAME, "name");
     private static final String NODE_ID = "openflow:1";
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
+    private static final TopLevelListKey NODE_KEY = new TopLevelListKey(NODE_ID);
 
     private static final Map<QName, Object> NODE_KEY_BI = Collections.<QName, Object> singletonMap(NODE_ID_QNAME,
             NODE_ID);
 
-    private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
+    private static final InstanceIdentifier<Top> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
             .toInstance();
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA =
-            NODES_INSTANCE_ID_BA.child(Node.class, NODE_KEY);
+    private static final InstanceIdentifier<TopLevelList> NODE_INSTANCE_ID_BA =
+            NODES_INSTANCE_ID_BA.child(TopLevelList.class, NODE_KEY);
 
     private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier NODE_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder() //
-            .node(Nodes.QNAME) //
-            .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
+            .node(Top.QNAME) //
+            .nodeWithKey(TopLevelList.QNAME, NODE_KEY_BI) //
             .toInstance();
     private DataChangeEvent<InstanceIdentifier<?>, DataObject> receivedChangeEvent;
 
@@ -81,56 +77,56 @@ public class MultipleAugmentationPutsTest extends AbstractDataServiceTest implem
 
         baDataService.registerDataChangeListener(NODES_INSTANCE_ID_BA, this);
 
-        Node flowCapableNode = createTestNode(FlowCapableNode.class, flowCapableNodeAugmentation());
+        TopLevelList flowCapableNode = createTestNode(TreeLeafOnlyAugment.class, createTreeLeafOnlyAugmentation());
         commitNodeAndVerifyTransaction(flowCapableNode);
 
         assertNotNull(receivedChangeEvent);
-        verifyNode((Nodes) receivedChangeEvent.getUpdatedOperationalSubtree(), flowCapableNode);
+        verifyNode((Top) receivedChangeEvent.getUpdatedOperationalSubtree(), flowCapableNode);
+
+        Top nodes = checkForNodes();
+        verifyNode(nodes, flowCapableNode).assertHasAugmentation(TreeLeafOnlyAugment.class);
+        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
+        TopLevelList meterStatsNode = createTestNode(TreeComplexUsesAugment.class, createTreeComplexUsesAugment());
+        commitNodeAndVerifyTransaction(meterStatsNode);
+
+        assertNotNull(receivedChangeEvent);
+        verifyNode((Top) receivedChangeEvent.getUpdatedOperationalSubtree(), meterStatsNode);
+
+        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
+
+        TopLevelList mergedNode = (TopLevelList) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
+
+        AugmentationVerifier.from(mergedNode) //
+                .assertHasAugmentation(TreeLeafOnlyAugment.class) //
+                .assertHasAugmentation(TreeComplexUsesAugment.class);
+
+        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
+
+        TopLevelList meterStatsNodeWithDuration = createTestNode(TreeComplexUsesAugment.class, createTreeComplexUsesAugment(5));
+        commitNodeAndVerifyTransaction(meterStatsNodeWithDuration);
+
+
+        TopLevelList nodeWithUpdatedList = (TopLevelList) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
+        AugmentationVerifier.from(nodeWithUpdatedList) //
+                .assertHasAugmentation(TreeLeafOnlyAugment.class) //
+                .assertHasAugmentation(TreeComplexUsesAugment.class);
 
-        Nodes nodes = checkForNodes();
-        verifyNode(nodes, flowCapableNode).assertHasAugmentation(FlowCapableNode.class);
+        List<ListViaUses> meterStats = nodeWithUpdatedList.getAugmentation(TreeComplexUsesAugment.class).getListViaUses();
+        assertNotNull(meterStats);
+        Assert.assertFalse(meterStats.isEmpty());
         assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
-//        Node meterStatsNode = createTestNode(NodeMeterStatistics.class, nodeMeterStatistics());
-//        commitNodeAndVerifyTransaction(meterStatsNode);
-//
-//        assertNotNull(receivedChangeEvent);
-//        verifyNode((Nodes) receivedChangeEvent.getUpdatedOperationalSubtree(), meterStatsNode);
-//
-//        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
-//
-//        Node mergedNode = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
-//
-//        AugmentationVerifier.from(mergedNode) //
-//                .assertHasAugmentation(FlowCapableNode.class) //
-//                .assertHasAugmentation(NodeMeterStatistics.class);
-//
-//        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
-//
-//        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());
-//        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
         testNodeRemove();
     }
 
-    private <T extends Augmentation<Node>> Node createTestNode(final Class<T> augmentationClass, final T augmentation) {
-        NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setId(new NodeId(NODE_ID));
+    private static <T extends Augmentation<TopLevelList>> TopLevelList createTestNode(final Class<T> augmentationClass, final T augmentation) {
+        TopLevelListBuilder nodeBuilder = new TopLevelListBuilder();
         nodeBuilder.setKey(NODE_KEY);
+        nodeBuilder.setName(NODE_KEY.getName());
         nodeBuilder.addAugmentation(augmentationClass, augmentation);
         return nodeBuilder.build();
     }
 
-    private DataModificationTransaction commitNodeAndVerifyTransaction(final Node original) throws Exception {
+    private DataModificationTransaction commitNodeAndVerifyTransaction(final TopLevelList original) throws Exception {
         DataModificationTransaction transaction = baDataService.beginTransaction();
         transaction.putOperationalData(NODE_INSTANCE_ID_BA, original);
         RpcResult<TransactionStatus> result = transaction.commit().get();
@@ -144,18 +140,18 @@ public class MultipleAugmentationPutsTest extends AbstractDataServiceTest implem
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
+        TopLevelList node = (TopLevelList) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
         assertNull(node);
     }
 
-    private AugmentationVerifier<Node> verifyNode(final Nodes nodes, final Node original) {
+    private static AugmentationVerifier<TopLevelList> verifyNode(final Top nodes, final TopLevelList original) {
         assertNotNull(nodes);
-        assertNotNull(nodes.getNode());
-        assertEquals(1, nodes.getNode().size());
-        Node readedNode = nodes.getNode().get(0);
-        assertEquals(original.getId(), readedNode.getId());
+        assertNotNull(nodes.getTopLevelList());
+        assertEquals(1, nodes.getTopLevelList().size());
+        TopLevelList readedNode = nodes.getTopLevelList().get(0);
+        assertEquals(original.getName(), readedNode.getName());
         assertEquals(original.getKey(), readedNode.getKey());
-        return new AugmentationVerifier<Node>(readedNode);
+        return new AugmentationVerifier<>(readedNode);
     }
 
     private void assertBindingIndependentVersion(final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier nodeId) {
@@ -163,46 +159,36 @@ public class MultipleAugmentationPutsTest extends AbstractDataServiceTest implem
         assertNotNull(node);
     }
 
-    private Nodes checkForNodes() {
-        return (Nodes) baDataService.readOperationalData(NODES_INSTANCE_ID_BA);
+    private Top checkForNodes() {
+        return (Top) baDataService.readOperationalData(NODES_INSTANCE_ID_BA);
     }
 
-    private NodeMeterStatistics nodeMeterStatistics() {
-        return nodeMeterStatistics(10, false);
+    private static TreeComplexUsesAugment createTreeComplexUsesAugment() {
+        return createTreeComplexUsesAugment(10);
     }
 
-    private NodeMeterStatistics nodeMeterStatistics(final int count, final boolean setDuration) {
-        NodeMeterStatisticsBuilder nmsb = new NodeMeterStatisticsBuilder();
-        MeterStatisticsBuilder meterStats = new MeterStatisticsBuilder();
+    private static TreeComplexUsesAugment createTreeComplexUsesAugment(final int count) {
+        TreeComplexUsesAugmentBuilder tcuaBld = new TreeComplexUsesAugmentBuilder();
+        ContainerWithUsesBuilder cwuBld = new ContainerWithUsesBuilder();
+        cwuBld.setLeafFromGrouping("lfg1");
 
-        List<MeterStats> stats = new ArrayList<>(count);
+        List<ListViaUses> lvuBag = new ArrayList<>(count);
         for (int i = 0; i <= count; i++) {
-            MeterStatsBuilder statistic = new MeterStatsBuilder();
-            statistic.setKey(new MeterStatsKey(new MeterId((long) i)));
-            statistic.setByteInCount(new Counter64(BigInteger.valueOf(34590 + i)));
-            statistic.setFlowCount(new Counter32(4569L + i));
-
-            if (setDuration) {
-                DurationBuilder duration = new DurationBuilder();
-                duration.setNanosecond(new Counter32(70L));
-                statistic.setDuration(duration.build());
-            }
-
-            stats.add(statistic.build());
+            ListViaUsesBuilder statistic = new ListViaUsesBuilder();
+            String name = String.valueOf(i);
+            statistic.setKey(new ListViaUsesKey(name));
+            statistic.setName(name);
+            lvuBag.add(statistic.build());
         }
-       // meterStats.setMeterStats(stats);
-        nmsb.setMeterStatistics(meterStats.build());
-        return nmsb.build();
+        tcuaBld.setContainerWithUses(cwuBld.build());
+        tcuaBld.setListViaUses(lvuBag);
+        return tcuaBld.build();
     }
 
-    private FlowCapableNode flowCapableNodeAugmentation() {
-        FlowCapableNodeBuilder fnub = new FlowCapableNodeBuilder();
-        fnub.setHardware("Hardware Foo");
-        fnub.setManufacturer("Manufacturer Foo");
-        fnub.setSerialNumber("Serial Foo");
-        fnub.setDescription("Description Foo");
-        fnub.setSoftware("JUnit emulated");
-        FlowCapableNode fnu = fnub.build();
+    private static TreeLeafOnlyAugment createTreeLeafOnlyAugmentation() {
+        TreeLeafOnlyAugmentBuilder fnub = new TreeLeafOnlyAugmentBuilder();
+        fnub.setSimpleValue("meVerySimpleIs");
+        TreeLeafOnlyAugment fnu = fnub.build();
         return fnu;
     }
 
index 96f52bd8dc4ba9ab22e125a64176530af85e2a2d..9f5bdd439efb102a751e1f64b5ca59986e63c688 100644 (file)
@@ -156,8 +156,6 @@ public class TestHelper {
 
     public static Option flowCapableModelBundles() {
         return new DefaultCompositeOption( //
-                mavenBundle(CONTROLLER_MODELS, "model-flow-base").versionAsInProject(), // //
-                mavenBundle(CONTROLLER_MODELS, "model-flow-service").versionAsInProject(), // //
                 mavenBundle(CONTROLLER_MODELS, "model-inventory").versionAsInProject() //
         );
 
index e1d5d0060da05900dd25a53ecfbd5709635abffc..41208091cfcf58e13a9f484020ca3d207e154c9e 100644 (file)
@@ -165,7 +165,6 @@ public class NotificationTest extends AbstractTest {
     }
 
     /**
-     *
      * Implements
      * {@link OpendaylightTestNotificationListener} and contains attributes which keep lists of objects of
      * the type {@link OutOfFairyDustNotification}.
index 96ed7f183893e3900d7ad31a2f977e067c1aed04..df6091b015733235b5b8b3c8f1c7257d11677122 100644 (file)
@@ -40,6 +40,7 @@
                     </operational-schema-service>
                     <operational-properties>
                         <persistent>false</persistent>
+                        <shard-election-timeout-factor>20</shard-election-timeout-factor>
                     </operational-properties>
                 </module>
 
@@ -50,6 +51,9 @@
                         <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
                         <name>yang-schema-service</name>
                     </config-schema-service>
+                    <config-properties>
+                        <shard-election-timeout-factor>20</shard-election-timeout-factor>
+                    </config-properties>
                 </module>
 
                 <module>
index 8e03223a7163c9188c1cdc85fd5a6e75973312d1..7df398355e0ab0cb2c9e96329652c69261910857 100644 (file)
@@ -7,7 +7,7 @@
 
 # The multiplication factor to be used to determine shard election timeout. The shard election timeout
 # is determined by multiplying shardHeartbeatIntervalInMillis with the shardElectionTimeoutFactor.
-#shard-election-timeout-factor=2
+shard-election-timeout-factor=20
 
 # The interval at which a shard will send a heart beat message to its remote shard.
 #shard-heartbeat-interval-in-millis=500
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/OperationCallback.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/OperationCallback.java
new file mode 100644 (file)
index 0000000..b944536
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015 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.cluster.datastore;
+
+public interface OperationCallback {
+    void run();
+    void success();
+    void failure();
+}
index 4445b14e2edc1b48b5c92012e8a659275357f433..c479da73127760977d4c27b3ff9873d10c295c57 100644 (file)
@@ -11,15 +11,12 @@ package org.opendaylight.controller.cluster.datastore;
 import akka.actor.ActorSelection;
 import akka.dispatch.Futures;
 import akka.dispatch.OnComplete;
-import com.codahale.metrics.Snapshot;
-import com.codahale.metrics.Timer;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.Collections;
 import java.util.List;
-import java.util.concurrent.TimeUnit;
 import org.opendaylight.controller.cluster.datastore.messages.AbortTransaction;
 import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply;
 import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransaction;
@@ -195,7 +192,7 @@ public class ThreePhaseCommitCohortProxy implements DOMStoreThreePhaseCommitCoho
     @Override
     public ListenableFuture<Void> commit() {
         OperationCallback operationCallback = (cohortFutures.size() == 0) ? NO_OP_CALLBACK :
-                new CommitCallback(actorContext);
+                new TransactionRateLimitingCallback(actorContext);
 
         return voidOperation("commit", new CommitTransaction(transactionId).toSerializable(),
                 CommitTransactionReply.SERIALIZABLE_CLASS, true, operationCallback);
@@ -311,58 +308,4 @@ public class ThreePhaseCommitCohortProxy implements DOMStoreThreePhaseCommitCoho
     List<Future<ActorSelection>> getCohortFutures() {
         return Collections.unmodifiableList(cohortFutures);
     }
-
-    private static interface OperationCallback {
-        void run();
-        void success();
-        void failure();
-    }
-
-    private static class CommitCallback implements OperationCallback{
-
-        private static final Logger LOG = LoggerFactory.getLogger(CommitCallback.class);
-        private static final String COMMIT = "commit";
-
-        private final Timer commitTimer;
-        private final ActorContext actorContext;
-        private Timer.Context timerContext;
-
-        CommitCallback(ActorContext actorContext){
-            this.actorContext = actorContext;
-            commitTimer = actorContext.getOperationTimer(COMMIT);
-        }
-
-        @Override
-        public void run() {
-            timerContext = commitTimer.time();
-        }
-
-        @Override
-        public void success() {
-            timerContext.stop();
-
-            Snapshot timerSnapshot = commitTimer.getSnapshot();
-            double allowedLatencyInNanos = timerSnapshot.get95thPercentile();
-
-            long commitTimeoutInSeconds = actorContext.getDatastoreContext()
-                    .getShardTransactionCommitTimeoutInSeconds();
-            long commitTimeoutInNanos = TimeUnit.SECONDS.toNanos(commitTimeoutInSeconds);
-
-            // Here we are trying to find out how many transactions per second are allowed
-            double newRateLimit = ((double) commitTimeoutInNanos / allowedLatencyInNanos) / commitTimeoutInSeconds;
-
-            LOG.debug("Data Store {} commit rateLimit adjusted to {} allowedLatencyInNanos = {}",
-                    actorContext.getDataStoreType(), newRateLimit, allowedLatencyInNanos);
-
-            actorContext.setTxCreationLimit(newRateLimit);
-        }
-
-        @Override
-        public void failure() {
-            // This would mean we couldn't get a transaction completed in 30 seconds which is
-            // the default transaction commit timeout. Using the timeout information to figure out the rate limit is
-            // not going to be useful - so we leave it as it is
-        }
-    }
-
 }
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionRateLimitingCallback.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionRateLimitingCallback.java
new file mode 100644 (file)
index 0000000..1202a90
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015 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.cluster.datastore;
+
+import com.codahale.metrics.Snapshot;
+import com.codahale.metrics.Timer;
+import com.google.common.base.Preconditions;
+import java.util.concurrent.TimeUnit;
+import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * TransactionRateLimitingCallback computes the new transaction rate limit on the successful completion of a
+ * transaction
+ */
+public class TransactionRateLimitingCallback implements OperationCallback{
+
+    private static final Logger LOG = LoggerFactory.getLogger(TransactionRateLimitingCallback.class);
+    private static final String COMMIT = "commit";
+
+    private final Timer commitTimer;
+    private final ActorContext actorContext;
+    private Timer.Context timerContext;
+
+    TransactionRateLimitingCallback(ActorContext actorContext){
+        this.actorContext = actorContext;
+        commitTimer = actorContext.getOperationTimer(COMMIT);
+    }
+
+    @Override
+    public void run() {
+        timerContext = commitTimer.time();
+    }
+
+    @Override
+    public void success() {
+        Preconditions.checkState(timerContext != null, "Call run before success");
+        timerContext.stop();
+
+        Snapshot timerSnapshot = commitTimer.getSnapshot();
+        double newRateLimit = 0;
+
+        long commitTimeoutInSeconds = actorContext.getDatastoreContext()
+                .getShardTransactionCommitTimeoutInSeconds();
+        long commitTimeoutInNanos = TimeUnit.SECONDS.toNanos(commitTimeoutInSeconds);
+
+        // Find the time that it takes for transactions to get executed in every 10th percentile
+        // Compute the rate limit for that percentile and sum it up
+        for(int i=1;i<=10;i++){
+            // Get the amount of time transactions take in the i*10th percentile
+            double percentileTimeInNanos = timerSnapshot.getValue(i * 0.1D);
+
+            if(percentileTimeInNanos > 0) {
+                // Figure out the rate limit for the i*10th percentile in nanos
+                double percentileRateLimit = ((double) commitTimeoutInNanos / percentileTimeInNanos);
+
+                // Add the percentileRateLimit to the total rate limit
+                newRateLimit += percentileRateLimit;
+            }
+        }
+
+        // Compute the rate limit per second
+        newRateLimit = newRateLimit/(commitTimeoutInSeconds*10);
+
+        LOG.debug("Data Store {} commit rateLimit adjusted to {}", actorContext.getDataStoreType(), newRateLimit);
+
+        actorContext.setTxCreationLimit(newRateLimit);
+    }
+
+    @Override
+    public void failure() {
+        // This would mean we couldn't get a transaction completed in 30 seconds which is
+        // the default transaction commit timeout. Using the timeout information to figure out the rate limit is
+        // not going to be useful - so we leave it as it is
+    }
+}
\ No newline at end of file
index e03693569b0812b3db941990b1dc56957c62568b..1ebd1b91dd474bf14ce0c5d9c32a9eb8cce64d84 100644 (file)
@@ -74,6 +74,7 @@ import org.opendaylight.controller.cluster.datastore.utils.SerializationUtils;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogImplEntry;
 import org.opendaylight.controller.cluster.raft.Snapshot;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyJournalEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyLogEntries;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
@@ -492,7 +493,7 @@ public class ShardTest extends AbstractActorTest {
         }
 
         InMemoryJournal.addEntry(shardID.toString(), nListEntries + 1,
-                new ApplyLogEntries(nListEntries));
+                new ApplyJournalEntries(nListEntries));
 
         testRecovery(listEntryKeys);
     }
index 0a2a0d1bc0595a8932f2e2ee3ab27c6b8f422855..647b6e7b542508953bb9750555aaf193c0ba2864 100644 (file)
@@ -7,7 +7,6 @@ import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.timeout;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import akka.actor.ActorPath;
@@ -68,11 +67,15 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         doReturn(getSystem()).when(actorContext).getActorSystem();
         doReturn(getSystem().dispatchers().defaultGlobalDispatcher()).when(actorContext).getClientDispatcher();
         doReturn(datastoreContext).when(actorContext).getDatastoreContext();
-        doReturn(100).when(datastoreContext).getShardTransactionCommitTimeoutInSeconds();
+        doReturn(30).when(datastoreContext).getShardTransactionCommitTimeoutInSeconds();
         doReturn(commitTimer).when(actorContext).getOperationTimer("commit");
         doReturn(commitTimerContext).when(commitTimer).time();
         doReturn(commitSnapshot).when(commitTimer).getSnapshot();
-        doReturn(TimeUnit.MILLISECONDS.toNanos(2000) * 1.0).when(commitSnapshot).get95thPercentile();
+        for(int i=1;i<11;i++){
+            // Keep on increasing the amount of time it takes to complete transaction for each tenth of a
+            // percentile. Essentially this would be 1ms for the 10th percentile, 2ms for 20th percentile and so on.
+            doReturn(TimeUnit.MILLISECONDS.toNanos(i) * 1D).when(commitSnapshot).getValue(i * 0.1);
+        }
         doReturn(10.0).when(actorContext).getTxCreationLimit();
     }
 
@@ -332,8 +335,6 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         verifyCohortInvocations(2, CanCommitTransaction.SERIALIZABLE_CLASS);
         verifyCohortInvocations(2, CommitTransaction.SERIALIZABLE_CLASS);
 
-        // Verify that the creation limit was changed to 0.5 (based on setup)
-        verify(actorContext, timeout(5000)).setTxCreationLimit(0.5);
     }
 
     @Test
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionRateLimitingCommitCallbackTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionRateLimitingCommitCallbackTest.java
new file mode 100644 (file)
index 0000000..f97e325
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2015 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.cluster.datastore;
+
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.anyDouble;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import com.codahale.metrics.Snapshot;
+import com.codahale.metrics.Timer;
+import java.util.concurrent.TimeUnit;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
+
+public class TransactionRateLimitingCommitCallbackTest {
+
+    @Mock
+    public ActorContext actorContext;
+
+    @Mock
+    public DatastoreContext datastoreContext;
+
+    @Mock
+    public Timer commitTimer;
+
+    @Mock
+    private Timer.Context commitTimerContext;
+
+    @Mock
+    private Snapshot commitSnapshot;
+
+    @Before
+    public void setUp(){
+        MockitoAnnotations.initMocks(this);
+        doReturn(datastoreContext).when(actorContext).getDatastoreContext();
+        doReturn(30).when(datastoreContext).getShardTransactionCommitTimeoutInSeconds();
+        doReturn(commitTimer).when(actorContext).getOperationTimer("commit");
+        doReturn(commitTimerContext).when(commitTimer).time();
+        doReturn(commitSnapshot).when(commitTimer).getSnapshot();
+    }
+
+    @Test
+    public void testSuccess(){
+
+        for(int i=1;i<11;i++){
+            // Keep on increasing the amount of time it takes to complete transaction for each tenth of a
+            // percentile. Essentially this would be 1ms for the 10th percentile, 2ms for 20th percentile and so on.
+            doReturn(TimeUnit.MILLISECONDS.toNanos(i) * 1D).when(commitSnapshot).getValue(i * 0.1);
+        }
+
+
+        TransactionRateLimitingCallback commitCallback = new TransactionRateLimitingCallback(actorContext);
+        commitCallback.run();
+        commitCallback.success();
+
+        verify(actorContext).setTxCreationLimit(Matchers.doubleThat(approximately(292)));
+    }
+
+    @Test
+    public void testSuccessPercentileValueZero(){
+
+        for(int i=1;i<11;i++){
+            // Keep on increasing the amount of time it takes to complete transaction for each tenth of a
+            // percentile. Essentially this would be 1ms for the 10th percentile, 2ms for 20th percentile and so on.
+            doReturn(TimeUnit.MILLISECONDS.toNanos(i) * 1D).when(commitSnapshot).getValue(i * 0.1);
+        }
+
+        doReturn(TimeUnit.MILLISECONDS.toNanos(0) * 1D).when(commitSnapshot).getValue(0.1);
+
+        TransactionRateLimitingCallback commitCallback = new TransactionRateLimitingCallback(actorContext);
+        commitCallback.run();
+        commitCallback.success();
+
+        verify(actorContext).setTxCreationLimit(Matchers.doubleThat(approximately(192)));
+    }
+
+    @Test
+    public void testSuccessOnePercentileValueVeryHigh(){
+
+        for(int i=1;i<11;i++){
+            // Keep on increasing the amount of time it takes to complete transaction for each tenth of a
+            // percentile. Essentially this would be 1ms for the 10th percentile, 2ms for 20th percentile and so on.
+            doReturn(TimeUnit.MILLISECONDS.toNanos(i) * 1D).when(commitSnapshot).getValue(i * 0.1);
+        }
+
+        // ten seconds
+        doReturn(TimeUnit.MILLISECONDS.toNanos(10000) * 1D).when(commitSnapshot).getValue(1.0);
+
+        TransactionRateLimitingCallback commitCallback = new TransactionRateLimitingCallback(actorContext);
+        commitCallback.run();
+        commitCallback.success();
+
+        verify(actorContext).setTxCreationLimit(Matchers.doubleThat(approximately(282)));
+    }
+
+    @Test
+    public void testSuccessWithAllPercentileValueVeryHigh(){
+
+        for(int i=1;i<11;i++){
+            // Keep on increasing the amount of time it takes to complete transaction for each tenth of a
+            // percentile. Essentially this would be 1ms for the 10th percentile, 2ms for 20th percentile and so on.
+            doReturn(TimeUnit.MILLISECONDS.toNanos(10000) * 1D).when(commitSnapshot).getValue(i * 0.1);
+        }
+
+        TransactionRateLimitingCallback commitCallback = new TransactionRateLimitingCallback(actorContext);
+        commitCallback.run();
+        commitCallback.success();
+
+        verify(actorContext).setTxCreationLimit(Matchers.doubleThat(approximately(0)));
+    }
+
+    @Test
+    public void testSuccessWithRealPercentileValues(){
+
+        for(int i=1;i<11;i++){
+            // Keep on increasing the amount of time it takes to complete transaction for each tenth of a
+            // percentile. Essentially this would be 1ms for the 10th percentile, 2ms for 20th percentile and so on.
+            doReturn(TimeUnit.MILLISECONDS.toNanos(8) * 1D).when(commitSnapshot).getValue(i * 0.1);
+        }
+
+        doReturn(TimeUnit.MILLISECONDS.toNanos(20) * 1D).when(commitSnapshot).getValue( 0.7);
+        doReturn(TimeUnit.MILLISECONDS.toNanos(100) * 1D).when(commitSnapshot).getValue( 0.9);
+        doReturn(TimeUnit.MILLISECONDS.toNanos(200) * 1D).when(commitSnapshot).getValue( 1.0);
+
+        TransactionRateLimitingCallback commitCallback = new TransactionRateLimitingCallback(actorContext);
+        commitCallback.run();
+        commitCallback.success();
+
+        verify(actorContext).setTxCreationLimit(Matchers.doubleThat(approximately(101)));
+    }
+
+
+    @Test
+    public void testSuccessWithoutRun(){
+        TransactionRateLimitingCallback commitCallback = new TransactionRateLimitingCallback(actorContext);
+
+        try {
+            commitCallback.success();
+            fail("Expected IllegalStateException");
+        } catch(IllegalStateException e){
+
+        }
+
+        verify(actorContext, never()).setTxCreationLimit(anyDouble());
+
+    }
+
+
+    @Test
+    public void testFailure(){
+        TransactionRateLimitingCallback commitCallback = new TransactionRateLimitingCallback(actorContext);
+        commitCallback.run();
+        commitCallback.failure();
+
+        verify(actorContext, never()).setTxCreationLimit(anyDouble());
+
+    }
+
+    public Matcher<Double> approximately(final double val){
+        return new BaseMatcher<Double>() {
+            @Override
+            public boolean matches(Object o) {
+                Double aDouble = (Double) o;
+                return aDouble > val && aDouble < val+1;
+            }
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("> " + val +" < " + (val+1));
+            }
+        };
+    }
+
+
+}
\ No newline at end of file
index aac425b3d400ca9ed530230a0359740f4f3db74c..b9972fc0a09f9773db0270e51198209438df010e 100644 (file)
@@ -79,6 +79,7 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
         final ExecutorService executor = Executors.newCachedThreadPool();
         final Disruptor<DOMNotificationRouterEvent> disruptor = new Disruptor<>(DOMNotificationRouterEvent.FACTORY, queueDepth, executor, ProducerType.MULTI, DEFAULT_STRATEGY);
 
+        disruptor.handleEventsWith(DISPATCH_NOTIFICATIONS);
         disruptor.after(DISPATCH_NOTIFICATIONS).handleEventsWith(NOTIFY_FUTURE);
         disruptor.start();
 
index dfae165d30c3fba4059b0c4c4aa5fb9308b825f6..568ebde0d393aca1b1d66c660d2b8f801f1dad8b 100644 (file)
@@ -91,6 +91,8 @@ final class NetconfDeviceSalProvider implements AutoCloseable, Provider, Binding
         mountInstance.close();
         datastoreAdapter.close();
         datastoreAdapter = null;
+        topologyDatastoreAdapter.close();
+        topologyDatastoreAdapter = null;
     }
 
     static final class MountInstance implements AutoCloseable {
index 7f8f0a1d0e32478d4b977cefab1398a252c52c2a..7bb90c83aa8b06f53f1e0cd65a3eee20cc34f42f 100644 (file)
@@ -62,19 +62,19 @@ public interface RestconfService {
     @Path("/modules")
     @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
-    public StructuredData getModules(@Context UriInfo uriInfo);
+    public NormalizedNodeContext getModules(@Context UriInfo uriInfo);
 
     @GET
     @Path("/modules/{identifier:.+}")
     @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
-    public StructuredData getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
+    public NormalizedNodeContext getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
 
     @GET
     @Path("/modules/module/{identifier:.+}")
     @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
-    public StructuredData getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
+    public NormalizedNodeContext getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
 
     @GET
     @Path("/operations")
index 7a879f33779f1a41343d3cc48d39064c461f57b9..589f9cd662bf7f9ea8d456fba38ba7925595d84e 100644 (file)
@@ -8,13 +8,13 @@
 package org.opendaylight.controller.sal.rest.impl;
 
 import com.google.common.base.Charsets;
+import com.google.gson.stream.JsonWriter;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.net.URI;
-import java.util.Iterator;
 import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
@@ -34,7 +34,9 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter;
+import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactory;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter;
+import org.opendaylight.yangtools.yang.data.codec.gson.JsonWriterFactory;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -60,47 +62,66 @@ public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter<Normalize
             final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream)
                     throws IOException, WebApplicationException {
         NormalizedNode<?, ?> data = t.getData();
-        InstanceIdentifierContext context = t.getInstanceIdentifierContext();
-        DataSchemaNode schema = context.getSchemaNode();
-        SchemaPath path = context.getSchemaNode().getPath();
-        OutputStreamWriter outputWriter = new OutputStreamWriter(entityStream, Charsets.UTF_8);
         if (data == null) {
             throw new RestconfDocumentedException(Response.Status.NOT_FOUND);
         }
 
+        final InstanceIdentifierContext context = t.getInstanceIdentifierContext();
+
+        SchemaPath path = context.getSchemaNode().getPath();
         boolean isDataRoot = false;
-        URI initialNs = null;
-        outputWriter.write('{');
         if (SchemaPath.ROOT.equals(path)) {
             isDataRoot = true;
         } else {
             path = path.getParent();
             // FIXME: Add proper handling of reading root.
         }
-        if(!schema.isAugmenting() && !(schema instanceof SchemaContext)) {
-            initialNs = schema.getQName().getNamespace();
-        }
-        NormalizedNodeStreamWriter jsonWriter = JSONNormalizedNodeStreamWriter.create(context.getSchemaContext(),path,initialNs,outputWriter);
-        NormalizedNodeWriter nnWriter = NormalizedNodeWriter.forStreamWriter(jsonWriter);
+
+        JsonWriter jsonWriter = createJsonWriter(entityStream);
+        NormalizedNodeWriter nnWriter = createNormalizedNodeWriter(context,path,jsonWriter);
+
+        jsonWriter.beginObject();
         if(isDataRoot) {
-            writeDataRoot(outputWriter,nnWriter,(ContainerNode) data);
+            writeDataRoot(nnWriter,(ContainerNode) data);
         } else {
             if(data instanceof MapEntryNode) {
                 data = ImmutableNodes.mapNodeBuilder(data.getNodeType()).withChild(((MapEntryNode) data)).build();
             }
             nnWriter.write(data);
         }
+
         nnWriter.flush();
-        outputWriter.write('}');
-        outputWriter.flush();
+        jsonWriter.endObject();
+        jsonWriter.flush();
+    }
+
+    private NormalizedNodeWriter createNormalizedNodeWriter(InstanceIdentifierContext context, SchemaPath path, JsonWriter jsonWriter) {
+
+        final DataSchemaNode schema = context.getSchemaNode();
+        final JSONCodecFactory codecs = getCodecFactory(context);
+
+        URI initialNs = null;
+        if(!schema.isAugmenting() && !(schema instanceof SchemaContext)) {
+            initialNs = schema.getQName().getNamespace();
+        }
+        final NormalizedNodeStreamWriter streamWriter = JSONNormalizedNodeStreamWriter.createNestedWriter(codecs,path,initialNs,jsonWriter);
+        return NormalizedNodeWriter.forStreamWriter(streamWriter);
+    }
+
+    private JsonWriter createJsonWriter(OutputStream entityStream) {
+        // FIXME BUG-2153: Add pretty print support
+        return JsonWriterFactory.createJsonWriter(new OutputStreamWriter(entityStream, Charsets.UTF_8));
+
+    }
+
+    private JSONCodecFactory getCodecFactory(InstanceIdentifierContext context) {
+        // TODO: Performance: Cache JSON Codec factory and schema context
+        return JSONCodecFactory.create(context.getSchemaContext());
     }
 
-    private void writeDataRoot(OutputStreamWriter outputWriter, NormalizedNodeWriter nnWriter, ContainerNode data) throws IOException {
-        Iterator<DataContainerChild<? extends PathArgument, ?>> iterator = data.getValue().iterator();
-        while(iterator.hasNext()) {
-            DataContainerChild<? extends PathArgument, ?> child = iterator.next();
+    private void writeDataRoot(final NormalizedNodeWriter nnWriter, final ContainerNode data) throws IOException {
+        for(DataContainerChild<? extends PathArgument, ?> child : data.getValue()) {
             nnWriter.write(child);
-            nnWriter.flush();
         }
     }
 
index d36200614d1bc99a5329c88dde2e97143e8feba9..bac967cfaf87b674cab950f4ead5922d3d4041d3 100644 (file)
@@ -27,17 +27,17 @@ public class RestconfCompositeWrapper implements RestconfService, SchemaRetrieva
     }
 
     @Override
-    public StructuredData getModules(final UriInfo uriInfo) {
+    public NormalizedNodeContext getModules(final UriInfo uriInfo) {
         return restconf.getModules(uriInfo);
     }
 
     @Override
-    public StructuredData getModules(final String identifier, final UriInfo uriInfo) {
+    public NormalizedNodeContext getModules(final String identifier, final UriInfo uriInfo) {
         return restconf.getModules(identifier, uriInfo);
     }
 
     @Override
-    public StructuredData getModule(final String identifier, final UriInfo uriInfo) {
+    public NormalizedNodeContext getModule(final String identifier, final UriInfo uriInfo) {
         return restconf.getModule(identifier, uriInfo);
     }
 
index dd5124649331ccd56b18f45406465cca3de66fb1..f44ce951550b3cd01c940739568f197cd0e8e6fd 100644 (file)
@@ -63,13 +63,22 @@ import org.opendaylight.yangtools.yang.data.api.Node;
 import org.opendaylight.yangtools.yang.data.api.SimpleNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
+import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
+import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException;
 import org.opendaylight.yangtools.yang.data.composite.node.schema.cnsn.parser.CnSnToNormalizedNodeParserFactory;
 import org.opendaylight.yangtools.yang.data.impl.ImmutableCompositeNode;
 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.ListNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
@@ -163,11 +172,11 @@ public class RestconfImpl implements RestconfService {
         try {
             EVENT_SUBSCRIPTION_AUGMENT_REVISION = new SimpleDateFormat("yyyy-MM-dd").parse("2014-07-08");
             NETCONF_BASE_QNAME = QName.create(QNameModule.create(new URI(NETCONF_BASE), null), NETCONF_BASE_PAYLOAD_NAME );
-        } catch (ParseException e) {
+        } catch (final ParseException e) {
             throw new RestconfDocumentedException(
                     "It wasn't possible to convert revision date of sal-remote-augment to date", ErrorType.APPLICATION,
                     ErrorTag.OPERATION_FAILED);
-        } catch (URISyntaxException e) {
+        } catch (final URISyntaxException e) {
             throw new RestconfDocumentedException(
                     "It wasn't possible to create instance of URI class with "+NETCONF_BASE+" URI", ErrorType.APPLICATION,
                     ErrorTag.OPERATION_FAILED);
@@ -190,105 +199,114 @@ public class RestconfImpl implements RestconfService {
     }
 
     @Override
-    public StructuredData getModules(final UriInfo uriInfo) {
-        final Module restconfModule = this.getRestconfModule();
+    public NormalizedNodeContext getModules(final UriInfo uriInfo) {
+        final Set<Module> allModules = controllerContext.getAllModules();
+        final MapNode allModuleMap = makeModuleMapNode(allModules);
 
-        final List<Node<?>> modulesAsData = new ArrayList<Node<?>>();
-        final DataSchemaNode moduleSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
-                Draft02.RestConfModule.MODULE_LIST_SCHEMA_NODE);
+        final SchemaContext schemaContext = controllerContext.getGlobalSchema();
 
-        Set<Module> allModules = this.controllerContext.getAllModules();
-        for (final Module module : allModules) {
-            CompositeNode moduleCompositeNode = this.toModuleCompositeNode(module, moduleSchemaNode);
-            modulesAsData.add(moduleCompositeNode);
-        }
+        final Module restconfModule = getRestconfModule();
+        final DataSchemaNode modulesSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(
+                restconfModule, Draft02.RestConfModule.MODULES_CONTAINER_SCHEMA_NODE);
+        Preconditions.checkState(modulesSchemaNode instanceof ContainerSchemaNode);
+
+        final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> moduleContainerBuilder =
+                Builders.containerBuilder((ContainerSchemaNode) modulesSchemaNode);
+        moduleContainerBuilder.withChild(allModuleMap);
 
-        final DataSchemaNode modulesSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
-                Draft02.RestConfModule.MODULES_CONTAINER_SCHEMA_NODE);
-        QName qName = modulesSchemaNode.getQName();
-        final CompositeNode modulesNode = NodeFactory.createImmutableCompositeNode(qName, null, modulesAsData);
-        return new StructuredData(modulesNode, modulesSchemaNode, null, parsePrettyPrintParameter(uriInfo));
+        return new NormalizedNodeContext(new InstanceIdentifierContext(null, modulesSchemaNode,
+                null, schemaContext), moduleContainerBuilder.build());
     }
 
+    /**
+     * Valid only for mount point
+     */
     @Override
-    public StructuredData getAvailableStreams(final UriInfo uriInfo) {
-        Set<String> availableStreams = Notificator.getStreamNames();
-
-        final List<Node<?>> streamsAsData = new ArrayList<Node<?>>();
-        Module restconfModule = this.getRestconfModule();
-        final DataSchemaNode streamSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
-                Draft02.RestConfModule.STREAM_LIST_SCHEMA_NODE);
-        for (final String streamName : availableStreams) {
-            streamsAsData.add(this.toStreamCompositeNode(streamName, streamSchemaNode));
+    public NormalizedNodeContext getModules(final String identifier, final UriInfo uriInfo) {
+        Preconditions.checkNotNull(identifier);
+        if ( ! identifier.contains(ControllerContext.MOUNT)) {
+            final String errMsg = "URI has bad format. If modules behind mount point should be showed,"
+                    + " URI has to end with " + ControllerContext.MOUNT;
+            throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
 
-        final DataSchemaNode streamsSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
-                Draft02.RestConfModule.STREAMS_CONTAINER_SCHEMA_NODE);
-        QName qName = streamsSchemaNode.getQName();
-        final CompositeNode streamsNode = NodeFactory.createImmutableCompositeNode(qName, null, streamsAsData);
-        return new StructuredData(streamsNode, streamsSchemaNode, null, parsePrettyPrintParameter(uriInfo));
+        final InstanceIdentifierContext mountPointIdentifier = controllerContext.toMountPointIdentifier(identifier);
+        final DOMMountPoint mountPoint = mountPointIdentifier.getMountPoint();
+        final Set<Module> modules = controllerContext.getAllModules(mountPoint);
+        final SchemaContext schemaContext = mountPoint.getSchemaContext();
+        final MapNode mountPointModulesMap = makeModuleMapNode(modules);
+
+        final Module restconfModule = getRestconfModule();
+        final DataSchemaNode modulesSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(
+                restconfModule, Draft02.RestConfModule.MODULES_CONTAINER_SCHEMA_NODE);
+        Preconditions.checkState(modulesSchemaNode instanceof ContainerSchemaNode);
+
+        final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> moduleContainerBuilder =
+                Builders.containerBuilder((ContainerSchemaNode) modulesSchemaNode);
+        moduleContainerBuilder.withChild(mountPointModulesMap);
+
+        return new NormalizedNodeContext(new InstanceIdentifierContext(null, modulesSchemaNode,
+                mountPoint, schemaContext), moduleContainerBuilder.build());
     }
 
     @Override
-    public StructuredData getModules(final String identifier, final UriInfo uriInfo) {
-        Set<Module> modules = null;
+    public NormalizedNodeContext getModule(final String identifier, final UriInfo uriInfo) {
+        Preconditions.checkNotNull(identifier);
+        final QName moduleNameAndRevision = getModuleNameAndRevision(identifier);
+        Module module = null;
         DOMMountPoint mountPoint = null;
+        final SchemaContext schemaContext;
         if (identifier.contains(ControllerContext.MOUNT)) {
-            InstanceIdentifierContext mountPointIdentifier = this.controllerContext.toMountPointIdentifier(identifier);
+            final InstanceIdentifierContext mountPointIdentifier = controllerContext.toMountPointIdentifier(identifier);
             mountPoint = mountPointIdentifier.getMountPoint();
-            modules = this.controllerContext.getAllModules(mountPoint);
+            module = controllerContext.findModuleByNameAndRevision(mountPoint, moduleNameAndRevision);
+            schemaContext = mountPoint.getSchemaContext();
         } else {
-            throw new RestconfDocumentedException(
-                    "URI has bad format. If modules behind mount point should be showed, URI has to end with "
-                            + ControllerContext.MOUNT, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
+            module = controllerContext.findModuleByNameAndRevision(moduleNameAndRevision);
+            schemaContext = controllerContext.getGlobalSchema();
         }
 
-        final List<Node<?>> modulesAsData = new ArrayList<Node<?>>();
-        Module restconfModule = this.getRestconfModule();
-        final DataSchemaNode moduleSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
-                Draft02.RestConfModule.MODULE_LIST_SCHEMA_NODE);
-
-        for (final Module module : modules) {
-            modulesAsData.add(this.toModuleCompositeNode(module, moduleSchemaNode));
+        if (module == null) {
+            final String errMsg = "Module with name '" + moduleNameAndRevision.getLocalName()
+                    + "' and revision '" + moduleNameAndRevision.getRevision() + "' was not found.";
+            throw new RestconfDocumentedException(errMsg, ErrorType.PROTOCOL, ErrorTag.UNKNOWN_ELEMENT);
         }
 
-        final DataSchemaNode modulesSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
-                Draft02.RestConfModule.MODULES_CONTAINER_SCHEMA_NODE);
-        QName qName = modulesSchemaNode.getQName();
-        final CompositeNode modulesNode = NodeFactory.createImmutableCompositeNode(qName, null, modulesAsData);
-        return new StructuredData(modulesNode, modulesSchemaNode, mountPoint, parsePrettyPrintParameter(uriInfo));
+        final Module restconfModule = getRestconfModule();
+        final Set<Module> modules = Collections.singleton(module);
+        final MapNode moduleMap = makeModuleMapNode(modules);
+
+        final DataSchemaNode moduleSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(
+                restconfModule, Draft02.RestConfModule.MODULE_LIST_SCHEMA_NODE);
+        Preconditions.checkState(moduleSchemaNode instanceof ListSchemaNode);
+
+        return new NormalizedNodeContext(new InstanceIdentifierContext(null, moduleSchemaNode, mountPoint,
+                schemaContext), moduleMap);
     }
 
     @Override
-    public StructuredData getModule(final String identifier, final UriInfo uriInfo) {
-        final QName moduleNameAndRevision = this.getModuleNameAndRevision(identifier);
-        Module module = null;
-        DOMMountPoint mountPoint = null;
-        if (identifier.contains(ControllerContext.MOUNT)) {
-            InstanceIdentifierContext mountPointIdentifier = this.controllerContext.toMountPointIdentifier(identifier);
-            mountPoint = mountPointIdentifier.getMountPoint();
-            module = this.controllerContext.findModuleByNameAndRevision(mountPoint, moduleNameAndRevision);
-        } else {
-            module = this.controllerContext.findModuleByNameAndRevision(moduleNameAndRevision);
-        }
+    public StructuredData getAvailableStreams(final UriInfo uriInfo) {
+        final Set<String> availableStreams = Notificator.getStreamNames();
 
-        if (module == null) {
-            throw new RestconfDocumentedException("Module with name '" + moduleNameAndRevision.getLocalName()
-                    + "' and revision '" + moduleNameAndRevision.getRevision() + "' was not found.",
-                    ErrorType.PROTOCOL, ErrorTag.UNKNOWN_ELEMENT);
+        final List<Node<?>> streamsAsData = new ArrayList<Node<?>>();
+        final Module restconfModule = getRestconfModule();
+        final DataSchemaNode streamSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
+                Draft02.RestConfModule.STREAM_LIST_SCHEMA_NODE);
+        for (final String streamName : availableStreams) {
+            streamsAsData.add(toStreamCompositeNode(streamName, streamSchemaNode));
         }
 
-        Module restconfModule = this.getRestconfModule();
-        final DataSchemaNode moduleSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
-                Draft02.RestConfModule.MODULE_LIST_SCHEMA_NODE);
-        final CompositeNode moduleNode = this.toModuleCompositeNode(module, moduleSchemaNode);
-        return new StructuredData(moduleNode, moduleSchemaNode, mountPoint, parsePrettyPrintParameter(uriInfo));
+        final DataSchemaNode streamsSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(restconfModule,
+                Draft02.RestConfModule.STREAMS_CONTAINER_SCHEMA_NODE);
+        final QName qName = streamsSchemaNode.getQName();
+        final CompositeNode streamsNode = NodeFactory.createImmutableCompositeNode(qName, null, streamsAsData);
+        return new StructuredData(streamsNode, streamsSchemaNode, null, parsePrettyPrintParameter(uriInfo));
     }
 
     @Override
     public StructuredData getOperations(final UriInfo uriInfo) {
-        Set<Module> allModules = this.controllerContext.getAllModules();
-        return this.operationsFromModulesToStructuredData(allModules, null, parsePrettyPrintParameter(uriInfo));
+        final Set<Module> allModules = controllerContext.getAllModules();
+        return operationsFromModulesToStructuredData(allModules, null, parsePrettyPrintParameter(uriInfo));
     }
 
     @Override
@@ -296,56 +314,56 @@ public class RestconfImpl implements RestconfService {
         Set<Module> modules = null;
         DOMMountPoint mountPoint = null;
         if (identifier.contains(ControllerContext.MOUNT)) {
-            InstanceIdentifierContext mountPointIdentifier = this.controllerContext.toMountPointIdentifier(identifier);
+            final InstanceIdentifierContext mountPointIdentifier = controllerContext.toMountPointIdentifier(identifier);
             mountPoint = mountPointIdentifier.getMountPoint();
-            modules = this.controllerContext.getAllModules(mountPoint);
+            modules = controllerContext.getAllModules(mountPoint);
         } else {
             throw new RestconfDocumentedException(
                     "URI has bad format. If operations behind mount point should be showed, URI has to end with "
                             + ControllerContext.MOUNT, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
 
-        return this.operationsFromModulesToStructuredData(modules, mountPoint, parsePrettyPrintParameter(uriInfo));
+        return operationsFromModulesToStructuredData(modules, mountPoint, parsePrettyPrintParameter(uriInfo));
     }
 
     private StructuredData operationsFromModulesToStructuredData(final Set<Module> modules,
             final DOMMountPoint mountPoint, final boolean prettyPrint) {
         final List<Node<?>> operationsAsData = new ArrayList<Node<?>>();
-        Module restconfModule = this.getRestconfModule();
+        final Module restconfModule = getRestconfModule();
         final DataSchemaNode operationsSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(
                 restconfModule, Draft02.RestConfModule.OPERATIONS_CONTAINER_SCHEMA_NODE);
-        QName qName = operationsSchemaNode.getQName();
-        SchemaPath path = operationsSchemaNode.getPath();
-        ContainerSchemaNodeBuilder containerSchemaNodeBuilder = new ContainerSchemaNodeBuilder(
+        final QName qName = operationsSchemaNode.getQName();
+        final SchemaPath path = operationsSchemaNode.getPath();
+        final ContainerSchemaNodeBuilder containerSchemaNodeBuilder = new ContainerSchemaNodeBuilder(
                 Draft02.RestConfModule.NAME, 0, qName, path);
         final ContainerSchemaNodeBuilder fakeOperationsSchemaNode = containerSchemaNodeBuilder;
         for (final Module module : modules) {
-            Set<RpcDefinition> rpcs = module.getRpcs();
+            final Set<RpcDefinition> rpcs = module.getRpcs();
             for (final RpcDefinition rpc : rpcs) {
-                QName rpcQName = rpc.getQName();
-                SimpleNode<Object> immutableSimpleNode = NodeFactory.<Object> createImmutableSimpleNode(rpcQName, null,
+                final QName rpcQName = rpc.getQName();
+                final SimpleNode<Object> immutableSimpleNode = NodeFactory.<Object> createImmutableSimpleNode(rpcQName, null,
                         null);
                 operationsAsData.add(immutableSimpleNode);
 
-                String name = module.getName();
-                LeafSchemaNodeBuilder leafSchemaNodeBuilder = new LeafSchemaNodeBuilder(name, 0, rpcQName,
+                final String name = module.getName();
+                final LeafSchemaNodeBuilder leafSchemaNodeBuilder = new LeafSchemaNodeBuilder(name, 0, rpcQName,
                         SchemaPath.create(true, QName.create("dummy")));
                 final LeafSchemaNodeBuilder fakeRpcSchemaNode = leafSchemaNodeBuilder;
                 fakeRpcSchemaNode.setAugmenting(true);
 
-                EmptyType instance = EmptyType.getInstance();
+                final EmptyType instance = EmptyType.getInstance();
                 fakeRpcSchemaNode.setType(instance);
                 fakeOperationsSchemaNode.addChildNode(fakeRpcSchemaNode.build());
             }
         }
 
         final CompositeNode operationsNode = NodeFactory.createImmutableCompositeNode(qName, null, operationsAsData);
-        ContainerSchemaNode schemaNode = fakeOperationsSchemaNode.build();
+        final ContainerSchemaNode schemaNode = fakeOperationsSchemaNode.build();
         return new StructuredData(operationsNode, schemaNode, mountPoint, prettyPrint);
     }
 
     private Module getRestconfModule() {
-        Module restconfModule = controllerContext.getRestconfModule();
+        final Module restconfModule = controllerContext.getRestconfModule();
         if (restconfModule == null) {
             throw new RestconfDocumentedException("ietf-restconf module was not found.", ErrorType.APPLICATION,
                     ErrorTag.OPERATION_NOT_SUPPORTED);
@@ -363,8 +381,8 @@ public class RestconfImpl implements RestconfService {
             moduleNameAndRevision = identifier;
         }
 
-        Splitter splitter = Splitter.on("/").omitEmptyStrings();
-        Iterable<String> split = splitter.split(moduleNameAndRevision);
+        final Splitter splitter = Splitter.on("/").omitEmptyStrings();
+        final Iterable<String> split = splitter.split(moduleNameAndRevision);
         final List<String> pathArgs = Lists.<String> newArrayList(split);
         if (pathArgs.size() < 2) {
             throw new RestconfDocumentedException(
@@ -374,10 +392,10 @@ public class RestconfImpl implements RestconfService {
 
         try {
             final String moduleName = pathArgs.get(0);
-            String revision = pathArgs.get(1);
+            final String revision = pathArgs.get(1);
             final Date moduleRevision = REVISION_FORMAT.parse(revision);
             return QName.create(null, moduleRevision, moduleName);
-        } catch (ParseException e) {
+        } catch (final ParseException e) {
             throw new RestconfDocumentedException("URI has bad format. It should be \'moduleName/yyyy-MM-dd\'",
                     ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
@@ -428,7 +446,7 @@ public class RestconfImpl implements RestconfService {
         instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(
                 ((DataNodeContainer) moduleSchemaNode), "revision");
         final DataSchemaNode revisionSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
-        Date _revision = module.getRevision();
+        final Date _revision = module.getRevision();
         moduleNodeValues.add(NodeFactory.<String> createImmutableSimpleNode(revisionSchemaNode.getQName(), null,
                 REVISION_FORMAT.format(_revision)));
 
@@ -456,9 +474,9 @@ public class RestconfImpl implements RestconfService {
 
     @Override
     public StructuredData invokeRpc(final String identifier, final CompositeNode payload, final UriInfo uriInfo) {
-        final RpcExecutor rpc = this.resolveIdentifierInInvokeRpc(identifier);
-        QName rpcName = rpc.getRpcDefinition().getQName();
-        URI rpcNamespace = rpcName.getNamespace();
+        final RpcExecutor rpc = resolveIdentifierInInvokeRpc(identifier);
+        final QName rpcName = rpc.getRpcDefinition().getQName();
+        final URI rpcNamespace = rpcName.getNamespace();
         if (Objects.equal(rpcNamespace.toString(), SAL_REMOTE_NAMESPACE)
                 && Objects.equal(rpcName.getLocalName(), SAL_REMOTE_RPC_SUBSRCIBE)) {
             return invokeSalRemoteRpcSubscribeRPC(payload, rpc.getRpcDefinition(), parsePrettyPrintParameter(uriInfo));
@@ -500,7 +518,7 @@ public class RestconfImpl implements RestconfService {
         final YangInstanceIdentifier pathIdentifier = ((YangInstanceIdentifier) pathValue);
         String streamName = null;
         if (!Iterables.isEmpty(pathIdentifier.getPathArguments())) {
-            String fullRestconfIdentifier = this.controllerContext.toFullRestconfIdentifier(pathIdentifier);
+            final String fullRestconfIdentifier = controllerContext.toFullRestconfIdentifier(pathIdentifier);
 
             LogicalDatastoreType datastore = parseEnumTypeParameter(value, LogicalDatastoreType.class,
                     DATASTORE_PARAM_NAME);
@@ -547,12 +565,12 @@ public class RestconfImpl implements RestconfService {
         DOMMountPoint mountPoint = null;
         if (identifier.contains(ControllerContext.MOUNT)) {
             // mounted RPC call - look up mount instance.
-            InstanceIdentifierContext mountPointId = controllerContext.toMountPointIdentifier(identifier);
+            final InstanceIdentifierContext mountPointId = controllerContext.toMountPointIdentifier(identifier);
             mountPoint = mountPointId.getMountPoint();
 
-            int startOfRemoteRpcName = identifier.lastIndexOf(ControllerContext.MOUNT)
+            final int startOfRemoteRpcName = identifier.lastIndexOf(ControllerContext.MOUNT)
                     + ControllerContext.MOUNT.length() + 1;
-            String remoteRpcName = identifier.substring(startOfRemoteRpcName);
+            final String remoteRpcName = identifier.substring(startOfRemoteRpcName);
             identifierEncoded = remoteRpcName;
 
         } else if (identifier.indexOf("/") != CHAR_NOT_FOUND) {
@@ -591,9 +609,9 @@ public class RestconfImpl implements RestconfService {
                     + " couldn't be splitted to 2 parts (module:rpc name)", ErrorType.APPLICATION,
                     ErrorTag.INVALID_VALUE);
         }
-        for (Module module : schemaContext.getModules()) {
+        for (final Module module : schemaContext.getModules()) {
             if (module.getName().equals(splittedIdentifier[0])) {
-                for (RpcDefinition rpcDefinition : module.getRpcs()) {
+                for (final RpcDefinition rpcDefinition : module.getRpcs()) {
                     if (rpcDefinition.getQName().getLocalName().equals(splittedIdentifier[1])) {
                         return rpcDefinition;
                     }
@@ -609,18 +627,18 @@ public class RestconfImpl implements RestconfService {
         }
 
         CompositeNode rpcRequest = null;
-        RpcDefinition rpc = rpcExecutor.getRpcDefinition();
-        QName rpcName = rpc.getQName();
+        final RpcDefinition rpc = rpcExecutor.getRpcDefinition();
+        final QName rpcName = rpc.getQName();
 
         if (payload == null) {
             rpcRequest = NodeFactory.createMutableCompositeNode(rpcName, null, null, null, null);
         } else {
             final CompositeNode value = this.normalizeNode(payload, rpc.getInput(), null);
-            List<Node<?>> input = Collections.<Node<?>> singletonList(value);
+            final List<Node<?>> input = Collections.<Node<?>> singletonList(value);
             rpcRequest = NodeFactory.createMutableCompositeNode(rpcName, null, input, null, null);
         }
 
-        RpcResult<CompositeNode> rpcResult = rpcExecutor.invokeRpc(rpcRequest);
+        final RpcResult<CompositeNode> rpcResult = rpcExecutor.invokeRpc(rpcRequest);
 
         checkRpcSuccessAndThrowException(rpcResult);
 
@@ -646,7 +664,7 @@ public class RestconfImpl implements RestconfService {
     @Override
     public NormalizedNodeContext readConfigurationData(final String identifier, final UriInfo uriInfo) {
         final InstanceIdentifierContext iiWithData = controllerContext.toInstanceIdentifier(identifier);
-        DOMMountPoint mountPoint = iiWithData.getMountPoint();
+        final DOMMountPoint mountPoint = iiWithData.getMountPoint();
         NormalizedNode<?, ?> data = null;
         YangInstanceIdentifier normalizedII;
         if (mountPoint != null) {
@@ -667,9 +685,9 @@ public class RestconfImpl implements RestconfService {
         }
 
         if (node instanceof CompositeNode) {
-            ImmutableList.Builder<Node<?>> newChildNodes = ImmutableList.<Node<?>> builder();
+            final ImmutableList.Builder<Node<?>> newChildNodes = ImmutableList.<Node<?>> builder();
             if (depth > 1) {
-                for (Node<?> childNode : ((CompositeNode) node).getValue()) {
+                for (final Node<?> childNode : ((CompositeNode) node).getValue()) {
                     newChildNodes.add(pruneDataAtDepth(childNode, depth - 1));
                 }
             }
@@ -681,13 +699,13 @@ public class RestconfImpl implements RestconfService {
     }
 
     private Integer parseDepthParameter(final UriInfo info) {
-        String param = info.getQueryParameters(false).getFirst(UriParameters.DEPTH.toString());
+        final String param = info.getQueryParameters(false).getFirst(UriParameters.DEPTH.toString());
         if (Strings.isNullOrEmpty(param) || "unbounded".equals(param)) {
             return null;
         }
 
         try {
-            Integer depth = Integer.valueOf(param);
+            final Integer depth = Integer.valueOf(param);
             if (depth < 1) {
                 throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
                         "Invalid depth parameter: " + depth, null,
@@ -695,7 +713,7 @@ public class RestconfImpl implements RestconfService {
             }
 
             return depth;
-        } catch (NumberFormatException e) {
+        } catch (final NumberFormatException e) {
             throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
                     "Invalid depth parameter: " + e.getMessage(), null,
                     "The depth parameter must be an integer > 1 or \"unbounded\""));
@@ -705,7 +723,7 @@ public class RestconfImpl implements RestconfService {
     @Override
     public NormalizedNodeContext readOperationalData(final String identifier, final UriInfo info) {
         final InstanceIdentifierContext iiWithData = controllerContext.toInstanceIdentifier(identifier);
-        DOMMountPoint mountPoint = iiWithData.getMountPoint();
+        final DOMMountPoint mountPoint = iiWithData.getMountPoint();
         NormalizedNode<?, ?> data = null;
         YangInstanceIdentifier normalizedII;
         if (mountPoint != null) {
@@ -721,17 +739,17 @@ public class RestconfImpl implements RestconfService {
     }
 
     private boolean parsePrettyPrintParameter(final UriInfo info) {
-        String param = info.getQueryParameters(false).getFirst(UriParameters.PRETTY_PRINT.toString());
+        final String param = info.getQueryParameters(false).getFirst(UriParameters.PRETTY_PRINT.toString());
         return Boolean.parseBoolean(param);
     }
 
     @Override
     public Response updateConfigurationData(final String identifier, final Node<?> payload) {
-        final InstanceIdentifierContext iiWithData = this.controllerContext.toInstanceIdentifier(identifier);
+        final InstanceIdentifierContext iiWithData = controllerContext.toInstanceIdentifier(identifier);
 
         validateInput(iiWithData.getSchemaNode(), payload);
 
-        DOMMountPoint mountPoint = iiWithData.getMountPoint();
+        final DOMMountPoint mountPoint = iiWithData.getMountPoint();
         validateTopLevelNodeName(payload, iiWithData.getInstanceIdentifier());
         final CompositeNode value = this.normalizeNode(payload, iiWithData.getSchemaNode(), mountPoint);
         validateListKeysEqualityInPayloadAndUri(iiWithData, value);
@@ -772,7 +790,7 @@ public class RestconfImpl implements RestconfService {
                 }
 
                 break;
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 if(e instanceof OptimisticLockFailedException) {
                     if(--tries <= 0) {
                         LOG.debug("Got OptimisticLockFailedException on last try - failing");
@@ -834,7 +852,7 @@ public class RestconfImpl implements RestconfService {
 
     private void isEqualUriAndPayloadKeyValues(final Map<QName, Object> uriKeyValues, final CompositeNode payload,
             final List<QName> keyDefinitions) {
-        for (QName keyDefinition : keyDefinitions) {
+        for (final QName keyDefinition : keyDefinitions) {
             final Object uriKeyValue = uriKeyValues.get(keyDefinition);
             // should be caught during parsing URI to InstanceIdentifier
             if (uriKeyValue == null) {
@@ -847,7 +865,7 @@ public class RestconfImpl implements RestconfService {
                         + " in the message body.", ErrorType.PROTOCOL, ErrorTag.DATA_MISSING);
             }
 
-            Object payloadKeyValue = payloadKeyValues.iterator().next().getValue();
+            final Object payloadKeyValue = payloadKeyValues.iterator().next().getValue();
             if (!uriKeyValue.equals(payloadKeyValue)) {
                 throw new RestconfDocumentedException("The value '" + uriKeyValue + "' for key '"
                         + keyDefinition.getLocalName() + "' specified in the URI doesn't match the value '"
@@ -863,7 +881,7 @@ public class RestconfImpl implements RestconfService {
             throw new RestconfDocumentedException("Input is required.", ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE);
         }
 
-        URI payloadNS = this.namespace(payload);
+        final URI payloadNS = namespace(payload);
         if (payloadNS == null) {
             throw new RestconfDocumentedException(
                     "Data has bad format. Root element node must have namespace (XML format) or module name(JSON format)",
@@ -872,27 +890,27 @@ public class RestconfImpl implements RestconfService {
 
         InstanceIdentifierContext iiWithData = null;
         CompositeNode value = null;
-        if (this.representsMountPointRootData(payload)) {
+        if (representsMountPointRootData(payload)) {
             // payload represents mount point data and URI represents path to the mount point
 
-            if (this.endsWithMountPoint(identifier)) {
+            if (endsWithMountPoint(identifier)) {
                 throw new RestconfDocumentedException("URI has bad format. URI should be without \""
                         + ControllerContext.MOUNT + "\" for POST operation.", ErrorType.PROTOCOL,
                         ErrorTag.INVALID_VALUE);
             }
 
-            final String completeIdentifier = this.addMountPointIdentifier(identifier);
-            iiWithData = this.controllerContext.toInstanceIdentifier(completeIdentifier);
+            final String completeIdentifier = addMountPointIdentifier(identifier);
+            iiWithData = controllerContext.toInstanceIdentifier(completeIdentifier);
 
             value = this.normalizeNode(payload, iiWithData.getSchemaNode(), iiWithData.getMountPoint());
         } else {
-            final InstanceIdentifierContext incompleteInstIdWithData = this.controllerContext
+            final InstanceIdentifierContext incompleteInstIdWithData = controllerContext
                     .toInstanceIdentifier(identifier);
             final DataNodeContainer parentSchema = (DataNodeContainer) incompleteInstIdWithData.getSchemaNode();
-            DOMMountPoint mountPoint = incompleteInstIdWithData.getMountPoint();
+            final DOMMountPoint mountPoint = incompleteInstIdWithData.getMountPoint();
             final Module module = findModule(mountPoint, payload);
 
-            String payloadName = this.getName(payload);
+            final String payloadName = getName(payload);
             final DataSchemaNode schemaNode = ControllerContext.findInstanceDataChildByNameAndNamespace(
                     parentSchema, payloadName, module.getNamespace());
             value = this.normalizeNode(payload, schemaNode, mountPoint);
@@ -902,7 +920,7 @@ public class RestconfImpl implements RestconfService {
 
         final NormalizedNode<?, ?> datastoreNormalizedData = compositeNodeToDatastoreNormalizedNode(value,
                 iiWithData.getSchemaNode());
-        DOMMountPoint mountPoint = iiWithData.getMountPoint();
+        final DOMMountPoint mountPoint = iiWithData.getMountPoint();
         YangInstanceIdentifier normalizedII;
 
         try {
@@ -914,9 +932,9 @@ public class RestconfImpl implements RestconfService {
                 normalizedII = controllerContext.toNormalized(iiWithData.getInstanceIdentifier());
                 broker.commitConfigurationDataPost(normalizedII, datastoreNormalizedData);
             }
-        } catch(RestconfDocumentedException e) {
+        } catch(final RestconfDocumentedException e) {
             throw e;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RestconfDocumentedException("Error creating data", e);
         }
 
@@ -929,7 +947,7 @@ public class RestconfImpl implements RestconfService {
             throw new RestconfDocumentedException("Input is required.", ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE);
         }
 
-        URI payloadNS = this.namespace(payload);
+        final URI payloadNS = namespace(payload);
         if (payloadNS == null) {
             throw new RestconfDocumentedException(
                     "Data has bad format. Root element node must have namespace (XML format) or module name(JSON format)",
@@ -938,13 +956,13 @@ public class RestconfImpl implements RestconfService {
 
         final Module module = this.findModule(null, payload);
 
-        String payloadName = this.getName(payload);
+        final String payloadName = getName(payload);
         final DataSchemaNode schemaNode = ControllerContext.findInstanceDataChildByNameAndNamespace(module,
                 payloadName, module.getNamespace());
         final CompositeNode value = this.normalizeNode(payload, schemaNode, null);
-        final InstanceIdentifierContext iiWithData = this.addLastIdentifierFromData(null, value, schemaNode,ControllerContext.getInstance().getGlobalSchema());
+        final InstanceIdentifierContext iiWithData = addLastIdentifierFromData(null, value, schemaNode,ControllerContext.getInstance().getGlobalSchema());
         final NormalizedNode<?, ?> datastoreNormalizedData = compositeNodeToDatastoreNormalizedNode(value, schemaNode);
-        DOMMountPoint mountPoint = iiWithData.getMountPoint();
+        final DOMMountPoint mountPoint = iiWithData.getMountPoint();
         YangInstanceIdentifier normalizedII;
 
         try {
@@ -957,9 +975,9 @@ public class RestconfImpl implements RestconfService {
                 normalizedII = controllerContext.toNormalized(iiWithData.getInstanceIdentifier());
                 broker.commitConfigurationDataPost(normalizedII, datastoreNormalizedData);
             }
-        } catch(RestconfDocumentedException e) {
+        } catch(final RestconfDocumentedException e) {
             throw e;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RestconfDocumentedException("Error creating data", e);
         }
 
@@ -969,7 +987,7 @@ public class RestconfImpl implements RestconfService {
     @Override
     public Response deleteConfigurationData(final String identifier) {
         final InstanceIdentifierContext iiWithData = controllerContext.toInstanceIdentifier(identifier);
-        DOMMountPoint mountPoint = iiWithData.getMountPoint();
+        final DOMMountPoint mountPoint = iiWithData.getMountPoint();
         YangInstanceIdentifier normalizedII;
 
         try {
@@ -981,7 +999,7 @@ public class RestconfImpl implements RestconfService {
                 normalizedII = controllerContext.toNormalized(iiWithData.getInstanceIdentifier());
                 broker.commitConfigurationDataDelete(normalizedII).get();
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             final Optional<Throwable> searchedException = Iterables.tryFind(Throwables.getCausalChain(e),
                     Predicates.instanceOf(ModifiedNodeDoesNotExistException.class));
             if (searchedException.isPresent()) {
@@ -1013,14 +1031,14 @@ public class RestconfImpl implements RestconfService {
             throw new RestconfDocumentedException("Stream was not found.", ErrorType.PROTOCOL, ErrorTag.UNKNOWN_ELEMENT);
         }
 
-        Map<String, String> paramToValues = resolveValuesFromUri(identifier);
-        LogicalDatastoreType datastore = parserURIEnumParameter(LogicalDatastoreType.class,
+        final Map<String, String> paramToValues = resolveValuesFromUri(identifier);
+        final LogicalDatastoreType datastore = parserURIEnumParameter(LogicalDatastoreType.class,
                 paramToValues.get(DATASTORE_PARAM_NAME));
         if (datastore == null) {
             throw new RestconfDocumentedException("Stream name doesn't contains datastore value (pattern /datastore=)",
                     ErrorType.APPLICATION, ErrorTag.MISSING_ATTRIBUTE);
         }
-        DataChangeScope scope = parserURIEnumParameter(DataChangeScope.class, paramToValues.get(SCOPE_PARAM_NAME));
+        final DataChangeScope scope = parserURIEnumParameter(DataChangeScope.class, paramToValues.get(SCOPE_PARAM_NAME));
         if (scope == null) {
             throw new RestconfDocumentedException("Stream name doesn't contains datastore value (pattern /scope=)",
                     ErrorType.APPLICATION, ErrorTag.MISSING_ATTRIBUTE);
@@ -1031,12 +1049,12 @@ public class RestconfImpl implements RestconfService {
         final UriBuilder uriBuilder = uriInfo.getAbsolutePathBuilder();
         int notificationPort = NOTIFICATION_PORT;
         try {
-            WebSocketServer webSocketServerInstance = WebSocketServer.getInstance();
+            final WebSocketServer webSocketServerInstance = WebSocketServer.getInstance();
             notificationPort = webSocketServerInstance.getPort();
-        } catch (NullPointerException e) {
+        } catch (final NullPointerException e) {
             WebSocketServer.createInstance(NOTIFICATION_PORT);
         }
-        UriBuilder port = uriBuilder.port(notificationPort);
+        final UriBuilder port = uriBuilder.port(notificationPort);
         final URI uriToWebsocketServer = port.replacePath(streamName).build();
 
         return Response.status(Status.OK).location(uriToWebsocketServer).build();
@@ -1051,13 +1069,13 @@ public class RestconfImpl implements RestconfService {
      */
     private <T> T parseEnumTypeParameter(final CompositeNode compNode, final Class<T> classDescriptor,
             final String paramName) {
-        QNameModule salRemoteAugment = QNameModule.create(NAMESPACE_EVENT_SUBSCRIPTION_AUGMENT,
+        final QNameModule salRemoteAugment = QNameModule.create(NAMESPACE_EVENT_SUBSCRIPTION_AUGMENT,
                 EVENT_SUBSCRIPTION_AUGMENT_REVISION);
-        SimpleNode<?> simpleNode = compNode.getFirstSimpleByName(QName.create(salRemoteAugment, paramName));
+        final SimpleNode<?> simpleNode = compNode.getFirstSimpleByName(QName.create(salRemoteAugment, paramName));
         if (simpleNode == null) {
             return null;
         }
-        Object rawValue = simpleNode.getValue();
+        final Object rawValue = simpleNode.getValue();
         if (!(rawValue instanceof String)) {
             return null;
         }
@@ -1079,9 +1097,9 @@ public class RestconfImpl implements RestconfService {
     }
 
     private <T> T resolveAsEnum(final Class<T> classDescriptor, final String value) {
-        T[] enumConstants = classDescriptor.getEnumConstants();
+        final T[] enumConstants = classDescriptor.getEnumConstants();
         if (enumConstants != null) {
-            for (T enm : classDescriptor.getEnumConstants()) {
+            for (final T enm : classDescriptor.getEnumConstants()) {
                 if (((Enum<?>) enm).name().equals(value)) {
                     return enm;
                 }
@@ -1091,10 +1109,10 @@ public class RestconfImpl implements RestconfService {
     }
 
     private Map<String, String> resolveValuesFromUri(final String uri) {
-        Map<String, String> result = new HashMap<>();
-        String[] tokens = uri.split("/");
+        final Map<String, String> result = new HashMap<>();
+        final String[] tokens = uri.split("/");
         for (int i = 1; i < tokens.length; i++) {
-            String[] parameterTokens = tokens[i].split("=");
+            final String[] parameterTokens = tokens[i].split("=");
             if (parameterTokens.length == 2) {
                 result.put(parameterTokens[0], parameterTokens[1]);
             }
@@ -1107,11 +1125,11 @@ public class RestconfImpl implements RestconfService {
         if (data instanceof NodeWrapper) {
             module = findModule(mountPoint, (NodeWrapper<?>) data);
         } else if (data != null) {
-            URI namespace = data.getNodeType().getNamespace();
+            final URI namespace = data.getNodeType().getNamespace();
             if (mountPoint != null) {
-                module = this.controllerContext.findModuleByNamespace(mountPoint, namespace);
+                module = controllerContext.findModuleByNamespace(mountPoint, namespace);
             } else {
-                module = this.controllerContext.findModuleByNamespace(namespace);
+                module = controllerContext.findModuleByNamespace(namespace);
             }
         }
         if (module != null) {
@@ -1123,19 +1141,19 @@ public class RestconfImpl implements RestconfService {
     }
 
     private Module findModule(final DOMMountPoint mountPoint, final NodeWrapper<?> data) {
-        URI namespace = data.getNamespace();
+        final URI namespace = data.getNamespace();
         Preconditions.<URI> checkNotNull(namespace);
 
         Module module = null;
         if (mountPoint != null) {
-            module = this.controllerContext.findModuleByNamespace(mountPoint, namespace);
+            module = controllerContext.findModuleByNamespace(mountPoint, namespace);
             if (module == null) {
-                module = this.controllerContext.findModuleByName(mountPoint, namespace.toString());
+                module = controllerContext.findModuleByName(mountPoint, namespace.toString());
             }
         } else {
-            module = this.controllerContext.findModuleByNamespace(namespace);
+            module = controllerContext.findModuleByNamespace(namespace);
             if (module == null) {
-                module = this.controllerContext.findModuleByName(namespace.toString());
+                module = controllerContext.findModuleByName(namespace.toString());
             }
         }
 
@@ -1143,7 +1161,7 @@ public class RestconfImpl implements RestconfService {
     }
 
     private InstanceIdentifierContext addLastIdentifierFromData(final InstanceIdentifierContext identifierWithSchemaNode,
-            final CompositeNode data, final DataSchemaNode schemaOfData, SchemaContext schemaContext) {
+            final CompositeNode data, final DataSchemaNode schemaOfData, final SchemaContext schemaContext) {
         YangInstanceIdentifier instanceIdentifier = null;
         if (identifierWithSchemaNode != null) {
             instanceIdentifier = identifierWithSchemaNode.getInstanceIdentifier();
@@ -1158,15 +1176,15 @@ public class RestconfImpl implements RestconfService {
         }
 
         if ((schemaOfData instanceof ListSchemaNode)) {
-            HashMap<QName, Object> keys = this.resolveKeysFromData(((ListSchemaNode) schemaOfData), data);
+            final HashMap<QName, Object> keys = resolveKeysFromData(((ListSchemaNode) schemaOfData), data);
             iiBuilder.nodeWithKey(schemaOfData.getQName(), keys);
         } else {
             iiBuilder.node(schemaOfData.getQName());
         }
 
-        YangInstanceIdentifier instance = iiBuilder.toInstance();
+        final YangInstanceIdentifier instance = iiBuilder.toInstance();
         DOMMountPoint mountPoint = null;
-        SchemaContext schemaCtx = null;
+        final SchemaContext schemaCtx = null;
         if (identifierWithSchemaNode != null) {
             mountPoint = identifierWithSchemaNode.getMountPoint();
         }
@@ -1176,11 +1194,11 @@ public class RestconfImpl implements RestconfService {
 
     private HashMap<QName, Object> resolveKeysFromData(final ListSchemaNode listNode, final CompositeNode dataNode) {
         final HashMap<QName, Object> keyValues = new HashMap<QName, Object>();
-        List<QName> _keyDefinition = listNode.getKeyDefinition();
+        final List<QName> _keyDefinition = listNode.getKeyDefinition();
         for (final QName key : _keyDefinition) {
             SimpleNode<? extends Object> head = null;
-            String localName = key.getLocalName();
-            List<SimpleNode<? extends Object>> simpleNodesByName = dataNode.getSimpleNodesByName(localName);
+            final String localName = key.getLocalName();
+            final List<SimpleNode<? extends Object>> simpleNodesByName = dataNode.getSimpleNodesByName(localName);
             if (simpleNodesByName != null) {
                 head = Iterables.getFirst(simpleNodesByName, null);
             }
@@ -1207,16 +1225,16 @@ public class RestconfImpl implements RestconfService {
     }
 
     private boolean representsMountPointRootData(final Node<?> data) {
-        URI namespace = this.namespace(data);
+        final URI namespace = namespace(data);
         return (SchemaContext.NAME.getNamespace().equals(namespace) /*
          * || MOUNT_POINT_MODULE_NAME .equals( namespace .
          * toString( ) )
          */)
-         && SchemaContext.NAME.getLocalName().equals(this.localName(data));
+         && SchemaContext.NAME.getLocalName().equals(localName(data));
     }
 
     private String addMountPointIdentifier(final String identifier) {
-        boolean endsWith = identifier.endsWith("/");
+        final boolean endsWith = identifier.endsWith("/");
         if (endsWith) {
             return (identifier + ControllerContext.MOUNT);
         }
@@ -1226,7 +1244,7 @@ public class RestconfImpl implements RestconfService {
 
     private CompositeNode normalizeNode(final Node<?> node, final DataSchemaNode schema, final DOMMountPoint mountPoint) {
         if (schema == null) {
-            String localName = node == null ? null :
+            final String localName = node == null ? null :
                     node instanceof NodeWrapper ? ((NodeWrapper<?>)node).getLocalName() :
                     node.getNodeType().getLocalName();
 
@@ -1241,13 +1259,13 @@ public class RestconfImpl implements RestconfService {
 
         if ((node instanceof NodeWrapper<?>)) {
             NodeWrapper<?> nodeWrap = (NodeWrapper<?>) node;
-            boolean isChangeAllowed = ((NodeWrapper<?>) node).isChangeAllowed();
+            final boolean isChangeAllowed = ((NodeWrapper<?>) node).isChangeAllowed();
             if (isChangeAllowed) {
                 nodeWrap = topLevelElementAsCompositeNodeWrapper((NodeWrapper<?>) node, schema);
                 try {
                     this.normalizeNode(nodeWrap, schema, null, mountPoint);
-                } catch (IllegalArgumentException e) {
-                    RestconfDocumentedException restconfDocumentedException = new RestconfDocumentedException(e.getMessage(), ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
+                } catch (final IllegalArgumentException e) {
+                    final RestconfDocumentedException restconfDocumentedException = new RestconfDocumentedException(e.getMessage(), ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
                     restconfDocumentedException.addSuppressed(e);
                     throw restconfDocumentedException;
                 }
@@ -1276,7 +1294,7 @@ public class RestconfImpl implements RestconfService {
         if (nodeBuilder.getQname() != null) {
             currentAugment = previousAugment;
         } else {
-            currentAugment = this.normalizeNodeName(nodeBuilder, schema, previousAugment, mountPoint);
+            currentAugment = normalizeNodeName(nodeBuilder, schema, previousAugment, mountPoint);
             if (nodeBuilder.getQname() == null) {
                 throw new RestconfDocumentedException(
                         "Data has bad format.\nIf data is in XML format then namespace for \""
@@ -1302,8 +1320,8 @@ public class RestconfImpl implements RestconfService {
     }
 
     private void normalizeAnyXmlNode(final CompositeNodeWrapper compositeNode, final AnyXmlSchemaNode schema) {
-        List<NodeWrapper<?>> children = compositeNode.getValues();
-        for (NodeWrapper<? extends Object> child : children) {
+        final List<NodeWrapper<?>> children = compositeNode.getValues();
+        for (final NodeWrapper<? extends Object> child : children) {
             child.setNamespace(schema.getQName().getNamespace());
             if (child instanceof CompositeNodeWrapper) {
                 normalizeAnyXmlNode((CompositeNodeWrapper) child, schema);
@@ -1326,15 +1344,15 @@ public class RestconfImpl implements RestconfService {
             final DOMMountPoint mountPoint) {
         final Object value = simpleNode.getValue();
         Object inputValue = value;
-        TypeDef typeDef = this.typeDefinition(schema);
+        final TypeDef typeDef = this.typeDefinition(schema);
         TypeDefinition<? extends Object> typeDefinition = typeDef != null ? typeDef.typedef : null;
 
         // For leafrefs, extract the type it is pointing to
         if(typeDefinition instanceof LeafrefTypeDefinition) {
             if (schema.getQName().equals(typeDef.qName)) {
-                typeDefinition = SchemaContextUtil.getBaseTypeForLeafRef(((LeafrefTypeDefinition) typeDefinition), mountPoint == null ? this.controllerContext.getGlobalSchema() : mountPoint.getSchemaContext(), schema);
+                typeDefinition = SchemaContextUtil.getBaseTypeForLeafRef(((LeafrefTypeDefinition) typeDefinition), mountPoint == null ? controllerContext.getGlobalSchema() : mountPoint.getSchemaContext(), schema);
             } else {
-                typeDefinition = SchemaContextUtil.getBaseTypeForLeafRef(((LeafrefTypeDefinition) typeDefinition), mountPoint == null ? this.controllerContext.getGlobalSchema() : mountPoint.getSchemaContext(), typeDef.qName);
+                typeDefinition = SchemaContextUtil.getBaseTypeForLeafRef(((LeafrefTypeDefinition) typeDefinition), mountPoint == null ? controllerContext.getGlobalSchema() : mountPoint.getSchemaContext(), typeDef.qName);
             }
         }
 
@@ -1345,7 +1363,7 @@ public class RestconfImpl implements RestconfService {
         Object outputValue = inputValue;
 
         if (typeDefinition != null) {
-            Codec<Object, Object> codec = RestCodec.from(typeDefinition, mountPoint);
+            final Codec<Object, Object> codec = RestCodec.from(typeDefinition, mountPoint);
             outputValue = codec == null ? null : codec.deserialize(inputValue);
         }
 
@@ -1369,7 +1387,7 @@ public class RestconfImpl implements RestconfService {
                     schema, child.getLocalName());
 
             if (potentialSchemaNodes.size() > 1 && child.getNamespace() == null) {
-                StringBuilder builder = new StringBuilder();
+                final StringBuilder builder = new StringBuilder();
                 for (final DataSchemaNode potentialSchemaNode : potentialSchemaNodes) {
                     builder.append("   ").append(potentialSchemaNode.getQName().getNamespace().toString()).append("\n");
                 }
@@ -1384,7 +1402,7 @@ public class RestconfImpl implements RestconfService {
             boolean rightNodeSchemaFound = false;
             for (final DataSchemaNode potentialSchemaNode : potentialSchemaNodes) {
                 if (!rightNodeSchemaFound) {
-                    final QName potentialCurrentAugment = this.normalizeNodeName(child, potentialSchemaNode,
+                    final QName potentialCurrentAugment = normalizeNodeName(child, potentialSchemaNode,
                             currentAugment, mountPoint);
                     if (child.getQname() != null) {
                         this.normalizeNode(child, potentialSchemaNode, potentialCurrentAugment, mountPoint);
@@ -1400,7 +1418,7 @@ public class RestconfImpl implements RestconfService {
         }
 
         if ((schema instanceof ListSchemaNode)) {
-            ListSchemaNode listSchemaNode = (ListSchemaNode) schema;
+            final ListSchemaNode listSchemaNode = (ListSchemaNode) schema;
             final List<QName> listKeys = listSchemaNode.getKeyDefinition();
             for (final QName listKey : listKeys) {
                 boolean foundKey = false;
@@ -1421,16 +1439,16 @@ public class RestconfImpl implements RestconfService {
 
     private void checkNodeMultiplicityAccordingToSchema(final DataNodeContainer dataNodeContainer,
             final List<NodeWrapper<?>> nodes) {
-        Map<String, Integer> equalNodeNamesToCounts = new HashMap<String, Integer>();
-        for (NodeWrapper<?> child : nodes) {
+        final Map<String, Integer> equalNodeNamesToCounts = new HashMap<String, Integer>();
+        for (final NodeWrapper<?> child : nodes) {
             Integer count = equalNodeNamesToCounts.get(child.getLocalName());
             equalNodeNamesToCounts.put(child.getLocalName(), count == null ? 1 : ++count);
         }
 
-        for (DataSchemaNode childSchemaNode : dataNodeContainer.getChildNodes()) {
+        for (final DataSchemaNode childSchemaNode : dataNodeContainer.getChildNodes()) {
             if (childSchemaNode instanceof ContainerSchemaNode || childSchemaNode instanceof LeafSchemaNode) {
-                String localName = childSchemaNode.getQName().getLocalName();
-                Integer count = equalNodeNamesToCounts.get(localName);
+                final String localName = childSchemaNode.getQName().getLocalName();
+                final Integer count = equalNodeNamesToCounts.get(localName);
                 if (count != null && count > 1) {
                     throw new RestconfDocumentedException("Multiple input data elements were specified for '"
                             + childSchemaNode.getQName().getLocalName()
@@ -1557,7 +1575,7 @@ public class RestconfImpl implements RestconfService {
 
     private NormalizedNode<?, ?> compositeNodeToDatastoreNormalizedNode(final CompositeNode compNode,
             final DataSchemaNode schema) {
-        List<Node<?>> lst = new ArrayList<Node<?>>();
+        final List<Node<?>> lst = new ArrayList<Node<?>>();
         lst.add(compNode);
         if (schema instanceof ContainerSchemaNode) {
             return CnSnToNormalizedNodeParserFactory.getInstance().getContainerNodeParser()
@@ -1624,4 +1642,25 @@ public class RestconfImpl implements RestconfService {
         // TODO Auto-generated method stub
         return null;
     }
+
+    private MapNode makeModuleMapNode(final Set<Module> modules) {
+        Preconditions.checkNotNull(modules);
+        final Module restconfModule = getRestconfModule();
+        final DataSchemaNode moduleSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(
+                restconfModule, Draft02.RestConfModule.MODULE_LIST_SCHEMA_NODE);
+        Preconditions.checkState(moduleSchemaNode instanceof ListSchemaNode);
+
+        final CollectionNodeBuilder<MapEntryNode, MapNode> listModuleBuilder = Builders
+                .mapBuilder((ListSchemaNode) moduleSchemaNode);
+
+        for (final Module module : modules) {
+            listModuleBuilder.withChild(toModuleEntryNode(module, moduleSchemaNode));
+        }
+        return listModuleBuilder.build();
+    }
+
+    protected MapEntryNode toModuleEntryNode(final Module module, final DataSchemaNode moduleSchemaNode) {
+        Preconditions.checkArgument(moduleSchemaNode instanceof ListSchemaNode,
+                "moduleSchemaNode has to be of type ListSchemaNode");\r        final ListSchemaNode listModuleSchemaNode = (ListSchemaNode) moduleSchemaNode;\r        final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> moduleNodeValues = Builders\r                .mapEntryBuilder(listModuleSchemaNode);\r\r        List<DataSchemaNode> instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r                (listModuleSchemaNode), "name");\r        final DataSchemaNode nameSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r        Preconditions.checkState(nameSchemaNode instanceof LeafSchemaNode);\r        moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) nameSchemaNode).withValue(module.getName())\r                .build());\r\r        instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r                (listModuleSchemaNode), "revision");\r        final DataSchemaNode revisionSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r        Preconditions.checkState(revisionSchemaNode instanceof LeafSchemaNode);\r        final String revision = REVISION_FORMAT.format(module.getRevision());\r        moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) revisionSchemaNode).withValue(revision)\r                .build());\r\r        instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r                (listModuleSchemaNode), "namespace");\r        final DataSchemaNode namespaceSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r        Preconditions.checkState(namespaceSchemaNode instanceof LeafSchemaNode);\r        moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) namespaceSchemaNode)\r                .withValue(module.getNamespace().toString()).build());\r\r        instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r                (listModuleSchemaNode), "feature");\r        final DataSchemaNode featureSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r        Preconditions.checkState(featureSchemaNode instanceof LeafListSchemaNode);\r        final ListNodeBuilder<Object, LeafSetEntryNode<Object>> featuresBuilder = Builders\r                .leafSetBuilder((LeafListSchemaNode) featureSchemaNode);\r        for (final FeatureDefinition feature : module.getFeatures()) {\r            featuresBuilder.withChild(Builders.leafSetEntryBuilder(((LeafListSchemaNode) featureSchemaNode))\r                    .withValue(feature.getQName().getLocalName()).build());\r        }\r        moduleNodeValues.withChild(featuresBuilder.build());
+\r        return moduleNodeValues.build();\r    }
 }
index eafbb81c4830f962ff41791bbf02429facb2f160..53dda7dbfb9d719481fd76cfce540696c13c2ac7 100644 (file)
@@ -28,7 +28,7 @@ public class StatisticsRestconfServiceWrapper implements RestconfService {
 
     final RestconfService delegate;
 
-    private StatisticsRestconfServiceWrapper(RestconfService delegate) {
+    private StatisticsRestconfServiceWrapper(final RestconfService delegate) {
         this.delegate = delegate;
     }
 
@@ -42,84 +42,84 @@ public class StatisticsRestconfServiceWrapper implements RestconfService {
     }
 
     @Override
-    public StructuredData getModules(UriInfo uriInfo) {
+    public NormalizedNodeContext getModules(final UriInfo uriInfo) {
         return delegate.getModules(uriInfo);
     }
 
     @Override
-    public StructuredData getModules(String identifier, UriInfo uriInfo) {
+    public NormalizedNodeContext getModules(final String identifier, final UriInfo uriInfo) {
         return delegate.getModules(identifier, uriInfo);
     }
 
     @Override
-    public StructuredData getModule(String identifier, UriInfo uriInfo) {
+    public NormalizedNodeContext getModule(final String identifier, final UriInfo uriInfo) {
         return delegate.getModule(identifier, uriInfo);
     }
 
     @Override
-    public StructuredData getOperations(UriInfo uriInfo) {
+    public StructuredData getOperations(final UriInfo uriInfo) {
         return delegate.getOperations(uriInfo);
     }
 
     @Override
-    public StructuredData getOperations(String identifier, UriInfo uriInfo) {
+    public StructuredData getOperations(final String identifier, final UriInfo uriInfo) {
         return delegate.getOperations(identifier, uriInfo);
     }
 
     @Override
-    public StructuredData invokeRpc(String identifier, CompositeNode payload, UriInfo uriInfo) {
+    public StructuredData invokeRpc(final String identifier, final CompositeNode payload, final UriInfo uriInfo) {
         rpc.incrementAndGet();
         return delegate.invokeRpc(identifier, payload, uriInfo);
     }
 
     @Override
-    public StructuredData invokeRpc(String identifier, String noPayload, UriInfo uriInfo) {
+    public StructuredData invokeRpc(final String identifier, final String noPayload, final UriInfo uriInfo) {
         rpc.incrementAndGet();
         return delegate.invokeRpc(identifier, noPayload, uriInfo);
     }
 
     @Override
-    public NormalizedNodeContext readConfigurationData(String identifier, UriInfo uriInfo) {
+    public NormalizedNodeContext readConfigurationData(final String identifier, final UriInfo uriInfo) {
         configGet.incrementAndGet();
         return delegate.readConfigurationData(identifier, uriInfo);
     }
 
     @Override
-    public NormalizedNodeContext readOperationalData(String identifier, UriInfo uriInfo) {
+    public NormalizedNodeContext readOperationalData(final String identifier, final UriInfo uriInfo) {
         operationalGet.incrementAndGet();
         return delegate.readOperationalData(identifier, uriInfo);
     }
 
     @Override
-    public Response updateConfigurationData(String identifier, Node<?> payload) {
+    public Response updateConfigurationData(final String identifier, final Node<?> payload) {
         configPut.incrementAndGet();
         return delegate.updateConfigurationData(identifier, payload);
     }
 
     @Override
-    public Response createConfigurationData(String identifier, Node<?> payload) {
+    public Response createConfigurationData(final String identifier, final Node<?> payload) {
         configPost.incrementAndGet();
         return delegate.createConfigurationData(identifier, payload);
     }
 
     @Override
-    public Response createConfigurationData(Node<?> payload) {
+    public Response createConfigurationData(final Node<?> payload) {
         configPost.incrementAndGet();
         return delegate.createConfigurationData(payload);
     }
 
     @Override
-    public Response deleteConfigurationData(String identifier) {
+    public Response deleteConfigurationData(final String identifier) {
         return delegate.deleteConfigurationData(identifier);
     }
 
     @Override
-    public Response subscribeToStream(String identifier, UriInfo uriInfo) {
+    public Response subscribeToStream(final String identifier, final UriInfo uriInfo) {
         return delegate.subscribeToStream(identifier, uriInfo);
     }
 
     @Override
-    public StructuredData getAvailableStreams(UriInfo uriInfo) {
+    public StructuredData getAvailableStreams(final UriInfo uriInfo) {
         return delegate.getAvailableStreams(uriInfo);
     }
 
@@ -146,5 +146,4 @@ public class StatisticsRestconfServiceWrapper implements RestconfService {
     public BigInteger getRpc() {
         return BigInteger.valueOf(rpc.get());
     }
-
 }
diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/iana-if-type.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/iana-if-type.yang
new file mode 100644 (file)
index 0000000..7bd0003
--- /dev/null
@@ -0,0 +1,1517 @@
+module iana-if-type {
+  namespace "urn:ietf:params:xml:ns:yang:iana-if-type";
+  prefix ianaift;
+
+  organization "IANA";
+  contact
+    "        Internet Assigned Numbers Authority
+
+     Postal: ICANN
+             4676 Admiralty Way, Suite 330
+             Marina del Rey, CA 90292
+
+     Tel:    +1 310 823 9358
+     E-Mail: iana&iana.org";
+  description
+    "This YANG module defines the iana-if-type typedef, which
+     contains YANG definitions for IANA-registered interface types.
+
+     This YANG module is maintained by IANA, and reflects the
+     'ifType definitions' registry.
+
+     The latest revision of this YANG module can be obtained from
+     the IANA web site.
+
+     Copyright (c) 2011 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or
+     without modification, is permitted pursuant to, and subject
+     to the license terms contained in, the Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC XXXX; see
+     the RFC itself for full legal notices.";
+  // RFC Ed.: replace XXXX with actual RFC number and remove this
+  // note.
+
+  // RFC Ed.: update the date below with the date of RFC publication
+  // and remove this note.
+  revision 2013-07-04 {
+    description
+      "Initial revision.";
+    reference
+      "RFC XXXX: IANA Interface Type YANG Module";
+  }
+
+  typedef iana-if-type {
+    type enumeration {
+      enum "other" {
+        value 1;
+        description
+          "None of the following";
+      }
+      enum "regular1822" {
+        value 2;
+      }
+      enum "hdh1822" {
+        value 3;
+      }
+      enum "ddnX25" {
+        value 4;
+      }
+      enum "rfc877x25" {
+        value 5;
+        reference
+          "RFC 1382 - SNMP MIB Extension for the X.25 Packet Layer";
+      }
+      enum "ethernetCsmacd" {
+        value 6;
+        description
+          "For all ethernet-like interfaces, regardless of speed,
+           as per RFC3635.";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "iso88023Csmacd" {
+        value 7;
+        status deprecated;
+        description
+          "Deprecated via RFC3635.
+           Use ethernetCsmacd(6) instead.";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "iso88024TokenBus" {
+        value 8;
+      }
+      enum "iso88025TokenRing" {
+        value 9;
+      }
+      enum "iso88026Man" {
+        value 10;
+      }
+      enum "starLan" {
+        value 11;
+        status deprecated;
+        description
+          "Deprecated via RFC3635.
+           Use ethernetCsmacd(6) instead.";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "proteon10Mbit" {
+        value 12;
+      }
+      enum "proteon80Mbit" {
+        value 13;
+      }
+      enum "hyperchannel" {
+        value 14;
+      }
+      enum "fddi" {
+        value 15;
+        reference
+          "RFC 1512 - FDDI Management Information Base";
+      }
+      enum "lapb" {
+        value 16;
+        reference
+          "RFC 1381 - SNMP MIB Extension for X.25 LAPB";
+      }
+      enum "sdlc" {
+        value 17;
+      }
+      enum "ds1" {
+        value 18;
+        description
+          "DS1-MIB";
+        reference
+          "RFC 4805 - Definitions of Managed Objects for the
+                      DS1, J1, E1, DS2, and E2 Interface Types";
+      }
+      enum "e1" {
+        value 19;
+        status obsolete;
+        description
+          "Obsolete see DS1-MIB";
+        reference
+          "RFC 4805 - Definitions of Managed Objects for the
+                      DS1, J1, E1, DS2, and E2 Interface Types";
+      }
+      enum "basicISDN" {
+        value 20;
+        description
+          "see also RFC2127";
+      }
+      enum "primaryISDN" {
+        value 21;
+      }
+      enum "propPointToPointSerial" {
+        value 22;
+        description
+          "proprietary serial";
+      }
+      enum "ppp" {
+        value 23;
+      }
+      enum "softwareLoopback" {
+        value 24;
+      }
+      enum "eon" {
+        value 25;
+        description
+          "CLNP over IP";
+      }
+      enum "ethernet3Mbit" {
+        value 26;
+      }
+      enum "nsip" {
+        value 27;
+        description
+          "XNS over IP";
+      }
+      enum "slip" {
+        value 28;
+        description
+          "generic SLIP";
+      }
+      enum "ultra" {
+        value 29;
+        description
+          "ULTRA technologies";
+      }
+      enum "ds3" {
+        value 30;
+        description
+          "DS3-MIB";
+        reference
+          "RFC 3896 - Definitions of Managed Objects for the
+                      DS3/E3 Interface Type";
+      }
+      enum "sip" {
+        value 31;
+        description
+          "SMDS, coffee";
+        reference
+          "RFC 1694 - Definitions of Managed Objects for SMDS
+                      Interfaces using SMIv2";
+      }
+      enum "frameRelay" {
+        value 32;
+        description
+          "DTE only.";
+        reference
+          "RFC 2115 - Management Information Base for Frame Relay
+                      DTEs Using SMIv2";
+      }
+      enum "rs232" {
+        value 33;
+        reference
+          "RFC 1659 - Definitions of Managed Objects for RS-232-like
+                      Hardware Devices using SMIv2";
+      }
+      enum "para" {
+        value 34;
+        description
+          "parallel-port";
+        reference
+          "RFC 1660 - Definitions of Managed Objects for
+                      Parallel-printer-like Hardware Devices using
+                      SMIv2";
+      }
+      enum "arcnet" {
+        value 35;
+        description
+          "arcnet";
+      }
+      enum "arcnetPlus" {
+        value 36;
+        description
+          "arcnet plus";
+      }
+      enum "atm" {
+        value 37;
+        description
+          "ATM cells";
+      }
+      enum "miox25" {
+        value 38;
+        reference
+          "RFC 1461 - SNMP MIB extension for Multiprotocol
+                      Interconnect over X.25";
+      }
+      enum "sonet" {
+        value 39;
+        description
+          "SONET or SDH";
+      }
+      enum "x25ple" {
+        value 40;
+        reference
+          "RFC 2127 - ISDN Management Information Base using SMIv2";
+      }
+      enum "iso88022llc" {
+        value 41;
+      }
+      enum "localTalk" {
+        value 42;
+      }
+      enum "smdsDxi" {
+        value 43;
+      }
+      enum "frameRelayService" {
+        value 44;
+        description
+          "FRNETSERV-MIB";
+        reference
+          "RFC 2954 - Definitions of Managed Objects for Frame
+                      Relay Service";
+      }
+      enum "v35" {
+        value 45;
+      }
+      enum "hssi" {
+        value 46;
+      }
+      enum "hippi" {
+        value 47;
+      }
+      enum "modem" {
+        value 48;
+        description
+          "Generic modem";
+      }
+      enum "aal5" {
+        value 49;
+        description
+          "AAL5 over ATM";
+      }
+      enum "sonetPath" {
+        value 50;
+      }
+      enum "sonetVT" {
+        value 51;
+      }
+      enum "smdsIcip" {
+        value 52;
+        description
+          "SMDS InterCarrier Interface";
+      }
+      enum "propVirtual" {
+        value 53;
+        description
+          "proprietary virtual/internal";
+        reference
+          "RFC 2863 - The Interfaces Group MIB";
+      }
+      enum "propMultiplexor" {
+        value 54;
+        description
+          "proprietary multiplexing";
+        reference
+          "RFC 2863 - The Interfaces Group MIB";
+      }
+      enum "ieee80212" {
+        value 55;
+        description
+          "100BaseVG";
+      }
+      enum "fibreChannel" {
+        value 56;
+        description
+          "Fibre Channel";
+      }
+      enum "hippiInterface" {
+        value 57;
+        description
+          "HIPPI interfaces";
+      }
+      enum "frameRelayInterconnect" {
+        value 58;
+        status obsolete;
+        description
+          "Obsolete use either
+           frameRelay(32) or frameRelayService(44).";
+      }
+      enum "aflane8023" {
+        value 59;
+        description
+          "ATM Emulated LAN for 802.3";
+      }
+      enum "aflane8025" {
+        value 60;
+        description
+          "ATM Emulated LAN for 802.5";
+      }
+      enum "cctEmul" {
+        value 61;
+        description
+         "ATM Emulated circuit";
+      }
+      enum "fastEther" {
+        value 62;
+        status deprecated;
+        description
+          "Obsoleted via RFC3635.
+          ethernetCsmacd(6) should be used instead";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "isdn" {
+        value 63;
+        description
+          "ISDN and X.25";
+        reference
+          "RFC 1356 - Multiprotocol Interconnect on X.25 and ISDN
+                      in the Packet Mode";
+      }
+      enum "v11" {
+        value 64;
+        description
+         "CCITT V.11/X.21";
+      }
+      enum "v36" {
+        value 65;
+        description
+          "CCITT V.36";
+      }
+      enum "g703at64k" {
+        value 66;
+        description
+          "CCITT G703 at 64Kbps";
+      }
+      enum "g703at2mb" {
+        value 67;
+        status obsolete;
+        description
+          "Obsolete see DS1-MIB";
+      }
+      enum "qllc" {
+        value 68;
+        description
+          "SNA QLLC";
+      }
+      enum "fastEtherFX" {
+        value 69;
+        status deprecated;
+        description
+          "Obsoleted via RFC3635
+          ethernetCsmacd(6) should be used instead";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "channel" {
+        value 70;
+        description
+          "channel";
+      }
+      enum "ieee80211" {
+        value 71;
+        description
+          "radio spread spectrum";
+      }
+      enum "ibm370parChan" {
+        value 72;
+        description
+          "IBM System 360/370 OEMI Channel";
+      }
+      enum "escon" {
+        value 73;
+        description
+          "IBM Enterprise Systems Connection";
+      }
+      enum "dlsw" {
+        value 74;
+        description
+          "Data Link Switching";
+      }
+      enum "isdns" {
+        value 75;
+        description
+          "ISDN S/T interface";
+      }
+      enum "isdnu" {
+        value 76;
+        description
+          "ISDN U interface";
+      }
+      enum "lapd" {
+        value 77;
+        description
+          "Link Access Protocol D";
+      }
+      enum "ipSwitch" {
+        value 78;
+        description
+          "IP Switching Objects";
+      }
+      enum "rsrb" {
+        value 79;
+        description
+          "Remote Source Route Bridging";
+      }
+      enum "atmLogical" {
+        value 80;
+        description
+          "ATM Logical Port";
+        reference
+          "RFC 3606 - Definitions of Supplemental Managed Objects
+                      for ATM Interface";
+      }
+      enum "ds0" {
+        value 81;
+        description
+          "Digital Signal Level 0";
+        reference
+          "RFC 2494 - Definitions of Managed Objects for the DS0
+                      and DS0 Bundle Interface Type";
+      }
+      enum "ds0Bundle" {
+        value 82;
+        description
+          "group of ds0s on the same ds1";
+        reference
+          "RFC 2494 - Definitions of Managed Objects for the DS0
+                      and DS0 Bundle Interface Type";
+      }
+      enum "bsc" {
+        value 83;
+        description
+          "Bisynchronous Protocol";
+      }
+      enum "async" {
+        value 84;
+        description
+          "Asynchronous Protocol";
+      }
+      enum "cnr" {
+        value 85;
+        description
+          "Combat Net Radio";
+      }
+      enum "iso88025Dtr" {
+        value 86;
+        description
+          "ISO 802.5r DTR";
+      }
+      enum "eplrs" {
+        value 87;
+        description
+          "Ext Pos Loc Report Sys";
+      }
+      enum "arap" {
+        value 88;
+        description
+          "Appletalk Remote Access Protocol";
+      }
+      enum "propCnls" {
+        value 89;
+        description
+          "Proprietary Connectionless Protocol";
+      }
+      enum "hostPad" {
+        value 90;
+        description
+          "CCITT-ITU X.29 PAD Protocol";
+      }
+      enum "termPad" {
+        value 91;
+        description
+          "CCITT-ITU X.3 PAD Facility";
+      }
+      enum "frameRelayMPI" {
+        value 92;
+        description
+          "Multiproto Interconnect over FR";
+      }
+      enum "x213" {
+        value 93;
+        description
+          "CCITT-ITU X213";
+      }
+      enum "adsl" {
+        value 94;
+        description
+          "Asymmetric Digital Subscriber Loop";
+      }
+      enum "radsl" {
+        value 95;
+        description
+          "Rate-Adapt. Digital Subscriber Loop";
+      }
+      enum "sdsl" {
+        value 96;
+        description
+          "Symmetric Digital Subscriber Loop";
+      }
+      enum "vdsl" {
+        value 97;
+        description
+          "Very H-Speed Digital Subscrib. Loop";
+      }
+      enum "iso88025CRFPInt" {
+        value 98;
+        description
+          "ISO 802.5 CRFP";
+      }
+      enum "myrinet" {
+        value 99;
+        description
+          "Myricom Myrinet";
+      }
+      enum "voiceEM" {
+        value 100;
+        description
+          "voice recEive and transMit";
+      }
+      enum "voiceFXO" {
+        value 101;
+        description
+          "voice Foreign Exchange Office";
+      }
+      enum "voiceFXS" {
+        value 102;
+        description
+          "voice Foreign Exchange Station";
+      }
+      enum "voiceEncap" {
+        value 103;
+        description
+          "voice encapsulation";
+      }
+      enum "voiceOverIp" {
+        value 104;
+        description
+          "voice over IP encapsulation";
+      }
+      enum "atmDxi" {
+        value 105;
+        description
+          "ATM DXI";
+      }
+      enum "atmFuni" {
+        value 106;
+        description
+          "ATM FUNI";
+      }
+      enum "atmIma" {
+        value 107;
+        description
+          "ATM IMA";
+      }
+      enum "pppMultilinkBundle" {
+        value 108;
+        description
+          "PPP Multilink Bundle";
+      }
+      enum "ipOverCdlc" {
+        value 109;
+        description
+          "IBM ipOverCdlc";
+      }
+      enum "ipOverClaw" {
+        value 110;
+        description
+          "IBM Common Link Access to Workstn";
+      }
+      enum "stackToStack" {
+        value 111;
+        description
+          "IBM stackToStack";
+      }
+      enum "virtualIpAddress" {
+        value 112;
+        description
+          "IBM VIPA";
+      }
+      enum "mpc" {
+        value 113;
+        description
+          "IBM multi-protocol channel support";
+      }
+      enum "ipOverAtm" {
+        value 114;
+        description
+          "IBM ipOverAtm";
+        reference
+          "RFC 2320 - Definitions of Managed Objects for Classical IP
+                      and ARP Over ATM Using SMIv2 (IPOA-MIB)";
+      }
+      enum "iso88025Fiber" {
+        value 115;
+        description
+          "ISO 802.5j Fiber Token Ring";
+      }
+      enum "tdlc" {
+        value 116;
+        description
+          "IBM twinaxial data link control";
+      }
+      enum "gigabitEthernet" {
+        value 117;
+        status deprecated;
+        description
+          "Obsoleted via RFC3635
+           ethernetCsmacd(6) should be used instead";
+        reference
+          "RFC 3635 - Definitions of Managed Objects for the
+                      Ethernet-like Interface Types.";
+      }
+      enum "hdlc" {
+        value 118;
+        description
+          "HDLC";
+      }
+      enum "lapf" {
+        value 119;
+        description
+          "LAP F";
+      }
+      enum "v37" {
+        value 120;
+        description
+          "V.37";
+      }
+      enum "x25mlp" {
+        value 121;
+        description
+          "Multi-Link Protocol";
+      }
+      enum "x25huntGroup" {
+        value 122;
+        description
+          "X25 Hunt Group";
+      }
+      enum "transpHdlc" {
+        value 123;
+        description
+          "Transp HDLC";
+      }
+      enum "interleave" {
+        value 124;
+        description
+          "Interleave channel";
+      }
+      enum "fast" {
+        value 125;
+        description
+          "Fast channel";
+      }
+      enum "ip" {
+        value 126;
+        description
+          "IP (for APPN HPR in IP networks)";
+      }
+      enum "docsCableMaclayer" {
+        value 127;
+        description
+          "CATV Mac Layer";
+      }
+      enum "docsCableDownstream" {
+        value 128;
+        description
+          "CATV Downstream interface";
+      }
+      enum "docsCableUpstream" {
+        value 129;
+        description
+          "CATV Upstream interface";
+      }
+      enum "a12MppSwitch" {
+        value 130;
+        description
+          "Avalon Parallel Processor";
+      }
+      enum "tunnel" {
+        value 131;
+        description
+          "Encapsulation interface";
+      }
+      enum "coffee" {
+        value 132;
+        description
+          "coffee pot";
+        reference
+          "RFC 2325 - Coffee MIB";
+      }
+      enum "ces" {
+        value 133;
+        description
+          "Circuit Emulation Service";
+      }
+      enum "atmSubInterface" {
+        value 134;
+        description
+          "ATM Sub Interface";
+      }
+      enum "l2vlan" {
+        value 135;
+        description
+          "Layer 2 Virtual LAN using 802.1Q";
+      }
+      enum "l3ipvlan" {
+        value 136;
+        description
+          "Layer 3 Virtual LAN using IP";
+      }
+      enum "l3ipxvlan" {
+        value 137;
+        description
+          "Layer 3 Virtual LAN using IPX";
+      }
+      enum "digitalPowerline" {
+        value 138;
+        description
+          "IP over Power Lines";
+      }
+      enum "mediaMailOverIp" {
+        value 139;
+        description
+          "Multimedia Mail over IP";
+      }
+      enum "dtm" {
+        value 140;
+        description
+          "Dynamic syncronous Transfer Mode";
+      }
+      enum "dcn" {
+        value 141;
+        description
+          "Data Communications Network";
+      }
+      enum "ipForward" {
+        value 142;
+        description
+          "IP Forwarding Interface";
+      }
+      enum "msdsl" {
+        value 143;
+        description
+          "Multi-rate Symmetric DSL";
+      }
+      enum "ieee1394" {
+        value 144;
+        description
+          "IEEE1394 High Performance Serial Bus";
+      }
+      enum "if-gsn" {
+        value 145;
+        description
+          "HIPPI-6400";
+      }
+      enum "dvbRccMacLayer" {
+        value 146;
+        description
+          "DVB-RCC MAC Layer";
+      }
+      enum "dvbRccDownstream" {
+        value 147;
+        description
+          "DVB-RCC Downstream Channel";
+      }
+      enum "dvbRccUpstream" {
+        value 148;
+        description
+          "DVB-RCC Upstream Channel";
+      }
+      enum "atmVirtual" {
+        value 149;
+        description
+          "ATM Virtual Interface";
+      }
+      enum "mplsTunnel" {
+        value 150;
+        description
+          "MPLS Tunnel Virtual Interface";
+      }
+      enum "srp" {
+        value 151;
+        description
+          "Spatial Reuse Protocol";
+      }
+      enum "voiceOverAtm" {
+        value 152;
+        description
+          "Voice Over ATM";
+      }
+      enum "voiceOverFrameRelay" {
+        value 153;
+        description
+          "Voice Over Frame Relay";
+      }
+      enum "idsl" {
+        value 154;
+        description
+          "Digital Subscriber Loop over ISDN";
+      }
+      enum "compositeLink" {
+        value 155;
+        description
+          "Avici Composite Link Interface";
+      }
+      enum "ss7SigLink" {
+        value 156;
+        description
+          "SS7 Signaling Link";
+      }
+      enum "propWirelessP2P" {
+        value 157;
+        description
+          "Prop. P2P wireless interface";
+      }
+      enum "frForward" {
+        value 158;
+        description
+          "Frame Forward Interface";
+      }
+      enum "rfc1483" {
+        value 159;
+        description
+          "Multiprotocol over ATM AAL5";
+        reference
+          "RFC 1483 - Multiprotocol Encapsulation over ATM
+                      Adaptation Layer 5";
+      }
+      enum "usb" {
+        value 160;
+        description
+          "USB Interface";
+      }
+      enum "ieee8023adLag" {
+        value 161;
+        description
+          "IEEE 802.3ad Link Aggregate";
+      }
+      enum "bgppolicyaccounting" {
+        value 162;
+        description
+          "BGP Policy Accounting";
+      }
+      enum "frf16MfrBundle" {
+        value 163;
+        description
+          "FRF .16 Multilink Frame Relay";
+      }
+      enum "h323Gatekeeper" {
+        value 164;
+        description
+          "H323 Gatekeeper";
+      }
+      enum "h323Proxy" {
+        value 165;
+        description
+          "H323 Voice and Video Proxy";
+      }
+      enum "mpls" {
+        value 166;
+        description
+          "MPLS";
+      }
+      enum "mfSigLink" {
+        value 167;
+        description
+          "Multi-frequency signaling link";
+      }
+      enum "hdsl2" {
+        value 168;
+        description
+          "High Bit-Rate DSL - 2nd generation";
+      }
+      enum "shdsl" {
+        value 169;
+        description
+          "Multirate HDSL2";
+      }
+      enum "ds1FDL" {
+        value 170;
+        description
+          "Facility Data Link 4Kbps on a DS1";
+      }
+      enum "pos" {
+        value 171;
+        description
+          "Packet over SONET/SDH Interface";
+      }
+      enum "dvbAsiIn" {
+        value 172;
+        description
+          "DVB-ASI Input";
+      }
+      enum "dvbAsiOut" {
+        value 173;
+        description
+          "DVB-ASI Output";
+      }
+      enum "plc" {
+        value 174;
+        description
+          "Power Line Communtications";
+      }
+      enum "nfas" {
+        value 175;
+        description
+          "Non Facility Associated Signaling";
+      }
+      enum "tr008" {
+        value 176;
+        description
+          "TR008";
+      }
+      enum "gr303RDT" {
+        value 177;
+        description
+          "Remote Digital Terminal";
+      }
+      enum "gr303IDT" {
+        value 178;
+        description
+          "Integrated Digital Terminal";
+      }
+      enum "isup" {
+        value 179;
+        description
+          "ISUP";
+      }
+      enum "propDocsWirelessMaclayer" {
+        value 180;
+        description
+          "Cisco proprietary Maclayer";
+      }
+      enum "propDocsWirelessDownstream" {
+        value 181;
+        description
+          "Cisco proprietary Downstream";
+      }
+      enum "propDocsWirelessUpstream" {
+        value 182;
+        description
+          "Cisco proprietary Upstream";
+      }
+      enum "hiperlan2" {
+        value 183;
+        description
+          "HIPERLAN Type 2 Radio Interface";
+      }
+      enum "propBWAp2Mp" {
+        value 184;
+        description
+          "PropBroadbandWirelessAccesspt2multipt use of this value
+           for IEEE 802.16 WMAN interfaces as per IEEE Std 802.16f
+           is deprecated and ieee80216WMAN(237) should be used
+           instead.";
+      }
+      enum "sonetOverheadChannel" {
+        value 185;
+        description
+          "SONET Overhead Channel";
+      }
+      enum "digitalWrapperOverheadChannel" {
+        value 186;
+        description
+          "Digital Wrapper";
+      }
+      enum "aal2" {
+        value 187;
+        description
+          "ATM adaptation layer 2";
+      }
+      enum "radioMAC" {
+        value 188;
+        description
+          "MAC layer over radio links";
+      }
+      enum "atmRadio" {
+        value 189;
+        description
+          "ATM over radio links";
+      }
+      enum "imt" {
+        value 190;
+        description
+          "Inter Machine Trunks";
+      }
+      enum "mvl" {
+        value 191;
+        description
+          "Multiple Virtual Lines DSL";
+      }
+      enum "reachDSL" {
+        value 192;
+        description
+          "Long Reach DSL";
+      }
+      enum "frDlciEndPt" {
+        value 193;
+        description
+          "Frame Relay DLCI End Point";
+      }
+      enum "atmVciEndPt" {
+        value 194;
+        description
+          "ATM VCI End Point";
+      }
+      enum "opticalChannel" {
+        value 195;
+        description
+          "Optical Channel";
+      }
+      enum "opticalTransport" {
+        value 196;
+        description
+          "Optical Transport";
+      }
+      enum "propAtm" {
+        value 197;
+        description
+          "Proprietary ATM";
+      }
+      enum "voiceOverCable" {
+        value 198;
+        description
+          "Voice Over Cable Interface";
+      }
+      enum "infiniband" {
+        value 199;
+        description
+          "Infiniband";
+      }
+      enum "teLink" {
+        value 200;
+        description
+          "TE Link";
+      }
+      enum "q2931" {
+        value 201;
+        description
+          "Q.2931";
+      }
+      enum "virtualTg" {
+        value 202;
+        description
+          "Virtual Trunk Group";
+      }
+      enum "sipTg" {
+        value 203;
+        description
+          "SIP Trunk Group";
+      }
+      enum "sipSig" {
+        value 204;
+        description
+          "SIP Signaling";
+      }
+      enum "docsCableUpstreamChannel" {
+        value 205;
+        description
+          "CATV Upstream Channel";
+      }
+      enum "econet" {
+        value 206;
+        description
+          "Acorn Econet";
+      }
+      enum "pon155" {
+        value 207;
+        description
+          "FSAN 155Mb Symetrical PON interface";
+      }
+      enum "pon622" {
+        value 208;
+        description
+          "FSAN622Mb Symetrical PON interface";
+      }
+      enum "bridge" {
+        value 209;
+        description
+          "Transparent bridge interface";
+      }
+      enum "linegroup" {
+        value 210;
+        description
+          "Interface common to multiple lines";
+      }
+      enum "voiceEMFGD" {
+        value 211;
+        description
+          "voice E&M Feature Group D";
+      }
+      enum "voiceFGDEANA" {
+        value 212;
+        description
+          "voice FGD Exchange Access North American";
+      }
+      enum "voiceDID" {
+        value 213;
+        description
+          "voice Direct Inward Dialing";
+      }
+      enum "mpegTransport" {
+        value 214;
+        description
+          "MPEG transport interface";
+      }
+      enum "sixToFour" {
+        value 215;
+        status deprecated;
+        description
+          "6to4 interface (DEPRECATED)";
+        reference
+          "RFC 4087 - IP Tunnel MIB";
+      }
+      enum "gtp" {
+        value 216;
+        description
+          "GTP (GPRS Tunneling Protocol)";
+      }
+      enum "pdnEtherLoop1" {
+        value 217;
+        description
+          "Paradyne EtherLoop 1";
+      }
+      enum "pdnEtherLoop2" {
+        value 218;
+        description
+          "Paradyne EtherLoop 2";
+      }
+      enum "opticalChannelGroup" {
+        value 219;
+        description
+          "Optical Channel Group";
+      }
+      enum "homepna" {
+        value 220;
+        description
+          "HomePNA ITU-T G.989";
+      }
+      enum "gfp" {
+        value 221;
+        description
+          "Generic Framing Procedure (GFP)";
+      }
+      enum "ciscoISLvlan" {
+        value 222;
+        description
+          "Layer 2 Virtual LAN using Cisco ISL";
+      }
+      enum "actelisMetaLOOP" {
+        value 223;
+        description
+          "Acteleis proprietary MetaLOOP High Speed Link";
+      }
+      enum "fcipLink" {
+        value 224;
+        description
+          "FCIP Link";
+      }
+      enum "rpr" {
+        value 225;
+        description
+          "Resilient Packet Ring Interface Type";
+      }
+      enum "qam" {
+        value 226;
+        description
+          "RF Qam Interface";
+      }
+      enum "lmp" {
+        value 227;
+        description
+          "Link Management Protocol";
+        reference
+          "RFC 4327 - Link Management Protocol (LMP) Management
+                      Information Base (MIB)";
+      }
+      enum "cblVectaStar" {
+        value 228;
+        description
+          "Cambridge Broadband Networks Limited VectaStar";
+      }
+      enum "docsCableMCmtsDownstream" {
+        value 229;
+        description
+          "CATV Modular CMTS Downstream Interface";
+      }
+      enum "adsl2" {
+        value 230;
+        status deprecated;
+        description
+          "Asymmetric Digital Subscriber Loop Version 2
+           (DEPRECATED/OBSOLETED - please use adsl2plus(238)
+           instead)";
+        reference
+          "RFC 4706 - Definitions of Managed Objects for Asymmetric
+                      Digital Subscriber Line 2 (ADSL2)";
+      }
+      enum "macSecControlledIF" {
+        value 231;
+        description
+          "MACSecControlled";
+      }
+      enum "macSecUncontrolledIF" {
+        value 232;
+        description
+          "MACSecUncontrolled";
+      }
+      enum "aviciOpticalEther" {
+        value 233;
+        description
+         "Avici Optical Ethernet Aggregate";
+      }
+      enum "atmbond" {
+        value 234;
+        description
+          "atmbond";
+      }
+      enum "voiceFGDOS" {
+        value 235;
+        description
+          "voice FGD Operator Services";
+      }
+      enum "mocaVersion1" {
+        value 236;
+        description
+          "MultiMedia over Coax Alliance (MoCA) Interface
+           as documented in information provided privately to IANA";
+      }
+      enum "ieee80216WMAN" {
+        value 237;
+        description
+          "IEEE 802.16 WMAN interface";
+      }
+      enum "adsl2plus" {
+        value 238;
+        description
+          "Asymmetric Digital Subscriber Loop Version 2,
+           Version 2 Plus and all variants";
+      }
+      enum "dvbRcsMacLayer" {
+        value 239;
+        description
+          "DVB-RCS MAC Layer";
+        reference
+          "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+      }
+      enum "dvbTdm" {
+        value 240;
+        description
+          "DVB Satellite TDM";
+        reference
+          "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+      }
+      enum "dvbRcsTdma" {
+        value 241;
+        description
+          "DVB-RCS TDMA";
+        reference
+          "RFC 5728 - The SatLabs Group DVB-RCS MIB";
+      }
+      enum "x86Laps" {
+        value 242;
+        description
+          "LAPS based on ITU-T X.86/Y.1323";
+      }
+      enum "wwanPP" {
+        value 243;
+        description
+          "3GPP WWAN";
+      }
+      enum "wwanPP2" {
+        value 244;
+        description
+          "3GPP2 WWAN";
+      }
+      enum "voiceEBS" {
+        value 245;
+        description
+          "voice P-phone EBS physical interface";
+      }
+      enum "ifPwType" {
+        value 246;
+        description
+          "Pseudowire interface type";
+        reference
+          "RFC 5601 - Pseudowire (PW) Management Information Base";
+      }
+      enum "ilan" {
+        value 247;
+        description
+          "Internal LAN on a bridge per IEEE 802.1ap";
+      }
+      enum "pip" {
+        value 248;
+        description
+          "Provider Instance Port on a bridge per IEEE 802.1ah PBB";
+      }
+      enum "aluELP" {
+        value 249;
+        description
+          "Alcatel-Lucent Ethernet Link Protection";
+      }
+      enum "gpon" {
+        value 250;
+        description
+          "Gigabit-capable passive optical networks (G-PON) as per
+           ITU-T G.948";
+      }
+      enum "vdsl2" {
+        value 251;
+        description
+          "Very high speed digital subscriber line Version 2
+           (as per ITU-T Recommendation G.993.2)";
+        reference
+          "RFC 5650 - Definitions of Managed Objects for Very High
+                      Speed Digital Subscriber Line 2 (VDSL2)";
+      }
+      enum "capwapDot11Profile" {
+        value 252;
+        description
+          "WLAN Profile Interface";
+        reference
+          "RFC 5834 - Control and Provisioning of Wireless Access
+                      Points (CAPWAP) Protocol Binding MIB for
+                      IEEE 802.11";
+      }
+      enum "capwapDot11Bss" {
+        value 253;
+        description
+          "WLAN BSS Interface";
+        reference
+          "RFC 5834 - Control and Provisioning of Wireless Access
+                      Points (CAPWAP) Protocol Binding MIB for
+                      IEEE 802.11";
+      }
+      enum "capwapWtpVirtualRadio" {
+        value 254;
+        description
+          "WTP Virtual Radio Interface";
+        reference
+          "RFC 5833 - Control and Provisioning of Wireless Access
+                      Points (CAPWAP) Protocol Base MIB";
+      }
+      enum "bits" {
+        value 255;
+        description
+          "bitsport";
+      }
+      enum "docsCableUpstreamRfPort" {
+        value 256;
+        description
+          "DOCSIS CATV Upstream RF Port";
+      }
+      enum "cableDownstreamRfPort" {
+        value 257;
+        description
+          "CATV downstream RF port";
+      }
+      enum "vmwareVirtualNic" {
+        value 258;
+        description
+          "VMware Virtual Network Interface";
+      }
+      enum "ieee802154" {
+        value 259;
+        description
+          "IEEE 802.15.4 WPAN interface";
+        reference
+          "IEEE 802.15.4-2006";
+      }
+      enum "otnOdu" {
+        value 260;
+        description
+          "OTN Optical Data Unit";
+      }
+      enum "otnOtu" {
+        value 261;
+        description
+          "OTN Optical channel Transport Unit";
+      }
+      enum "ifVfiType" {
+        value 262;
+        description
+          "VPLS Forwarding Instance Interface Type";
+      }
+      enum "g9981" {
+        value 263;
+        description
+          "G.998.1 bonded interface";
+      }
+      enum "g9982" {
+        value 264;
+        description
+          "G.998.2 bonded interface";
+      }
+      enum "g9983" {
+        value 265;
+        description
+          "G.998.3 bonded interface";
+      }
+      enum "aluEpon" {
+        value 266;
+        description
+          "Ethernet Passive Optical Networks (E-PON)";
+      }
+      enum "aluEponOnu" {
+        value 267;
+        description
+          "EPON Optical Network Unit";
+      }
+      enum "aluEponPhysicalUni" {
+        value 268;
+        description
+          "EPON physical User to Network interface";
+      }
+      enum "aluEponLogicalLink" {
+        value 269;
+        description
+          "The emulation of a point-to-point link over the EPON
+           layer";
+      }
+      enum "aluGponOnu" {
+        value 270;
+        description
+          "GPON Optical Network Unit";
+        reference
+          "ITU-T G.984.2";
+      }
+      enum "aluGponPhysicalUni" {
+        value 271;
+        description
+          "GPON physical User to Network interface";
+        reference
+          "ITU-T G.984.2";
+      }
+      enum "vmwareNicTeam" {
+        value 272;
+        description
+          "VMware NIC Team";
+      }
+      // value 273 reserved by IANA
+    }
+    description
+      "This data type is used as the syntax of the 'type'
+       leaf in the 'interface' list in the YANG module
+       ietf-interface.
+
+       The definition of this typedef with the
+       addition of newly assigned values is published
+       periodically by the IANA, in either the Assigned
+       Numbers RFC, or some derivative of it specific to
+       Internet Network Management number assignments.  (The
+       latest arrangements can be obtained by contacting the
+       IANA.)
+
+       Requests for new values should be made to IANA via
+       email (iana&iana.org).";
+    reference
+      "IANA ifType definitions registry.
+       <http://www.iana.org/assignments/smi-numbers>";
+  }
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-inet-types.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-inet-types.yang
new file mode 100644 (file)
index 0000000..de20feb
--- /dev/null
@@ -0,0 +1,418 @@
+ module ietf-inet-types {
+
+   namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
+   prefix "inet";
+
+   organization
+    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+   contact
+    "WG Web:   <http://tools.ietf.org/wg/netmod/>
+     WG List:  <mailto:netmod@ietf.org>
+
+     WG Chair: David Partain
+               <mailto:david.partain@ericsson.com>
+
+     WG Chair: David Kessens
+               <mailto:david.kessens@nsn.com>
+
+     Editor:   Juergen Schoenwaelder
+               <mailto:j.schoenwaelder@jacobs-university.de>";
+
+   description
+    "This module contains a collection of generally useful derived
+     YANG data types for Internet addresses and related things.
+
+     Copyright (c) 2010 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or without
+     modification, is permitted pursuant to, and subject to the license
+     terms contained in, the Simplified BSD License set forth in Section
+     4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC 6021; see
+     the RFC itself for full legal notices.";
+
+   revision 2010-09-24 {
+     description
+      "Initial revision.";
+     reference
+      "RFC 6021: Common YANG Data Types";
+   }
+
+   /*** collection of protocol field related types ***/
+
+   typedef ip-version {
+     type enumeration {
+       enum unknown {
+         value "0";
+         description
+          "An unknown or unspecified version of the Internet protocol.";
+       }
+       enum ipv4 {
+         value "1";
+         description
+          "The IPv4 protocol as defined in RFC 791.";
+       }
+       enum ipv6 {
+         value "2";
+         description
+          "The IPv6 protocol as defined in RFC 2460.";
+       }
+     }
+     description
+      "This value represents the version of the IP protocol.
+
+       In the value set and its semantics, this type is equivalent
+       to the InetVersion textual convention of the SMIv2.";
+     reference
+      "RFC  791: Internet Protocol
+       RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
+       RFC 4001: Textual Conventions for Internet Network Addresses";
+   }
+
+   typedef dscp {
+     type uint8 {
+       range "0..63";
+     }
+     description
+      "The dscp type represents a Differentiated Services Code-Point
+       that may be used for marking packets in a traffic stream.
+
+       In the value set and its semantics, this type is equivalent
+       to the Dscp textual convention of the SMIv2.";
+     reference
+      "RFC 3289: Management Information Base for the Differentiated
+                 Services Architecture
+       RFC 2474: Definition of the Differentiated Services Field
+                 (DS Field) in the IPv4 and IPv6 Headers
+       RFC 2780: IANA Allocation Guidelines For Values In
+                 the Internet Protocol and Related Headers";
+   }
+
+   typedef ipv6-flow-label {
+     type uint32 {
+       range "0..1048575";
+     }
+     description
+      "The flow-label type represents flow identifier or Flow Label
+       in an IPv6 packet header that may be used to discriminate
+       traffic flows.
+
+       In the value set and its semantics, this type is equivalent
+       to the IPv6FlowLabel textual convention of the SMIv2.";
+     reference
+      "RFC 3595: Textual Conventions for IPv6 Flow Label
+       RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
+   }
+
+   typedef port-number {
+     type uint16 {
+       range "0..65535";
+     }
+     description
+      "The port-number type represents a 16-bit port number of an
+       Internet transport layer protocol such as UDP, TCP, DCCP, or
+       SCTP.  Port numbers are assigned by IANA.  A current list of
+       all assignments is available from <http://www.iana.org/>.
+
+       Note that the port number value zero is reserved by IANA.  In
+       situations where the value zero does not make sense, it can
+       be excluded by subtyping the port-number type.
+
+       In the value set and its semantics, this type is equivalent
+       to the InetPortNumber textual convention of the SMIv2.";
+     reference
+      "RFC  768: User Datagram Protocol
+       RFC  793: Transmission Control Protocol
+       RFC 4960: Stream Control Transmission Protocol
+       RFC 4340: Datagram Congestion Control Protocol (DCCP)
+       RFC 4001: Textual Conventions for Internet Network Addresses";
+   }
+
+   /*** collection of autonomous system related types ***/
+
+   typedef as-number {
+     type uint32;
+     description
+      "The as-number type represents autonomous system numbers
+       which identify an Autonomous System (AS).  An AS is a set
+       of routers under a single technical administration, using
+       an interior gateway protocol and common metrics to route
+       packets within the AS, and using an exterior gateway
+       protocol to route packets to other ASs'.  IANA maintains
+       the AS number space and has delegated large parts to the
+       regional registries.
+
+       Autonomous system numbers were originally limited to 16
+       bits.  BGP extensions have enlarged the autonomous system
+       number space to 32 bits.  This type therefore uses an uint32
+       base type without a range restriction in order to support
+       a larger autonomous system number space.
+
+       In the value set and its semantics, this type is equivalent
+       to the InetAutonomousSystemNumber textual convention of
+       the SMIv2.";
+     reference
+      "RFC 1930: Guidelines for creation, selection, and registration
+                 of an Autonomous System (AS)
+       RFC 4271: A Border Gateway Protocol 4 (BGP-4)
+       RFC 4893: BGP Support for Four-octet AS Number Space
+       RFC 4001: Textual Conventions for Internet Network Addresses";
+   }
+
+   /*** collection of IP address and hostname related types ***/
+
+   typedef ip-address {
+     type union {
+       type inet:ipv4-address;
+       type inet:ipv6-address;
+     }
+     description
+      "The ip-address type represents an IP address and is IP
+       version neutral.  The format of the textual representations
+       implies the IP version.";
+   }
+
+   typedef ipv4-address {
+     type string {
+       pattern
+         '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+       +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+       + '(%[\p{N}\p{L}]+)?';
+     }
+     description
+       "The ipv4-address type represents an IPv4 address in
+        dotted-quad notation.  The IPv4 address may include a zone
+        index, separated by a % sign.
+
+        The zone index is used to disambiguate identical address
+        values.  For link-local addresses, the zone index will
+        typically be the interface index number or the name of an
+        interface.  If the zone index is not present, the default
+        zone of the device will be used.
+
+        The canonical format for the zone index is the numerical
+        format";
+   }
+
+   typedef ipv6-address {
+     type string {
+       pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+             + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+             + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+             + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+             + '(%[\p{N}\p{L}]+)?';
+       pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+             + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+             + '(%.+)?';
+     }
+     description
+      "The ipv6-address type represents an IPv6 address in full,
+       mixed, shortened, and shortened-mixed notation.  The IPv6
+       address may include a zone index, separated by a % sign.
+
+       The zone index is used to disambiguate identical address
+       values.  For link-local addresses, the zone index will
+       typically be the interface index number or the name of an
+       interface.  If the zone index is not present, the default
+       zone of the device will be used.
+
+       The canonical format of IPv6 addresses uses the compressed
+       format described in RFC 4291, Section 2.2, item 2 with the
+       following additional rules: the :: substitution must be
+       applied to the longest sequence of all-zero 16-bit chunks
+       in an IPv6 address.  If there is a tie, the first sequence
+       of all-zero 16-bit chunks is replaced by ::.  Single
+       all-zero 16-bit chunks are not compressed.  The canonical
+       format uses lowercase characters and leading zeros are
+       not allowed.  The canonical format for the zone index is
+       the numerical format as described in RFC 4007, Section
+       11.2.";
+     reference
+      "RFC 4291: IP Version 6 Addressing Architecture
+       RFC 4007: IPv6 Scoped Address Architecture
+       RFC 5952: A Recommendation for IPv6 Address Text Representation";
+   }
+
+   typedef ip-prefix {
+     type union {
+       type inet:ipv4-prefix;
+       type inet:ipv6-prefix;
+     }
+     description
+      "The ip-prefix type represents an IP prefix and is IP
+       version neutral.  The format of the textual representations
+       implies the IP version.";
+   }
+
+   typedef ipv4-prefix {
+     type string {
+       pattern
+          '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+        +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+        + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
+     }
+     description
+      "The ipv4-prefix type represents an IPv4 address prefix.
+       The prefix length is given by the number following the
+       slash character and must be less than or equal to 32.
+
+       A prefix length value of n corresponds to an IP address
+       mask that has n contiguous 1-bits from the most
+       significant bit (MSB) and all other bits set to 0.
+
+       The canonical format of an IPv4 prefix has all bits of
+       the IPv4 address set to zero that are not part of the
+       IPv4 prefix.";
+   }
+
+   typedef ipv6-prefix {
+     type string {
+       pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+             + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+             + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+             + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+             + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
+       pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+             + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+             + '(/.+)';
+     }
+     description
+      "The ipv6-prefix type represents an IPv6 address prefix.
+       The prefix length is given by the number following the
+       slash character and must be less than or equal 128.
+
+       A prefix length value of n corresponds to an IP address
+       mask that has n contiguous 1-bits from the most
+       significant bit (MSB) and all other bits set to 0.
+
+       The IPv6 address should have all bits that do not belong
+       to the prefix set to zero.
+
+       The canonical format of an IPv6 prefix has all bits of
+       the IPv6 address set to zero that are not part of the
+       IPv6 prefix.  Furthermore, IPv6 address is represented
+       in the compressed format described in RFC 4291, Section
+       2.2, item 2 with the following additional rules: the ::
+       substitution must be applied to the longest sequence of
+       all-zero 16-bit chunks in an IPv6 address.  If there is
+       a tie, the first sequence of all-zero 16-bit chunks is
+       replaced by ::.  Single all-zero 16-bit chunks are not
+       compressed.  The canonical format uses lowercase
+       characters and leading zeros are not allowed.";
+     reference
+      "RFC 4291: IP Version 6 Addressing Architecture";
+   }
+
+   /*** collection of domain name and URI types ***/
+
+   typedef domain-name {
+     type string {
+       pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*'
+            +  '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)'
+            +  '|\.';
+       length "1..253";
+     }
+     description
+      "The domain-name type represents a DNS domain name.  The
+       name SHOULD be fully qualified whenever possible.
+
+       Internet domain names are only loosely specified.  Section
+       3.5 of RFC 1034 recommends a syntax (modified in Section
+       2.1 of RFC 1123).  The pattern above is intended to allow
+       for current practice in domain name use, and some possible
+       future expansion.  It is designed to hold various types of
+       domain names, including names used for A or AAAA records
+       (host names) and other records, such as SRV records.  Note
+       that Internet host names have a stricter syntax (described
+       in RFC 952) than the DNS recommendations in RFCs 1034 and
+       1123, and that systems that want to store host names in
+       schema nodes using the domain-name type are recommended to
+       adhere to this stricter standard to ensure interoperability.
+
+       The encoding of DNS names in the DNS protocol is limited
+       to 255 characters.  Since the encoding consists of labels
+       prefixed by a length bytes and there is a trailing NULL
+       byte, only 253 characters can appear in the textual dotted
+       notation.
+
+       The description clause of schema nodes using the domain-name
+       type MUST describe when and how these names are resolved to
+       IP addresses.  Note that the resolution of a domain-name value
+       may require to query multiple DNS records (e.g., A for IPv4
+       and AAAA for IPv6).  The order of the resolution process and
+       which DNS record takes precedence can either be defined
+       explicitely or it may depend on the configuration of the
+       resolver.
+
+       Domain-name values use the US-ASCII encoding.  Their canonical
+       format uses lowercase US-ASCII characters.  Internationalized
+       domain names MUST be encoded in punycode as described in RFC
+       3492";
+     reference
+      "RFC  952: DoD Internet Host Table Specification
+       RFC 1034: Domain Names - Concepts and Facilities
+       RFC 1123: Requirements for Internet Hosts -- Application
+                 and Support
+       RFC 2782: A DNS RR for specifying the location of services
+                 (DNS SRV)
+       RFC 3492: Punycode: A Bootstring encoding of Unicode for
+                 Internationalized Domain Names in Applications
+                 (IDNA)
+       RFC 5891: Internationalizing Domain Names in Applications
+                 (IDNA): Protocol";
+   }
+
+   typedef host {
+     type union {
+       type inet:ip-address;
+       type inet:domain-name;
+     }
+     description
+      "The host type represents either an IP address or a DNS
+       domain name.";
+   }
+
+   typedef uri {
+     type string;
+     description
+      "The uri type represents a Uniform Resource Identifier
+       (URI) as defined by STD 66.
+
+       Objects using the uri type MUST be in US-ASCII encoding,
+       and MUST be normalized as described by RFC 3986 Sections
+       6.2.1, 6.2.2.1, and 6.2.2.2.  All unnecessary
+       percent-encoding is removed, and all case-insensitive
+       characters are set to lowercase except for hexadecimal
+       digits, which are normalized to uppercase as described in
+       Section 6.2.2.1.
+
+       The purpose of this normalization is to help provide
+       unique URIs.  Note that this normalization is not
+       sufficient to provide uniqueness.  Two URIs that are
+       textually distinct after this normalization may still be
+       equivalent.
+
+       Objects using the uri type may restrict the schemes that
+       they permit.  For example, 'data:' and 'urn:' schemes
+       might not be appropriate.
+
+       A zero-length URI is not a valid URI.  This can be used to
+       express 'URI absent' where required.
+
+       In the value set and its semantics, this type is equivalent
+       to the Uri SMIv2 textual convention defined in RFC 5017.";
+     reference
+      "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
+       RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
+                 Group: Uniform Resource Identifiers (URIs), URLs,
+                 and Uniform Resource Names (URNs): Clarifications
+                 and Recommendations
+       RFC 5017: MIB Textual Conventions for Uniform Resource
+                 Identifiers (URIs)";
+   }
+
+ }
diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-interfaces@2013-07-04.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-interfaces@2013-07-04.yang
new file mode 100644 (file)
index 0000000..9db753c
--- /dev/null
@@ -0,0 +1,673 @@
+module ietf-interfaces {
+
+  namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
+  prefix if;
+
+  import ietf-yang-types {
+    prefix yang;
+  }
+  import iana-if-type {
+    prefix ianaift;
+  }
+
+  organization
+    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+  contact
+    "WG Web:   <http://tools.ietf.org/wg/netmod/>
+     WG List:  <mailto:netmod@ietf.org>
+
+     WG Chair: David Kessens
+               <mailto:david.kessens@nsn.com>
+
+     WG Chair: Juergen Schoenwaelder
+               <mailto:j.schoenwaelder@jacobs-university.de>
+
+     Editor:   Martin Bjorklund
+               <mailto:mbj@tail-f.com>";
+
+  description
+    "This module contains a collection of YANG definitions for
+     managing network interfaces.
+
+     Copyright (c) 2013 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or
+     without modification, is permitted pursuant to, and subject
+     to the license terms contained in, the Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC XXXX; see
+     the RFC itself for full legal notices.";
+
+  // RFC Ed.: replace XXXX with actual RFC number and remove this
+  // note.
+
+  // RFC Ed.: update the date below with the date of RFC publication
+  // and remove this note.
+  revision 2013-07-04 {
+    description
+      "Initial revision.";
+    reference
+      "RFC XXXX: A YANG Data Model for Interface Management";
+  }
+
+  /* Typedefs */
+
+  typedef interface-ref {
+    type leafref {
+      path "/if:interfaces/if:interface/if:name";
+    }
+    description
+      "This type is used by data models that need to reference
+       configured interfaces.";
+  }
+
+  typedef interface-state-ref {
+    type leafref {
+      path "/if:interfaces-state/if:interface/if:name";
+    }
+    description
+      "This type is used by data models that need to reference
+       the operationally present interfaces.";
+  }
+
+  /* Features */
+
+  feature arbitrary-names {
+    description
+      "This feature indicates that the device allows user-controlled
+       interfaces to be named arbitrarily.";
+  }
+
+  feature pre-provisioning {
+    description
+      "This feature indicates that the device supports
+       pre-provisioning of interface configuration, i.e., it is
+       possible to configure an interface whose physical interface
+       hardware is not present on the device.";
+  }
+
+  feature if-mib {
+    description
+      "This feature indicates that the device implements IF-MIB.";
+    reference
+      "RFC 2863: The Interfaces Group MIB";
+  }
+
+  /* Data nodes */
+
+  container interfaces {
+    description
+      "Interface configuration parameters.";
+
+    list interface {
+      key "name";
+
+      description
+        "The list of configured interfaces on the device.
+
+         The operational state of an interface is available in the
+         /interfaces-state/interface list.  If the configuration of a
+         system-controlled interface cannot be used by the system
+         (e.g., the interface hardware present does not match the
+         interface type), then the configuration is not applied to
+         the system-controlled interface shown in the
+         /interfaces-state/interface list.  If the the configuration
+         of a user-controlled interface cannot be used by the system,
+         the configured interface is not instantiated in the
+         /interfaces-state/interface list.";
+
+     leaf name {
+        type string;
+        description
+          "The name of the interface.
+
+           A device MAY restrict the allowed values for this leaf,
+           possibly depending on the type of the interface.
+
+           For system-controlled interfaces, this leaf is the
+           device-specific name of the interface.  The 'config false'
+           list /interfaces-state/interface contains the currently
+           existing interfaces on the device.
+
+           If a client tries to create configuration for a
+           system-controlled interface that is not present in the
+           /interfaces-state/interface list, the server MAY reject
+           the request, if the implementation does not support
+           pre-provisioning of interfaces, or if the name refers to
+           an interface that can never exist in the system.  A
+           NETCONF server MUST reply with an rpc-error with the
+           error-tag 'invalid-value' in this case.
+
+           If the device supports pre-provisioning of interface
+           configuration, the feature 'pre-provisioning' is
+           advertised.
+
+           If the device allows arbitrarily named user-controlled
+           interfaces, the feature 'arbitrary-names' is advertised.
+
+           When a configured user-controlled interface is created by
+           the system, it is instantiated with the same name in the
+           /interface-state/interface list.  Since the name in that
+           list MAY be mapped to ifName by an implementation, such an
+           implementation MUST restrict the allowed values for this
+           leaf so that it matches the restrictions of ifName.
+
+           If a NETCONF server that implements this restriction is
+           sent a value that doesn't match the restriction, it MUST
+           reply with an rpc-error with the error-tag
+           'invalid-value'.";
+      }
+
+      leaf description {
+        type string;
+        description
+          "A textual description of the interface.
+
+           This leaf MAY be mapped to ifAlias by an implementation.
+           Such an implementation MUST restrict the allowed values
+           for this leaf so that it matches the restrictions of
+           ifAlias.
+
+           If a NETCONF server that implements this restriction is
+           sent a value that doesn't match the restriction, it MUST
+           reply with an rpc-error with the error-tag
+           'invalid-value'.
+
+           Since ifAlias is defined to be stored in non-volatile
+           storage, the MIB implementation MUST map ifAlias to the
+           value of 'description' in the persistently stored
+           datastore.
+
+           Specifically, if the device supports ':startup', when
+           ifAlias is read the device MUST return the value of
+           'description' in the 'startup' datastore, and when it is
+           written, it MUST be written to the 'running' and 'startup'
+           datastores.  Note that it is up to the implementation if
+           it modifies this single leaf in 'startup', or if it
+           performs an implicit copy-config from 'running' to
+           'startup'.
+
+           If the device does not support ':startup', ifAlias MUST
+           be mapped to the 'description' leaf in the 'running'
+           datastore.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifAlias";
+      }
+
+      leaf type {
+        type ianaift:iana-if-type;
+        mandatory true;
+        description
+          "The type of the interface.
+
+           When an interface entry is created, a server MAY
+           initialize the type leaf with a valid value, e.g., if it
+           is possible to derive the type from the name of the
+           interface.
+
+           If a client tries to set the type of an interface to a
+           value that can never be used by the system, e.g., if the
+           type is not supported or if the type does not match the
+           name of the interface, the server MUST reject the request.
+           A NETCONF server MUST reply with an rpc-error with the
+           error-tag 'invalid-value' in this case.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifType";
+      }
+
+      leaf enabled {
+        type boolean;
+        default "true";
+        description
+          "This leaf contains the configured, desired state of the
+           interface.
+
+           Systems that implement the IF-MIB use the value of this
+           leaf in the 'running' datastore to set
+           IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
+           has been initialized, as described in RFC 2863.
+
+           Changes in this leaf in the 'running' datastore are
+           reflected in ifAdminStatus, but if ifAdminStatus is
+           changed over SNMP, this leaf is not affected.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+      }
+
+      leaf link-up-down-trap-enable {
+        if-feature if-mib;
+        type enumeration {
+          enum enabled {
+            value 1;
+          }
+          enum disabled {
+            value 2;
+          }
+        }
+        description
+          "Controls whether linkUp/linkDown SNMP notifications
+           should be generated for this interface.
+
+           If this node is not configured, the value 'enabled' is
+           operationally used by the server for interfaces which do
+           not operate on top of any other interface (i.e., there are
+           no 'lower-layer-if' entries), and 'disabled' otherwise.";
+        reference
+          "RFC 2863: The Interfaces Group MIB -
+                     ifLinkUpDownTrapEnable";
+      }
+    }
+  }
+
+  container interfaces-state {
+    config false;
+    description
+      "Data nodes for the operational state of interfaces.";
+
+    list interface {
+      key "name";
+
+      description
+        "The list of interfaces on the device.
+
+         System-controlled interfaces created by the system are
+         always present in this list, whether they are configured or
+         not.";
+
+      leaf name {
+        type string;
+        description
+          "The name of the interface.
+
+           This leaf MAY be mapped to ifName by an implementation.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifName";
+      }
+
+      leaf type {
+        type ianaift:iana-if-type;
+        mandatory true;
+        description
+          "The type of the interface.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifType";
+      }
+
+      leaf admin-status {
+        if-feature if-mib;
+        type enumeration {
+          enum up {
+            value 1;
+            description
+              "Ready to pass packets.";
+          }
+          enum down {
+            value 2;
+            description
+              "Not ready to pass packets and not in some test mode.";
+          }
+          enum testing {
+            value 3;
+            description
+              "In some test mode.";
+          }
+        }
+        mandatory true;
+        description
+          "The desired state of the interface.
+
+           This leaf has the same read semantics as ifAdminStatus.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
+      }
+
+      leaf oper-status {
+        type enumeration {
+          enum up {
+            value 1;
+            description
+              "Ready to pass packets.";
+          }
+          enum down {
+            value 2;
+            description
+              "The interface does not pass any packets.";
+          }
+          enum testing {
+            value 3;
+            description
+              "In some test mode.  No operational packets can
+               be passed.";
+          }
+          enum unknown {
+            value 4;
+            description
+              "Status cannot be determined for some reason.";
+          }
+          enum dormant {
+            value 5;
+            description
+              "Waiting for some external event.";
+          }
+          enum not-present {
+            value 6;
+            description
+              "Some component (typically hardware) is missing.";
+          }
+          enum lower-layer-down {
+            value 7;
+            description
+              "Down due to state of lower-layer interface(s).";
+          }
+        }
+        mandatory true;
+        description
+          "The current operational state of the interface.
+
+           This leaf has the same semantics as ifOperStatus.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifOperStatus";
+      }
+
+      leaf last-change {
+        type yang:date-and-time;
+        description
+          "The time the interface entered its current operational
+           state.  If the current state was entered prior to the
+           last re-initialization of the local network management
+           subsystem, then this node is not present.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifLastChange";
+      }
+
+      leaf if-index {
+        if-feature if-mib;
+        type int32 {
+          range "1..2147483647";
+        }
+        mandatory true;
+        description
+          "The ifIndex value for the ifEntry represented by this
+           interface.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifIndex";
+      }
+
+      leaf phys-address {
+        type yang:phys-address;
+        description
+          "The interface's address at its protocol sub-layer.  For
+          example, for an 802.x interface, this object normally
+          contains a MAC address.  The interface's media-specific
+          modules must define the bit and byte ordering and the
+          format of the value of this object.  For interfaces that do
+          not have such an address (e.g., a serial line), this node
+          is not present.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
+      }
+
+      leaf-list higher-layer-if {
+        type interface-state-ref;
+        description
+          "A list of references to interfaces layered on top of this
+           interface.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifStackTable";
+      }
+
+      leaf-list lower-layer-if {
+        type interface-state-ref;
+        description
+          "A list of references to interfaces layered underneath this
+           interface.";
+        reference
+          "RFC 2863: The Interfaces Group MIB - ifStackTable";
+      }
+
+      leaf speed {
+        type yang:gauge64;
+        units "bits / second";
+        description
+            "An estimate of the interface's current bandwidth in bits
+             per second.  For interfaces that do not vary in
+             bandwidth or for those where no accurate estimation can
+             be made, this node should contain the nominal bandwidth.
+             For interfaces that have no concept of bandwidth, this
+             node is not present.";
+        reference
+          "RFC 2863: The Interfaces Group MIB -
+                     ifSpeed, ifHighSpeed";
+      }
+
+      container statistics {
+        description
+          "A collection of interface-related statistics objects.";
+
+        leaf discontinuity-time {
+          type yang:date-and-time;
+          mandatory true;
+          description
+            "The time on the most recent occasion at which any one or
+             more of this interface's counters suffered a
+             discontinuity.  If no such discontinuities have occurred
+             since the last re-initialization of the local management
+             subsystem, then this node contains the time the local
+             management subsystem re-initialized itself.";
+        }
+
+        leaf in-octets {
+          type yang:counter64;
+          description
+            "The total number of octets received on the interface,
+             including framing characters.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
+        }
+        leaf in-unicast-pkts {
+          type yang:counter64;
+          description
+            "The number of packets, delivered by this sub-layer to a
+             higher (sub-)layer, which were not addressed to a
+             multicast or broadcast address at this sub-layer.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
+        }
+        leaf in-broadcast-pkts {
+          type yang:counter64;
+          description
+            "The number of packets, delivered by this sub-layer to a
+             higher (sub-)layer, which were addressed to a broadcast
+             address at this sub-layer.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCInBroadcastPkts";
+        }
+        leaf in-multicast-pkts {
+          type yang:counter64;
+          description
+            "The number of packets, delivered by this sub-layer to a
+             higher (sub-)layer, which were addressed to a multicast
+             address at this sub-layer.  For a MAC layer protocol,
+             this includes both Group and Functional addresses.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCInMulticastPkts";
+        }
+        leaf in-discards {
+          type yang:counter32;
+          description
+            "The number of inbound packets which were chosen to be
+             discarded even though no errors had been detected to
+             prevent their being deliverable to a higher-layer
+             protocol.  One possible reason for discarding such a
+             packet could be to free up buffer space.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifInDiscards";
+        }
+        leaf in-errors {
+          type yang:counter32;
+          description
+            "For packet-oriented interfaces, the number of inbound
+             packets that contained errors preventing them from being
+             deliverable to a higher-layer protocol.  For character-
+             oriented or fixed-length interfaces, the number of
+             inbound transmission units that contained errors
+             preventing them from being deliverable to a higher-layer
+             protocol.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifInErrors";
+        }
+        leaf in-unknown-protos {
+          type yang:counter32;
+          description
+            "For packet-oriented interfaces, the number of packets
+             received via the interface which were discarded because
+             of an unknown or unsupported protocol.  For
+             character-oriented or fixed-length interfaces that
+             support protocol multiplexing the number of transmission
+             units received via the interface which were discarded
+             because of an unknown or unsupported protocol.  For any
+             interface that does not support protocol multiplexing,
+             this counter is not present.
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
+        }
+
+        leaf out-octets {
+          type yang:counter64;
+          description
+            "The total number of octets transmitted out of the
+             interface, including framing characters.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
+        }
+        leaf out-unicast-pkts {
+          type yang:counter64;
+          description
+            "The total number of packets that higher-level protocols
+             requested be transmitted, and which were not addressed
+             to a multicast or broadcast address at this sub-layer,
+             including those that were discarded or not sent.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
+        }
+        leaf out-broadcast-pkts {
+          type yang:counter64;
+          description
+            "The total number of packets that higher-level protocols
+             requested be transmitted, and which were addressed to a
+             broadcast address at this sub-layer, including those
+             that were discarded or not sent.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCOutBroadcastPkts";
+        }
+        leaf out-multicast-pkts {
+          type yang:counter64;
+          description
+            "The total number of packets that higher-level protocols
+             requested be transmitted, and which were addressed to a
+             multicast address at this sub-layer, including those
+             that were discarded or not sent.  For a MAC layer
+             protocol, this includes both Group and Functional
+             addresses.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB -
+                       ifHCOutMulticastPkts";
+        }
+        leaf out-discards {
+          type yang:counter32;
+          description
+            "The number of outbound packets which were chosen to be
+             discarded even though no errors had been detected to
+             prevent their being transmitted.  One possible reason
+             for discarding such a packet could be to free up buffer
+             space.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
+        }
+        leaf out-errors {
+          type yang:counter32;
+          description
+            "For packet-oriented interfaces, the number of outbound
+             packets that could not be transmitted because of errors.
+             For character-oriented or fixed-length interfaces, the
+             number of outbound transmission units that could not be
+             transmitted because of errors.
+
+             Discontinuities in the value of this counter can occur
+             at re-initialization of the management system, and at
+             other times as indicated by the value of
+             'discontinuity-time'.";
+          reference
+            "RFC 2863: The Interfaces Group MIB - ifOutErrors";
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf@2013-10-19.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf@2013-10-19.yang
new file mode 100644 (file)
index 0000000..16766b0
--- /dev/null
@@ -0,0 +1,684 @@
+module ietf-restconf {
+     namespace "urn:ietf:params:xml:ns:yang:ietf-restconf";
+     prefix "restconf";
+
+     import ietf-yang-types { prefix yang; }
+     import ietf-inet-types { prefix inet; }
+     organization
+       "IETF NETCONF (Network Configuration) Working Group";
+
+     contact
+       "Editor:   Andy Bierman
+                  <mailto:andy@yumaworks.com>
+
+        Editor:   Martin Bjorklund
+                  <mailto:mbj@tail-f.com>
+
+        Editor:   Kent Watsen
+                  <mailto:kwatsen@juniper.net>
+
+        Editor:   Rex Fernando
+                  <mailto:rex@cisco.com>";
+
+     description
+       "This module contains conceptual YANG specifications
+        for the YANG Patch and error content that is used in
+        RESTCONF protocol messages. A conceptual container
+        representing the RESTCONF API nodes (media type
+        application/yang.api).
+
+        Note that the YANG definitions within this module do not
+        represent configuration data of any kind.
+        The YANG grouping statements provide a normative syntax
+        for XML and JSON message encoding purposes.
+        Copyright (c) 2013 IETF Trust and the persons identified as
+        authors of the code.  All rights reserved.
+
+        Redistribution and use in source and binary forms, with or
+        without modification, is permitted pursuant to, and subject
+        to the license terms contained in, the Simplified BSD License
+        set forth in Section 4.c of the IETF Trust's Legal Provisions
+        Relating to IETF Documents
+        (http://trustee.ietf.org/license-info).
+
+        This version of this YANG module is part of RFC XXXX; see
+        the RFC itself for full legal notices.";
+
+     // RFC Ed.: replace XXXX with actual RFC number and remove this
+     // note.
+
+     // RFC Ed.: remove this note
+     // Note: extracted from draft-bierman-netconf-restconf-02.txt
+
+     // RFC Ed.: update the date below with the date of RFC publication
+     // and remove this note.
+     revision 2013-10-19 {
+       description
+         "Initial revision.";
+       reference
+         "RFC XXXX: RESTCONF Protocol.";
+     }
+
+     typedef data-resource-identifier {
+       type string {
+         length "1 .. max";
+       }
+       description
+         "Contains a Data Resource Identifier formatted string
+          to identify a specific data node. The data node that
+          uses this data type SHOULD define the document root
+          for data resource identifiers.  The default document
+          root is the target datastore conceptual root node.
+          Data resource identifiers are defined relative to
+          this document root.";
+       reference
+         "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]";
+     }
+
+     // this typedef is TBD; not currently used
+     typedef datastore-identifier {
+       type union {
+         type enumeration {
+           enum candidate {
+             description
+               "Identifies the NETCONF shared candidate datastore.";
+             reference
+               "RFC 6241, section 8.3";
+           }
+           enum running {
+             description
+               "Identifies the NETCONF running datastore.";
+             reference
+               "RFC 6241, section 5.1";
+           }
+           enum startup {
+             description
+               "Identifies the NETCONF startup datastore.";
+             reference
+               "RFC 6241, section 8.7";
+           }
+         }
+         type string;
+       }
+       description
+         "Contains a string to identify a specific datastore.
+          The enumerated datastore identifier values are
+          reserved for standard datastore names.";
+     }
+
+     typedef revision-identifier {
+       type string {
+         pattern '\d{4}-\d{2}-\d{2}';
+       }
+       description
+         "Represents a specific date in YYYY-MM-DD format.
+          TBD: make pattern more precise to exclude leading zeros.";
+     }
+
+     grouping yang-patch {
+       description
+         "A grouping that contains a YANG container
+          representing the syntax and semantics of a
+          YANG Patch edit request message.";
+
+       container yang-patch {
+         description
+           "Represents a conceptual sequence of datastore edits,
+            called a patch. Each patch is given a client-assigned
+            patch identifier. Each edit MUST be applied
+            in ascending order, and all edits MUST be applied.
+            If any errors occur, then the target datastore MUST NOT
+            be changed by the patch operation.
+
+            A patch MUST be validated by the server to be a
+            well-formed message before any of the patch edits
+            are validated or attempted.
+
+            YANG datastore validation (defined in RFC 6020, section 
+            8.3.3) is performed after all edits have been
+            individually validated.
+
+            It is possible for a datastore constraint violation to occur
+            due to any node in the datastore, including nodes not
+            included in the edit list. Any validation errors MUST
+            be reported in the reply message.";
+
+         reference
+           "RFC 6020, section 8.3.";
+
+         leaf patch-id {
+           type string;
+           description
+             "An arbitrary string provided by the client to identify
+              the entire patch.  This value SHOULD be present in any
+              audit logging records generated by the server for the
+              patch. Error messages returned by the server pertaining
+              to this patch will be identified by this patch-id value.";
+         }
+
+         leaf comment {
+           type string {
+             length "0 .. 1024";
+           }
+           description
+             "An arbitrary string provided by the client to describe
+              the entire patch.  This value SHOULD be present in any
+              audit logging records generated by the server for the
+              patch.";
+         }
+
+         list edit {
+           key edit-id;
+           ordered-by user;
+
+           description
+             "Represents one edit within the YANG Patch
+              request message.";
+           leaf edit-id {
+             type string;
+             description
+               "Arbitrary string index for the edit.
+                Error messages returned by the server pertaining
+                to a specific edit will be identified by this
+                value.";
+           }
+
+           leaf operation {
+             type enumeration {
+               enum create {
+                 description
+                   "The target data node is created using the
+                    supplied value, only if it does not already
+                    exist.";
+               }
+               enum delete {
+                 description
+                   "Delete the target node, only if the data resource
+                    currently exists, otherwise return an error.";
+               }
+               enum insert {
+                 description
+                   "Insert the supplied value into a user-ordered
+                    list or leaf-list entry. The target node must
+                    represent a new data resource.";
+               }
+               enum merge {
+                 description
+                   "The supplied value is merged with the target data
+                    node.";
+               }
+               enum move {
+                 description
+                   "Move the target node. Reorder a user-ordered
+                    list or leaf-list. The target node must represent
+                    an existing data resource.";
+               }
+               enum replace {
+                 description
+                   "The supplied value is used to replace the target
+                    data node.";
+               }
+               enum remove {
+                 description
+                   "Delete the target node if it currently exists.";
+               }
+             }
+             mandatory true;
+             description
+               "The datastore operation requested for the associated
+                edit entry";
+           }
+
+           leaf target {
+             type data-resource-identifier;
+             mandatory true;
+             description
+               "Identifies the target data resource for the edit
+                operation.";
+           }
+
+           leaf point {
+             when "(../operation = 'insert' or " +
+               "../operation = 'move') and " +
+               "(../where = 'before' or ../where = 'after')" {
+               description
+                 "Point leaf only applies for insert or move
+                  operations, before or after an existing entry.";
+             }
+             type data-resource-identifier;
+             description
+               "The absolute URL path for the data node that is being
+                used as the insertion point or move point for the
+                target of this edit entry.";
+           }
+
+           leaf where {
+             when "../operation = 'insert' or ../operation = 'move'" {
+               description
+                 "Where leaf only applies for insert or move
+                  operations.";
+             }
+             type enumeration {
+               enum before {
+                 description
+                   "Insert or move a data node before the data resource
+                    identified by the 'point' parameter.";
+               }
+               enum after {
+                 description
+                   "Insert or move a data node after the data resource
+                    identified by the 'point' parameter.";
+               }
+               enum first {
+                 description
+                   "Insert or move a data node so it becomes ordered
+                    as the first entry.";
+               }
+               enum last {
+                 description
+                   "Insert or move a data node so it becomes ordered
+                    as the last entry.";
+               }
+
+             }
+             default last;
+             description
+               "Identifies where a data resource will be inserted or
+                moved. YANG only allows these operations for
+                list and leaf-list data nodes that are ordered-by
+                user.";
+           }
+
+           anyxml value {
+             when "(../operation = 'create' or " +
+               "../operation = 'merge' " +
+               "or ../operation = 'replace' or " +
+               "../operation = 'insert')" {
+               description
+                 "Value node only used for create, merge,
+                  replace, and insert operations";
+             }
+             description
+               "Value used for this edit operation.";
+           }
+         }
+       }
+
+     } // grouping yang-patch
+
+
+     grouping yang-patch-status {
+
+       description
+         "A grouping that contains a YANG container
+          representing the syntax and semantics of
+          YANG Patch status response message.";
+
+       container yang-patch-status {
+         description
+           "A container representing the response message
+            sent by the server after a YANG Patch edit
+            request message has been processed.";
+
+         leaf patch-id {
+           type string;
+           description
+             "The patch-id value used in the request";
+         }
+
+         choice global-status {
+           description
+             "Report global errors or complete success.
+              If there is no case selected then errors
+              are reported in the edit-status container.";
+
+           case global-errors {
+             uses errors;
+             description
+               "This container will be present if global
+                errors unrelated to a specific edit occurred.";
+           }
+           leaf ok {
+             type empty;
+             description
+               "This leaf will be present if the request succeeded
+                and there are no errors reported in the edit-status
+                container.";
+           }
+         }
+
+         container edit-status {
+           description
+             "This container will be present if there are
+              edit-specific status responses to report.";
+
+           list edit {
+             key edit-id;
+
+             description
+               "Represents a list of status responses,
+                corresponding to edits in the YANG Patch
+                request message.  If an edit entry was
+                skipped or not reached by the server,
+                then this list will not contain a corresponding
+                entry for that edit.";
+
+             leaf edit-id {
+               type string;
+                description
+                  "Response status is for the edit list entry
+                   with this edit-id value.";
+             }
+             choice edit-status-choice {
+               description
+                 "A choice between different types of status
+                  responses for each edit entry.";
+               leaf ok {
+                 type empty;
+                 description
+                   "This edit entry was invoked without any
+                    errors detected by the server associated
+                    with this edit.";
+               }
+               leaf location {
+                 type inet:uri;
+                 description
+                   "Contains the Location header value that would be
+                    returned if this edit causes a new resource to be
+                    created. If the edit identified by the same edit-id
+                    value was successfully invoked and a new resource
+                    was created, then this field will be returned
+                    instead of 'ok'.";
+               }
+               case errors {
+                 uses errors;
+                 description
+                   "The server detected errors associated with the
+                     edit identified by the same edit-id value.";
+               }
+             }
+           }
+         }
+       }
+     }  // grouping yang-patch-status
+
+
+     grouping errors {
+
+       description
+         "A grouping that contains a YANG container
+          representing the syntax and semantics of a
+          YANG Patch errors report within a response message.";
+
+       container errors {
+         config false;  // needed so list error does not need a key
+         description
+           "Represents an error report returned by the server if
+            a request results in an error.";
+
+         list error {
+           description
+             "An entry containing information about one
+              specific error that occurred while processing
+              a RESTCONF request.";
+           reference "RFC 6241, Section 4.3";
+
+           leaf error-type {
+             type enumeration {
+               enum transport {
+                 description "The transport layer";
+               }
+               enum rpc {
+                 description "The rpc or notification layer";
+               }
+               enum protocol {
+                 description "The protocol operation layer";
+               }
+               enum application {
+                 description "The server application layer";
+               }
+             }
+             mandatory true;
+             description
+               "The protocol layer where the error occurred.";
+           }
+
+           leaf error-tag {
+             type string;
+             mandatory true;
+             description
+               "The enumerated error tag.";
+           }
+
+           leaf error-app-tag {
+             type string;
+             description
+               "The application-specific error tag.";
+           }
+
+           leaf error-path {
+             type data-resource-identifier;
+             description
+               "The target data resource identifier associated
+                with the error, if any.";
+           }
+           leaf error-message {
+             type string;
+             description
+               "A message describing the error.";
+           }
+
+           container error-info {
+              description
+                "A container allowing additional information
+                 to be included in the error report.";
+              // arbitrary anyxml content here
+           }
+         }
+       }
+     } // grouping errors
+
+
+     grouping restconf {
+
+       description
+         "A grouping that contains a YANG container
+          representing the syntax and semantics of
+          the RESTCONF API resource.";
+
+       container restconf {
+         description
+           "Conceptual container representing the
+            application/yang.api resource type.";
+
+         container config {
+           description
+             "Container representing the application/yang.datastore
+              resource type. Represents the conceptual root of the
+              unified configuration datastore containing YANG data
+              nodes. The child nodes of this container are
+              configuration data resources (application/yang.data)
+              defined as top-level YANG data nodes from the modules
+              advertised by the server in /restconf/modules.";
+         }
+
+         container operational {
+           description
+             "Container representing the application/yang.datastore
+              resource type. Represents the conceptual root of the
+              operational data supported by the server.  The child
+              nodes of this container are operational data resources
+              (application/yang.data) defined as top-level
+              YANG data nodes from the modules advertised by
+              the server in /restconf/modules.";
+         }
+
+         container modules {
+           description
+             "Contains a list of module description entries.
+              These modules are currently loaded into the server.";
+
+           list module {
+             key "name revision";
+             description
+               "Each entry represents one module currently
+                supported by the server.";
+
+             leaf name {
+               type yang:yang-identifier;
+               description "The YANG module name.";
+             }
+             leaf revision {
+               type union {
+                 type revision-identifier;
+                 type string { length 0; }
+               }
+               description
+                 "The YANG module revision date. An empty string is
+                  used if no revision statement is present in the
+                  YANG module.";
+             }
+             leaf namespace {
+               type inet:uri;
+               mandatory true;
+               description
+                 "The XML namespace identifier for this module.";
+             }
+             leaf-list feature {
+               type yang:yang-identifier;
+               description
+                 "List of YANG feature names from this module that are
+                  supported by the server.";
+             }
+             leaf-list deviation {
+               type yang:yang-identifier;
+               description
+                 "List of YANG deviation module names used by this
+                  server to modify the conformance of the module
+                  associated with this entry.";
+             }
+           }
+         }
+
+         container operations {
+           description
+             "Container for all operation resources
+              (application/yang.operation),
+
+              Each resource is represented as an empty leaf with the
+              name of the RPC operation from the YANG rpc statement.
+
+              E.g.;
+
+                 POST /restconf/operations/show-log-errors
+
+                 leaf show-log-errors {
+                   type empty;
+                 }
+             ";
+         }
+
+         container streams {
+           description
+             "Container representing the notification event streams
+              supported by the server.";
+            reference
+              "RFC 5277, Section 3.4, <streams> element.";
+
+           list stream {
+             key name;
+             description
+               "Each entry describes an event stream supported by
+                the server.";
+
+             leaf name {
+               type string;
+               description "The stream name";
+               reference "RFC 5277, Section 3.4, <name> element.";
+             }
+
+             leaf description {
+               type string;
+               description "Description of stream content";
+               reference
+                 "RFC 5277, Section 3.4, <description> element.";
+             }
+
+             leaf replay-support {
+               type boolean;
+               description
+                 "Indicates if replay buffer supported for this stream";
+               reference
+                 "RFC 5277, Section 3.4, <replaySupport> element.";
+             }
+
+             leaf replay-log-creation-time {
+               type yang:date-and-time;
+               description
+                 "Indicates the time the replay log for this stream
+                  was created.";
+               reference
+                 "RFC 5277, Section 3.4, <replayLogCreationTime>
+                  element.";
+             }
+
+             leaf events {
+               type empty;
+               description
+                 "Represents the entry point for establishing
+                  notification delivery via server sent events.";
+             }
+           }
+         }
+
+         leaf version {
+           type enumeration {
+             enum "1.0" {
+               description
+                 "Version 1.0 of the RESTCONF protocol.";
+             }
+           }
+           config false;
+           description
+             "Contains the RESTCONF protocol version.";
+         }
+       }
+     }  // grouping restconf
+
+
+     grouping notification {
+       description
+         "Contains the notification message wrapper definition.";
+
+       container notification {
+         description
+           "RESTCONF notification message wrapper.";
+         leaf event-time {
+           type yang:date-and-time;
+           mandatory true;
+           description
+             "The time the event was generated by the
+              event source.";
+           reference
+             "RFC 5277, section 4, <eventTime> element.";
+         }
+
+         /* The YANG-specific notification container is encoded
+          * after the 'event-time' element.  The format
+          * corresponds to the notificationContent element
+          * in RFC 5277, section 4. For example:
+          *
+          *  module example-one {
+          *     ...
+          *     notification event1 { ... }
+          *
+          *  }
+          *
+          *  Encoded as element 'event1' in the namespace
+          *  for module 'example-one'.
+          */
+       }
+     }  // grouping notification
+
+   }
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-yang-types.yang b/opendaylight/md-sal/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-yang-types.yang
new file mode 100644 (file)
index 0000000..07e50b3
--- /dev/null
@@ -0,0 +1,417 @@
+ module ietf-yang-types {
+
+   namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
+   prefix "yang";
+
+   organization
+    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+   contact
+    "WG Web:   <http://tools.ietf.org/wg/netmod/>
+     WG List:  <mailto:netmod@ietf.org>
+
+     WG Chair: David Partain
+               <mailto:david.partain@ericsson.com>
+
+     WG Chair: David Kessens
+               <mailto:david.kessens@nsn.com>
+
+     Editor:   Juergen Schoenwaelder
+               <mailto:j.schoenwaelder@jacobs-university.de>";
+
+   description
+    "This module contains a collection of generally useful derived
+     YANG data types.
+
+     Copyright (c) 2010 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or without
+     modification, is permitted pursuant to, and subject to the license
+     terms contained in, the Simplified BSD License set forth in Section
+     4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     This version of this YANG module is part of RFC 6021; see
+     the RFC itself for full legal notices.";
+
+   revision 2010-09-24 {
+     description
+      "Initial revision.";
+     reference
+      "RFC 6021: Common YANG Data Types";
+   }
+
+   /*** collection of counter and gauge types ***/
+
+   typedef counter32 {
+     type uint32;
+     description
+      "The counter32 type represents a non-negative integer
+       that monotonically increases until it reaches a
+       maximum value of 2^32-1 (4294967295 decimal), when it
+       wraps around and starts increasing again from zero.
+
+       Counters have no defined 'initial' value, and thus, a
+       single value of a counter has (in general) no information
+       content.  Discontinuities in the monotonically increasing
+       value normally occur at re-initialization of the
+       management system, and at other times as specified in the
+       description of a schema node using this type.  If such
+       other times can occur, for example, the creation of
+       a schema node of type counter32 at times other than
+       re-initialization, then a corresponding schema node
+       should be defined, with an appropriate type, to indicate
+       the last discontinuity.
+
+       The counter32 type should not be used for configuration
+       schema nodes.  A default statement SHOULD NOT be used in
+       combination with the type counter32.
+
+       In the value set and its semantics, this type is equivalent
+       to the Counter32 type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef zero-based-counter32 {
+     type yang:counter32;
+     default "0";
+     description
+      "The zero-based-counter32 type represents a counter32
+       that has the defined 'initial' value zero.
+
+       A schema node of this type will be set to zero (0) on creation
+       and will thereafter increase monotonically until it reaches
+       a maximum value of 2^32-1 (4294967295 decimal), when it
+       wraps around and starts increasing again from zero.
+
+       Provided that an application discovers a new schema node
+       of this type within the minimum time to wrap, it can use the
+       'initial' value as a delta.  It is important for a management
+       station to be aware of this minimum time and the actual time
+       between polls, and to discard data if the actual time is too
+       long or there is no defined minimum time.
+
+       In the value set and its semantics, this type is equivalent
+       to the ZeroBasedCounter32 textual convention of the SMIv2.";
+     reference
+       "RFC 4502: Remote Network Monitoring Management Information
+                  Base Version 2";
+   }
+
+   typedef counter64 {
+     type uint64;
+     description
+      "The counter64 type represents a non-negative integer
+       that monotonically increases until it reaches a
+       maximum value of 2^64-1 (18446744073709551615 decimal),
+       when it wraps around and starts increasing again from zero.
+
+       Counters have no defined 'initial' value, and thus, a
+       single value of a counter has (in general) no information
+       content.  Discontinuities in the monotonically increasing
+       value normally occur at re-initialization of the
+       management system, and at other times as specified in the
+       description of a schema node using this type.  If such
+       other times can occur, for example, the creation of
+       a schema node of type counter64 at times other than
+       re-initialization, then a corresponding schema node
+       should be defined, with an appropriate type, to indicate
+       the last discontinuity.
+
+       The counter64 type should not be used for configuration
+       schema nodes.  A default statement SHOULD NOT be used in
+       combination with the type counter64.
+
+       In the value set and its semantics, this type is equivalent
+       to the Counter64 type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef zero-based-counter64 {
+     type yang:counter64;
+     default "0";
+     description
+      "The zero-based-counter64 type represents a counter64 that
+       has the defined 'initial' value zero.
+
+       A schema node of this type will be set to zero (0) on creation
+       and will thereafter increase monotonically until it reaches
+       a maximum value of 2^64-1 (18446744073709551615 decimal),
+       when it wraps around and starts increasing again from zero.
+
+       Provided that an application discovers a new schema node
+       of this type within the minimum time to wrap, it can use the
+       'initial' value as a delta.  It is important for a management
+       station to be aware of this minimum time and the actual time
+       between polls, and to discard data if the actual time is too
+       long or there is no defined minimum time.
+
+       In the value set and its semantics, this type is equivalent
+       to the ZeroBasedCounter64 textual convention of the SMIv2.";
+     reference
+      "RFC 2856: Textual Conventions for Additional High Capacity
+                 Data Types";
+   }
+
+   typedef gauge32 {
+     type uint32;
+     description
+      "The gauge32 type represents a non-negative integer, which
+       may increase or decrease, but shall never exceed a maximum
+       value, nor fall below a minimum value.  The maximum value
+       cannot be greater than 2^32-1 (4294967295 decimal), and
+       the minimum value cannot be smaller than 0.  The value of
+       a gauge32 has its maximum value whenever the information
+       being modeled is greater than or equal to its maximum
+       value, and has its minimum value whenever the information
+       being modeled is smaller than or equal to its minimum value.
+       If the information being modeled subsequently decreases
+       below (increases above) the maximum (minimum) value, the
+       gauge32 also decreases (increases).
+
+       In the value set and its semantics, this type is equivalent
+       to the Gauge32 type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef gauge64 {
+     type uint64;
+     description
+      "The gauge64 type represents a non-negative integer, which
+       may increase or decrease, but shall never exceed a maximum
+       value, nor fall below a minimum value.  The maximum value
+       cannot be greater than 2^64-1 (18446744073709551615), and
+       the minimum value cannot be smaller than 0.  The value of
+       a gauge64 has its maximum value whenever the information
+       being modeled is greater than or equal to its maximum
+       value, and has its minimum value whenever the information
+       being modeled is smaller than or equal to its minimum value.
+       If the information being modeled subsequently decreases
+       below (increases above) the maximum (minimum) value, the
+       gauge64 also decreases (increases).
+
+       In the value set and its semantics, this type is equivalent
+       to the CounterBasedGauge64 SMIv2 textual convention defined
+       in RFC 2856";
+     reference
+      "RFC 2856: Textual Conventions for Additional High Capacity
+                 Data Types";
+   }
+
+   /*** collection of identifier related types ***/
+
+   typedef object-identifier {
+     type string {
+       pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))'
+             + '(\.(0|([1-9]\d*)))*';
+     }
+     description
+      "The object-identifier type represents administratively
+       assigned names in a registration-hierarchical-name tree.
+
+       Values of this type are denoted as a sequence of numerical
+       non-negative sub-identifier values.  Each sub-identifier
+       value MUST NOT exceed 2^32-1 (4294967295).  Sub-identifiers
+       are separated by single dots and without any intermediate
+       whitespace.
+
+       The ASN.1 standard restricts the value space of the first
+       sub-identifier to 0, 1, or 2.  Furthermore, the value space
+       of the second sub-identifier is restricted to the range
+       0 to 39 if the first sub-identifier is 0 or 1.  Finally,
+       the ASN.1 standard requires that an object identifier
+       has always at least two sub-identifier.  The pattern
+       captures these restrictions.
+
+       Although the number of sub-identifiers is not limited,
+       module designers should realize that there may be
+       implementations that stick with the SMIv2 limit of 128
+       sub-identifiers.
+
+       This type is a superset of the SMIv2 OBJECT IDENTIFIER type
+       since it is not restricted to 128 sub-identifiers.  Hence,
+       this type SHOULD NOT be used to represent the SMIv2 OBJECT
+       IDENTIFIER type, the object-identifier-128 type SHOULD be
+       used instead.";
+     reference
+      "ISO9834-1: Information technology -- Open Systems
+       Interconnection -- Procedures for the operation of OSI
+       Registration Authorities: General procedures and top
+       arcs of the ASN.1 Object Identifier tree";
+   }
+
+
+
+
+   typedef object-identifier-128 {
+     type object-identifier {
+       pattern '\d*(\.\d*){1,127}';
+     }
+     description
+      "This type represents object-identifiers restricted to 128
+       sub-identifiers.
+
+       In the value set and its semantics, this type is equivalent
+       to the OBJECT IDENTIFIER type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+   
+    typedef yang-identifier {
+       type string {
+         length "1..max";
+         pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';
+         pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
+       }
+       description
+         "A YANG identifier string as defined by the 'identifier'
+          rule in Section 12 of RFC 6020.  An identifier must
+          start with an alphabetic character or an underscore
+          followed by an arbitrary sequence of alphabetic or
+          numeric characters, underscores, hyphens, or dots.
+
+          A YANG identifier MUST NOT start with any possible
+          combination of the lowercase or uppercase character
+          sequence 'xml'.";
+       reference
+         "RFC 6020: YANG - A Data Modeling Language for the Network
+                    Configuration Protocol (NETCONF)";
+     }   
+
+   /*** collection of date and time related types ***/
+
+   typedef date-and-time {
+     type string {
+       pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
+             + '(Z|[\+\-]\d{2}:\d{2})';
+     }
+     description
+      "The date-and-time type is a profile of the ISO 8601
+       standard for representation of dates and times using the
+       Gregorian calendar.  The profile is defined by the
+       date-time production in Section 5.6 of RFC 3339.
+
+       The date-and-time type is compatible with the dateTime XML
+       schema type with the following notable exceptions:
+
+       (a) The date-and-time type does not allow negative years.
+
+       (b) The date-and-time time-offset -00:00 indicates an unknown
+           time zone (see RFC 3339) while -00:00 and +00:00 and Z all
+           represent the same time zone in dateTime.
+
+       (c) The canonical format (see below) of data-and-time values
+           differs from the canonical format used by the dateTime XML
+           schema type, which requires all times to be in UTC using the
+           time-offset 'Z'.
+
+       This type is not equivalent to the DateAndTime textual
+       convention of the SMIv2 since RFC 3339 uses a different
+       separator between full-date and full-time and provides
+       higher resolution of time-secfrac.
+
+       The canonical format for date-and-time values with a known time
+       zone uses a numeric time zone offset that is calculated using
+       the device's configured known offset to UTC time.  A change of
+       the device's offset to UTC time will cause date-and-time values
+       to change accordingly.  Such changes might happen periodically
+       in case a server follows automatically daylight saving time
+       (DST) time zone offset changes.  The canonical format for
+       date-and-time values with an unknown time zone (usually referring
+       to the notion of local time) uses the time-offset -00:00.";
+     reference
+      "RFC 3339: Date and Time on the Internet: Timestamps
+       RFC 2579: Textual Conventions for SMIv2
+       XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
+   }
+
+   typedef timeticks {
+     type uint32;
+     description
+      "The timeticks type represents a non-negative integer that
+       represents the time, modulo 2^32 (4294967296 decimal), in
+       hundredths of a second between two epochs.  When a schema
+       node is defined that uses this type, the description of
+       the schema node identifies both of the reference epochs.
+
+       In the value set and its semantics, this type is equivalent
+       to the TimeTicks type of the SMIv2.";
+     reference
+      "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
+   }
+
+   typedef timestamp {
+     type yang:timeticks;
+     description
+      "The timestamp type represents the value of an associated
+       timeticks schema node at which a specific occurrence happened.
+       The specific occurrence must be defined in the description
+       of any schema node defined using this type.  When the specific
+       occurrence occurred prior to the last time the associated
+       timeticks attribute was zero, then the timestamp value is
+       zero.  Note that this requires all timestamp values to be
+       reset to zero when the value of the associated timeticks
+       attribute reaches 497+ days and wraps around to zero.
+
+       The associated timeticks schema node must be specified
+       in the description of any schema node using this type.
+
+       In the value set and its semantics, this type is equivalent
+       to the TimeStamp textual convention of the SMIv2.";
+     reference
+      "RFC 2579: Textual Conventions for SMIv2";
+   }
+
+   /*** collection of generic address types ***/
+
+   typedef phys-address {
+     type string {
+       pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
+     }
+     description
+      "Represents media- or physical-level addresses represented
+       as a sequence octets, each octet represented by two hexadecimal
+       numbers.  Octets are separated by colons.  The canonical
+       representation uses lowercase characters.
+
+       In the value set and its semantics, this type is equivalent
+       to the PhysAddress textual convention of the SMIv2.";
+     reference
+      "RFC 2579: Textual Conventions for SMIv2";
+   }
+
+   typedef mac-address {
+     type string {
+       pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
+     }
+     description
+      "The mac-address type represents an IEEE 802 MAC address.
+       The canonical representation uses lowercase characters.
+
+       In the value set and its semantics, this type is equivalent
+       to the MacAddress textual convention of the SMIv2.";
+     reference
+      "IEEE 802: IEEE Standard for Local and Metropolitan Area
+                 Networks: Overview and Architecture
+       RFC 2579: Textual Conventions for SMIv2";
+   }
+
+   /*** collection of XML specific types ***/
+
+   typedef xpath1.0 {
+     type string;
+     description
+      "This type represents an XPATH 1.0 expression.
+
+       When a schema node is defined that uses this type, the
+       description of the schema node MUST specify the XPath
+       context in which the XPath expression is evaluated.";
+     reference
+      "XPATH: XML Path Language (XPath) Version 1.0";
+   }
+
+ }
index 804da597acf77b64ec6a6e0a549578b0bde103c1..eb40d73bd17d863acdbed4895a5c5edf6a6e8a6e 100644 (file)
       <groupId>org.opendaylight.controller.samples</groupId>
       <artifactId>sample-toaster-consumer</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>yang-ext</artifactId>
+    </dependency>
 
     <dependency>
       <groupId>org.opendaylight.controller.samples</groupId>
index 30f1762197ecf58a35c8828775dfb009742a7025..93b398f5b14ca807435622d74bd94ebb38175338 100644 (file)
@@ -31,7 +31,6 @@ import static org.junit.Assert.assertEquals;
 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.baseModelBundles;
 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.bindingAwareSalBundles;
 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.configMinumumBundles;
-import static org.opendaylight.controller.test.sal.binding.it.TestHelper.flowCapableModelBundles;
 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.junitAndMockitoBundles;
 import static org.opendaylight.controller.test.sal.binding.it.TestHelper.mdSalCoreBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
@@ -67,7 +66,6 @@ public class ToasterTest {
                 configMinumumBundles(),
                 // BASE Models
                 baseModelBundles(),
-                flowCapableModelBundles(),
 
                 // Set fail if unresolved bundle present
                 systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
index 08f0988b5c92cd6db60bd963ae91f743f0e0cceb..dd9810388d07824f123993b872c83858b8aa5997 100644 (file)
       <scope>test</scope>
     </dependency>
 
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-binding</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>yang-ext</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>ietf-yang-types</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>opendaylight-l2-types</artifactId>
+    </dependency>
+
   </dependencies>
 
   <build>
diff --git a/opendaylight/md-sal/statistics-manager-config/pom.xml b/opendaylight/md-sal/statistics-manager-config/pom.xml
deleted file mode 100644 (file)
index f4b5f76..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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
--->
-<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.2.0-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.opendaylight.controller.md</groupId>
-    <artifactId>statistics-manager-config</artifactId>
-    <description>Configuration files for statistics manager</description>
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <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/initial/30-statistics-manager.xml</file>
-                                    <type>xml</type>
-                                    <classifier>config</classifier>
-                                </artifact>
-                            </artifacts>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/opendaylight/md-sal/statistics-manager-config/src/main/resources/initial/30-statistics-manager.xml b/opendaylight/md-sal/statistics-manager-config/src/main/resources/initial/30-statistics-manager.xml
deleted file mode 100644 (file)
index 797c14e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
- 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
--->
-<snapshot>
-    <configuration>
-        <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-            <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-                <module>
-                    <type xmlns:statsmanager="urn:opendaylight:params:xml:ns:yang:controller:md:sal:statistics-manager">
-                        statsmanager:statistics-manager
-                    </type>
-                    <name>statistics-manager</name>
-
-                    <rpc-registry>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
-                        <name>binding-rpc-broker</name>
-                    </rpc-registry>
-
-                    <data-broker>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-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
-                        </type>
-                        <name>binding-notification-broker</name>
-                    </notification-service>
-
-                    <statistics-manager-settings>
-                        <min-request-net-monitor-interval>3000</min-request-net-monitor-interval>
-                        <max-nodes-for-collector>16</max-nodes-for-collector>
-                    </statistics-manager-settings>
-
-                </module>
-            </modules>
-        </data>
-    </configuration>
-
-    <required-capabilities>
-        <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:statistics-manager?module=statistics-manager&amp;revision=2014-09-25</capability>
-    </required-capabilities>
-
-</snapshot>
-
diff --git a/opendaylight/md-sal/statistics-manager/pom.xml b/opendaylight/md-sal/statistics-manager/pom.xml
deleted file mode 100644 (file)
index 234e108..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-  </parent>
-  <groupId>org.opendaylight.controller.md</groupId>
-  <artifactId>statistics-manager</artifactId>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-broker-impl</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-base</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-statistics</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <scope>provided</scope>
-    </dependency>
-      <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>sal-binding-config</artifactId>
-      </dependency>
-      <dependency>
-          <groupId>org.opendaylight.controller</groupId>
-          <artifactId>config-api</artifactId>
-      </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-        <plugin>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>maven-bundle-plugin</artifactId>
-            <configuration>
-                <instructions>
-                    <Import-Package>*</Import-Package>
-                </instructions>
-            </configuration>
-        </plugin>
-        <plugin>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-maven-plugin</artifactId>
-            <executions>
-                <execution>
-                    <id>config</id>
-                    <goals>
-                        <goal>generate-sources</goal>
-                    </goals>
-                    <configuration>
-                        <codeGenerators>
-                            <generator>
-                                <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
-                                <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
-                                <additionalConfiguration>
-                                    <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
-                                </additionalConfiguration>
-                            </generator>
-                            <generator>
-                                <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
-                                <outputBaseDir>${salGeneratorPath}</outputBaseDir>
-                            </generator>
-                        </codeGenerators>
-                        <inspectDependencies>true</inspectDependencies>
-                    </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/statistics-manager/src/main/java/org/opendaylight/controller/config/yang/md/sal/statistics_manager/StatisticsManagerModule.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/config/yang/md/sal/statistics_manager/StatisticsManagerModule.java
deleted file mode 100644 (file)
index fb920a6..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.opendaylight.controller.config.yang.md.sal.statistics_manager;
-
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.impl.StatisticsManagerConfig;
-import org.opendaylight.controller.md.statistics.manager.impl.StatisticsManagerImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class StatisticsManagerModule extends org.opendaylight.controller.config.yang.md.sal.statistics_manager.AbstractStatisticsManagerModule {
-    private final static Logger LOG = LoggerFactory.getLogger(StatisticsManagerModule.class);
-
-    private final static int MAX_NODES_FOR_COLLECTOR_DEFAULT = 16;
-    private final static int MIN_REQUEST_NET_MONITOR_INTERVAL_DEFAULT = 3000;
-
-    private StatisticsManager statisticsManagerProvider;
-
-    public StatisticsManagerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public StatisticsManagerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final StatisticsManagerModule oldModule, final java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        LOG.info("StatisticsManager module initialization.");
-        final StatisticsManagerConfig config = createConfig();
-        statisticsManagerProvider = new StatisticsManagerImpl(getDataBrokerDependency(), config);
-        statisticsManagerProvider.start(getNotificationServiceDependency(), getRpcRegistryDependency());
-        LOG.info("StatisticsManager started successfully.");
-        return new AutoCloseable() {
-            @Override
-            public void close() throws Exception {
-                try {
-                    statisticsManagerProvider.close();
-                }
-                catch (final Exception e) {
-                    LOG.error("Unexpected error by stopping StatisticsManager module", e);
-                }
-                LOG.info("StatisticsManager module stopped.");
-            }
-        };
-    }
-
-    public StatisticsManagerConfig createConfig() {
-        final StatisticsManagerConfig.StatisticsManagerConfigBuilder builder = StatisticsManagerConfig.builder();
-        if (getStatisticsManagerSettings() != null && getStatisticsManagerSettings().getMaxNodesForCollector() != null) {
-            builder.setMaxNodesForCollector(getStatisticsManagerSettings().getMaxNodesForCollector());
-        } else {
-            LOG.warn("Load the xml ConfigSubsystem input value fail! MaxNodesForCollector value is set to {} ",
-                    MAX_NODES_FOR_COLLECTOR_DEFAULT);
-            builder.setMaxNodesForCollector(MAX_NODES_FOR_COLLECTOR_DEFAULT);
-        }
-        if (getStatisticsManagerSettings() != null &&
-                getStatisticsManagerSettings().getMinRequestNetMonitorInterval() != null) {
-            builder.setMinRequestNetMonitorInterval(getStatisticsManagerSettings().getMinRequestNetMonitorInterval());
-        } else {
-            LOG.warn("Load the xml CofnigSubsystem input value fail! MinRequestNetMonitorInterval value is set to {} ",
-                    MIN_REQUEST_NET_MONITOR_INTERVAL_DEFAULT);
-            builder.setMinRequestNetMonitorInterval(MIN_REQUEST_NET_MONITOR_INTERVAL_DEFAULT);
-        }
-        return builder.build();
-    }
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/config/yang/md/sal/statistics_manager/StatisticsManagerModuleFactory.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/config/yang/md/sal/statistics_manager/StatisticsManagerModuleFactory.java
deleted file mode 100644 (file)
index dc37447..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: statistics-manager yang module local name: statistics-manager
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue Oct 07 14:09:47 CEST 2014
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.md.sal.statistics_manager;
-public class StatisticsManagerModuleFactory extends org.opendaylight.controller.config.yang.md.sal.statistics_manager.AbstractStatisticsManagerModuleFactory {
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatListeningCommiter.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatListeningCommiter.java
deleted file mode 100644 (file)
index be3d402..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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.statistics.manager;
-
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager
- *
- * StatListeningCommiter
- * Definition Interface for {@link DataChangeListener} implementer class rule.
- * Interface represent a contract between Config/DataStore changes and
- * Operational/DataStore commits. All Operational/DataStore commit have
- * to by represent as RPC Device response Notification processing. So
- * Operational/DS could contains only real mirror of OF Device
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 27, 2014
- */
-public interface StatListeningCommiter<T extends DataObject, N extends NotificationListener> extends DataChangeListener, StatNotifyCommiter<N> {
-
-
-    /**
-     * All StatListeningCommiter implementer has to clean its actual state
-     * for all cached data related to disconnected node.
-     * Method prevents unwanted dataStore changes.
-     *
-     * @param nodeIdent
-     */
-    void cleanForDisconnect(InstanceIdentifier<Node> nodeIdent);
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatNodeRegistration.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatNodeRegistration.java
deleted file mode 100644 (file)
index 80a15a3..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * 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.statistics.manager;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.OpendaylightInventoryListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatNodeRegistration
- * Class represents {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
- * {@link org.opendaylight.controller.md.sal.binding.api.DataChangeListener} in Operational/DataStore for ADD / REMOVE
- * actions which are represented connect / disconnect OF actions. Connect functionality are expecting
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Sep 5, 2014
- */
-public interface StatNodeRegistration extends OpendaylightInventoryListener, AutoCloseable {
-
-    /**
-     * Method contains {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode} registration to {@link StatisticsManager}
-     * for permanently collecting statistics by {@link StatPermCollector} and
-     * as a prevention to use a validation check to the Operational/DS for identify
-     * connected {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}.
-     *
-     * @param InstanceIdentifier<SwitchFeatures> keyIdent
-     * @param FlowCapableNode data
-     * @param InstanceIdentifier<Node> nodeIdent
-     */
-    void connectFlowCapableNode(InstanceIdentifier<SwitchFeatures> keyIdent,
-            SwitchFeatures data, InstanceIdentifier<Node> nodeIdent);
-
-    /**
-     * Method cut {@link Node} registration for {@link StatPermCollector}
-     *
-     * @param InstanceIdentifier<Node> keyIdent
-     */
-    void disconnectFlowCapableNode(InstanceIdentifier<Node> keyIdent);
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatNotifyCommiter.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatNotifyCommiter.java
deleted file mode 100644 (file)
index 0392e47..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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.statistics.manager;
-
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager
- *
- * StatNotifyCommiter
- * Definition Interface for notification implementer class rule
- * Interface represent a contract between RPC Device Notification
- * and Operational/DataStore commits.
- *
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 28, 2014
- */
-public interface StatNotifyCommiter<N extends NotificationListener> extends AutoCloseable, NotificationListener {
-
-
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatPermCollector.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatPermCollector.java
deleted file mode 100644 (file)
index 94d6dfa..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * 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.statistics.manager;
-
-import java.util.List;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager
- *
- * StatPermCollector
- * Class implement {@link Runnable} and inside is running statistic collecting
- * process DataObject statistics by DataObject statistics for every {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}.
- * Every statistics wait to finish previous statistics. Only if all statistics finish,
- * next {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
- * Statistics should be collecting. We are able to set minimal time for start next round cross all Network,
- * but all depends on network possibility.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 28, 2014
- */
-public interface StatPermCollector extends Runnable, AutoCloseable {
-
-    /**
-     * StatCapType
-     * Enum class refers ofp_statistics capabilities fields from OF Switch
-     * capabilities specification which have to come as a post HandShake
-     * information from OF Switch and Inventory Manager adds all to the
-     * Operational/DS.
-     * If the capabilities are not add (for any reason) NodeRegistrator
-     * adds all StatCapTypes for the {@link Node}.
-     */
-    public enum StatCapabTypes {
-        /**
-         * OFPC_FLOW_STATS
-         */
-        FLOW_STATS,
-        /**
-         * OFPC_TABLE_STATS
-         */
-        TABLE_STATS,
-        /**
-         * OFPC_PORT_STATS
-         */
-        PORT_STATS,
-        /**
-         * OFPC_GROUP_STATS
-         */
-        GROUP_STATS,
-        /**
-         * OFPC_QUEUE_STATS
-         */
-        QUEUE_STATS,
-        /**
-         * Meter statistics has no support from OF Switch capabilities
-         * so we have to try get statistics for it and wait for response
-         * Error or response package with results.
-         */
-        METER_STATS
-    }
-
-    /**
-     * Add new connected node for permanent statistics collecting process
-     *
-     * @param flowNode
-     * @param statTypes
-     * @param nrOfSwitchTables
-     * @return true/false if the {@link Node} added successful
-     */
-    boolean connectedNodeRegistration(InstanceIdentifier<Node> nodeIdent,
-            List<StatCapabTypes> statTypes, Short nrOfSwitchTables);
-
-    /**
-     * All disconnected Nodes need be removed from stat list Nodes
-     *
-     * @param flowNode
-     * @return true/false if the {@link Node} removed successful
-     */
-    boolean disconnectedNodeUnregistration(InstanceIdentifier<Node> nodeIdent);
-
-    /**
-     * Method add new feature {@link StatCapabTypes} to Node identified by
-     * nodeIdent -> InstanceIdentifier<Node>
-     *
-     * @param flowNode
-     * @return true/false if the {@link StatCapabTypes} add successful
-     */
-    boolean registerAdditionalNodeFeature(InstanceIdentifier<Node> nodeIdent, StatCapabTypes statCapab);
-
-    /**
-     * Method return true only and only if {@link StatPermCollector} contain
-     * valid node registration in its internal {@link Node} map.
-     * Otherwise return false.
-     *
-     * @param flowNode
-     * @return
-     */
-    boolean isProvidedFlowNodeActive(InstanceIdentifier<Node> nodeIdent);
-
-    /**
-     * Object notification for continue statistics collecting process.
-     * It is call from collecting allStatistics methods as a future result for
-     * Operational/DS statistic store call (does not matter in the outcome).
-     */
-    void collectNextStatistics(TransactionId xid);
-
-    /**
-     * Method returns true if collector has registered some active nodes
-     * otherwise return false.
-     *
-     * @return
-     */
-    boolean hasActiveNodes();
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatRpcMsgManager.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatRpcMsgManager.java
deleted file mode 100644 (file)
index 62319ad..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * 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.statistics.manager;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Future;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.SettableFuture;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager
- *
- * StatRpcMsgManager
- * It represent access point for Device statistics RPC services which are
- * filtered for needed methods only and they are wrapped in simply way.
- * Many statistics responses are Multipart messages, so StatRpcMsgManager
- * provide a functionality to add all multipart msg and provides back whole
- * stack to listener when listener catch the last Multipart msg.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 29, 2014
- */
-public interface StatRpcMsgManager extends Runnable, AutoCloseable {
-
-    interface RpcJobsQueue extends Callable<Void> {}
-
-    /**
-     * Transaction container is definition for Multipart transaction
-     * join container for all Multipart msg with same TransactionId
-     * Input {@link DataObject} is a possible light-weight DataObject
-     * which is used for identification (e.g. Flow-> Priority,Match,Cookie,FlowId)
-     *
-     * @param <T> extends TransactionAware -
-     */
-    interface TransactionCacheContainer<T extends TransactionAware> {
-
-        void addNotif(T notification);
-
-        TransactionId getId();
-
-        NodeId getNodeId();
-
-        Optional<? extends DataObject> getConfInput();
-
-        List<T> getNotifications();
-    }
-
-    /**
-     * Method is used for check a transaction registration
-     * for multipart cache holder
-     *
-     * @param TransactionId id
-     * @return true if the transaction has been correctly registered
-     */
-    Future<Boolean> isExpectedStatistics(TransactionId id, NodeId nodeId);
-
-    /**
-     * Method converts {@link java.util.concurrent.Future} object to listenenable future which
-     * is registered for Multipart Notification Statistics Collecting processing.
-     *
-     * @param future - result every Device RPC call
-     */
-    <T extends TransactionAware, D extends DataObject> void registrationRpcFutureCallBack(
-            Future<RpcResult<T>> future, D inputObj, NodeRef ref, SettableFuture<TransactionId> resultTransId);
-
-    /**
-     * Method adds Notification which is marked as Multipart to the transaction cash
-     * to wait for the last one.
-     *
-     * @param notification
-     */
-    <T extends TransactionAware> void addNotification(T notification, NodeId nodeId);
-
-    /**
-     * The last Multipart should inform code about possibility to take all previous
-     * messages for next processing. The method take all msg and possible input object
-     * and build all to TransactionCacheContainer Object to return. This process clean
-     * all instances in Cache.
-     *
-     * @param TransactionId id
-     * @return TransactionCacheContainer
-     */
-    Future<Optional<TransactionCacheContainer<?>>> getTransactionCacheContainer(TransactionId id, NodeId nodeId);
-
-    /**
-     * Method wraps OpendaylightGroupStatisticsService.getAllGroupStatistics
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllGroupsStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightGroupStatisticsService.getGroupDescription
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllGroupsConfStats(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightMeterStatisticsService.getGroupFeatures
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    void getGroupFeaturesStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightMeterStatisticsService.getAllMeterStatistics
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllMetersStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightMeterStatisticsService.getAllMeterConfigStatistics
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllMeterConfigStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightMeterStatisticsService.getMeterFeatures
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    void getMeterFeaturesStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightFlowStatisticsService.getAllFlowsStatisticsFromAllFlowTables
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllFlowsStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightFlowStatisticsService.getAggregateFlowStatisticsFromFlowTableForAllFlows
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     * @param TableId tableId
-     */
-    void getAggregateFlowStat(NodeRef nodeRef, TableId tableId);
-
-    /**
-     * Method wraps OpendaylightPortStatisticsService.getAllNodeConnectorsStatistics
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllPortsStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightFlowTableStatisticsService.getFlowTablesStatistics
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllTablesStat(NodeRef nodeRef);
-
-    /**
-     * Method wraps OpendaylightQueueStatisticsService.getAllQueuesStatisticsFromAllPorts
-     * and registers to Transaction Cache
-     *
-     * @param NodeRef nodeRef
-     */
-    Future<TransactionId> getAllQueueStat(NodeRef nodeRef);
-
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsManager.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsManager.java
deleted file mode 100644 (file)
index 6124bdf..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/**
- * 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.statistics.manager;
-
-import java.util.List;
-
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.statistics.manager.StatPermCollector.StatCapabTypes;
-import org.opendaylight.controller.md.statistics.manager.impl.StatisticsManagerConfig;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsListener;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager
- *
- * StatisticsManager
- * It represent a central point for whole module. Implementation
- * StatisticsManager registers all Operation/DS {@link StatNotifyCommiter} and
- * Config/DS {@StatListeningCommiter}, as well as {@link StatPermCollector}
- * for statistic collecting and {@link StatRpcMsgManager} as Device RPCs provider.
- * In next, StatisticsManager provides all DS contact Transaction services.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 27, 2014
- */
-public interface StatisticsManager extends AutoCloseable, TransactionChainListener {
-
-    /**
-     * StatDataStoreOperation
-     * Interface represent functionality to submit changes to DataStore.
-     * Internal {@link TransactionChainListener} joining all DS commits
-     * to Set of chained changes for prevent often DataStore touches.
-     */
-    public abstract class StatDataStoreOperation {
-        public enum StatsManagerOperationType {
-            /**
-             * Operation will carry out work related to new node addition /
-             * update
-             */
-            NODE_UPDATE,
-            /**
-             * Operation will carry out work related to node removal
-             */
-            NODE_REMOVAL,
-            /**
-             * Operation will commit data to the operational data store
-             */
-            DATA_COMMIT_OPER_DS
-        }
-
-        private NodeId nodeId;
-        private StatsManagerOperationType operationType = StatsManagerOperationType.DATA_COMMIT_OPER_DS;
-
-        public StatDataStoreOperation(final StatsManagerOperationType operType, final NodeId id){
-            if(operType != null){
-                operationType = operType;
-            }
-            nodeId = id;
-        }
-
-        public final StatsManagerOperationType getType() {
-            return operationType;
-        }
-
-        public final NodeId getNodeId(){
-            return nodeId;
-        }
-
-        /**
-         * Apply all read / write (put|merge) operation for DataStore
-         *
-         * @param {@link ReadWriteTransaction} tx
-         */
-        public abstract void applyOperation(ReadWriteTransaction tx);
-
-    }
-
-    /**
-     * Method starts whole StatisticManager functionality
-     *
-     * @param {@link NotificationProviderService} notifService
-     * @param {@link RpcConsumerRegistry} rpcRegistry
-     * @param minReqNetMonitInt
-     */
-    void start(final NotificationProviderService notifService,
-            final RpcConsumerRegistry rpcRegistry);
-
-    /**
-     * Method provides read/write DataStore functionality cross applyOperation
-     * defined in {@link StatDataStoreOperation}
-     *
-     * @param inventoryOper - operation for DataStore
-     */
-    void enqueue(final StatDataStoreOperation inventoryOper);
-
-    /**
-     * Method wraps {@link StatisticCollector}.isProvidedFlowNodeActive method
-     * to provide parallel statCollection process for Set of Nodes. So it has to
-     * identify correct Node Set by NodeIdentifier
-     *
-     * @param nodeIdent
-     */
-     boolean isProvidedFlowNodeActive(InstanceIdentifier<Node> nodeIdent);
-
-     /**
-      * Method wraps {@link StatPermCollector}.collectNextStatistics to provide
-      * parallel statCollection process for Set of Nodes. So it has to
-      * identify correct Node Set by NodeIdentifier.
-      *
-      * @param nodeIdent
-      */
-     void collectNextStatistics(InstanceIdentifier<Node> nodeIdent, TransactionId xid);
-
-     /**
-      * Method wraps {@link StatPermCollector}.connectedNodeRegistration to provide
-      * parallel statCollection process for Set of Nodes. So it has to
-      * connect node to new or not full Node statCollector Set.
-      *
-      * @param nodeIdent
-      * @param statTypes
-      * @param nrOfSwitchTables
-      */
-     void connectedNodeRegistration(InstanceIdentifier<Node> nodeIdent,
-             List<StatCapabTypes> statTypes, Short nrOfSwitchTables);
-
-     /**
-      * Method wraps {@link StatPermCollector}.disconnectedNodeUnregistration to provide
-      * parallel statCollection process for Set of Nodes. So it has to identify
-      * correct collector for disconnect node.
-      *
-      * @param nodeIdent
-      */
-     void disconnectedNodeUnregistration(InstanceIdentifier<Node> nodeIdent);
-
-     /**
-      * Method wraps {@link StatPermCollector}.registerAdditionalNodeFeature to provide
-      * possibility to register additional Node Feature {@link StatCapabTypes} for
-      * statistics collecting.
-      *
-      * @param nodeIdent
-      * @param statCapab
-      */
-     void registerAdditionalNodeFeature(InstanceIdentifier<Node> nodeIdent, StatCapabTypes statCapab);
-
-    /**
-     * Method provides access to Device RPC methods by wrapped
-     * internal method. In next {@link StatRpcMsgManager} is registered all
-     * Multipart device msg response and joining all to be able run all
-     * collected statistics in one time (easy identification Data for delete)
-     *
-     * @return {@link StatRpcMsgManager}
-     */
-    StatRpcMsgManager getRpcMsgManager();
-
-    /**
-     * Define Method : {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
-     * Operational/DS data change listener -> impl. target -> register FlowCapableNode to Statistic Collecting process
-     * @return {@link StatNodeRegistration}
-     */
-    StatNodeRegistration getNodeRegistrator();
-
-    /**
-     * Define Method : Flow Config/DS data change listener -> impl. target ->
-     * -> make pair between Config/DS FlowId and Device Flow response Hash
-     * @return
-     */
-    StatListeningCommiter<Flow, OpendaylightFlowStatisticsListener> getFlowListenComit();
-
-    /**
-     * Define Method : Meter Config/DS data change listener and Operation/DS notify commit
-     * functionality
-     * @return
-     */
-    StatListeningCommiter<Meter, OpendaylightMeterStatisticsListener> getMeterListenCommit();
-
-    /**
-     * Define Method : Group Config/DS data change listener and Operation/DS notify commit
-     * functionality
-     * @return
-     */
-    StatListeningCommiter<Group, OpendaylightGroupStatisticsListener> getGroupListenCommit();
-
-    /**
-     * Define Method : Queue Config/DS change listener and Operation/DS notify commit functionality
-     * @return
-     */
-    StatListeningCommiter<Queue, OpendaylightQueueStatisticsListener> getQueueNotifyCommit();
-
-    /**
-     * Define Method : Table Operation/DS notify commit functionality
-     * @return
-     */
-    StatNotifyCommiter<OpendaylightFlowTableStatisticsListener> getTableNotifCommit();
-
-    /**
-     * Define Method : Port Operation/DS notify commit functionality
-     * @return
-     */
-    StatNotifyCommiter<OpendaylightPortStatisticsListener> getPortNotifyCommit();
-
-    StatisticsManagerConfig getConfiguration();
-
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractListenCommit.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractListenCommit.java
deleted file mode 100644 (file)
index 6819780..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.statistics.manager.StatListeningCommiter;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatAbstractListeneningCommiter
- * Class is abstract implementation for all Configuration/DataStore DataChange
- * listenable DataObjects like flows, groups, meters. It is a holder for common
- * functionality needed by construction/destruction class and for DataChange
- * event processing.
- *
- */
-public abstract class StatAbstractListenCommit<T extends DataObject, N extends NotificationListener>
-                                            extends StatAbstractNotifyCommit<N> implements StatListeningCommiter<T,N> {
-
-    private static final Logger LOG = LoggerFactory.getLogger(StatAbstractListenCommit.class);
-
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-
-    protected final Map<InstanceIdentifier<Node>, Map<InstanceIdentifier<T>, Integer>> mapNodesForDelete = new ConcurrentHashMap<>();
-    protected final Map<InstanceIdentifier<Node>, Integer> mapNodeFeautureRepeater = new ConcurrentHashMap<>();
-
-    private final Class<T> clazz;
-
-    private final DataBroker dataBroker;
-
-    private volatile ReadOnlyTransaction currentReadTx;
-
-    /* Constructor has to make a registration */
-    public StatAbstractListenCommit(final StatisticsManager manager, final DataBroker db,
-            final NotificationProviderService nps, final Class<T> clazz) {
-        super(manager,nps);
-        this.clazz = Preconditions.checkNotNull(clazz, "Referenced Class can not be null");
-        Preconditions.checkArgument(db != null, "DataBroker can not be null!");
-        listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION,
-                getWildCardedRegistrationPath(), this, DataChangeScope.BASE);
-        this.dataBroker = db;
-    }
-
-    /**
-     * Method returns WildCarded Path which is used for registration as a listening path changes in
-     * {@link org.opendaylight.controller.md.sal.binding.api.DataChangeListener}
-     * @return
-     */
-    protected abstract InstanceIdentifier<T> getWildCardedRegistrationPath();
-
-    @Override
-    public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changeEvent) {
-        Preconditions.checkNotNull(changeEvent,"Async ChangeEvent can not be null!");
-        /*
-         * If we have opened read transaction for configuraiton data store,
-         * we will close and null it.
-         *
-         * Latest read transaction will be allocated on another read using readLatestConfiguration
-         */
-        if(currentReadTx != null) {
-            final ReadOnlyTransaction previous = currentReadTx;
-            currentReadTx = null;
-            previous.close();
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    protected void removeData(final InstanceIdentifier<?> key, final Integer value) {
-        if (clazz.equals(key.getTargetType())) {
-            final InstanceIdentifier<Node> nodeIdent = key.firstIdentifierOf(Node.class);
-            Map<InstanceIdentifier<T>, Integer> map = null;
-            if (mapNodesForDelete.containsKey(nodeIdent)) {
-                map = mapNodesForDelete.get(nodeIdent);
-            }
-            if (map == null) {
-                map = new ConcurrentHashMap<>();
-                mapNodesForDelete.put(nodeIdent, map);
-            }
-            map.put((InstanceIdentifier<T>) key, value);
-        }
-    }
-
-    @Override
-    public void cleanForDisconnect(final InstanceIdentifier<Node> nodeIdent) {
-        mapNodesForDelete.remove(nodeIdent);
-    }
-
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (final Exception e) {
-                LOG.error("Error by stop {} DataChange StatListeningCommiter.", clazz.getSimpleName(), e);
-            }
-            listenerRegistration = null;
-        }
-
-        super.close();
-    }
-
-    /**
-     * Method return actual DataObject identified by InstanceIdentifier from Config/DS
-     * @param path
-     * @return
-     */
-    protected final <K extends DataObject> Optional<K> readLatestConfiguration(final InstanceIdentifier<K> path) {
-        if(currentReadTx == null) {
-             currentReadTx = dataBroker.newReadOnlyTransaction();
-        }
-        try {
-            return currentReadTx.read(LogicalDatastoreType.CONFIGURATION, path).checkedGet();
-        } catch (final ReadFailedException e) {
-            return Optional.absent();
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractNotifyCommit.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatAbstractNotifyCommit.java
deleted file mode 100644 (file)
index 3f0e5e4..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import org.opendaylight.controller.md.statistics.manager.StatNotifyCommiter;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatAbstratNotifiCommiter
- * Class is abstract implementation for all no Configuration/DataStore DataObjects
- * and represent common functionality for all DataObject Statistics Commiters.
- * Class defines contract between DataObject and relevant Statistics NotificationListener.
- *
- */
-public abstract class StatAbstractNotifyCommit<N extends NotificationListener> implements StatNotifyCommiter<N> {
-
-    private static final Logger LOG = LoggerFactory.getLogger(StatAbstractNotifyCommit.class);
-
-    protected final StatisticsManager manager;
-    private ListenerRegistration<NotificationListener> notifyListenerRegistration;
-
-    public StatAbstractNotifyCommit(final StatisticsManager manager,
-            final NotificationProviderService nps) {
-        Preconditions.checkArgument(nps != null, "NotificationProviderService can not be null!");
-        this.manager = Preconditions.checkNotNull(manager, "StatisticManager can not be null!");
-        notifyListenerRegistration = nps.registerNotificationListener(getStatNotificationListener());
-    }
-
-    @Override
-    public void close() {
-        if (notifyListenerRegistration != null) {
-            try {
-                notifyListenerRegistration.close();
-            }
-            catch (final Exception e) {
-                LOG.error("Error by stop {} StatNotificationListener.", this.getClass().getSimpleName());
-            }
-            notifyListenerRegistration = null;
-        }
-    }
-
-    /**
-     * Method returns Statistics Notification Listener for relevant DataObject implementation,
-     * which is declared for {@link StatNotifyCommiter} interface.
-     *
-     * @return
-     */
-    protected abstract N getStatNotificationListener();
-
-    /**
-     * PreConfigurationCheck - Node identified by input InstanceIdentifier<Node>
-     * has to be registered in {@link org.opendaylight.controller.md.statistics.manager.StatPermCollector}
-     *
-     * @param InstanceIdentifier<Node> nodeIdent
-     */
-    protected boolean preConfigurationCheck(final InstanceIdentifier<Node> nodeIdent) {
-        Preconditions.checkNotNull(nodeIdent, "FlowCapableNode ident can not be null!");
-        return manager.isProvidedFlowNodeActive(nodeIdent);
-    }
-
-    protected void notifyToCollectNextStatistics(final InstanceIdentifier<Node> nodeIdent, final TransactionId xid) {
-        Preconditions.checkNotNull(nodeIdent, "FlowCapableNode ident can not be null!");
-        manager.collectNextStatistics(nodeIdent, xid);
-    }
-
-    /**
-     * Wrapping Future object call for {@link org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager}
-     * getTransactionCacheContainer with 10sec TimeOut.
-     * Method has returned {@link Optional} which could contains a {@link TransactionCacheContainer}
-     *
-     * @param TransactionId transId
-     * @param NodeId nodeId
-     * @return
-     */
-    protected Optional<TransactionCacheContainer<?>> getTransactionCacheContainer(final TransactionId transId, final NodeId nodeId) {
-        Optional<TransactionCacheContainer<?>> txContainer;
-        try {
-            txContainer = manager.getRpcMsgManager().getTransactionCacheContainer(transId, nodeId).get(10, TimeUnit.SECONDS);
-        }
-        catch (InterruptedException | ExecutionException | TimeoutException e) {
-            LOG.warn("Get TransactionCacheContainer fail!", e);
-            txContainer = Optional.absent();
-        }
-        return txContainer;
-    }
-
-    /**
-     * Method validate TransactionCacheContainer. It needs to call before every txCacheContainer processing.
-     *
-     * @param txCacheContainer
-     * @return
-     */
-    protected boolean isTransactionCacheContainerValid(final Optional<TransactionCacheContainer<?>> txCacheContainer) {
-        if ( ! txCacheContainer.isPresent()) {
-            LOG.debug("Transaction Cache Container is not presented!");
-            return false;
-        }
-        if (txCacheContainer.get().getNodeId() == null) {
-            LOG.debug("Transaction Cache Container {} don't have Node ID!", txCacheContainer.get().getId());
-            return false;
-        }
-        if (txCacheContainer.get().getNotifications() == null) {
-            LOG.debug("Transaction Cache Container {} for {} node don't have Notifications!",
-                    txCacheContainer.get().getId(), txCacheContainer.get().getNodeId());
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Wrapping Future object call to {@link org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager}
-     * isExpectedStatistics with 10sec TimeOut.
-     * Method has checked registration for provided {@link TransactionId} and {@link NodeId}
-     *
-     * @param TransactionId transId - Transaction identification
-     * @param NodeId nodeId - Node identification
-     * @return boolean
-     */
-    protected boolean isExpectedStatistics(final TransactionId transId, final NodeId nodeId) {
-        Boolean isExpectedStat = Boolean.FALSE;
-        try {
-            isExpectedStat = manager.getRpcMsgManager().isExpectedStatistics(transId, nodeId).get(10, TimeUnit.SECONDS);
-        }
-        catch (InterruptedException | ExecutionException | TimeoutException e) {
-            LOG.warn("Check Transaction registraion {} fail!", transId, e);
-            return false;
-        }
-        return isExpectedStat.booleanValue();
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitFlow.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitFlow.java
deleted file mode 100644 (file)
index 49fe3bb..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.md.statistics.manager.impl.helper.FlowComparator;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowHashIdMapping;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowHashIdMappingBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMapKey;
-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.TableBuilder;
-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.AggregateFlowStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate;
-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.FlowsStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.aggregate.flow.statistics.AggregateFlowStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.BiMap;
-import com.google.common.collect.HashBiMap;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatListenCommitFlow
- * Class is a NotifyListener for FlowStatistics and DataChangeListener for Config/DataStore for Flow node.
- * All expected (registered) FlowStatistics will be builded and commit to Operational/DataStore.
- * DataChangeEven should call create/delete Flow in Operational/DS create process needs to pair
- * Device Flow HashCode and FlowId from Config/DS
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class StatListenCommitFlow extends StatAbstractListenCommit<Flow, OpendaylightFlowStatisticsListener>
-                                            implements OpendaylightFlowStatisticsListener {
-
-    protected static final Logger LOG = LoggerFactory.getLogger(StatListenCommitFlow.class);
-
-    private static final String ALIEN_SYSTEM_FLOW_ID = "#UF$TABLE*";
-
-    private static final Integer REMOVE_AFTER_MISSING_COLLECTION = 1;
-
-    private final AtomicInteger unaccountedFlowsCounter = new AtomicInteger(0);
-
-    public StatListenCommitFlow (final StatisticsManager manager, final DataBroker db,
-            final NotificationProviderService nps){
-        super(manager, db, nps, Flow.class);
-    }
-
-    @Override
-    protected OpendaylightFlowStatisticsListener getStatNotificationListener() {
-        return this;
-    }
-
-    @Override
-    protected InstanceIdentifier<Flow> getWildCardedRegistrationPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class)
-                .augmentation(FlowCapableNode.class).child(Table.class).child(Flow.class);
-    }
-
-    @Override
-    public void onAggregateFlowStatisticsUpdate(final AggregateFlowStatisticsUpdate notification) {
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - AggregateFlowStatisticsUpdate: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-        /* check flow Capable Node and write statistics */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if (( ! txContainer.isPresent()) || txContainer.get().getNotifications() == null) {
-                    return;
-                }
-                final Optional<? extends DataObject> inputObj = txContainer.get().getConfInput();
-                if (( ! inputObj.isPresent()) || ( ! (inputObj.get() instanceof Table))) {
-                    return;
-                }
-                final Table table = (Table) inputObj.get();
-                final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-                for (final TransactionAware notif : cacheNotifs) {
-                    if (notif instanceof AggregateFlowStatisticsUpdate) {
-                        final AggregateFlowStatisticsData stats = new AggregateFlowStatisticsDataBuilder()
-                            .setAggregateFlowStatistics(new AggregateFlowStatisticsBuilder(notification).build()).build();
-                        final InstanceIdentifier<FlowCapableNode> fNodeIdent = InstanceIdentifier.create(Nodes.class)
-                                .child(Node.class, new NodeKey(nodeId)).augmentation(FlowCapableNode.class);
-                        final InstanceIdentifier<Table> tableRef = fNodeIdent.child(Table.class, table.getKey());
-                        final InstanceIdentifier<AggregateFlowStatisticsData> tableStatRef = tableRef
-                                .augmentation(AggregateFlowStatisticsData.class);
-                        Optional<FlowCapableNode> fNode = Optional.absent();
-                        try {
-                            fNode = tx.read(LogicalDatastoreType.OPERATIONAL, fNodeIdent).checkedGet();
-                        } catch (final ReadFailedException e) {
-                            LOG.debug("Read Operational/DS for FlowCapableNode fail! {}", fNodeIdent, e);
-                            return;
-                        }
-                        if (fNode.isPresent()) {
-                            ensureTable(tx, table.getId(), tableRef);
-                            tx.put(LogicalDatastoreType.OPERATIONAL, tableStatRef, stats);
-                        }
-                    }
-                }
-            }
-        });
-    }
-
-    public void ensureTable(final ReadWriteTransaction tx, final Short tableId, final InstanceIdentifier<Table> tableRef) {
-        final Table tableNew = new TableBuilder().setId(tableId).build();
-        tx.merge(LogicalDatastoreType.OPERATIONAL, tableRef, tableNew);
-    }
-
-    @Override
-    public void onFlowsStatisticsUpdate(final FlowsStatisticsUpdate notification) {
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - FlowsStatisticsUpdate: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            LOG.trace("Next notification for join txId {}", transId);
-            return;
-        }
-        /* add flow's statistics */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if (( ! txContainer.isPresent()) || txContainer.get().getNotifications() == null) {
-                    return;
-                }
-                final List<FlowAndStatisticsMapList> flowStats = new ArrayList<FlowAndStatisticsMapList>(10);
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier.create(Nodes.class)
-                        .child(Node.class, new NodeKey(nodeId));
-                final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-                for (final TransactionAware notif : cacheNotifs) {
-                    if (notif instanceof FlowsStatisticsUpdate) {
-                        final List<FlowAndStatisticsMapList> notifList =
-                                ((FlowsStatisticsUpdate) notif).getFlowAndStatisticsMapList();
-                        if (notifList != null) {
-                            flowStats.addAll(notifList);
-                        }
-                    }
-                }
-
-                statsFlowCommitAll(flowStats, nodeIdent, tx);
-                /* cleaning all not cached hash collisions */
-                final Map<InstanceIdentifier<Flow>, Integer> listAliens = mapNodesForDelete.get(nodeIdent);
-                if (listAliens != null) {
-                    for (final Entry<InstanceIdentifier<Flow>, Integer> nodeForDelete : listAliens.entrySet()) {
-                        final Integer lifeIndex = nodeForDelete.getValue();
-                        if (nodeForDelete.getValue() > 0) {
-                            nodeForDelete.setValue(Integer.valueOf(lifeIndex.intValue() - 1));
-                        } else {
-                            final InstanceIdentifier<Flow> flowNodeIdent = nodeForDelete.getKey();
-                            mapNodesForDelete.get(nodeIdent).remove(flowNodeIdent);
-                            tx.delete(LogicalDatastoreType.OPERATIONAL, flowNodeIdent);
-                        }
-                    }
-                }
-                /* Notification for continue collecting statistics */
-                notifyToCollectNextStatistics(nodeIdent, transId);
-            }
-
-        });
-    }
-
-    private void statsFlowCommitAll(final List<FlowAndStatisticsMapList> list,
-            final InstanceIdentifier<Node> nodeIdent, final ReadWriteTransaction tx) {
-
-        final InstanceIdentifier<FlowCapableNode> fNodeIdent = nodeIdent.augmentation(FlowCapableNode.class);
-
-        final Optional<FlowCapableNode> fNode;
-        try {
-            fNode = tx.read(LogicalDatastoreType.OPERATIONAL, fNodeIdent).checkedGet();
-        }
-        catch (final ReadFailedException e) {
-            LOG.debug("Read FlowCapableNode {} in Operational/DS fail! Statistic scan not be updated.", nodeIdent, e);
-            return;
-        }
-        if ( ! fNode.isPresent()) {
-            LOG.trace("FlowCapableNode {} is not presented in Operational/DS. Statisticscan not be updated.", nodeIdent);
-            return;
-        }
-
-        final NodeUpdateState nodeState = new NodeUpdateState(fNodeIdent,fNode.get());
-
-        for (final FlowAndStatisticsMapList flowStat : list) {
-            final TableKey tableKey = new TableKey(flowStat.getTableId());
-            final TableFlowUpdateState tableState = nodeState.getTable(tableKey, tx);
-            tableState.reportFlow(flowStat,tx);
-        }
-
-        for (final TableFlowUpdateState table : nodeState.getTables()) {
-            table.removeUnreportedFlows(tx);
-        }
-    }
-
-    /**
-     * Method adds statistics to Flow
-     *
-     * @param flowBuilder
-     * @param deviceFlow
-     */
-    private void addStatistics(final FlowBuilder flowBuilder, final FlowAndStatisticsMapList deviceFlow) {
-        final FlowAndStatisticsMapListBuilder stats = new FlowAndStatisticsMapListBuilder(deviceFlow);
-        final FlowStatisticsBuilder flowStatisticsBuilder = new FlowStatisticsBuilder(stats.build());
-        final FlowStatisticsDataBuilder flowStatisticsData =new FlowStatisticsDataBuilder();
-        flowStatisticsData.setFlowStatistics(flowStatisticsBuilder.build());
-        flowBuilder.addAugmentation(FlowStatisticsData.class, flowStatisticsData.build());
-    }
-
-    /**
-     * build pseudoUnique hashCode for flow in table
-     * for future easy identification
-     *
-     * FIXME: we expect same version for YANG models for all clusters and that has to be fix
-     * FIXME: CREATE BETTER KEY - for flow (MATCH is the problem)
-     */
-    static String buildFlowIdOperKey(final FlowAndStatisticsMapList deviceFlow) {
-        return new StringBuffer().append(deviceFlow.getMatch())
-                .append(deviceFlow.getPriority()).append(deviceFlow.getCookie().getValue()).toString();
-    }
-
-    private class NodeUpdateState {
-        private final InstanceIdentifier<FlowCapableNode> nodeIdentifier;
-        private final Map<TableKey,TableFlowUpdateState> tables = new HashMap<>();
-
-        public NodeUpdateState(final InstanceIdentifier<FlowCapableNode> fNodeIdent, final FlowCapableNode flowCapableNode) {
-            nodeIdentifier = fNodeIdent;
-            final List<Table> tableList = flowCapableNode.getTable();
-            if(tableList != null) {
-            for (final Table table : tableList) {
-                final TableKey tableKey = table.getKey();
-                    tables.put(tableKey, new TableFlowUpdateState(nodeIdentifier.child(Table.class,tableKey),table));
-                }
-            }
-        }
-
-        public Iterable<TableFlowUpdateState> getTables() {
-            return tables.values();
-        }
-
-        TableFlowUpdateState getTable(final TableKey key,final ReadWriteTransaction tx) {
-            TableFlowUpdateState table = tables.get(key);
-            if(table == null) {
-                table = new TableFlowUpdateState(nodeIdentifier.child(Table.class, key), null);
-                tables.put(key, table);
-            }
-            return table;
-        }
-    }
-
-    private class TableFlowUpdateState {
-
-        private boolean tableEnsured = false;
-        final KeyedInstanceIdentifier<Table, TableKey> tableRef;
-        final TableKey tableKey;
-        final BiMap<FlowHashIdMapKey, FlowId> flowIdByHash;
-        List<Flow> configFlows;
-
-        public TableFlowUpdateState(final KeyedInstanceIdentifier<Table, TableKey> tablePath, final Table table) {
-            tableRef = tablePath;
-            tableKey = tablePath.getKey();
-            flowIdByHash = HashBiMap.create();
-            if(table != null) {
-                final FlowHashIdMapping flowHashMapping = table.getAugmentation(FlowHashIdMapping.class);
-                if (flowHashMapping != null) {
-                    final List<FlowHashIdMap>  flowHashMap = flowHashMapping.getFlowHashIdMap() != null
-                            ? flowHashMapping.getFlowHashIdMap() : Collections.<FlowHashIdMap> emptyList();
-                    for (final FlowHashIdMap flowHashId : flowHashMap) {
-                        try {
-                            flowIdByHash.put(flowHashId.getKey(), flowHashId.getFlowId());
-                        } catch (final Exception e) {
-                            LOG.warn("flow hashing hit a duplicate for {} -> {}", flowHashId.getKey(), flowHashId.getFlowId());
-                        }
-                    }
-                }
-            }
-        }
-
-        private void ensureTableFowHashIdMapping(final ReadWriteTransaction tx) {
-            if( ! tableEnsured) {
-                ensureTable(tx, tableKey.getId(), tableRef);
-                final FlowHashIdMapping emptyMapping = new FlowHashIdMappingBuilder()
-                    .setFlowHashIdMap(Collections.<FlowHashIdMap> emptyList()).build();
-                tx.merge(LogicalDatastoreType.OPERATIONAL, tableRef.augmentation(FlowHashIdMapping.class), emptyMapping);
-                tableEnsured = true;
-            }
-        }
-
-        private FlowKey searchInConfiguration(final FlowAndStatisticsMapList flowStat, final ReadWriteTransaction trans) {
-            initConfigFlows(trans);
-            final Iterator<Flow> it = configFlows.iterator();
-            while(it.hasNext()) {
-                final Flow cfgFlow = it.next();
-                final FlowKey cfgKey = cfgFlow.getKey();
-                if(flowIdByHash.inverse().containsKey(cfgKey)) {
-                    it.remove();
-                } else if(FlowComparator.flowEquals(flowStat, cfgFlow)) {
-                    it.remove();
-                    return cfgKey;
-                }
-            }
-            return null;
-        }
-
-        private void initConfigFlows(final ReadWriteTransaction trans) {
-            final Optional<Table> table = readLatestConfiguration(tableRef);
-            List<Flow> localList = null;
-            if(table.isPresent()) {
-                localList = table.get().getFlow();
-            }
-            if(localList == null) {
-                configFlows = Collections.emptyList();
-            } else {
-                configFlows = new LinkedList<>(localList);
-            }
-        }
-
-        private FlowKey getFlowKeyAndRemoveHash(final FlowHashIdMapKey key) {
-            final FlowId ret = flowIdByHash.get(key);
-            if(ret != null) {
-                flowIdByHash.remove(key);
-                return new FlowKey(ret);
-            }
-            return null;
-        }
-
-        /* Returns FlowKey which doesn't exist in any DataStore for now */
-        private FlowKey makeAlienFlowKey() {
-            final StringBuilder sBuilder = new StringBuilder(ALIEN_SYSTEM_FLOW_ID)
-                .append(tableKey.getId()).append("-").append(unaccountedFlowsCounter.incrementAndGet());
-            final FlowId flowId = new FlowId(sBuilder.toString());
-            return new FlowKey(flowId);
-        }
-
-        private Map<FlowHashIdMapKey, FlowId> getRemovalList() {
-            return flowIdByHash;
-        }
-
-        void reportFlow(final FlowAndStatisticsMapList flowStat, final ReadWriteTransaction trans) {
-            ensureTableFowHashIdMapping(trans);
-            final FlowHashIdMapKey hashingKey = new FlowHashIdMapKey(buildFlowIdOperKey(flowStat));
-            FlowKey flowKey = getFlowKeyAndRemoveHash(hashingKey);
-            if (flowKey == null) {
-                flowKey = searchInConfiguration(flowStat, trans);
-                if ( flowKey == null) {
-                    flowKey = makeAlienFlowKey();
-                }
-                updateHashCache(trans,flowKey,hashingKey);
-            }
-            final FlowBuilder flowBuilder = new FlowBuilder(flowStat);
-            flowBuilder.setKey(flowKey);
-            addStatistics(flowBuilder, flowStat);
-            final InstanceIdentifier<Flow> flowIdent = tableRef.child(Flow.class, flowKey);
-            trans.put(LogicalDatastoreType.OPERATIONAL, flowIdent, flowBuilder.build());
-            /* check life for Alien flows */
-            if (flowKey.getId().getValue().startsWith(ALIEN_SYSTEM_FLOW_ID)) {
-                removeData(flowIdent, REMOVE_AFTER_MISSING_COLLECTION);
-            }
-        }
-
-        /* Build and deploy new FlowHashId map */
-        private void updateHashCache(final ReadWriteTransaction trans, final FlowKey flowKey, final FlowHashIdMapKey hashingKey) {
-            final FlowHashIdMapBuilder flHashIdMap = new FlowHashIdMapBuilder();
-            flHashIdMap.setFlowId(flowKey.getId());
-            flHashIdMap.setKey(hashingKey);
-            final KeyedInstanceIdentifier<FlowHashIdMap, FlowHashIdMapKey> flHashIdent = tableRef
-                    .augmentation(FlowHashIdMapping.class).child(FlowHashIdMap.class, hashingKey);
-            /* Add new FlowHashIdMap */
-            trans.put(LogicalDatastoreType.OPERATIONAL, flHashIdent, flHashIdMap.build());
-        }
-
-        void removeUnreportedFlows(final ReadWriteTransaction tx) {
-            final InstanceIdentifier<Node> nodeIdent = tableRef.firstIdentifierOf(Node.class);
-            final List<InstanceIdentifier<Flow>> listMissingConfigFlows = notStatReportedConfigFlows();
-            final Map<InstanceIdentifier<Flow>, Integer> nodeDeleteMap = mapNodesForDelete.get(nodeIdent);
-            final Map<FlowHashIdMapKey, FlowId> listForRemove = getRemovalList();
-            for (final Entry<FlowHashIdMapKey, FlowId> entryForRemove : listForRemove.entrySet()) {
-                final FlowKey flowKey = new FlowKey(entryForRemove.getValue());
-                final InstanceIdentifier<Flow> flowRef = tableRef.child(Flow.class, flowKey);
-                if (nodeDeleteMap != null && flowKey.getId().getValue().startsWith(ALIEN_SYSTEM_FLOW_ID)) {
-                    final Integer lifeIndex = nodeDeleteMap.get(flowRef);
-                    if (lifeIndex > 0) {
-                        break;
-                    } else {
-                        nodeDeleteMap.remove(flowRef);
-                    }
-                } else {
-                    if (listMissingConfigFlows.remove(flowRef)) {
-                        break; // we probably lost some multipart msg
-                    }
-                }
-                final InstanceIdentifier<FlowHashIdMap> flHashIdent =
-                        tableRef.augmentation(FlowHashIdMapping.class).child(FlowHashIdMap.class, entryForRemove.getKey());
-                tx.delete(LogicalDatastoreType.OPERATIONAL, flowRef);
-                tx.delete(LogicalDatastoreType.OPERATIONAL, flHashIdent);
-            }
-        }
-
-        List<InstanceIdentifier<Flow>> notStatReportedConfigFlows() {
-            if (configFlows != null) {
-                final List<InstanceIdentifier<Flow>> returnList = new ArrayList<>(configFlows.size());
-                for (final Flow confFlow : configFlows) {
-                    final InstanceIdentifier<Flow> confFlowIdent = tableRef.child(Flow.class, confFlow.getKey());
-                    returnList.add(confFlowIdent);
-                }
-                return returnList;
-            }
-            return Collections.emptyList();
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitGroup.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitGroup.java
deleted file mode 100644 (file)
index 538b9ef..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.statistics.manager.StatPermCollector.StatCapabTypes;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupDescStatsUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupFeaturesUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupStatisticsUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupDescStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupDescStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.desc.GroupDescBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.features.GroupFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.features.GroupFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.statistics.GroupStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.statistics.GroupStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
-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.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatListenCommitGroup
- * Class is a NotifyListener for GroupStatistics and DataChangeListener for Config/DataStore for Group node.
- * All expected (registered) GroupStatistics will be builded and commit to Operational/DataStore.
- * DataChangeEven should call create/delete Group in Operational/DS
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class StatListenCommitGroup extends StatAbstractListenCommit<Group, OpendaylightGroupStatisticsListener>
-                                                    implements OpendaylightGroupStatisticsListener {
-
-    private static final Logger LOG = LoggerFactory.getLogger(StatListenCommitMeter.class);
-
-    public StatListenCommitGroup(final StatisticsManager manager,  final DataBroker db,
-            final NotificationProviderService nps) {
-        super(manager, db, nps, Group.class);
-    }
-
-    @Override
-    protected OpendaylightGroupStatisticsListener getStatNotificationListener() {
-        return this;
-    }
-
-    @Override
-    protected InstanceIdentifier<Group> getWildCardedRegistrationPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class)
-                .augmentation(FlowCapableNode.class).child(Group.class);
-    }
-
-    @Override
-    public void onGroupDescStatsUpdated(final GroupDescStatsUpdated notification) {
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("Unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier
-                        .create(Nodes.class).child(Node.class, new NodeKey(nodeId));
-                /* Validate exist FlowCapableNode */
-                final InstanceIdentifier<FlowCapableNode> fNodeIdent = nodeIdent.augmentation(FlowCapableNode.class);
-                Optional<FlowCapableNode> fNode = Optional.absent();
-                try {
-                    fNode = tx.read(LogicalDatastoreType.OPERATIONAL,fNodeIdent).checkedGet();
-                }
-                catch (final ReadFailedException e) {
-                    LOG.debug("Read Operational/DS for FlowCapableNode fail! {}", fNodeIdent, e);
-                }
-                if ( ! fNode.isPresent()) {
-                    return;
-                }
-                /* Get and Validate TransactionCacheContainer */
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if ( ! isTransactionCacheContainerValid(txContainer)) {
-                    return;
-                }
-                /* Prepare List actual Groups and not updated Groups will be removed */
-                final List<Group> existGroups = fNode.get().getGroup() != null
-                        ? fNode.get().getGroup() : Collections.<Group> emptyList();
-                final List<GroupKey> existGroupKeys = new ArrayList<>();
-                for (final Group group : existGroups) {
-                    existGroupKeys.add(group.getKey());
-                }
-                /* GroupDesc processing */
-                statGroupDescCommit(txContainer, tx, fNodeIdent, existGroupKeys);
-                /* Delete all not presented Group Nodes */
-                deleteAllNotPresentNode(fNodeIdent, tx, Collections.unmodifiableList(existGroupKeys));
-                /* Notification for continue collecting statistics */
-                notifyToCollectNextStatistics(nodeIdent, transId);
-            }
-        });
-    }
-
-    @Override
-    public void onGroupFeaturesUpdated(final GroupFeaturesUpdated notification) {
-        Preconditions.checkNotNull(notification);
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("Unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                /* Get and Validate TransactionCacheContainer */
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if ( ! isTransactionCacheContainerValid(txContainer)) {
-                    return;
-                }
-
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier
-                        .create(Nodes.class).child(Node.class, new NodeKey(nodeId));
-
-                final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-                for (final TransactionAware notif : cacheNotifs) {
-                    if ( ! (notif instanceof GroupFeaturesUpdated)) {
-                        break;
-                    }
-                    final GroupFeatures stats = new GroupFeaturesBuilder((GroupFeaturesUpdated)notif).build();
-                    final InstanceIdentifier<NodeGroupFeatures> nodeGroupFeatureIdent =
-                            nodeIdent.augmentation(NodeGroupFeatures.class);
-                    final InstanceIdentifier<GroupFeatures> groupFeatureIdent = nodeGroupFeatureIdent
-                            .child(GroupFeatures.class);
-                    Optional<Node> node = Optional.absent();
-                    try {
-                        node = tx.read(LogicalDatastoreType.OPERATIONAL, nodeIdent).checkedGet();
-                    }
-                    catch (final ReadFailedException e) {
-                        LOG.debug("Read Operational/DS for Node fail! {}", nodeIdent, e);
-                    }
-                    if (node.isPresent()) {
-                        tx.merge(LogicalDatastoreType.OPERATIONAL, nodeGroupFeatureIdent, new NodeGroupFeaturesBuilder().build(), true);
-                        tx.put(LogicalDatastoreType.OPERATIONAL, groupFeatureIdent, stats);
-                        manager.registerAdditionalNodeFeature(nodeIdent, StatCapabTypes.GROUP_STATS);
-                    }
-                }
-            }
-        });
-    }
-
-    @Override
-    public void onGroupStatisticsUpdated(final GroupStatisticsUpdated notification) {
-        Preconditions.checkNotNull(notification);
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - GroupStatisticsUpdated: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier
-                        .create(Nodes.class).child(Node.class, new NodeKey(nodeId));
-                /* Node exist check */
-                Optional<Node> node = Optional.absent();
-                try {
-                    node = tx.read(LogicalDatastoreType.OPERATIONAL, nodeIdent).checkedGet();
-                }
-                catch (final ReadFailedException e) {
-                    LOG.debug("Read Operational/DS for Node fail! {}", nodeIdent, e);
-                }
-                if ( ! node.isPresent()) {
-                    return;
-                }
-
-                /* Get and Validate TransactionCacheContainer */
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if ( ! isTransactionCacheContainerValid(txContainer)) {
-                    return;
-                }
-                final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-
-                Optional<Group> notifGroup = Optional.absent();
-                final Optional<? extends DataObject> inputObj = txContainer.get().getConfInput();
-                if (inputObj.isPresent() && inputObj.get() instanceof Group) {
-                    notifGroup = Optional.<Group> of((Group)inputObj.get());
-                }
-                for (final TransactionAware notif : cacheNotifs) {
-                    if ( ! (notif instanceof GroupStatisticsUpdated)) {
-                        break;
-                    }
-                    statGroupCommit(((GroupStatisticsUpdated) notif).getGroupStats(), nodeIdent, tx);
-                }
-                if ( ! notifGroup.isPresent()) {
-                    notifyToCollectNextStatistics(nodeIdent, transId);
-                }
-            }
-        });
-    }
-
-    private void statGroupCommit(final List<GroupStats> groupStats, final InstanceIdentifier<Node> nodeIdent,
-            final ReadWriteTransaction tx) {
-
-        Preconditions.checkNotNull(groupStats);
-        Preconditions.checkNotNull(nodeIdent);
-        Preconditions.checkNotNull(tx);
-
-        final InstanceIdentifier<FlowCapableNode> fNodeIdent = nodeIdent.augmentation(FlowCapableNode.class);
-
-        for (final GroupStats gStat : groupStats) {
-            final GroupStatistics stats = new GroupStatisticsBuilder(gStat).build();
-
-            final InstanceIdentifier<Group> groupIdent = fNodeIdent.child(Group.class, new GroupKey(gStat.getGroupId()));
-            final InstanceIdentifier<NodeGroupStatistics> nGroupStatIdent =groupIdent
-                    .augmentation(NodeGroupStatistics.class);
-            final InstanceIdentifier<GroupStatistics> gsIdent = nGroupStatIdent.child(GroupStatistics.class);
-            /* Statistics Writing */
-            Optional<Group> group = Optional.absent();
-            try {
-                group = tx.read(LogicalDatastoreType.OPERATIONAL, groupIdent).checkedGet();
-            }
-            catch (final ReadFailedException e) {
-                LOG.debug("Read Operational/DS for Group node fail! {}", groupIdent, e);
-            }
-            if (group.isPresent()) {
-                tx.merge(LogicalDatastoreType.OPERATIONAL, nGroupStatIdent, new NodeGroupStatisticsBuilder().build(), true);
-                tx.put(LogicalDatastoreType.OPERATIONAL, gsIdent, stats);
-            }
-        }
-    }
-
-    private void statGroupDescCommit(final Optional<TransactionCacheContainer<?>> txContainer, final ReadWriteTransaction tx,
-            final InstanceIdentifier<FlowCapableNode> fNodeIdent, final List<GroupKey> existGroupKeys) {
-
-        Preconditions.checkNotNull(existGroupKeys);
-        Preconditions.checkNotNull(txContainer);
-        Preconditions.checkNotNull(fNodeIdent);
-        Preconditions.checkNotNull(tx);
-
-        final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-        for (final TransactionAware notif : cacheNotifs) {
-            if ( ! (notif instanceof GroupDescStatsUpdated)) {
-                break;
-            }
-            final List<GroupDescStats> groupStats = ((GroupDescStatsUpdated) notif).getGroupDescStats();
-            if (groupStats == null) {
-                break;
-            }
-            for (final GroupDescStats group : groupStats) {
-                if (group.getGroupId() != null) {
-                    final GroupBuilder groupBuilder = new GroupBuilder(group);
-                    final GroupKey groupKey = new GroupKey(group.getGroupId());
-                    final InstanceIdentifier<Group> groupRef = fNodeIdent.child(Group.class,groupKey);
-
-                    final NodeGroupDescStatsBuilder groupDesc= new NodeGroupDescStatsBuilder();
-                    groupDesc.setGroupDesc(new GroupDescBuilder(group).build());
-                    //Update augmented data
-                    groupBuilder.addAugmentation(NodeGroupDescStats.class, groupDesc.build());
-                    existGroupKeys.remove(groupKey);
-                    tx.put(LogicalDatastoreType.OPERATIONAL, groupRef, groupBuilder.build());
-                }
-            }
-        }
-    }
-
-    private void deleteAllNotPresentNode(final InstanceIdentifier<FlowCapableNode> fNodeIdent,
-            final ReadWriteTransaction trans, final List<GroupKey> deviceGroupKeys) {
-
-        Preconditions.checkNotNull(fNodeIdent);
-        Preconditions.checkNotNull(trans);
-
-        if (deviceGroupKeys == null) {
-            return;
-        }
-
-        for (final GroupKey key : deviceGroupKeys) {
-            final InstanceIdentifier<Group> delGroupIdent = fNodeIdent.child(Group.class, key);
-            LOG.trace("Group {} has to removed.", key);
-            Optional<Group> delGroup = Optional.absent();
-            try {
-                delGroup = trans.read(LogicalDatastoreType.OPERATIONAL, delGroupIdent).checkedGet();
-            }
-            catch (final ReadFailedException e) {
-                // NOOP - probably another transaction delete that node
-            }
-            if (delGroup.isPresent()) {
-                trans.delete(LogicalDatastoreType.OPERATIONAL, delGroupIdent);
-            }
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitMeter.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitMeter.java
deleted file mode 100644 (file)
index 77d51c3..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.statistics.manager.StatPermCollector.StatCapabTypes;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterConfigStatsUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterFeaturesUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatisticsUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterConfigStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterConfigStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.MeterFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.MeterFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterConfigStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.config.stats.reply.MeterConfigStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatListenCommitMeter
- * Class is a NotifyListener for MeterStatistics and DataChangeListener for Config/DataStore for Meter node.
- * All expected (registered) MeterStatistics will be builded and commit to Operational/DataStore.
- * DataChangeEven should call create/delete Meter in Operational/DS
- *
- */
-public class StatListenCommitMeter extends StatAbstractListenCommit<Meter, OpendaylightMeterStatisticsListener>
-                                            implements OpendaylightMeterStatisticsListener {
-
-    private static final Logger LOG = LoggerFactory.getLogger(StatListenCommitMeter.class);
-
-    public StatListenCommitMeter(final StatisticsManager manager, final DataBroker db,
-            final NotificationProviderService nps) {
-        super(manager, db, nps, Meter.class);
-    }
-
-    @Override
-    protected InstanceIdentifier<Meter> getWildCardedRegistrationPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class)
-                .augmentation(FlowCapableNode.class).child(Meter.class);
-    }
-
-    @Override
-    protected OpendaylightMeterStatisticsListener getStatNotificationListener() {
-        return this;
-    }
-
-    @Override
-    public void onMeterConfigStatsUpdated(final MeterConfigStatsUpdated notification) {
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - MeterConfigStatsUpdated: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier
-                        .create(Nodes.class).child(Node.class, new NodeKey(nodeId));
-
-                /* Validate exist FlowCapableNode */
-                final InstanceIdentifier<FlowCapableNode> fNodeIdent = nodeIdent.augmentation(FlowCapableNode.class);
-                Optional<FlowCapableNode> fNode = Optional.absent();
-                try {
-                    fNode = tx.read(LogicalDatastoreType.OPERATIONAL,fNodeIdent).checkedGet();
-                }
-                catch (final ReadFailedException e) {
-                    LOG.debug("Read Operational/DS for FlowCapableNode fail! {}", fNodeIdent, e);
-                }
-                if ( ! fNode.isPresent()) {
-                    return;
-                }
-                /* Get and Validate TransactionCacheContainer */
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if ( ! isTransactionCacheContainerValid(txContainer)) {
-                    return;
-                }
-                /* Prepare List actual Meters and not updated Meters will be removed */
-                final List<Meter> existMeters = fNode.get().getMeter() != null
-                        ? fNode.get().getMeter() : Collections.<Meter> emptyList();
-                final List<MeterKey> existMeterKeys = new ArrayList<>();
-                for (final Meter meter : existMeters) {
-                    existMeterKeys.add(meter.getKey());
-                }
-                /* MeterConfig processing */
-                comitConfMeterStats(txContainer, tx, fNodeIdent, existMeterKeys);
-                /* Delete all not presented Meter Nodes */
-                deleteAllNotPresentedNodes(fNodeIdent, tx, Collections.unmodifiableList(existMeterKeys));
-                /* Notification for continue collecting statistics */
-                notifyToCollectNextStatistics(nodeIdent, transId);
-            }
-        });
-    }
-
-    @Override
-    public void onMeterFeaturesUpdated(final MeterFeaturesUpdated notification) {
-        Preconditions.checkNotNull(notification);
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - MeterFeaturesUpdated: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                /* Get and Validate TransactionCacheContainer */
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if ( ! isTransactionCacheContainerValid(txContainer)) {
-                    return;
-                }
-
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier
-                        .create(Nodes.class).child(Node.class, new NodeKey(nodeId));
-
-                final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-                for (final TransactionAware notif : cacheNotifs) {
-                    if ( ! (notif instanceof MeterFeaturesUpdated)) {
-                        break;
-                    }
-                    final MeterFeatures stats = new MeterFeaturesBuilder((MeterFeaturesUpdated)notif).build();
-                    final InstanceIdentifier<NodeMeterFeatures> nodeMeterFeatureIdent =
-                            nodeIdent.augmentation(NodeMeterFeatures.class);
-                    final InstanceIdentifier<MeterFeatures> meterFeatureIdent = nodeMeterFeatureIdent
-                            .child(MeterFeatures.class);
-                    Optional<Node> node = Optional.absent();
-                    try {
-                        node = tx.read(LogicalDatastoreType.OPERATIONAL, nodeIdent).checkedGet();
-                    }
-                    catch (final ReadFailedException e) {
-                        LOG.debug("Read Operational/DS for Node fail! {}", nodeIdent, e);
-                    }
-                    if (node.isPresent()) {
-                        tx.merge(LogicalDatastoreType.OPERATIONAL, nodeMeterFeatureIdent, new NodeMeterFeaturesBuilder().build(), true);
-                        tx.put(LogicalDatastoreType.OPERATIONAL, meterFeatureIdent, stats);
-                        manager.registerAdditionalNodeFeature(nodeIdent, StatCapabTypes.METER_STATS);
-                    }
-                }
-            }
-        });
-    }
-
-    @Override
-    public void onMeterStatisticsUpdated(final MeterStatisticsUpdated notification) {
-        Preconditions.checkNotNull(notification);
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - MeterStatisticsUpdated: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier
-                        .create(Nodes.class).child(Node.class, new NodeKey(nodeId));
-                /* Node exist check */
-                Optional<Node> node = Optional.absent();
-                try {
-                    node = tx.read(LogicalDatastoreType.OPERATIONAL, nodeIdent).checkedGet();
-                }
-                catch (final ReadFailedException e) {
-                    LOG.debug("Read Operational/DS for Node fail! {}", nodeIdent, e);
-                }
-                if ( ! node.isPresent()) {
-                    return;
-                }
-
-                /* Get and Validate TransactionCacheContainer */
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if ( ! isTransactionCacheContainerValid(txContainer)) {
-                    return;
-                }
-                final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-
-                Optional<Meter> notifMeter = Optional.absent();
-                final Optional<? extends DataObject> inputObj = txContainer.get().getConfInput();
-                if (inputObj.isPresent() && inputObj.get() instanceof Meter) {
-                    notifMeter = Optional.<Meter> of((Meter)inputObj.get());
-                }
-                for (final TransactionAware notif : cacheNotifs) {
-                    if ( ! (notif instanceof MeterStatisticsUpdated)) {
-                        break;
-                    }
-                    statMeterCommit(((MeterStatisticsUpdated) notif).getMeterStats(), nodeIdent, tx);
-                }
-                if ( ! notifMeter.isPresent()) {
-                    notifyToCollectNextStatistics(nodeIdent, transId);
-                }
-            }
-        });
-    }
-
-    private void statMeterCommit(final List<MeterStats> meterStats,
-            final InstanceIdentifier<Node> nodeIdent, final ReadWriteTransaction tx) {
-
-        Preconditions.checkNotNull(meterStats);
-        Preconditions.checkNotNull(nodeIdent);
-        Preconditions.checkNotNull(tx);
-
-        final InstanceIdentifier<FlowCapableNode> fNodeIdent = nodeIdent.augmentation(FlowCapableNode.class);
-
-        for (final MeterStats mStat : meterStats) {
-            final MeterStatistics stats = new MeterStatisticsBuilder(mStat).build();
-
-            final InstanceIdentifier<Meter> meterIdent = fNodeIdent.child(Meter.class, new MeterKey(mStat.getMeterId()));
-            final InstanceIdentifier<NodeMeterStatistics> nodeMeterStatIdent = meterIdent
-                    .augmentation(NodeMeterStatistics.class);
-            final InstanceIdentifier<MeterStatistics> msIdent = nodeMeterStatIdent.child(MeterStatistics.class);
-            /* Meter Statistics commit */
-            Optional<Meter> meter = Optional.absent();
-            try {
-                meter = tx.read(LogicalDatastoreType.OPERATIONAL, meterIdent).checkedGet();
-            }
-            catch (final ReadFailedException e) {
-                LOG.debug("Read Operational/DS for FlowCapableNode fail! {}", fNodeIdent, e);
-            }
-            if (meter.isPresent()) {
-                tx.merge(LogicalDatastoreType.OPERATIONAL, nodeMeterStatIdent, new NodeMeterStatisticsBuilder().build(), true);
-                tx.put(LogicalDatastoreType.OPERATIONAL, msIdent, stats);
-            }
-        }
-    }
-
-    private void comitConfMeterStats(final Optional<TransactionCacheContainer<?>> txContainer, final ReadWriteTransaction tx,
-            final InstanceIdentifier<FlowCapableNode> fNodeIdent, final List<MeterKey> existMeterKeys) {
-
-        Preconditions.checkNotNull(existMeterKeys);
-        Preconditions.checkNotNull(txContainer);
-        Preconditions.checkNotNull(fNodeIdent);
-        Preconditions.checkNotNull(tx);
-
-        final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-        for (final TransactionAware notif : cacheNotifs) {
-            if ( ! (notif instanceof MeterConfigStatsUpdated)) {
-                break;
-            }
-            final List<MeterConfigStats> meterStats = ((MeterConfigStatsUpdated) notif).getMeterConfigStats();
-            if (meterStats == null) {
-                break;
-            }
-            for (final MeterConfigStats meterStat : meterStats) {
-                if (meterStat.getMeterId() != null) {
-                    final MeterBuilder meterBuilder = new MeterBuilder(meterStat);
-                    final MeterKey meterKey = new MeterKey(meterStat.getMeterId());
-                    final InstanceIdentifier<Meter> meterRef = fNodeIdent.child(Meter.class, meterKey);
-
-                    final NodeMeterConfigStatsBuilder meterConfig = new NodeMeterConfigStatsBuilder();
-                    meterConfig.setMeterConfigStats(new MeterConfigStatsBuilder(meterStat).build());
-                    //Update augmented data
-                    meterBuilder.addAugmentation(NodeMeterConfigStats.class, meterConfig.build());
-                    existMeterKeys.remove(meterKey);
-                    tx.put(LogicalDatastoreType.OPERATIONAL, meterRef, meterBuilder.build());
-                }
-            }
-        }
-    }
-
-    private void deleteAllNotPresentedNodes(final InstanceIdentifier<FlowCapableNode> fNodeIdent,
-            final ReadWriteTransaction tx, final List<MeterKey> deviceMeterKeys) {
-
-        Preconditions.checkNotNull(fNodeIdent);
-        Preconditions.checkNotNull(tx);
-
-        if (deviceMeterKeys == null) {
-            return;
-        }
-
-        for (final MeterKey key : deviceMeterKeys) {
-            final InstanceIdentifier<Meter> delMeterIdent = fNodeIdent.child(Meter.class, key);
-            LOG.trace("Meter {} has to removed.", key);
-            Optional<Meter> delMeter = Optional.absent();
-            try {
-                delMeter = tx.read(LogicalDatastoreType.OPERATIONAL, delMeterIdent).checkedGet();
-            }
-            catch (final ReadFailedException e) {
-                // NOOP - probably another transaction delete that node
-            }
-            if (delMeter.isPresent()) {
-                tx.delete(LogicalDatastoreType.OPERATIONAL, delMeterIdent);
-            }
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitQueue.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatListenCommitQueue.java
deleted file mode 100644 (file)
index 1bff3de..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueKey;
-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.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-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.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.FlowCapableNodeConnectorQueueStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.FlowCapableNodeConnectorQueueStatisticsDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.flow.capable.node.connector.queue.statistics.FlowCapableNodeConnectorQueueStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.flow.capable.node.connector.queue.statistics.FlowCapableNodeConnectorQueueStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMap;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatNotifyCommitQueue
- * Class is a NotifyListner for Queues Statistics
- * All expected (registered) queueStatistics will be builded and
- * commit to Operational/DataStore
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class StatListenCommitQueue extends StatAbstractListenCommit<Queue, OpendaylightQueueStatisticsListener>
-                                        implements OpendaylightQueueStatisticsListener {
-
-    private final static Logger LOG = LoggerFactory.getLogger(StatListenCommitQueue.class);
-
-    public StatListenCommitQueue(final StatisticsManager manager, final DataBroker db,
-            final NotificationProviderService nps) {
-        super(manager, db, nps, Queue.class);
-    }
-
-    @Override
-    protected OpendaylightQueueStatisticsListener getStatNotificationListener() {
-        return this;
-    }
-
-    @Override
-    protected InstanceIdentifier<Queue> getWildCardedRegistrationPath() {
-        return InstanceIdentifier.create(Nodes.class).child(Node.class).child(NodeConnector.class)
-            .augmentation(FlowCapableNodeConnector.class).child(Queue.class);
-    }
-
-    @Override
-    public void onQueueStatisticsUpdate(final QueueStatisticsUpdate notification) {
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - QueueStatisticsUpdate: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier.create(Nodes.class)
-                        .child(Node.class, new NodeKey(nodeId));
-
-                /* Validate exist Node */
-                Optional<Node> fNode = Optional.absent();
-                try {
-                    fNode = tx.read(LogicalDatastoreType.OPERATIONAL, nodeIdent).checkedGet();
-                }
-                catch (final ReadFailedException e) {
-                    LOG.debug("Read Operational/DS for Node fail! {}", nodeIdent, e);
-                }
-                if ( ! fNode.isPresent()) {
-                    LOG.trace("Read Operational/DS for Node fail! Node {} doesn't exist.", nodeIdent);
-                    return;
-                }
-
-                /* Get and Validate TransactionCacheContainer */
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if ( ! isTransactionCacheContainerValid(txContainer)) {
-                    return;
-                }
-                /* Prepare List actual Queues and not updated Queues will be removed */
-                final List<NodeConnector> existConnectors = fNode.get().getNodeConnector() != null
-                        ? fNode.get().getNodeConnector() : Collections.<NodeConnector> emptyList();
-                final Map<QueueKey, NodeConnectorKey> existQueueKeys = new HashMap<>();
-                for (final NodeConnector connect : existConnectors) {
-                    final List<Queue> listQueues = connect.getAugmentation(FlowCapableNodeConnector.class).getQueue();
-                    if (listQueues != null) {
-                        for (final Queue queue : listQueues) {
-                            existQueueKeys.put(queue.getKey(), connect.getKey());
-                        }
-                    }
-                }
-                /* Queue processing */
-                statQueueCommit(txContainer, tx, nodeIdent, existQueueKeys);
-                /* Delete all not presented Group Nodes */
-                deleteAllNotPresentedNodes(nodeIdent, tx, Collections.unmodifiableMap(existQueueKeys));
-                /* Notification for continue collecting statistics */
-                notifyToCollectNextStatistics(nodeIdent, transId);
-            }
-        });
-    }
-
-    private void statQueueCommit(
-            final Optional<TransactionCacheContainer<?>> txContainer, final ReadWriteTransaction tx,
-            final InstanceIdentifier<Node> nodeIdent, final Map<QueueKey, NodeConnectorKey> existQueueKeys) {
-
-        Preconditions.checkNotNull(existQueueKeys);
-        Preconditions.checkNotNull(txContainer);
-        Preconditions.checkNotNull(nodeIdent);
-        Preconditions.checkNotNull(tx);
-
-        final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
-        for (final TransactionAware notif : cacheNotifs) {
-            if ( ! (notif instanceof QueueStatisticsUpdate)) {
-                break;
-            }
-            final List<QueueIdAndStatisticsMap> queueStats = ((QueueStatisticsUpdate) notif).getQueueIdAndStatisticsMap();
-            if (queueStats == null) {
-                break;
-            }
-            for (final QueueIdAndStatisticsMap queueStat : queueStats) {
-                if (queueStat.getQueueId() != null) {
-                    final FlowCapableNodeConnectorQueueStatistics statChild =
-                            new FlowCapableNodeConnectorQueueStatisticsBuilder(queueStat).build();
-                    final FlowCapableNodeConnectorQueueStatisticsDataBuilder statBuild =
-                            new FlowCapableNodeConnectorQueueStatisticsDataBuilder();
-                    statBuild.setFlowCapableNodeConnectorQueueStatistics(statChild);
-                    final QueueKey qKey = new QueueKey(queueStat.getQueueId());
-                    final InstanceIdentifier<Queue> queueIdent = nodeIdent
-                            .child(NodeConnector.class, new NodeConnectorKey(queueStat.getNodeConnectorId()))
-                            .augmentation(FlowCapableNodeConnector.class)
-                            .child(Queue.class, qKey);
-                    final InstanceIdentifier<FlowCapableNodeConnectorQueueStatisticsData> queueStatIdent = queueIdent.augmentation(FlowCapableNodeConnectorQueueStatisticsData.class);
-                    existQueueKeys.remove(qKey);
-                    tx.merge(LogicalDatastoreType.OPERATIONAL, queueIdent, new QueueBuilder().setKey(qKey).build());
-                    tx.put(LogicalDatastoreType.OPERATIONAL, queueStatIdent, statBuild.build());
-                }
-            }
-        }
-    }
-
-    private void deleteAllNotPresentedNodes(final InstanceIdentifier<Node> nodeIdent,
-            final ReadWriteTransaction tx, final Map<QueueKey, NodeConnectorKey> existQueueKeys) {
-
-        Preconditions.checkNotNull(nodeIdent);
-        Preconditions.checkNotNull(tx);
-
-        if (existQueueKeys == null) {
-            return;
-        }
-
-        for (final Entry<QueueKey, NodeConnectorKey> entry : existQueueKeys.entrySet()) {
-            final InstanceIdentifier<Queue> queueIdent = nodeIdent.child(NodeConnector.class, entry.getValue())
-                    .augmentation(FlowCapableNodeConnector.class).child(Queue.class, entry.getKey());
-            LOG.trace("Queue {} has to removed.", queueIdent);
-            Optional<Queue> delQueue = Optional.absent();
-            try {
-                delQueue = tx.read(LogicalDatastoreType.OPERATIONAL, queueIdent).checkedGet();
-            }
-            catch (final ReadFailedException e) {
-                // NOOP - probably another transaction delete that node
-            }
-            if (delQueue.isPresent()) {
-                tx.delete(LogicalDatastoreType.OPERATIONAL, queueIdent);
-            }
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNodeRegistrationImpl.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNodeRegistrationImpl.java
deleted file mode 100644 (file)
index 4169725..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.statistics.manager.StatNodeRegistration;
-import org.opendaylight.controller.md.statistics.manager.StatPermCollector.StatCapabTypes;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityFlowStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityGroupStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityPortStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityQueueStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityTableStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
-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 org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatNodeRegistrationImpl
- * {@link FlowCapableNode} Registration Implementation contains two method for registration/unregistration
- * {@link FeatureCapability} for every connect/disconnect {@link FlowCapableNode}. Process of connection/disconnection
- * is substituted by listening Operation/DS for add/delete {@link FeatureCapability}.
- * All statistic capabilities are reading from new Node directly without contacting device or DS.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 28, 2014
- */
-public class StatNodeRegistrationImpl implements StatNodeRegistration, DataChangeListener {
-
-    private static final Logger LOG = LoggerFactory.getLogger(StatNodeRegistrationImpl.class);
-
-    private final StatisticsManager manager;
-    private ListenerRegistration<DataChangeListener> listenerRegistration;
-    private ListenerRegistration<?> notifListenerRegistration;
-
-    public StatNodeRegistrationImpl(final StatisticsManager manager, final DataBroker db,
-            final NotificationProviderService notificationService) {
-        this.manager = Preconditions.checkNotNull(manager, "StatisticManager can not be null!");
-        Preconditions.checkArgument(db != null, "DataBroker can not be null!");
-        Preconditions.checkArgument(notificationService != null, "NotificationProviderService can not be null!");
-        notifListenerRegistration = notificationService.registerNotificationListener(this);
-        /* Build Path */
-        final InstanceIdentifier<FlowCapableNode> flowNodeWildCardIdentifier = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class).augmentation(FlowCapableNode.class);
-        listenerRegistration = db.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                flowNodeWildCardIdentifier, StatNodeRegistrationImpl.this, DataChangeScope.BASE);
-    }
-
-    @Override
-    public void close() throws Exception {
-
-        if (notifListenerRegistration != null) {
-            try {
-                notifListenerRegistration.close();
-            }
-            catch (final Exception e) {
-                LOG.warn("Error by stop FlowCapableNode Notification StatNodeRegistration.");
-            }
-            notifListenerRegistration = null;
-        }
-
-        if (listenerRegistration != null) {
-            try {
-                listenerRegistration.close();
-            } catch (final Exception e) {
-                LOG.warn("Error by stop FlowCapableNode DataChange StatListeningCommiter.", e);
-            }
-            listenerRegistration = null;
-        }
-    }
-
-    @Override
-    public void connectFlowCapableNode(final InstanceIdentifier<SwitchFeatures> keyIdent,
-            final SwitchFeatures data, final InstanceIdentifier<Node> nodeIdent) {
-        Preconditions.checkNotNull(keyIdent, "InstanceIdentifier can not be null!");
-        Preconditions.checkNotNull(data, "SwitchFeatures data for {} can not be null!", keyIdent);
-        Preconditions.checkArgument(( ! keyIdent.isWildcarded()), "InstanceIdentifier is WildCarded!");
-
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.NODE_UPDATE,nodeIdent.firstKeyOf(Node.class, NodeKey.class).getId()) {
-
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-
-                final List<StatCapabTypes> statCapabTypes = new ArrayList<>();
-                Short maxCapTables = Short.valueOf("1");
-
-                final List<Class<? extends FeatureCapability>> capabilities = data.getCapabilities() != null
-                        ? data.getCapabilities() : Collections.<Class<? extends FeatureCapability>> emptyList();
-                for (final Class<? extends FeatureCapability> capability : capabilities) {
-                    if (capability == FlowFeatureCapabilityTableStats.class) {
-                        statCapabTypes.add(StatCapabTypes.TABLE_STATS);
-                    } else if (capability == FlowFeatureCapabilityFlowStats.class) {
-                        statCapabTypes.add(StatCapabTypes.FLOW_STATS);
-                    } else if (capability == FlowFeatureCapabilityGroupStats.class) {
-                        statCapabTypes.add(StatCapabTypes.GROUP_STATS);
-                    } else if (capability == FlowFeatureCapabilityPortStats.class) {
-                        statCapabTypes.add(StatCapabTypes.PORT_STATS);
-                    } else if (capability == FlowFeatureCapabilityQueueStats.class) {
-                        statCapabTypes.add(StatCapabTypes.QUEUE_STATS);
-                    }
-                }
-                maxCapTables = data.getMaxTables();
-
-                final Optional<Short> maxTables = Optional.<Short> of(maxCapTables);
-                manager.connectedNodeRegistration(nodeIdent,
-                        Collections.unmodifiableList(statCapabTypes), maxTables.get());
-            }
-        });
-    }
-
-    @Override
-    public void disconnectFlowCapableNode(final InstanceIdentifier<Node> nodeIdent) {
-        Preconditions.checkArgument(nodeIdent != null, "InstanceIdentifier can not be NULL!");
-        Preconditions.checkArgument(( ! nodeIdent.isWildcarded()),
-                "InstanceIdentifier {} is WildCarded!", nodeIdent);
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.NODE_REMOVAL,nodeIdent.firstKeyOf(Node.class, NodeKey.class).getId()) {
-
-            @Override
-            public void applyOperation(final ReadWriteTransaction tx) {
-                manager.disconnectedNodeUnregistration(nodeIdent);
-            }
-        });
-    }
-
-
-    @Override
-    public void onNodeConnectorRemoved(final NodeConnectorRemoved notification) {
-        // NOOP
-    }
-
-    @Override
-    public void onNodeConnectorUpdated(final NodeConnectorUpdated notification) {
-        // NOOP
-    }
-
-    @Override
-    public void onNodeRemoved(final NodeRemoved notification) {
-        Preconditions.checkNotNull(notification);
-        final NodeRef nodeRef = notification.getNodeRef();
-        final InstanceIdentifier<?> nodeRefIdent = nodeRef.getValue();
-        final InstanceIdentifier<Node> nodeIdent =
-                nodeRefIdent.firstIdentifierOf(Node.class);
-        if (nodeIdent != null) {
-            disconnectFlowCapableNode(nodeIdent);
-        }
-    }
-
-    @Override
-    public void onNodeUpdated(final NodeUpdated notification) {
-        Preconditions.checkNotNull(notification);
-        final FlowCapableNodeUpdated newFlowNode =
-                notification.getAugmentation(FlowCapableNodeUpdated.class);
-        if (newFlowNode != null && newFlowNode.getSwitchFeatures() != null) {
-            final NodeRef nodeRef = notification.getNodeRef();
-            final InstanceIdentifier<?> nodeRefIdent = nodeRef.getValue();
-            final InstanceIdentifier<Node> nodeIdent =
-                    nodeRefIdent.firstIdentifierOf(Node.class);
-
-            final InstanceIdentifier<SwitchFeatures> swichFeaturesIdent =
-                    nodeIdent.augmentation(FlowCapableNode.class).child(SwitchFeatures.class);
-            final SwitchFeatures switchFeatures = newFlowNode.getSwitchFeatures();
-            connectFlowCapableNode(swichFeaturesIdent, switchFeatures, nodeIdent);
-        }
-    }
-
-    @Override
-    public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changeEvent) {
-        Preconditions.checkNotNull(changeEvent,"Async ChangeEvent can not be null!");
-        /* All DataObjects for create */
-        final Set<InstanceIdentifier<?>>  createdData = changeEvent.getCreatedData() != null
-                ? changeEvent.getCreatedData().keySet() : Collections.<InstanceIdentifier<?>> emptySet();
-
-        for (final InstanceIdentifier<?> entryKey : createdData) {
-            final InstanceIdentifier<Node> nodeIdent = entryKey
-                    .firstIdentifierOf(Node.class);
-            if ( ! nodeIdent.isWildcarded()) {
-                final NodeRef nodeRef = new NodeRef(nodeIdent);
-                // FIXME: these calls is a job for handshake or for inventory manager
-                /* check Group and Meter future */
-                manager.getRpcMsgManager().getGroupFeaturesStat(nodeRef);
-                manager.getRpcMsgManager().getMeterFeaturesStat(nodeRef);
-            }
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNotifyCommitPort.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNotifyCommitPort.java
deleted file mode 100644 (file)
index 65b5df0..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-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.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.flow.capable.node.connector.statistics.FlowCapableNodeConnectorStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.flow.capable.node.connector.statistics.FlowCapableNodeConnectorStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatNotifyCommitPort
- * Class is a NotifyListener for PortStatistics
- * All expected (registered) portStatistics will be builded and
- * commit to Operational/DataStore
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class StatNotifyCommitPort extends StatAbstractNotifyCommit<OpendaylightPortStatisticsListener>
-                                        implements OpendaylightPortStatisticsListener {
-
-    private static final Logger LOG = LoggerFactory.getLogger(StatNotifyCommitPort.class);
-
-    public StatNotifyCommitPort(final StatisticsManager manager,
-            final NotificationProviderService nps) {
-        super(manager, nps);
-    }
-
-    @Override
-    protected OpendaylightPortStatisticsListener getStatNotificationListener() {
-        return this;
-    }
-
-    @Override
-    public void onNodeConnectorStatisticsUpdate(final NodeConnectorStatisticsUpdate notification) {
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - NodeConnectorStatisticsUpdate: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-        final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, new NodeKey(nodeId));
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction trans) {
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                if (( ! txContainer.isPresent()) || txContainer.get().getNotifications() == null) {
-                    return;
-                }
-                final List<NodeConnectorStatisticsAndPortNumberMap> portStats =
-                        new ArrayList<NodeConnectorStatisticsAndPortNumberMap>(10);
-                final List<? extends TransactionAware> cachedNotifs = txContainer.get().getNotifications();
-                for (final TransactionAware notif : cachedNotifs) {
-                    if (notif instanceof NodeConnectorStatisticsUpdate) {
-                        final List<NodeConnectorStatisticsAndPortNumberMap> notifStat =
-                                ((NodeConnectorStatisticsUpdate) notif).getNodeConnectorStatisticsAndPortNumberMap();
-                        if (notifStat != null) {
-                            portStats.addAll(notifStat);
-                        }
-                    }
-                }
-                /* write stat to trans */
-                statPortCommit(portStats, nodeIdent, trans);
-                /* Notification for continue collecting statistics - Port statistics are still same size
-                 * and they are small - don't need to wait for whole apply operation*/
-                notifyToCollectNextStatistics(nodeIdent, transId);
-            }
-        });
-    }
-
-    private void statPortCommit(final List<NodeConnectorStatisticsAndPortNumberMap> portStats,
-            final InstanceIdentifier<Node> nodeIdent, final ReadWriteTransaction tx) {
-
-        /* check exist FlowCapableNode and write statistics probable with parent */
-        Optional<Node> fNode = Optional.absent();
-        try {
-            fNode = tx.read(LogicalDatastoreType.OPERATIONAL, nodeIdent).checkedGet();
-        }
-        catch (final ReadFailedException e) {
-            LOG.debug("Read Operational/DS for Node fail! {}", nodeIdent, e);
-            return;
-        }
-        if ( ! fNode.isPresent()) {
-            LOG.trace("Read Operational/DS for Node fail! Node {} doesn't exist.", nodeIdent);
-            return;
-        }
-        for (final NodeConnectorStatisticsAndPortNumberMap nConnectPort : portStats) {
-            final FlowCapableNodeConnectorStatistics stats = new FlowCapableNodeConnectorStatisticsBuilder(nConnectPort).build();
-            final NodeConnectorKey key = new NodeConnectorKey(nConnectPort.getNodeConnectorId());
-            final InstanceIdentifier<NodeConnector> nodeConnectorIdent = nodeIdent.child(NodeConnector.class, key);
-            final InstanceIdentifier<FlowCapableNodeConnectorStatisticsData> nodeConnStatIdent = nodeConnectorIdent
-                    .augmentation(FlowCapableNodeConnectorStatisticsData.class);
-            final InstanceIdentifier<FlowCapableNodeConnectorStatistics> flowCapNodeConnStatIdent =
-                    nodeConnStatIdent.child(FlowCapableNodeConnectorStatistics.class);
-            Optional<NodeConnector> fNodeConector;
-            try {
-                fNodeConector = tx.read(LogicalDatastoreType.OPERATIONAL, nodeConnectorIdent).checkedGet();
-            }
-            catch (final ReadFailedException e) {
-                LOG.debug("Read NodeConnector {} in Operational/DS fail!", nodeConnectorIdent, e);
-                fNodeConector = Optional.absent();
-            }
-            if (fNodeConector.isPresent()) {
-                tx.merge(LogicalDatastoreType.OPERATIONAL, nodeConnectorIdent, new NodeConnectorBuilder().setId(key.getId()).build());
-                tx.merge(LogicalDatastoreType.OPERATIONAL, nodeConnStatIdent, new FlowCapableNodeConnectorStatisticsDataBuilder().build());
-                tx.put(LogicalDatastoreType.OPERATIONAL, flowCapNodeConnStatIdent, stats);
-            }
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNotifyCommitTable.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatNotifyCommitTable.java
deleted file mode 100644 (file)
index 2d73064..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-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.TableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.statistics.FlowTableStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.statistics.FlowTableStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Optional;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatNotifyCommitTable
- * Class is a NotifyListener for TableStatistics
- * All expected (registered) tableStatistics will be builded and
- * commit to Operational/DataStore
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class StatNotifyCommitTable extends StatAbstractNotifyCommit<OpendaylightFlowTableStatisticsListener>
-                                        implements OpendaylightFlowTableStatisticsListener {
-
-    private final static Logger LOG = LoggerFactory.getLogger(StatNotifyCommitTable.class);
-
-    public StatNotifyCommitTable(final StatisticsManager manager,
-            final NotificationProviderService nps) {
-        super(manager, nps);
-    }
-
-    @Override
-    protected OpendaylightFlowTableStatisticsListener getStatNotificationListener() {
-        return this;
-    }
-
-    @Override
-    public void onFlowTableStatisticsUpdate(final FlowTableStatisticsUpdate notification) {
-        final TransactionId transId = notification.getTransactionId();
-        final NodeId nodeId = notification.getId();
-        if ( ! isExpectedStatistics(transId, nodeId)) {
-            LOG.debug("STAT-MANAGER - FlowTableStatisticsUpdate: unregistred notification detect TransactionId {}", transId);
-            return;
-        }
-        manager.getRpcMsgManager().addNotification(notification, nodeId);
-        if (notification.isMoreReplies()) {
-            return;
-        }
-        /* Don't block RPC Notification thread */
-        manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.DATA_COMMIT_OPER_DS,nodeId) {
-            @Override
-            public void applyOperation(final ReadWriteTransaction trans) {
-                final List<FlowTableAndStatisticsMap> tableStats = new ArrayList<FlowTableAndStatisticsMap>(10);
-                final Optional<TransactionCacheContainer<?>> txContainer = getTransactionCacheContainer(transId, nodeId);
-                final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier.create(Nodes.class)
-                        .child(Node.class, new NodeKey(nodeId));
-                if (( ! txContainer.isPresent()) || txContainer.get().getNodeId() == null) {
-                    return;
-                }
-                final List<? extends TransactionAware> cachedNotifs = txContainer.get().getNotifications();
-                for (final TransactionAware notif : cachedNotifs) {
-                    if (notif instanceof FlowTableStatisticsUpdate) {
-                        final List<FlowTableAndStatisticsMap> statNotif =
-                                ((FlowTableStatisticsUpdate) notif).getFlowTableAndStatisticsMap();
-                        if (statNotif != null) {
-                            tableStats.addAll(statNotif);
-                        }
-                    }
-                }
-                /* write stat to trans */
-                statTableCommit(tableStats, nodeIdent, trans);
-                /* Notification for continue collecting statistics - Tables statistics are still same size
-                 * and they are small - don't need to wait to whole apply operation */
-                notifyToCollectNextStatistics(nodeIdent, transId);
-            }
-        });
-    }
-
-    private void statTableCommit(final List<FlowTableAndStatisticsMap> tableStats, final InstanceIdentifier<Node> nodeIdent,
-            final ReadWriteTransaction trans) {
-        final InstanceIdentifier<FlowCapableNode> fNodeIdent = nodeIdent.augmentation(FlowCapableNode.class);
-        /* check flow Capable Node and write statistics */
-        Optional<FlowCapableNode> fNode = Optional.absent();
-        try {
-            fNode = trans.read(LogicalDatastoreType.OPERATIONAL, fNodeIdent).checkedGet();
-        }
-        catch (final ReadFailedException e) {
-            LOG.debug("Read Operational/DS for FlowCapableNode fail! {}", fNodeIdent, e);
-            return;
-        }
-        if ( ! fNode.isPresent()) {
-            LOG.trace("Read Operational/DS for FlowCapableNode fail! Node {} doesn't exist.", fNodeIdent);
-            return;
-        }
-        for (final FlowTableAndStatisticsMap tableStat : tableStats) {
-            final InstanceIdentifier<Table> tableIdent = fNodeIdent
-                    .child(Table.class, new TableKey(tableStat.getTableId().getValue()));
-            final Table table = new TableBuilder().setId(tableStat.getTableId().getValue()).build();
-            trans.merge(LogicalDatastoreType.OPERATIONAL, tableIdent, table);
-            final InstanceIdentifier<FlowTableStatisticsData> tableStatIdent = tableIdent
-                    .augmentation(FlowTableStatisticsData.class);
-            trans.merge(LogicalDatastoreType.OPERATIONAL, tableStatIdent, new FlowTableStatisticsDataBuilder().build());
-
-            final FlowTableStatistics stats = new FlowTableStatisticsBuilder(tableStat).build();
-            final InstanceIdentifier<FlowTableStatistics> tStatIdent = tableStatIdent.child(FlowTableStatistics.class);
-            trans.put(LogicalDatastoreType.OPERATIONAL, tStatIdent, stats);
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatPermCollectorImpl.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatPermCollectorImpl.java
deleted file mode 100644 (file)
index 9dd70b5..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-package org.opendaylight.controller.md.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-
-import org.opendaylight.controller.md.statistics.manager.StatPermCollector;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatPermCollectorImpl
- * Thread base statistic collector. Class holds internal map for all registered
- * (means connected) nodes with List of Switch capabilities;
- * Statistics collecting process get cross whole Network Device by device
- * and statistic by statistic (follow Switch capabilities to prevent unnecessary
- * ask) Next statistic start collecting by notification or by timeout.
- *
- * @author @author avishnoi@in.ibm.com <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class StatPermCollectorImpl implements StatPermCollector {
-
-    private final static Logger LOG = LoggerFactory.getLogger(StatPermCollectorImpl.class);
-
-    private final static long STAT_COLLECT_TIME_OUT = 3000L;
-
-    private final ExecutorService statNetCollectorServ;
-    private final StatisticsManager manager;
-
-    private final int maxNodeForCollector;
-    private final long minReqNetInterval;
-    private final String name;
-
-    private final Object statCollectorLock = new Object();
-    private final Object statNodeHolderLock = new Object();
-    private final Object transNotifyLock = new Object();
-
-    private Map<InstanceIdentifier<Node>, StatNodeInfoHolder> statNodeHolder =
-            Collections.<InstanceIdentifier<Node>, StatNodeInfoHolder> emptyMap();
-
-    private volatile boolean wakeMe = false;
-    private volatile boolean finishing = false;
-    private TransactionId actualTransactionId;
-
-    public StatPermCollectorImpl(final StatisticsManager manager, final long minReqNetInterv, final int nr,
-            final int maxNodeForCollectors) {
-        this.manager = Preconditions.checkNotNull(manager, "StatisticsManager can not be null!");
-        name = "odl-stat-collector-" + nr;
-        minReqNetInterval = minReqNetInterv;
-        final ThreadFactory threadFact = new ThreadFactoryBuilder()
-            .setNameFormat(name + "-thread-%d").build();
-        statNetCollectorServ = Executors.newSingleThreadExecutor(threadFact);
-        maxNodeForCollector = maxNodeForCollectors;
-        LOG.trace("StatCollector {} start successfull!", name);
-    }
-
-    /**
-     * finish collecting statistics
-     */
-    @Override
-    public void close() {
-        statNodeHolder = Collections.<InstanceIdentifier<Node>, StatNodeInfoHolder> emptyMap();
-        finishing = true;
-        collectNextStatistics(actualTransactionId);
-        statNetCollectorServ.shutdown();
-    }
-
-    @Override
-    public boolean hasActiveNodes() {
-        return ( ! statNodeHolder.isEmpty());
-    }
-
-    @Override
-    public boolean isProvidedFlowNodeActive(
-            final InstanceIdentifier<Node> flowNode) {
-        return statNodeHolder.containsKey(flowNode);
-    }
-
-    @Override
-    public boolean connectedNodeRegistration(final InstanceIdentifier<Node> ident,
-            final List<StatCapabTypes> statTypes, final Short nrOfSwitchTables) {
-        if (isNodeIdentValidForUse(ident)) {
-            if ( ! statNodeHolder.containsKey(ident)) {
-                synchronized (statNodeHolderLock) {
-                    final boolean startStatCollecting = statNodeHolder.size() == 0;
-                    if ( ! statNodeHolder.containsKey(ident)) {
-                        if (statNodeHolder.size() >= maxNodeForCollector) {
-                            return false;
-                        }
-                        final Map<InstanceIdentifier<Node>, StatNodeInfoHolder> statNode =
-                                new HashMap<>(statNodeHolder);
-                        final NodeRef nodeRef = new NodeRef(ident);
-                        final StatNodeInfoHolder nodeInfoHolder = new StatNodeInfoHolder(nodeRef,
-                                statTypes, nrOfSwitchTables);
-                        statNode.put(ident, nodeInfoHolder);
-                        statNodeHolder = Collections.unmodifiableMap(statNode);
-                    }
-                    if (startStatCollecting) {
-                        finishing = false;
-                        statNetCollectorServ.execute(this);
-                    }
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean disconnectedNodeUnregistration(final InstanceIdentifier<Node> ident) {
-        if (isNodeIdentValidForUse(ident)) {
-            if (statNodeHolder.containsKey(ident)) {
-                synchronized (statNodeHolderLock) {
-                    if (statNodeHolder.containsKey(ident)) {
-                        final Map<InstanceIdentifier<Node>, StatNodeInfoHolder> statNode =
-                                new HashMap<>(statNodeHolder);
-                        statNode.remove(ident);
-                        statNodeHolder = Collections.unmodifiableMap(statNode);
-                    }
-                    if (statNodeHolder.isEmpty()) {
-                        finishing = true;
-                        collectNextStatistics(actualTransactionId);
-                        statNetCollectorServ.shutdown();
-                    }
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public boolean registerAdditionalNodeFeature(final InstanceIdentifier<Node> ident,
-            final StatCapabTypes statCapab) {
-        if (isNodeIdentValidForUse(ident)) {
-            if ( ! statNodeHolder.containsKey(ident)) {
-                return false;
-            }
-            final StatNodeInfoHolder statNode = statNodeHolder.get(ident);
-            if ( ! statNode.getStatMarkers().contains(statCapab)) {
-                synchronized (statNodeHolderLock) {
-                    if ( ! statNode.getStatMarkers().contains(statCapab)) {
-                        final List<StatCapabTypes> statCapabForEdit = new ArrayList<>(statNode.getStatMarkers());
-                        statCapabForEdit.add(statCapab);
-                        final StatNodeInfoHolder nodeInfoHolder = new StatNodeInfoHolder(statNode.getNodeRef(),
-                                Collections.unmodifiableList(statCapabForEdit), statNode.getMaxTables());
-
-                        final Map<InstanceIdentifier<Node>, StatNodeInfoHolder> statNodes =
-                                new HashMap<>(statNodeHolder);
-                        statNodes.put(ident, nodeInfoHolder);
-                        statNodeHolder = Collections.unmodifiableMap(statNodes);
-                    }
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public void collectNextStatistics(final TransactionId xid) {
-        if (checkTransactionId(xid)) {
-            if (wakeMe) {
-                synchronized (statCollectorLock) {
-                    if (wakeMe) {
-                        LOG.trace("STAT-COLLECTOR is notified to conntinue");
-                        statCollectorLock.notify();
-                    }
-                }
-            }
-        }
-    }
-
-    @Override
-    public void run() {
-        try {
-            // sleep 5 second before collecting all statistics cycles is important
-            // for loading all Nodes to Operational/DS
-            Thread.sleep(5000);
-        }
-        catch (final InterruptedException e1) {
-            // NOOP
-        }
-        LOG.debug("StatCollector {} Start collecting!", name);
-         /* Neverending cyle - wait for finishing */
-         while ( ! finishing) {
-            boolean collecting = false;
-            final long startTime = System.currentTimeMillis();
-
-            if ( ! statNodeHolder.isEmpty()) {
-                collecting = true;
-                collectStatCrossNetwork();
-                collecting = false;
-            }
-
-            if ( ! collecting) {
-                final long statFinalTime = System.currentTimeMillis() - startTime;
-                LOG.debug("STAT-MANAGER {}: last all NET statistics collection cost {} ms", name, statFinalTime);
-                if (statFinalTime < minReqNetInterval) {
-                    LOG.trace("statCollector is about to make a collecting sleep");
-                    synchronized (statCollectorLock) {
-                        wakeMe = true;
-                        try {
-                            final long waitTime = minReqNetInterval - statFinalTime;
-                            statCollectorLock.wait(waitTime);
-                            LOG.trace("STAT-MANAGER : statCollector {} is waking up from a collecting sleep for {} ms", name, waitTime);
-                        } catch (final InterruptedException e) {
-                            LOG.warn("statCollector has been interrupted during collecting sleep", e);
-                        } finally {
-                            wakeMe = false;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    private void waitingForNotification() {
-        synchronized (statCollectorLock) {
-            wakeMe = true;
-            try {
-                statCollectorLock.wait(STAT_COLLECT_TIME_OUT);
-                LOG.trace("statCollector is waking up from a wait stat Response sleep");
-            } catch (final InterruptedException e) {
-                LOG.warn("statCollector has been interrupted waiting stat Response sleep", e);
-            } finally {
-                setActualTransactionId(null);
-                wakeMe = false;
-            }
-        }
-    }
-
-
-    private void collectStatCrossNetwork() {
-        for (final Entry<InstanceIdentifier<Node>, StatNodeInfoHolder> nodeEntity : statNodeHolder.entrySet()) {
-            final List<StatCapabTypes> listNeededStat = nodeEntity.getValue().getStatMarkers();
-            final NodeRef actualNodeRef = nodeEntity.getValue().getNodeRef();
-            final Short maxTables = nodeEntity.getValue().getMaxTables();
-            for (final StatCapabTypes statMarker : listNeededStat) {
-                if ( ! isProvidedFlowNodeActive(nodeEntity.getKey())) {
-                    break;
-                }
-                try {
-                    switch (statMarker) {
-                    case PORT_STATS:
-                        LOG.trace("STAT-MANAGER-collecting PORT-STATS for NodeRef {}", actualNodeRef);
-                        setActualTransactionId(manager.getRpcMsgManager().getAllPortsStat(actualNodeRef).get());
-                        waitingForNotification();
-                        break;
-                    case QUEUE_STATS:
-                        LOG.trace("STAT-MANAGER-collecting QUEUE-STATS for NodeRef {}", actualNodeRef);
-                        setActualTransactionId(manager.getRpcMsgManager().getAllQueueStat(actualNodeRef).get());
-                        waitingForNotification();
-                        break;
-                    case TABLE_STATS:
-                        LOG.trace("STAT-MANAGER-collecting TABLE-STATS for NodeRef {}", actualNodeRef);
-                        setActualTransactionId(manager.getRpcMsgManager().getAllTablesStat(actualNodeRef).get());
-                        waitingForNotification();
-                        break;
-                    case GROUP_STATS:
-                        LOG.trace("STAT-MANAGER-collecting GROUP-STATS for NodeRef {}", actualNodeRef);
-                        setActualTransactionId(manager.getRpcMsgManager().getAllGroupsConfStats(actualNodeRef).get());
-                        waitingForNotification();
-                        setActualTransactionId(manager.getRpcMsgManager().getAllGroupsStat(actualNodeRef).get());
-                        waitingForNotification();
-                        break;
-                    case METER_STATS:
-                        LOG.trace("STAT-MANAGER-collecting METER-STATS for NodeRef {}", actualNodeRef);
-                        setActualTransactionId(manager.getRpcMsgManager().getAllMeterConfigStat(actualNodeRef).get());
-                        waitingForNotification();
-                        setActualTransactionId(manager.getRpcMsgManager().getAllMetersStat(actualNodeRef).get());
-                        waitingForNotification();
-                        break;
-                    case FLOW_STATS:
-                        LOG.trace("STAT-MANAGER-collecting FLOW-STATS-ALL_FLOWS for NodeRef {}", actualNodeRef);
-                        setActualTransactionId(manager.getRpcMsgManager().getAllFlowsStat(actualNodeRef).get());
-                        waitingForNotification();
-                        LOG.trace("STAT-MANAGER-collecting FLOW-AGGREGATE-STATS for NodeRef {}", actualNodeRef);
-                        for (short i = 0; i < maxTables; i++) {
-                            final TableId tableId = new TableId(i);
-                            manager.getRpcMsgManager().getAggregateFlowStat(actualNodeRef, tableId);
-                        }
-                        break;
-                    default:
-                        /* Exception for programmers in implementation cycle */
-                        throw new IllegalStateException("Not implemented ASK for " + statMarker);
-                    }
-                } catch (InterruptedException | ExecutionException ex) {
-                    LOG.warn("Unexpected RPC exception by call RPC Future!", ex);
-                    continue;
-                }
-            }
-        }
-    }
-
-    private class StatNodeInfoHolder {
-        private final NodeRef nodeRef;
-        private final List<StatCapabTypes> statMarkers;
-        private final Short maxTables;
-
-        public StatNodeInfoHolder(final NodeRef nodeRef,
-                final List<StatCapabTypes> statMarkers, final Short maxTables) {
-            this.nodeRef = nodeRef;
-            this.maxTables = maxTables;
-            this.statMarkers = statMarkers;
-        }
-
-        public final NodeRef getNodeRef() {
-            return nodeRef;
-        }
-
-        public final List<StatCapabTypes> getStatMarkers() {
-            return statMarkers;
-        }
-
-        public final Short getMaxTables() {
-            return maxTables;
-        }
-    }
-
-    private boolean isNodeIdentValidForUse(final InstanceIdentifier<Node> ident) {
-        if (ident == null) {
-            LOG.warn("FlowCapableNode InstanceIdentifier {} can not be null!");
-            return false;
-        }
-        if (ident.isWildcarded()) {
-            LOG.warn("FlowCapableNode InstanceIdentifier {} can not be wildcarded!", ident);
-            return false;
-        }
-        return true;
-    }
-
-    private boolean checkTransactionId(final TransactionId xid) {
-        synchronized (transNotifyLock) {
-            return actualTransactionId != null && actualTransactionId.equals(xid);
-        }
-    }
-
-    private void setActualTransactionId(final TransactionId transactionId) {
-        synchronized (transNotifyLock) {
-            actualTransactionId = transactionId;
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRPCFailedException.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRPCFailedException.java
deleted file mode 100644 (file)
index 5ff4913..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.statistics.manager.impl;
-
-import org.opendaylight.yangtools.yang.common.RpcError;
-
-import java.util.Collection;
-
-public final class StatRPCFailedException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-    private final Collection<RpcError> errors;
-
-    public StatRPCFailedException(final String message, final Collection<RpcError> errors) {
-        super(message);
-        this.errors = errors;
-    }
-
-    @Override
-    public String toString() {
-        return "RPCFailedException [errors=" + errors + ", message=" + getMessage() + ']';
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRpcMsgManagerImpl.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatRpcMsgManagerImpl.java
deleted file mode 100644 (file)
index 20341bc..0000000
+++ /dev/null
@@ -1,536 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Future;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-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.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.JdkFutureAdapters;
-import com.google.common.util.concurrent.SettableFuture;
-
-
-/**
- * statistics-manager
- * org.opendaylight.controller.md.statistics.manager.impl
- *
- * StatRpcMsgManagerImpl
- * Class register and provide all RPC Statistics Device Services and implement pre-defined
- * wrapped methods for prepare easy access to RPC Statistics Device Services like getAllStatisticsFor...
- *
- * In next Class implement process for joining multipart messages.
- * Class internally use two WeakHashMap and GuavaCache for holding values for joining multipart msg.
- * One Weak map is used for holding all Multipart Messages and second is used for possible input
- * Config/DS light-weight DataObject (DataObject contains only necessary identification fields as
- * TableId, GroupId, MeterId or for flow Match, Priority, FlowCookie, TableId and FlowId ...
- *
- * @author avishnoi@in.ibm.com <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- */
-public class StatRpcMsgManagerImpl implements StatRpcMsgManager {
-
-    private final static Logger LOG = LoggerFactory.getLogger(StatRpcMsgManagerImpl.class);
-
-    private final Cache<String, TransactionCacheContainer<? super TransactionAware>> txCache;
-
-    private final int queueCapacity = 5000;
-
-    private final OpendaylightGroupStatisticsService groupStatsService;
-    private final OpendaylightMeterStatisticsService meterStatsService;
-    private final OpendaylightFlowStatisticsService flowStatsService;
-    private final OpendaylightPortStatisticsService portStatsService;
-    private final OpendaylightFlowTableStatisticsService flowTableStatsService;
-    private final OpendaylightQueueStatisticsService queueStatsService;
-
-    private BlockingQueue<RpcJobsQueue> statsRpcJobQueue;
-
-    private volatile boolean finishing = false;
-
-    public StatRpcMsgManagerImpl (final StatisticsManager manager,
-            final RpcConsumerRegistry rpcRegistry, final long maxNodeForCollector) {
-        Preconditions.checkArgument(manager != null, "StatisticManager can not be null!");
-        Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry can not be null !");
-        groupStatsService = Preconditions.checkNotNull(
-                rpcRegistry.getRpcService(OpendaylightGroupStatisticsService.class),
-                "OpendaylightGroupStatisticsService can not be null!");
-        meterStatsService = Preconditions.checkNotNull(
-                rpcRegistry.getRpcService(OpendaylightMeterStatisticsService.class),
-                "OpendaylightMeterStatisticsService can not be null!");
-        flowStatsService = Preconditions.checkNotNull(
-                rpcRegistry.getRpcService(OpendaylightFlowStatisticsService.class),
-                "OpendaylightFlowStatisticsService can not be null!");
-        portStatsService = Preconditions.checkNotNull(
-                rpcRegistry.getRpcService(OpendaylightPortStatisticsService.class),
-                "OpendaylightPortStatisticsService can not be null!");
-        flowTableStatsService = Preconditions.checkNotNull(
-                rpcRegistry.getRpcService(OpendaylightFlowTableStatisticsService.class),
-                "OpendaylightFlowTableStatisticsService can not be null!");
-        queueStatsService = Preconditions.checkNotNull(
-                rpcRegistry.getRpcService(OpendaylightQueueStatisticsService.class),
-                "OpendaylightQueueStatisticsService can not be null!");
-
-        statsRpcJobQueue = new LinkedBlockingQueue<>(queueCapacity);
-        /* nr. 7 is here nr. of possible statistic which are waiting for notification
-         *      - check it in StatPermCollectorImpl method collectStatCrossNetwork */
-        txCache = CacheBuilder.newBuilder().expireAfterWrite((maxNodeForCollector * 7), TimeUnit.SECONDS)
-                .maximumSize(10000).build();
-    }
-
-    @Override
-    public void close() {
-        finishing = true;
-        statsRpcJobQueue = null;
-    }
-
-    @Override
-    public void run() {
-         /* Neverending cyle - wait for finishing */
-        while ( ! finishing) {
-            try {
-                statsRpcJobQueue.take().call();
-            }
-            catch (final Exception e) {
-                LOG.warn("Stat Element RPC executor fail!", e);
-            }
-        }
-        // Drain all rpcCall, making sure any blocked threads are unblocked
-        while ( ! statsRpcJobQueue.isEmpty()) {
-            statsRpcJobQueue.poll();
-        }
-    }
-
-    private void addGetAllStatJob(final RpcJobsQueue getAllStatJob) {
-        final boolean success = statsRpcJobQueue.offer(getAllStatJob);
-        if ( ! success) {
-            LOG.warn("Put RPC request getAllStat fail! Queue is full.");
-        }
-    }
-
-    private void addStatJob(final RpcJobsQueue getStatJob) {
-        final boolean success = statsRpcJobQueue.offer(getStatJob);
-        if ( ! success) {
-            LOG.debug("Put RPC request for getStat fail! Queue is full.");
-        }
-    }
-
-    @Override
-    public <T extends TransactionAware, D extends DataObject> void registrationRpcFutureCallBack(
-            final Future<RpcResult<T>> future, final D inputObj, final NodeRef nodeRef,
-            final SettableFuture<TransactionId> resultTransId) {
-
-        Futures.addCallback(JdkFutureAdapters.listenInPoolThread(future),
-                new FutureCallback<RpcResult<? extends TransactionAware>>() {
-
-            @Override
-            public void onSuccess(final RpcResult<? extends TransactionAware> result) {
-                final TransactionId id = result.getResult().getTransactionId();
-                final NodeKey nodeKey = nodeRef.getValue().firstKeyOf(Node.class, NodeKey.class);
-                if (id == null) {
-                    String[] multipartRequestName = result.getResult().getClass().getSimpleName().split("(?=\\p{Upper})");
-                    LOG.warn("Node [{}] does not support statistics request type : {}",
-                            nodeKey.getId(),Joiner.on(" ").join(Arrays.copyOfRange(multipartRequestName, 2, multipartRequestName.length-2)));
-                } else {
-                    if (resultTransId != null) {
-                        resultTransId.set(id);
-                    }
-                    final String cacheKey = buildCacheKey(id, nodeKey.getId());
-                    final TransactionCacheContainer<? super TransactionAware> container =
-                            new TransactionCacheContainerImpl<>(id, inputObj, nodeKey.getId());
-                    txCache.put(cacheKey, container);
-                }
-            }
-
-            @Override
-            public void onFailure(final Throwable t) {
-                LOG.warn("Response Registration for Statistics RPC call fail!", t);
-            }
-
-        });
-    }
-
-    private String buildCacheKey(final TransactionId id, final NodeId nodeId) {
-        return String.valueOf(id.getValue()) + "-" + nodeId.getValue();
-    }
-
-    @Override
-    public Future<Optional<TransactionCacheContainer<?>>> getTransactionCacheContainer(
-            final TransactionId id, final NodeId nodeId) {
-        Preconditions.checkArgument(id != null, "TransactionId can not be null!");
-        Preconditions.checkArgument(nodeId != null, "NodeId can not be null!");
-
-        final String key = buildCacheKey(id, nodeId);
-        final SettableFuture<Optional<TransactionCacheContainer<?>>> result = SettableFuture.create();
-
-        final RpcJobsQueue getTransactionCacheContainer = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final Optional<TransactionCacheContainer<?>> resultContainer =
-                        Optional.<TransactionCacheContainer<?>> fromNullable(txCache.getIfPresent(key));
-                if (resultContainer.isPresent()) {
-                    txCache.invalidate(key);
-                }
-                result.set(resultContainer);
-                return null;
-            }
-        };
-        addStatJob(getTransactionCacheContainer);
-        return result;
-    }
-
-    @Override
-    public Future<Boolean> isExpectedStatistics(final TransactionId id, final NodeId nodeId) {
-        Preconditions.checkArgument(id != null, "TransactionId can not be null!");
-        Preconditions.checkArgument(nodeId != null, "NodeId can not be null!");
-
-        final String key = buildCacheKey(id, nodeId);
-        final SettableFuture<Boolean> checkStatId = SettableFuture.create();
-
-        final RpcJobsQueue isExpecedStatistics = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final Optional<TransactionCacheContainer<?>> result =
-                        Optional.<TransactionCacheContainer<?>> fromNullable(txCache.getIfPresent(key));
-                checkStatId.set(Boolean.valueOf(result.isPresent()));
-                return null;
-            }
-        };
-        addStatJob(isExpecedStatistics);
-        return checkStatId;
-    }
-
-    @Override
-    public void addNotification(final TransactionAware notification, final NodeId nodeId) {
-        Preconditions.checkArgument(notification != null, "TransactionAware can not be null!");
-        Preconditions.checkArgument(nodeId != null, "NodeId can not be null!");
-
-        final RpcJobsQueue addNotification = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final TransactionId txId = notification.getTransactionId();
-                final String key = buildCacheKey(txId, nodeId);
-                final TransactionCacheContainer<? super TransactionAware> container = (txCache.getIfPresent(key));
-                if (container != null) {
-                    container.addNotif(notification);
-                }
-                return null;
-            }
-        };
-        addStatJob(addNotification);
-    }
-
-    @Override
-    public Future<TransactionId> getAllGroupsStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue getAllGroupStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetAllGroupStatisticsInputBuilder builder =
-                        new GetAllGroupStatisticsInputBuilder();
-                builder.setNode(nodeRef);
-                registrationRpcFutureCallBack(groupStatsService
-                        .getAllGroupStatistics(builder.build()), null, nodeRef, result);
-                return null;
-            }
-        };
-        addGetAllStatJob(getAllGroupStat);
-        return result;
-    }
-
-    @Override
-    public Future<TransactionId> getAllMetersStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue getAllMeterStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetAllMeterStatisticsInputBuilder builder =
-                        new GetAllMeterStatisticsInputBuilder();
-                builder.setNode(nodeRef);
-                registrationRpcFutureCallBack(meterStatsService
-                        .getAllMeterStatistics(builder.build()), null, nodeRef, result);
-                return null;
-            }
-        };
-        addGetAllStatJob(getAllMeterStat);
-        return result;
-    }
-
-    @Override
-    public Future<TransactionId> getAllFlowsStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue getAllFlowStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetAllFlowsStatisticsFromAllFlowTablesInputBuilder builder =
-                        new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder();
-                builder.setNode(nodeRef);
-                registrationRpcFutureCallBack(flowStatsService
-                        .getAllFlowsStatisticsFromAllFlowTables(builder.build()), null, nodeRef, result);
-                return null;
-            }
-        };
-        addGetAllStatJob(getAllFlowStat);
-        return result;
-    }
-
-    @Override
-    public void getAggregateFlowStat(final NodeRef nodeRef, final TableId tableId) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        Preconditions.checkArgument(tableId != null, "TableId can not be null!");
-        final RpcJobsQueue getAggregateFlowStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder builder =
-                        new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder();
-                builder.setNode(nodeRef);
-                builder.setTableId(tableId);
-
-                final TableBuilder tbuilder = new TableBuilder();
-                tbuilder.setId(tableId.getValue());
-                tbuilder.setKey(new TableKey(tableId.getValue()));
-                registrationRpcFutureCallBack(flowStatsService
-                        .getAggregateFlowStatisticsFromFlowTableForAllFlows(builder.build()), tbuilder.build(), nodeRef, null);
-                return null;
-            }
-        };
-        addGetAllStatJob(getAggregateFlowStat);
-    }
-
-    @Override
-    public Future<TransactionId> getAllPortsStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue getAllPortsStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetAllNodeConnectorsStatisticsInputBuilder builder =
-                        new GetAllNodeConnectorsStatisticsInputBuilder();
-                builder.setNode(nodeRef);
-                final Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> rpc =
-                        portStatsService.getAllNodeConnectorsStatistics(builder.build());
-                registrationRpcFutureCallBack(rpc, null, nodeRef, result);
-                return null;
-            }
-        };
-        addGetAllStatJob(getAllPortsStat);
-        return result;
-    }
-
-    @Override
-    public Future<TransactionId> getAllTablesStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue getAllTableStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetFlowTablesStatisticsInputBuilder builder =
-                        new GetFlowTablesStatisticsInputBuilder();
-                builder.setNode(nodeRef);
-                registrationRpcFutureCallBack(flowTableStatsService
-                        .getFlowTablesStatistics(builder.build()), null, nodeRef, result);
-                return null;
-            }
-        };
-        addGetAllStatJob(getAllTableStat);
-        return result;
-    }
-
-    @Override
-    public Future<TransactionId>  getAllQueueStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue getAllQueueStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetAllQueuesStatisticsFromAllPortsInputBuilder builder =
-                        new GetAllQueuesStatisticsFromAllPortsInputBuilder();
-                builder.setNode(nodeRef);
-                registrationRpcFutureCallBack(queueStatsService
-                        .getAllQueuesStatisticsFromAllPorts(builder.build()), null, nodeRef, result);
-                return null;
-            }
-        };
-        addGetAllStatJob(getAllQueueStat);
-        return result;
-    }
-
-    @Override
-    public Future<TransactionId> getAllMeterConfigStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue qetAllMeterConfStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetAllMeterConfigStatisticsInputBuilder builder =
-                        new GetAllMeterConfigStatisticsInputBuilder();
-                builder.setNode(nodeRef);
-                registrationRpcFutureCallBack(meterStatsService
-                        .getAllMeterConfigStatistics(builder.build()), null, nodeRef, result);
-                return null;
-            }
-        };
-        addGetAllStatJob(qetAllMeterConfStat);
-        return result;
-    }
-
-    @Override
-    public void getGroupFeaturesStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final RpcJobsQueue getGroupFeaturesStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                /* RPC input */
-                final GetGroupFeaturesInputBuilder input = new GetGroupFeaturesInputBuilder();
-                input.setNode(nodeRef);
-                registrationRpcFutureCallBack(groupStatsService.getGroupFeatures(input.build()), null, nodeRef, null);
-                return null;
-            }
-        };
-        addStatJob(getGroupFeaturesStat);
-    }
-
-    @Override
-    public void getMeterFeaturesStat(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final RpcJobsQueue getMeterFeaturesStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                /* RPC input */
-                final GetMeterFeaturesInputBuilder input = new GetMeterFeaturesInputBuilder();
-                input.setNode(nodeRef);
-                registrationRpcFutureCallBack(meterStatsService.getMeterFeatures(input.build()), null, nodeRef, null);
-                return null;
-            }
-        };
-        addStatJob(getMeterFeaturesStat);
-    }
-
-    @Override
-    public Future<TransactionId> getAllGroupsConfStats(final NodeRef nodeRef) {
-        Preconditions.checkArgument(nodeRef != null, "NodeRef can not be null!");
-        final SettableFuture<TransactionId> result = SettableFuture.create();
-        final RpcJobsQueue getAllGropConfStat = new RpcJobsQueue() {
-
-            @Override
-            public Void call() throws Exception {
-                final GetGroupDescriptionInputBuilder builder =
-                        new GetGroupDescriptionInputBuilder();
-                builder.setNode(nodeRef);
-                registrationRpcFutureCallBack(groupStatsService
-                        .getGroupDescription(builder.build()), null, nodeRef, result);
-
-                return null;
-            }
-        };
-        addGetAllStatJob(getAllGropConfStat);
-        return result;
-    }
-
-    public class TransactionCacheContainerImpl<T extends TransactionAware> implements TransactionCacheContainer<T> {
-
-        private final TransactionId id;
-        private final NodeId nId;
-        private final List<T> notifications;
-        private final Optional<? extends DataObject> confInput;
-
-        public <D extends DataObject> TransactionCacheContainerImpl (final TransactionId id, final D input, final NodeId nodeId) {
-            this.id = Preconditions.checkNotNull(id, "TransactionId can not be null!");
-            notifications = new CopyOnWriteArrayList<T>();
-            confInput = Optional.fromNullable(input);
-            nId = nodeId;
-        }
-
-        @Override
-        public void addNotif(final T notif) {
-            notifications.add(notif);
-        }
-
-        @Override
-        public TransactionId getId() {
-            return id;
-        }
-
-        @Override
-        public NodeId getNodeId() {
-            return nId;
-        }
-
-        @Override
-        public List<T> getNotifications() {
-            return notifications;
-        }
-
-        @Override
-        public Optional<? extends DataObject> getConfInput() {
-            return confInput;
-        }
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatisticsManagerConfig.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatisticsManagerConfig.java
deleted file mode 100644 (file)
index 0f56ea9..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.opendaylight.controller.md.statistics.manager.impl;
-
-public class StatisticsManagerConfig {
-    private final int maxNodesForCollector;
-    private final int minRequestNetMonitorInterval;
-
-    private StatisticsManagerConfig(StatisticsManagerConfigBuilder builder) {
-        this.maxNodesForCollector = builder.getMaxNodesForCollector();
-        this.minRequestNetMonitorInterval = builder.getMinRequestNetMonitorInterval();
-    }
-
-    public int getMaxNodesForCollector() {
-        return maxNodesForCollector;
-    }
-
-    public int getMinRequestNetMonitorInterval() {
-        return minRequestNetMonitorInterval;
-    }
-
-    public static StatisticsManagerConfigBuilder builder() {
-        return new StatisticsManagerConfigBuilder();
-    }
-
-    public static class StatisticsManagerConfigBuilder {
-        private int maxNodesForCollector;
-        private int minRequestNetMonitorInterval;
-
-        public int getMaxNodesForCollector() {
-            return maxNodesForCollector;
-        }
-
-        public void setMaxNodesForCollector(int maxNodesForCollector) {
-            this.maxNodesForCollector = maxNodesForCollector;
-        }
-
-        public int getMinRequestNetMonitorInterval() {
-            return minRequestNetMonitorInterval;
-        }
-
-        public void setMinRequestNetMonitorInterval(int minRequestNetMonitorInterval) {
-            this.minRequestNetMonitorInterval = minRequestNetMonitorInterval;
-        }
-
-        public StatisticsManagerConfig build() {
-            return new StatisticsManagerConfig(this);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatisticsManagerImpl.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/StatisticsManagerImpl.java
deleted file mode 100644 (file)
index 437c92f..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-/**
- * 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.statistics.manager.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.LinkedBlockingDeque;
-import java.util.concurrent.ThreadFactory;
-
-import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
-import org.opendaylight.controller.md.statistics.manager.StatListeningCommiter;
-import org.opendaylight.controller.md.statistics.manager.StatNodeRegistration;
-import org.opendaylight.controller.md.statistics.manager.StatNotifyCommiter;
-import org.opendaylight.controller.md.statistics.manager.StatPermCollector;
-import org.opendaylight.controller.md.statistics.manager.StatPermCollector.StatCapabTypes;
-import org.opendaylight.controller.md.statistics.manager.StatRpcMsgManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager.StatDataStoreOperation.StatsManagerOperationType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsListener;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-
-/**
-* statistics-manager
-* org.opendaylight.controller.md.statistics.manager.impl
-*
-* StatisticsManagerImpl
-* It represent a central point for whole module. Implementation
-* {@link StatisticsManager} registers all Operation/DS {@link StatNotifyCommiter} and
-* Config/DS {@StatListeningCommiter}, as well as {@link StatPermCollector}
-* for statistic collecting and {@link StatRpcMsgManager} as Device RPCs provider.
-* In next, StatisticsManager provides all DS contact Transaction services.
-*
-* @author avishnoi@in.ibm.com <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
-*
-*/
-public class StatisticsManagerImpl implements StatisticsManager, Runnable {
-
-   private final static Logger LOG = LoggerFactory.getLogger(StatisticsManagerImpl.class);
-
-   private static final int QUEUE_DEPTH = 5000;
-   private static final int MAX_BATCH = 100;
-
-   private final BlockingQueue<StatDataStoreOperation> dataStoreOperQueue = new LinkedBlockingDeque<>(QUEUE_DEPTH);
-
-   private final DataBroker dataBroker;
-   private final ExecutorService statRpcMsgManagerExecutor;
-   private final ExecutorService statDataStoreOperationServ;
-   private StatRpcMsgManager rpcMsgManager;
-   private List<StatPermCollector> statCollectors;
-   private final Object statCollectorLock = new Object();
-   private BindingTransactionChain txChain;
-   private volatile boolean finishing = false;
-
-   private StatNodeRegistration nodeRegistrator;
-   private StatListeningCommiter<Flow, OpendaylightFlowStatisticsListener> flowListeningCommiter;
-   private StatListeningCommiter<Meter, OpendaylightMeterStatisticsListener> meterListeningCommiter;
-   private StatListeningCommiter<Group, OpendaylightGroupStatisticsListener> groupListeningCommiter;
-   private StatListeningCommiter<Queue, OpendaylightQueueStatisticsListener> queueNotifyCommiter;
-   private StatNotifyCommiter<OpendaylightFlowTableStatisticsListener> tableNotifCommiter;
-   private StatNotifyCommiter<OpendaylightPortStatisticsListener> portNotifyCommiter;
-
-   private final StatisticsManagerConfig statManagerConfig;
-
-   public StatisticsManagerImpl (final DataBroker dataBroker, final StatisticsManagerConfig statManagerconfig) {
-       statManagerConfig = Preconditions.checkNotNull(statManagerconfig);
-       this.dataBroker = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!");
-       ThreadFactory threadFact;
-       threadFact = new ThreadFactoryBuilder().setNameFormat("odl-stat-rpc-oper-thread-%d").build();
-       statRpcMsgManagerExecutor = Executors.newSingleThreadExecutor(threadFact);
-       threadFact = new ThreadFactoryBuilder().setNameFormat("odl-stat-ds-oper-thread-%d").build();
-       statDataStoreOperationServ = Executors.newSingleThreadExecutor(threadFact);
-       txChain =  dataBroker.createTransactionChain(this);
-   }
-
-   @Override
-   public void start(final NotificationProviderService notifService,
-           final RpcConsumerRegistry rpcRegistry) {
-       Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry can not be null !");
-       rpcMsgManager = new StatRpcMsgManagerImpl(this, rpcRegistry, statManagerConfig.getMaxNodesForCollector());
-       statCollectors = Collections.emptyList();
-       nodeRegistrator = new StatNodeRegistrationImpl(this, dataBroker, notifService);
-       flowListeningCommiter = new StatListenCommitFlow(this, dataBroker, notifService);
-       meterListeningCommiter = new StatListenCommitMeter(this, dataBroker, notifService);
-       groupListeningCommiter = new StatListenCommitGroup(this, dataBroker, notifService);
-       tableNotifCommiter = new StatNotifyCommitTable(this, notifService);
-       portNotifyCommiter = new StatNotifyCommitPort(this, notifService);
-       queueNotifyCommiter = new StatListenCommitQueue(this, dataBroker, notifService);
-
-       statRpcMsgManagerExecutor.execute(rpcMsgManager);
-       statDataStoreOperationServ.execute(this);
-       LOG.info("Statistics Manager started successfully!");
-   }
-
-   @Override
-   public void close() throws Exception {
-       LOG.info("StatisticsManager close called");
-       finishing = true;
-       if (nodeRegistrator != null) {
-           nodeRegistrator.close();
-           nodeRegistrator = null;
-       }
-       if (flowListeningCommiter != null) {
-           flowListeningCommiter.close();
-           flowListeningCommiter = null;
-       }
-       if (meterListeningCommiter != null) {
-           meterListeningCommiter.close();
-           meterListeningCommiter = null;
-       }
-       if (groupListeningCommiter != null) {
-           groupListeningCommiter.close();
-           groupListeningCommiter = null;
-       }
-       if (tableNotifCommiter != null) {
-           tableNotifCommiter.close();
-           tableNotifCommiter = null;
-       }
-       if (portNotifyCommiter != null) {
-           portNotifyCommiter.close();
-           portNotifyCommiter = null;
-       }
-       if (queueNotifyCommiter != null) {
-           queueNotifyCommiter.close();
-           queueNotifyCommiter = null;
-       }
-       if (statCollectors != null) {
-           for (StatPermCollector collector : statCollectors) {
-               collector.close();
-               collector = null;
-           }
-           statCollectors = null;
-       }
-       if (rpcMsgManager != null) {
-           rpcMsgManager.close();
-           rpcMsgManager = null;
-       }
-       statRpcMsgManagerExecutor.shutdown();
-       statDataStoreOperationServ.shutdown();
-       if (txChain != null) {
-           txChain.close();
-           txChain = null;
-       }
-   }
-
-   @Override
-   public void enqueue(final StatDataStoreOperation op) {
-       // we don't need to block anything - next statistics come soon
-       final boolean success = dataStoreOperQueue.offer(op);
-       if ( ! success) {
-           LOG.debug("Stat DS/Operational submiter Queue is full!");
-       }
-   }
-
-   @Override
-   public void run() {
-       /* Neverending cyle - wait for finishing */
-       while ( ! finishing) {
-           try {
-               StatDataStoreOperation op = dataStoreOperQueue.take();
-               final ReadWriteTransaction tx = txChain.newReadWriteTransaction();
-               LOG.trace("New operations available, starting transaction {}", tx.getIdentifier());
-
-               int ops = 0;
-               do {
-                   op.applyOperation(tx);
-
-                   ops++;
-                   if (ops < MAX_BATCH) {
-                       op = dataStoreOperQueue.poll();
-                   } else {
-                       op = null;
-                   }
-               } while (op != null);
-
-               LOG.trace("Processed {} operations, submitting transaction {}", ops, tx.getIdentifier());
-
-                   tx.submit().checkedGet();
-           } catch (final InterruptedException e) {
-               LOG.warn("Stat Manager DS Operation thread interupted!", e);
-               finishing = true;
-           } catch (final Exception e) {
-               LOG.warn("Unhandled exception during processing statistics. Restarting transaction chain.", e);
-               txChain.close();
-               txChain = dataBroker.createTransactionChain(StatisticsManagerImpl.this);
-               cleanDataStoreOperQueue();
-           }
-       }
-       // Drain all events, making sure any blocked threads are unblocked
-       cleanDataStoreOperQueue();
-   }
-
-   private synchronized void cleanDataStoreOperQueue() {
-       // Drain all events, making sure any blocked threads are unblocked
-       while (! dataStoreOperQueue.isEmpty()) {
-           StatDataStoreOperation op = dataStoreOperQueue.poll();
-
-           // Execute the node removal clean up operation if queued in the
-           // operational queue.
-           if (op.getType() == StatsManagerOperationType.NODE_REMOVAL) {
-               try {
-                   LOG.debug("Node {} disconnected. Cleaning internal data.",op.getNodeId());
-                   op.applyOperation(null);
-               } catch (final Exception ex) {
-                   LOG.warn("Unhandled exception while cleaning up internal data of node [{}]",op.getNodeId());
-               }
-           }
-       }
-   }
-
-   @Override
-   public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction,
-           final Throwable cause) {
-       LOG.warn("Failed to export Flow Capable Statistics, Transaction {} failed.",transaction.getIdentifier(),cause);
-   }
-
-   @Override
-   public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
-       // NOOP
-   }
-
-   @Override
-   public boolean isProvidedFlowNodeActive(final InstanceIdentifier<Node> nodeIdent) {
-       for (final StatPermCollector collector : statCollectors) {
-           if (collector.isProvidedFlowNodeActive(nodeIdent)) {
-               return true;
-           }
-       }
-       return false;
-   }
-
-   @Override
-   public void collectNextStatistics(final InstanceIdentifier<Node> nodeIdent, final TransactionId xid) {
-       for (final StatPermCollector collector : statCollectors) {
-           if (collector.isProvidedFlowNodeActive(nodeIdent)) {
-               collector.collectNextStatistics(xid);
-           }
-       }
-   }
-
-   @Override
-   public void connectedNodeRegistration(final InstanceIdentifier<Node> nodeIdent,
-           final List<StatCapabTypes> statTypes, final Short nrOfSwitchTables) {
-       for (final StatPermCollector collector : statCollectors) {
-           if (collector.connectedNodeRegistration(nodeIdent, statTypes, nrOfSwitchTables)) {
-               return;
-           }
-       }
-       synchronized (statCollectorLock) {
-           for (final StatPermCollector collector : statCollectors) {
-               if (collector.connectedNodeRegistration(nodeIdent, statTypes, nrOfSwitchTables)) {
-                   return;
-               }
-           }
-           final StatPermCollectorImpl newCollector = new StatPermCollectorImpl(this,
-                   statManagerConfig.getMinRequestNetMonitorInterval(), statCollectors.size() + 1,
-                   statManagerConfig.getMaxNodesForCollector());
-           final List<StatPermCollector> statCollectorsNew = new ArrayList<>(statCollectors);
-           newCollector.connectedNodeRegistration(nodeIdent, statTypes, nrOfSwitchTables);
-           statCollectorsNew.add(newCollector);
-           statCollectors = Collections.unmodifiableList(statCollectorsNew);
-       }
-   }
-
-   @Override
-   public void disconnectedNodeUnregistration(final InstanceIdentifier<Node> nodeIdent) {
-       flowListeningCommiter.cleanForDisconnect(nodeIdent);
-
-       for (final StatPermCollector collector : statCollectors) {
-           if (collector.disconnectedNodeUnregistration(nodeIdent)) {
-               if ( ! collector.hasActiveNodes()) {
-                   synchronized (statCollectorLock) {
-                       if (collector.hasActiveNodes()) {
-                           return;
-                       }
-                       final List<StatPermCollector> newStatColl =
-                               new ArrayList<>(statCollectors);
-                       newStatColl.remove(collector);
-                       statCollectors = Collections.unmodifiableList(newStatColl);
-                   }
-               }
-               return;
-           }
-       }
-       LOG.debug("Node {} has not been removed.", nodeIdent);
-   }
-
-   @Override
-   public void registerAdditionalNodeFeature(final InstanceIdentifier<Node> nodeIdent,
-           final StatCapabTypes statCapab) {
-       for (final StatPermCollector collector : statCollectors) {
-           if (collector.registerAdditionalNodeFeature(nodeIdent, statCapab)) {
-               return;
-           }
-       }
-       LOG.debug("Node {} has not been extended for feature {}!", nodeIdent, statCapab);
-   }
-
-   /* Getter internal Statistic Manager Job Classes */
-   @Override
-   public StatRpcMsgManager getRpcMsgManager() {
-       return rpcMsgManager;
-   }
-
-   @Override
-   public StatNodeRegistration getNodeRegistrator() {
-       return nodeRegistrator;
-   }
-
-   @Override
-   public StatListeningCommiter<Flow, OpendaylightFlowStatisticsListener> getFlowListenComit() {
-       return flowListeningCommiter;
-   }
-
-   @Override
-   public StatListeningCommiter<Meter, OpendaylightMeterStatisticsListener> getMeterListenCommit() {
-       return meterListeningCommiter;
-   }
-
-   @Override
-   public StatListeningCommiter<Group, OpendaylightGroupStatisticsListener> getGroupListenCommit() {
-       return groupListeningCommiter;
-   }
-
-   @Override
-   public StatListeningCommiter<Queue, OpendaylightQueueStatisticsListener> getQueueNotifyCommit() {
-       return queueNotifyCommiter;
-   }
-
-
-   @Override
-   public StatNotifyCommiter<OpendaylightFlowTableStatisticsListener> getTableNotifCommit() {
-       return tableNotifCommiter;
-   }
-
-   @Override
-   public StatNotifyCommiter<OpendaylightPortStatisticsListener> getPortNotifyCommit() {
-       return portNotifyCommiter;
-   }
-
-    @Override
-    public StatisticsManagerConfig getConfiguration() {
-        return statManagerConfig;
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/helper/FlowComparator.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/helper/FlowComparator.java
deleted file mode 100644 (file)
index ded3197..0000000
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.statistics.manager.impl.helper;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.net.InetAddresses;
-import java.net.Inet4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.MacAddressFilter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class for comparing flows.
- */
-public final class FlowComparator {
-    private final static Logger LOG = LoggerFactory.getLogger(FlowComparator.class);
-
-    private FlowComparator() {
-        throw new UnsupportedOperationException("Utilities class should not be instantiated");
-    }
-
-    public static boolean flowEquals(final Flow statsFlow, final Flow storedFlow) {
-        if (statsFlow == null || storedFlow == null) {
-            return false;
-        }
-        if (statsFlow.getContainerName()== null) {
-            if (storedFlow.getContainerName()!= null) {
-                return false;
-            }
-        } else if(!statsFlow.getContainerName().equals(storedFlow.getContainerName())) {
-            return false;
-        }
-        if (storedFlow.getPriority() == null) {
-            if (statsFlow.getPriority() != null && statsFlow.getPriority()!= 0x8000) {
-                return false;
-            }
-        } else if(!statsFlow.getPriority().equals(storedFlow.getPriority())) {
-            return false;
-        }
-        if (statsFlow.getMatch()== null) {
-            if (storedFlow.getMatch() != null) {
-                return false;
-            }
-        } else if(!matchEquals(statsFlow.getMatch(), storedFlow.getMatch())) {
-            return false;
-        }
-        if (statsFlow.getTableId() == null) {
-            if (storedFlow.getTableId() != null) {
-                return false;
-            }
-        } else if(!statsFlow.getTableId().equals(storedFlow.getTableId())) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Explicit equals method to compare the 'match' for flows stored in the data-stores and flow fetched from the switch.
-     * Flow installation process has three steps
-     * 1) Store flow in config data store
-     * 2) and send it to plugin for installation
-     * 3) Flow gets installed in switch
-     *
-     * The flow user wants to install and what finally gets installed in switch can be slightly different.
-     * E.g, If user installs flow with src/dst ip=10.0.0.1/24, when it get installed in the switch
-     * src/dst ip will be changes to 10.0.0.0/24 because of netmask of 24. When statistics manager fetch
-     * stats it gets 10.0.0.0/24 rather then 10.0.0.1/24. Custom match takes care of by using masked ip
-     * while comparing two ip addresses.
-     *
-     * Sometimes when user don't provide few values that is required by flow installation request, like
-     * priority,hard timeout, idle timeout, cookies etc, plugin usages default values before sending
-     * request to the switch. So when statistics manager gets flow statistics, it gets the default value.
-     * But the flow stored in config data store don't have those defaults value. I included those checks
-     * in the customer flow/match equal function.
-     *
-     *
-     * @param statsFlow
-     * @param storedFlow
-     * @return
-     */
-    public static boolean matchEquals(final Match statsFlow, final Match storedFlow) {
-        if (statsFlow == storedFlow) {
-            return true;
-        }
-        if (storedFlow == null && statsFlow != null) {
-            return false;
-        }
-        if (statsFlow == null && storedFlow != null) {
-            return false;
-        }
-        if (storedFlow.getEthernetMatch() == null) {
-            if (statsFlow.getEthernetMatch() != null) {
-                return false;
-            }
-        } else if(!ethernetMatchEquals(statsFlow.getEthernetMatch(),storedFlow.getEthernetMatch())) {
-            return false;
-        }
-        if (storedFlow.getIcmpv4Match()== null) {
-            if (statsFlow.getIcmpv4Match() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getIcmpv4Match().equals(statsFlow.getIcmpv4Match())) {
-            return false;
-        }
-        if (storedFlow.getIcmpv6Match() == null) {
-            if (statsFlow.getIcmpv6Match() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getIcmpv6Match().equals(statsFlow.getIcmpv6Match())) {
-            return false;
-        }
-        if (storedFlow.getInPhyPort() == null) {
-            if (statsFlow.getInPhyPort() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getInPhyPort().equals(statsFlow.getInPhyPort())) {
-            return false;
-        }
-        if (storedFlow.getInPort()== null) {
-            if (statsFlow.getInPort() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getInPort().equals(statsFlow.getInPort())) {
-            return false;
-        }
-        if (storedFlow.getIpMatch()== null) {
-            if (statsFlow.getIpMatch() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getIpMatch().equals(statsFlow.getIpMatch())) {
-            return false;
-        }
-        if (storedFlow.getLayer3Match()== null) {
-            if (statsFlow.getLayer3Match() != null) {
-                    return false;
-            }
-        } else if(!layer3MatchEquals(statsFlow.getLayer3Match(),storedFlow.getLayer3Match())) {
-            return false;
-        }
-        if (storedFlow.getLayer4Match()== null) {
-            if (statsFlow.getLayer4Match() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getLayer4Match().equals(statsFlow.getLayer4Match())) {
-            return false;
-        }
-        if (storedFlow.getMetadata() == null) {
-            if (statsFlow.getMetadata() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getMetadata().equals(statsFlow.getMetadata())) {
-            return false;
-        }
-        if (storedFlow.getProtocolMatchFields() == null) {
-            if (statsFlow.getProtocolMatchFields() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getProtocolMatchFields().equals(statsFlow.getProtocolMatchFields())) {
-            return false;
-        }
-        if (storedFlow.getTunnel()== null) {
-            if (statsFlow.getTunnel() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getTunnel().equals(statsFlow.getTunnel())) {
-            return false;
-        }
-        if (storedFlow.getVlanMatch()== null) {
-            if (statsFlow.getVlanMatch() != null) {
-                return false;
-            }
-        } else if(!storedFlow.getVlanMatch().equals(statsFlow.getVlanMatch())) {
-            return false;
-        }
-        return true;
-    }
-
-    /*
-     * Custom EthernetMatch is required because mac address string provided by user in EthernetMatch can be in
-     * any case (upper or lower or mix). Ethernet Match which controller receives from switch is always
-     * an upper case string. Default EthernetMatch equals doesn't use equalsIgnoreCase() and hence it fails.
-     * E.g User provided mac address string in flow match is aa:bb:cc:dd:ee:ff and when controller fetch
-     * statistic data, openflow driver library returns AA:BB:CC:DD:EE:FF and default eqauls fails here.
-     */
-    @VisibleForTesting
-    static boolean ethernetMatchEquals(final EthernetMatch statsEthernetMatch, final EthernetMatch storedEthernetMatch){
-        boolean verdict = true;
-        final Boolean checkNullValues = checkNullValues(statsEthernetMatch, storedEthernetMatch);
-        if (checkNullValues != null) {
-            verdict = checkNullValues;
-        } else {
-            if(verdict){
-                verdict = ethernetMatchFieldsEquals(statsEthernetMatch.getEthernetSource(),storedEthernetMatch.getEthernetSource());
-            }
-            if(verdict){
-                verdict = ethernetMatchFieldsEquals(statsEthernetMatch.getEthernetDestination(),storedEthernetMatch.getEthernetDestination());
-            }
-            if(verdict){
-                if(statsEthernetMatch.getEthernetType() == null){
-                    if(storedEthernetMatch.getEthernetType() != null){
-                        verdict = false;
-                    }
-                }else{
-                    verdict = statsEthernetMatch.getEthernetType().equals(storedEthernetMatch.getEthernetType());
-                }
-            }
-        }
-        return verdict;
-    }
-
-    private static boolean ethernetMatchFieldsEquals(final MacAddressFilter statsEthernetMatchFields,
-                                                        final MacAddressFilter storedEthernetMatchFields){
-        boolean verdict = true;
-        final Boolean checkNullValues = checkNullValues(statsEthernetMatchFields, storedEthernetMatchFields);
-        if (checkNullValues != null) {
-            verdict = checkNullValues;
-        } else {
-            if(verdict){
-                verdict = macAddressEquals(statsEthernetMatchFields.getAddress(),storedEthernetMatchFields.getAddress());
-            }
-            if(verdict){
-                verdict = macAddressEquals(statsEthernetMatchFields.getMask(),storedEthernetMatchFields.getMask());
-            }
-        }
-        return verdict;
-    }
-
-    private static boolean macAddressEquals(final MacAddress statsMacAddress, final MacAddress storedMacAddress){
-        boolean verdict = true;
-        final Boolean checkNullValues = checkNullValues(statsMacAddress, storedMacAddress);
-        if (checkNullValues != null) {
-            verdict = checkNullValues;
-        } else {
-            verdict = statsMacAddress.getValue().equalsIgnoreCase(storedMacAddress.getValue());
-        }
-        return verdict;
-    }
-
-    @VisibleForTesting
-    static boolean layer3MatchEquals(final Layer3Match statsLayer3Match, final Layer3Match storedLayer3Match){
-        boolean verdict = true;
-        if(statsLayer3Match instanceof Ipv4Match && storedLayer3Match instanceof Ipv4Match){
-            final Ipv4Match statsIpv4Match = (Ipv4Match)statsLayer3Match;
-            final Ipv4Match storedIpv4Match = (Ipv4Match)storedLayer3Match;
-
-            if (verdict) {
-                verdict = compareNullSafe(
-                        storedIpv4Match.getIpv4Destination(), statsIpv4Match.getIpv4Destination());
-            }
-            if (verdict) {
-                verdict = compareNullSafe(
-                        statsIpv4Match.getIpv4Source(), storedIpv4Match.getIpv4Source());
-            }
-        } else {
-            final Boolean nullCheckOut = checkNullValues(storedLayer3Match, statsLayer3Match);
-            if (nullCheckOut != null) {
-                verdict = nullCheckOut;
-            } else {
-                verdict = storedLayer3Match.equals(statsLayer3Match);
-            }
-        }
-
-        return verdict;
-    }
-
-    private static boolean compareNullSafe(final Ipv4Prefix statsIpv4, final Ipv4Prefix storedIpv4) {
-        boolean verdict = true;
-        final Boolean checkDestNullValuesOut = checkNullValues(storedIpv4, statsIpv4);
-        if (checkDestNullValuesOut != null) {
-            verdict = checkDestNullValuesOut;
-        } else if(!IpAddressEquals(statsIpv4, storedIpv4)){
-            verdict = false;
-        }
-
-        return verdict;
-    }
-
-    private static Boolean checkNullValues(final Object v1, final Object v2) {
-        Boolean verdict = null;
-        if (v1 == null && v2 != null) {
-            verdict = Boolean.FALSE;
-        } else if (v1 != null && v2 == null) {
-            verdict = Boolean.FALSE;
-        } else if (v1 == null && v2 == null) {
-            verdict = Boolean.TRUE;
-        }
-
-        return verdict;
-    }
-
-    /**
-     * TODO: why don't we use the default Ipv4Prefix.equals()?
-     *
-     * @param statsIpAddress
-     * @param storedIpAddress
-     * @return true if IPv4prefixes equals
-     */
-    private static boolean IpAddressEquals(final Ipv4Prefix statsIpAddress, final Ipv4Prefix storedIpAddress) {
-        final IntegerIpAddress statsIpAddressInt = StrIpToIntIp(statsIpAddress.getValue());
-        final IntegerIpAddress storedIpAddressInt = StrIpToIntIp(storedIpAddress.getValue());
-
-        if(IpAndMaskBasedMatch(statsIpAddressInt,storedIpAddressInt)){
-            return true;
-        }
-        if(IpBasedMatch(statsIpAddressInt,storedIpAddressInt)){
-            return true;
-        }
-        return false;
-    }
-
-    private static boolean IpAndMaskBasedMatch(final IntegerIpAddress statsIpAddressInt,final IntegerIpAddress storedIpAddressInt){
-        return ((statsIpAddressInt.getIp() & statsIpAddressInt.getMask()) ==  (storedIpAddressInt.getIp() & storedIpAddressInt.getMask()));
-    }
-
-    private static boolean IpBasedMatch(final IntegerIpAddress statsIpAddressInt,final IntegerIpAddress storedIpAddressInt){
-        return (statsIpAddressInt.getIp() == storedIpAddressInt.getIp());
-    }
-
-    /**
-     * Method return integer version of ip address. Converted int will be mask if
-     * mask specified
-     */
-    private static IntegerIpAddress StrIpToIntIp(final String ipAddresss){
-
-        final String[] parts = ipAddresss.split("/");
-        final String ip = parts[0];
-        int prefix;
-
-        if (parts.length < 2) {
-            prefix = 32;
-        } else {
-            prefix = Integer.parseInt(parts[1]);
-        }
-
-        IntegerIpAddress integerIpAddress = null;
-
-            final Inet4Address addr = ((Inet4Address) InetAddresses.forString(ip));
-            final byte[] addrBytes = addr.getAddress();
-            final int ipInt = ((addrBytes[0] & 0xFF) << 24) |
-                    ((addrBytes[1] & 0xFF) << 16) |
-                    ((addrBytes[2] & 0xFF) << 8)  |
-                    ((addrBytes[3] & 0xFF) << 0);
-
-            // FIXME: Is this valid?
-            final int mask = 0xffffffff << 32 - prefix;
-
-            integerIpAddress = new IntegerIpAddress(ipInt, mask);
-
-
-        return integerIpAddress;
-    }
-
-    private static class IntegerIpAddress{
-        int ip;
-        int mask;
-        public IntegerIpAddress(final int ip, final int mask) {
-            this.ip = ip;
-            this.mask = mask;
-        }
-        public int getIp() {
-            return ip;
-        }
-        public int getMask() {
-            return mask;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/main/yang/statistics-manager.yang b/opendaylight/md-sal/statistics-manager/src/main/yang/statistics-manager.yang
deleted file mode 100644 (file)
index 5f35f70..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-module statistics-manager {
-
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:statistics-manager";
-    prefix "statistics-manager";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
-
-    description
-        "This module contains the base YANG definitions for
-        statitics-manager implementation.";
-
-    revision "2014-09-25" {
-        description
-            "Initial revision.";
-    }
-
-    identity statistics-manager {
-            base config:module-type;
-            config:java-name-prefix StatisticsManager;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case statistics-manager {
-            when "/config:modules/config:module/config:type = 'statistics-manager'";
-
-            container rpc-registry {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-rpc-registry;
-                    }
-                }
-            }
-
-            container notification-service {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-notification-service;
-                    }
-                }
-            }
-
-            container data-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity mdsal:binding-async-data-broker;
-                    }
-                }
-            }
-
-            container statistics-manager-settings {
-                leaf min-request-net-monitor-interval {
-                    type int32;
-                }
-                leaf max-nodes-for-collector {
-                    type int32;
-                }
-            }
-        }
-    }
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/org/opendaylight/controller/md/statistics/manager/impl/helper/StatisticsUpdateCommiterTest.java b/opendaylight/md-sal/statistics-manager/src/test/java/org/opendaylight/controller/md/statistics/manager/impl/helper/StatisticsUpdateCommiterTest.java
deleted file mode 100644 (file)
index 9361e28..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/**
- * 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.statistics.manager.impl.helper;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- */
-public class StatisticsUpdateCommiterTest {
-
-    private static final Logger LOG = LoggerFactory
-            .getLogger(StatisticsUpdateCommiterTest.class);
-
-    /**
-     * Test method for {@link org.opendaylight.controller.md.statistics.manager.StatisticsListener#layer3MatchEquals(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match, org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match)}.
-     */
-    @Test
-    public void testLayer3MatchEquals() {
-        final String[][][] matchSeeds = new String[][][] {
-                {{"10.1.2.0/24", "10.1.2.0/24"}, {"10.1.2.0/24", "10.1.2.0/24"}},
-                {{"10.1.2.0/24", "10.1.2.0/24"}, {"10.1.2.0/24", "10.1.1.0/24"}},
-                {{"10.1.1.0/24", "10.1.2.0/24"}, {"10.1.2.0/24", "10.1.2.0/24"}},
-                {{"10.1.1.0/24", "10.1.1.0/24"}, {"10.1.2.0/24", "10.1.2.0/24"}},
-
-                {{"10.1.1.0/24", null}, {"10.1.1.0/24", "10.1.2.0/24"}},
-                {{"10.1.1.0/24", null}, {"10.1.2.0/24", "10.1.2.0/24"}},
-                {{"10.1.1.0/24", null}, {"10.1.2.0/24", null}},
-                {{"10.1.1.0/24", null}, {"10.1.1.0/24", null}},
-
-                {{null, "10.1.1.0/24"}, {"10.1.2.0/24", "10.1.1.0/24"}},
-                {{null, "10.1.1.0/24"}, {"10.1.2.0/24", "10.1.2.0/24"}},
-                {{null, "10.1.1.0/24"}, {null, "10.1.2.0/24"}},
-                {{null, "10.1.1.0/24"}, {null, "10.1.1.0/24"}},
-
-                {{null, null}, {null, "10.1.1.0/24"}},
-                {{null, null}, {null, null}},
-        };
-
-        final boolean[] matches = new boolean[] {
-                true,
-                false,
-                false,
-                false,
-
-                false,
-                false,
-                false,
-                true,
-
-                false,
-                false,
-                false,
-                true,
-
-                false,
-                true
-        };
-
-        for (int i = 0; i < matches.length; i++) {
-            checkComparisonOfL3Match(
-                    matchSeeds[i][0][0], matchSeeds[i][0][1],
-                    matchSeeds[i][1][0], matchSeeds[i][1][1],
-                    matches[i]);
-        }
-    }
-
-    /**
-     * @param m1Source match1 - src
-     * @param m1Destination match1 - dest
-     * @param m2Source match2 - src
-     * @param msDestination match2 - dest
-     * @param matches expected match output
-     *
-     */
-    private static void checkComparisonOfL3Match(final String m1Source, final String m1Destination,
-            final String m2Source, final String msDestination, final boolean matches) {
-        final Ipv4Match m1Layer3 = prepareIPv4Match(m1Source, m1Destination);
-        final Ipv4Match m2Layer3 = prepareIPv4Match(m2Source, msDestination);
-        boolean comparisonResult;
-        try {
-            comparisonResult = FlowComparator.layer3MatchEquals(m1Layer3, m2Layer3);
-            Assert.assertEquals("failed to compare: "+m1Layer3+" vs. "+m2Layer3,
-                    matches, comparisonResult);
-        } catch (final Exception e) {
-            LOG.error("failed to compare: {} vs. {}", m1Layer3, m2Layer3, e);
-            Assert.fail(e.getMessage());
-        }
-    }
-
-    private static Ipv4Match prepareIPv4Match(final String source, final String destination) {
-        final Ipv4MatchBuilder ipv4MatchBuilder = new Ipv4MatchBuilder();
-        if (source != null) {
-            ipv4MatchBuilder.setIpv4Source(new Ipv4Prefix(source));
-        }
-        if (destination != null) {
-            ipv4MatchBuilder.setIpv4Destination(new Ipv4Prefix(destination));
-        }
-
-        return ipv4MatchBuilder.build();
-    }
-    /**
-     * Test method for {@link org.opendaylight.controller.md.statistics.manager.impl.helper.FlowComparator#ethernetMatchEquals(EthernetMatch, EthernetMatch)
-     */
-    @Test
-    public void testEthernetMatchEquals() {
-        final String[][][] ethernetMatchSeeds = new String[][][] {
-                {{"aa:bb:cc:dd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}, {"aa:bb:cc:dd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}},
-                {{"aa:bb:cc:dd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}, {"aa:bb:bc:cd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}},
-                {{"aa:bb:cc:dd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}, {"AA:BB:CC:DD:EE:FF", "ff:ff:ff:ff:ff:ff","0800"}},
-                {{"AA:BB:CC:dd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}, {"aa:bb:cc:dd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}},
-                {{"AA:BB:CC:dd:ee:ff", "ff:ff:ff:ff:ff:ff","0800"}, {"aa:bb:cc:dd:ee:ff", "FF:FF:FF:FF:FF:FF","0800"}},
-                {{"AA:BB:CC:dd:ee:ff", "ff:ff:ff:ee:ee:ee","0800"}, {"aa:bb:cc:dd:ee:ff", "FF:FF:FF:FF:FF:FF","0800"}},
-
-                {{"AA:BB:CC:dd:ee:ff", null,"0800"}, {"aa:bb:cc:dd:ee:ff", null,"0800"}},
-                {{"AA:BB:CC:dd:ee:ff", null,"0800"}, {"aa:bb:cc:dd:ee:ff", null,"0806"}},
-                {{"AA:BB:CC:dd:ee:ff", null,"0800"}, {"aa:bb:cc:dd:ee:ff", "FF:FF:FF:FF:FF:FF","0800"}},
-                {{"AA:BB:CC:dd:ee:ff", null,"0800"}, {null, "FF:FF:FF:FF:FF:FF","0800"}},
-
-                {{"AA:BB:CC:dd:ee:ff", "ff:ff:ff:ff:ff:ff",null}, {null, "FF:FF:FF:FF:FF:FF","0800"}},
-                {{"AA:BB:CC:dd:ee:ff", "ff:ff:ff:ff:ff:ff",null}, {"aa:bb:cc:dd:ee:ff", "FF:FF:FF:FF:FF:FF",null}},
-                {{"AA:BB:CC:dd:ee:ff", "ff:ff:ff:ff:ff:ff",null}, {null, "FF:FF:FF:FF:FF:FF",null}},
-
-                {{null, null,null}, {null, null,"0800"}},
-                {{null, null,null}, {null, null,null}},
-        };
-
-        final boolean[] matches = new boolean[] {
-                true,
-                false,
-                true,
-                true,
-                true,
-                false,
-
-                true,
-                false,
-                false,
-                false,
-
-                false,
-                true,
-                false,
-
-                false,
-                true
-        };
-
-        for (int i = 0; i < matches.length; i++) {
-            checkComparisonOfEthernetMatch(
-                    ethernetMatchSeeds[i][0][0], ethernetMatchSeeds[i][0][1],ethernetMatchSeeds[i][0][2],
-                    ethernetMatchSeeds[i][1][0], ethernetMatchSeeds[i][1][1],ethernetMatchSeeds[i][1][2],
-                    matches[i]);
-        }
-    }
-
-    /*
-     * @param ethernetMatch1
-     * @param ethernetMatch2
-     */
-    private static void checkComparisonOfEthernetMatch(final String macAddress1, final String macAddressMask1,final String etherType1,
-            final String macAddress2, final String macAddressMask2,final String etherType2, final boolean expectedResult) {
-        final EthernetMatch ethernetMatch1 = prepareEthernetMatch(macAddress1, macAddressMask1,etherType1);
-        final EthernetMatch ethernetMatch2 = prepareEthernetMatch(macAddress2, macAddressMask2,etherType2);
-        boolean comparisonResult;
-        try {
-            comparisonResult = FlowComparator.ethernetMatchEquals(ethernetMatch1, ethernetMatch2);
-            Assert.assertEquals("failed to compare: "+ethernetMatch1+" vs. "+ethernetMatch2,
-                    expectedResult, comparisonResult);
-        } catch (final Exception e) {
-            LOG.error("failed to compare: {} vs. {}", ethernetMatch1, ethernetMatch2, e);
-            Assert.fail(e.getMessage());
-        }
-    }
-
-    private static EthernetMatch prepareEthernetMatch(final String macAddress, final String macAddressMask, final String etherType) {
-        final EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder();
-        final EthernetSourceBuilder ethernetSourceBuilder =  new EthernetSourceBuilder();
-        if (macAddress != null) {
-            ethernetSourceBuilder.setAddress(new MacAddress(macAddress));
-        }
-        if (macAddressMask != null) {
-            ethernetSourceBuilder.setMask(new MacAddress(macAddressMask));
-        }
-        if(etherType != null){
-            final EthernetTypeBuilder ethernetType = new EthernetTypeBuilder();
-            ethernetType.setType(new EtherType(Long.parseLong(etherType,16)));
-            ethernetMatchBuilder.setEthernetType(ethernetType.build());
-        }
-        ethernetMatchBuilder.setEthernetSource(ethernetSourceBuilder.build());
-
-        return ethernetMatchBuilder.build();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/NodeRegistrationTest.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/NodeRegistrationTest.java
deleted file mode 100644 (file)
index 79eb236..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package test.mock;
-
-import org.junit.Test;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-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.yangtools.yang.binding.InstanceIdentifier;
-import test.mock.util.StatisticsManagerTest;
-
-import java.util.concurrent.ExecutionException;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class NodeRegistrationTest extends StatisticsManagerTest {
-
-    @Test
-    public void nodeRegistrationTest() throws ExecutionException, InterruptedException {
-        StatisticsManager statisticsManager = setupStatisticsManager();
-
-        addFlowCapableNode(s1Key);
-        Thread.sleep(2000);
-        final InstanceIdentifier<Node> nodeII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key);
-
-        assertTrue(statisticsManager.isProvidedFlowNodeActive(nodeII));
-    }
-
-    @Test
-    public void nodeUnregistrationTest() throws ExecutionException, InterruptedException {
-        StatisticsManager statisticsManager = setupStatisticsManager();
-
-        addFlowCapableNode(s1Key);
-        Thread.sleep(2000);
-        final InstanceIdentifier<Node> nodeII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key);
-
-        assertTrue(statisticsManager.isProvidedFlowNodeActive(nodeII));
-
-        removeNode(s1Key);
-        Thread.sleep(2000);
-        assertFalse(statisticsManager.isProvidedFlowNodeActive(nodeII));
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/StatCollectorTest.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/StatCollectorTest.java
deleted file mode 100644 (file)
index 48a993e..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-package test.mock;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import com.google.common.base.Optional;
-import java.util.concurrent.ExecutionException;
-import org.junit.Test;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityFlowStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityGroupStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityPortStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityQueueStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowFeatureCapabilityTableStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-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.statistics.rev130819.FlowStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupDescStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.features.GroupFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterConfigStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.MeterFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.FlowCapableNodeConnectorQueueStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import test.mock.util.StatisticsManagerTest;
-
-public class StatCollectorTest extends StatisticsManagerTest {
-    private final Object waitObject = new Object();
-
-    @Test(timeout = 200000)
-    public void getAllFlowStatsTest() throws ExecutionException, InterruptedException, ReadFailedException {
-        setupStatisticsManager();
-
-        addFlowCapableNodeWithFeatures(s1Key, false, FlowFeatureCapabilityFlowStats.class);
-
-        final Flow flow = getFlow();
-
-        final InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(flow.getTableId()));
-
-        getDataBroker().registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                tableII.child(Flow.class), new ChangeListener(), AsyncDataBroker.DataChangeScope.BASE);
-
-        synchronized (waitObject) {
-            waitObject.wait();
-        }
-
-        final ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<Table> tableOptional = readTx.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).augmentation(FlowCapableNode.class)
-                .child(Table.class, new TableKey(flow.getTableId()))).checkedGet();
-        assertTrue(tableOptional.isPresent());
-        final FlowStatisticsData flowStats = tableOptional.get().getFlow().get(0).getAugmentation(FlowStatisticsData.class);
-        assertTrue(flowStats != null);
-        assertEquals(COUNTER_64_TEST_VALUE, flowStats.getFlowStatistics().getByteCount());
-    }
-
-    @Test(timeout = 200000)
-    public void getAllGroupStatsFeatureNotAdvertisedTest() throws ExecutionException, InterruptedException {
-        setupStatisticsManager();
-
-        addFlowCapableNodeWithFeatures(s1Key, true);
-
-        final InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Group.class, getGroup().getKey());
-        getDataBroker().registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                groupII.augmentation(NodeGroupStatistics.class), new ChangeListener(), AsyncDataBroker.DataChangeScope.BASE);
-
-        synchronized (waitObject) {
-            waitObject.wait();
-        }
-
-        ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<Group> optionalGroup = readTx.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).augmentation(FlowCapableNode.class)
-                .child(Group.class, getGroup().getKey())).get();
-
-        assertTrue(optionalGroup.isPresent());
-        assertTrue(optionalGroup.get().getAugmentation(NodeGroupDescStats.class) != null);
-        final NodeGroupStatistics groupStats = optionalGroup.get().getAugmentation(NodeGroupStatistics.class);
-        assertTrue(groupStats != null);
-        assertEquals(COUNTER_64_TEST_VALUE, groupStats.getGroupStatistics().getByteCount());
-
-        readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<GroupFeatures> optionalGroupFeatures = readTx.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).augmentation(NodeGroupFeatures.class).child(GroupFeatures.class)).get();
-        assertTrue(optionalGroupFeatures.isPresent());
-        assertEquals(1, optionalGroupFeatures.get().getMaxGroups().size());
-        assertEquals(MAX_GROUPS_TEST_VALUE, optionalGroupFeatures.get().getMaxGroups().get(0));
-    }
-
-    @Test(timeout = 200000)
-    public void getAllGroupStatsFeatureAdvertisedTest() throws ExecutionException, InterruptedException {
-        setupStatisticsManager();
-
-        addFlowCapableNodeWithFeatures(s1Key, false, FlowFeatureCapabilityGroupStats.class);
-
-        final InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Group.class, getGroup().getKey());
-        getDataBroker().registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                groupII.augmentation(NodeGroupStatistics.class), new ChangeListener(), AsyncDataBroker.DataChangeScope.BASE);
-
-        synchronized (waitObject) {
-            waitObject.wait();
-        }
-
-        ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<Group> optionalGroup = readTx.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).augmentation(FlowCapableNode.class)
-                .child(Group.class, getGroup().getKey())).get();
-
-        assertTrue(optionalGroup.isPresent());
-        assertTrue(optionalGroup.get().getAugmentation(NodeGroupDescStats.class) != null);
-        final NodeGroupStatistics groupStats = optionalGroup.get().getAugmentation(NodeGroupStatistics.class);
-        assertTrue(groupStats != null);
-        assertEquals(COUNTER_64_TEST_VALUE, groupStats.getGroupStatistics().getByteCount());
-
-        readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<GroupFeatures> optionalGroupFeatures = readTx.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).augmentation(NodeGroupFeatures.class).child(GroupFeatures.class)).get();
-        assertTrue(optionalGroupFeatures.isPresent());
-        assertEquals(1, optionalGroupFeatures.get().getMaxGroups().size());
-        assertEquals(MAX_GROUPS_TEST_VALUE, optionalGroupFeatures.get().getMaxGroups().get(0));
-    }
-
-    @Test(timeout = 200000)
-    public void getAllMeterStatsTest() throws ExecutionException, InterruptedException {
-        setupStatisticsManager();
-
-        addFlowCapableNodeWithFeatures(s1Key, true);
-
-        final InstanceIdentifier<Meter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Meter.class, getMeter().getKey());
-        getDataBroker().registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                meterII.augmentation(NodeMeterStatistics.class), new ChangeListener(), AsyncDataBroker.DataChangeScope.BASE);
-
-        synchronized (waitObject) {
-            waitObject.wait();
-        }
-
-        ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<Meter> optionalMeter = readTx.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).augmentation(FlowCapableNode.class)
-                .child(Meter.class, getMeter().getKey())).get();
-
-        assertTrue(optionalMeter.isPresent());
-        assertTrue(optionalMeter.get().getAugmentation(NodeMeterConfigStats.class) != null);
-        final NodeMeterStatistics meterStats = optionalMeter.get().getAugmentation(NodeMeterStatistics.class);
-        assertTrue(meterStats != null);
-        assertEquals(COUNTER_64_TEST_VALUE, meterStats.getMeterStatistics().getByteInCount());
-        assertEquals(COUNTER_64_TEST_VALUE, meterStats.getMeterStatistics().getPacketInCount());
-
-        readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<MeterFeatures> optionalMeterFeautures = readTx.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).augmentation(NodeMeterFeatures.class).child(MeterFeatures.class)).get();
-        assertTrue(optionalMeterFeautures.isPresent());
-        assertEquals(COUNTER_32_TEST_VALUE, optionalMeterFeautures.get().getMaxMeter());
-    }
-
-    @Test(timeout = 200000)
-    public void getAllQueueStatsTest() throws ExecutionException, InterruptedException, ReadFailedException {
-        setupStatisticsManager();
-
-        addFlowCapableNodeWithFeatures(s1Key, false, FlowFeatureCapabilityQueueStats.class);
-
-        final NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
-        final FlowCapableNodeConnectorBuilder fcncBuilder = new FlowCapableNodeConnectorBuilder();
-        ncBuilder.setKey(new NodeConnectorKey(getNodeConnectorId()));
-        ncBuilder.addAugmentation(FlowCapableNodeConnector.class, fcncBuilder.build());
-
-        final InstanceIdentifier<NodeConnector> nodeConnectorII = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key)
-                .child(NodeConnector.class, ncBuilder.getKey());
-
-        final WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, nodeConnectorII, ncBuilder.build());
-        final InstanceIdentifier<Queue> queueII = nodeConnectorII.augmentation(FlowCapableNodeConnector.class)
-                .child(Queue.class, getQueue().getKey());
-        final QueueBuilder qBuilder = new QueueBuilder(getQueue());
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, queueII, qBuilder.build());
-        assertCommit(writeTx.submit());
-
-        getDataBroker().registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                queueII.augmentation(FlowCapableNodeConnectorQueueStatisticsData.class), new ChangeListener(), AsyncDataBroker.DataChangeScope.BASE);
-
-        synchronized (waitObject) {
-            waitObject.wait();
-        }
-
-        final ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<Queue> queueOptional = readTx.read(LogicalDatastoreType.OPERATIONAL, queueII).checkedGet();
-        assertTrue(queueOptional.isPresent());
-        final FlowCapableNodeConnectorQueueStatisticsData queueStats =
-                queueOptional.get().getAugmentation(FlowCapableNodeConnectorQueueStatisticsData.class);
-        assertTrue(queueStats != null);
-        assertEquals(COUNTER_64_TEST_VALUE,
-                queueStats.getFlowCapableNodeConnectorQueueStatistics().getTransmittedBytes());
-    }
-
-    @Test(timeout = 200000)
-    public void getAllPortStatsTest() throws ExecutionException, InterruptedException, ReadFailedException {
-        setupStatisticsManager();
-
-        addFlowCapableNodeWithFeatures(s1Key, false, FlowFeatureCapabilityPortStats.class);
-
-        final InstanceIdentifier<NodeConnector> nodeConnectorII = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, s1Key).child(NodeConnector.class, new NodeConnectorKey(getNodeConnectorId()));
-
-        NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
-        ncBuilder.setKey(new NodeConnectorKey(getNodeConnectorId()));
-        WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, nodeConnectorII, ncBuilder.build());
-        assertCommit(writeTx.submit());
-
-        getDataBroker().registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                nodeConnectorII.augmentation(FlowCapableNodeConnectorStatisticsData.class),
-                new ChangeListener(), AsyncDataBroker.DataChangeScope.BASE);
-
-        synchronized (waitObject) {
-            waitObject.wait();
-        }
-
-        final ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<FlowCapableNodeConnectorStatisticsData> flowCapableNodeConnectorStatisticsDataOptional =
-                readTx.read(LogicalDatastoreType.OPERATIONAL,
-                        nodeConnectorII.augmentation(FlowCapableNodeConnectorStatisticsData.class)).checkedGet();
-        assertTrue(flowCapableNodeConnectorStatisticsDataOptional.isPresent());
-        assertEquals(BIG_INTEGER_TEST_VALUE,
-                flowCapableNodeConnectorStatisticsDataOptional.get().getFlowCapableNodeConnectorStatistics()
-                        .getReceiveDrops());
-        assertEquals(BIG_INTEGER_TEST_VALUE,
-                flowCapableNodeConnectorStatisticsDataOptional.get().getFlowCapableNodeConnectorStatistics()
-                        .getCollisionCount());
-    }
-
-    @Test(timeout = 200000)
-    public void getAllTableStatsTest() throws ExecutionException, InterruptedException, ReadFailedException {
-        setupStatisticsManager();
-
-        addFlowCapableNodeWithFeatures(s1Key, false, FlowFeatureCapabilityTableStats.class);
-
-        final TableId tableId = getTableId();
-        final InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key)
-                .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tableId.getValue()));
-
-        getDataBroker().registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
-                tableII.augmentation(FlowTableStatisticsData.class), new ChangeListener(), AsyncDataBroker.DataChangeScope.BASE);
-
-        synchronized (waitObject) {
-            waitObject.wait();
-        }
-
-        final ReadOnlyTransaction readTx = getDataBroker().newReadOnlyTransaction();
-        final Optional<FlowTableStatisticsData> flowTableStatisticsDataOptional = readTx.read(
-                LogicalDatastoreType.OPERATIONAL, tableII.augmentation(FlowTableStatisticsData.class)).checkedGet();
-        assertTrue(flowTableStatisticsDataOptional.isPresent());
-        assertEquals(COUNTER_32_TEST_VALUE,
-                flowTableStatisticsDataOptional.get().getFlowTableStatistics().getActiveFlows());
-        assertEquals(COUNTER_64_TEST_VALUE,
-                flowTableStatisticsDataOptional.get().getFlowTableStatistics().getPacketsLookedUp());
-    }
-
-    public class ChangeListener implements DataChangeListener {
-
-        @Override
-        public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
-            synchronized (waitObject) {
-                waitObject.notify();
-            }
-        }
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/AbstractDataBrokerTest.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/AbstractDataBrokerTest.java
deleted file mode 100644 (file)
index f9efa51..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-public class AbstractDataBrokerTest extends AbstractSchemaAwareTest {
-
-    private DataBrokerTestCustomizer testCustomizer;
-    private DataBroker dataBroker;
-    private DOMDataBroker domBroker;
-
-
-    @Override
-    protected void setupWithSchema(final SchemaContext context) {
-        testCustomizer = createDataBrokerTestCustomizer();
-        dataBroker = testCustomizer.createDataBroker();
-        domBroker = testCustomizer.createDOMDataBroker();
-        testCustomizer.updateSchema(context);
-        setupWithDataBroker(dataBroker);
-    }
-
-    protected void setupWithDataBroker(final DataBroker dataBroker) {
-        // Intentionally left No-op, subclasses may customize it
-    }
-
-   protected DataBrokerTestCustomizer createDataBrokerTestCustomizer() {
-        return new DataBrokerTestCustomizer();
-    }
-
-    public DataBroker getDataBroker() {
-        return dataBroker;
-    }
-
-    public DOMDataBroker getDomBroker() {
-        return domBroker;
-    }
-
-    protected static final void assertCommit(final ListenableFuture<Void> commit) {
-        try {
-            commit.get(500, TimeUnit.MILLISECONDS);
-        } catch (InterruptedException | ExecutionException | TimeoutException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/AbstractSchemaAwareTest.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/AbstractSchemaAwareTest.java
deleted file mode 100644 (file)
index d520d59..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import org.junit.Before;
-import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-public abstract class AbstractSchemaAwareTest {
-
-    private Iterable<YangModuleInfo> moduleInfos;
-    private SchemaContext schemaContext;
-
-
-    protected Iterable<YangModuleInfo> getModuleInfos() {
-        return BindingReflections.loadModuleInfos();
-    }
-
-
-    @Before
-    public final void setup() {
-        moduleInfos = getModuleInfos();
-        ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create();
-        moduleContext.addModuleInfos(moduleInfos);
-        schemaContext = moduleContext.tryToCreateSchemaContext().get();
-        setupWithSchema(schemaContext);
-    }
-
-    /**
-     * Setups test with Schema context.
-     * This method is called before {@link #setupWithSchemaService(SchemaService)}
-     *
-     * @param context
-     */
-    protected abstract void setupWithSchema(SchemaContext context);
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/BundleContextMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/BundleContextMock.java
deleted file mode 100644 (file)
index 37cea44..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-package test.mock.util;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.Filter;
-import org.osgi.framework.FrameworkListener;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Dictionary;
-
-public class BundleContextMock implements BundleContext {
-    @Override
-    public String getProperty(String s) {
-        return null;
-    }
-
-    @Override
-    public Bundle getBundle() {
-        return null;
-    }
-
-    @Override
-    public Bundle installBundle(String s, InputStream inputStream) throws BundleException {
-        return null;
-    }
-
-    @Override
-    public Bundle installBundle(String s) throws BundleException {
-        return null;
-    }
-
-    @Override
-    public Bundle getBundle(long l) {
-        return null;
-    }
-
-    @Override
-    public Bundle[] getBundles() {
-        return new Bundle[0];
-    }
-
-    @Override
-    public void addServiceListener(ServiceListener serviceListener, String s) throws InvalidSyntaxException {
-
-    }
-
-    @Override
-    public void addServiceListener(ServiceListener serviceListener) {
-
-    }
-
-    @Override
-    public void removeServiceListener(ServiceListener serviceListener) {
-
-    }
-
-    @Override
-    public void addBundleListener(BundleListener bundleListener) {
-
-    }
-
-    @Override
-    public void removeBundleListener(BundleListener bundleListener) {
-
-    }
-
-    @Override
-    public void addFrameworkListener(FrameworkListener frameworkListener) {
-
-    }
-
-    @Override
-    public void removeFrameworkListener(FrameworkListener frameworkListener) {
-
-    }
-
-    @Override
-    public ServiceRegistration<?> registerService(String[] strings, Object o, Dictionary<String, ?> stringDictionary) {
-        return null;
-    }
-
-    @Override
-    public ServiceRegistration<?> registerService(String s, Object o, Dictionary<String, ?> stringDictionary) {
-        return null;
-    }
-
-    @Override
-    public <S> ServiceRegistration<S> registerService(Class<S> sClass, S s, Dictionary<String, ?> stringDictionary) {
-        return null;
-    }
-
-    @Override
-    public ServiceReference<?>[] getServiceReferences(String s, String s2) throws InvalidSyntaxException {
-        return new ServiceReference<?>[0];
-    }
-
-    @Override
-    public ServiceReference<?>[] getAllServiceReferences(String s, String s2) throws InvalidSyntaxException {
-        return new ServiceReference<?>[0];
-    }
-
-    @Override
-    public ServiceReference<?> getServiceReference(String s) {
-        return null;
-    }
-
-    @Override
-    public <S> ServiceReference<S> getServiceReference(Class<S> sClass) {
-        return null;
-    }
-
-    @Override
-    public <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> sClass, String s) throws InvalidSyntaxException {
-        return null;
-    }
-
-    @Override
-    public <S> S getService(ServiceReference<S> sServiceReference) {
-        return null;
-    }
-
-    @Override
-    public boolean ungetService(ServiceReference<?> serviceReference) {
-        return false;
-    }
-
-    @Override
-    public File getDataFile(String s) {
-        return null;
-    }
-
-    @Override
-    public Filter createFilter(String s) throws InvalidSyntaxException {
-        return null;
-    }
-
-    @Override
-    public Bundle getBundle(String s) {
-        return null;
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/DataBrokerTestCustomizer.java
deleted file mode 100644 (file)
index de7d33e..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import javassist.ClassPool;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.binding.impl.ForwardedBackwardsCompatibleDataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.ForwardedBindingDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
-import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
-import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.yangtools.sal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
-import org.opendaylight.yangtools.sal.binding.generator.util.JavassistUtils;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
-public class DataBrokerTestCustomizer {
-
-    private DOMDataBroker domDataBroker;
-    private final RuntimeGeneratedMappingServiceImpl mappingService;
-    private final MockSchemaService schemaService;
-    private ImmutableMap<LogicalDatastoreType, DOMStore> datastores;
-    private final BindingToNormalizedNodeCodec bindingToNormalized ;
-
-    public ImmutableMap<LogicalDatastoreType, DOMStore> createDatastores() {
-        return ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
-                .put(LogicalDatastoreType.OPERATIONAL, createOperationalDatastore())
-                .put(LogicalDatastoreType.CONFIGURATION,createConfigurationDatastore())
-                .build();
-    }
-
-    public DataBrokerTestCustomizer() {
-        schemaService = new MockSchemaService();
-        ClassPool pool = ClassPool.getDefault();
-        mappingService = new RuntimeGeneratedMappingServiceImpl(pool);
-        DataObjectSerializerGenerator generator = StreamWriterGenerator.create(JavassistUtils.forClassPool(pool));
-        BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(generator);
-        GeneratedClassLoadingStrategy loading = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
-        bindingToNormalized = new BindingToNormalizedNodeCodec(loading, mappingService, codecRegistry);
-        schemaService.registerSchemaContextListener(bindingToNormalized);
-    }
-
-    public DOMStore createConfigurationDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", MoreExecutors.sameThreadExecutor());
-        schemaService.registerSchemaContextListener(store);
-        return store;
-    }
-
-    public DOMStore createOperationalDatastore() {
-        InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", MoreExecutors.sameThreadExecutor());
-        schemaService.registerSchemaContextListener(store);
-        return store;
-    }
-
-    public DOMDataBroker createDOMDataBroker() {
-        return new SerializedDOMDataBroker(getDatastores(), getCommitCoordinatorExecutor());
-    }
-
-    public ListeningExecutorService getCommitCoordinatorExecutor() {
-        return MoreExecutors.sameThreadExecutor();
-    }
-
-    public DataBroker createDataBroker() {
-        return new ForwardedBindingDataBroker(getDOMDataBroker(), bindingToNormalized, schemaService );
-    }
-
-    public ForwardedBackwardsCompatibleDataBroker createBackwardsCompatibleDataBroker() {
-        return new ForwardedBackwardsCompatibleDataBroker(getDOMDataBroker(), bindingToNormalized, getSchemaService(), MoreExecutors.sameThreadExecutor());
-    }
-
-    private SchemaService getSchemaService() {
-        return schemaService;
-    }
-
-    private DOMDataBroker getDOMDataBroker() {
-        if(domDataBroker == null) {
-            domDataBroker = createDOMDataBroker();
-        }
-        return domDataBroker;
-    }
-
-    private synchronized ImmutableMap<LogicalDatastoreType, DOMStore> getDatastores() {
-        if (datastores == null) {
-            datastores = createDatastores();
-        }
-        return datastores;
-    }
-
-    public void updateSchema(final SchemaContext ctx) {
-        schemaService.changeSchema(ctx);
-        mappingService.onGlobalContextUpdated(ctx);
-    }
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/FlowMockGenerator.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/FlowMockGenerator.java
deleted file mode 100644 (file)
index fb5351b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package test.mock.util;
-
-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.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.types.rev131026.FlowCookie;
-
-import java.math.BigInteger;
-import java.util.Random;
-
-public class FlowMockGenerator {
-    private static final Random rnd = new Random();
-    private static final FlowBuilder flowBuilder = new FlowBuilder();
-
-    public static Flow getRandomFlow() {
-        flowBuilder.setKey(new FlowKey(new FlowId("flow." + rnd.nextInt(1000))));
-        flowBuilder.setOutGroup(TestUtils.nextLong(0, 4294967296L));
-        flowBuilder.setTableId((short) rnd.nextInt(256));
-        flowBuilder.setOutPort(BigInteger.valueOf(TestUtils.nextLong(0, Long.MAX_VALUE)));
-        flowBuilder.setStrict(rnd.nextBoolean());
-        flowBuilder.setContainerName("container." + rnd.nextInt(1000));
-        flowBuilder.setBarrier(rnd.nextBoolean());
-        flowBuilder.setMatch(MatchMockGenerator.getRandomMatch());
-        flowBuilder.setPriority(rnd.nextInt(65535));
-        flowBuilder.setCookie(new FlowCookie(BigInteger.valueOf(TestUtils.nextLong(0, Long.MAX_VALUE))));
-        flowBuilder.setCookieMask(flowBuilder.getCookie());
-        return flowBuilder.build();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/GroupMockGenerator.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/GroupMockGenerator.java
deleted file mode 100644 (file)
index 183524d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupTypes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
-
-import java.util.Random;
-
-public class GroupMockGenerator {
-    private static final Random rnd = new Random();
-    private static final GroupBuilder groupBuilder = new GroupBuilder();
-
-    public static Group getRandomGroup() {
-        groupBuilder.setKey(new GroupKey(new GroupId(TestUtils.nextLong(0, 4294967295L))));
-        groupBuilder.setContainerName("container." + rnd.nextInt(1000));
-        groupBuilder.setBarrier(rnd.nextBoolean());
-        groupBuilder.setGroupName("group." + rnd.nextInt(1000));
-        groupBuilder.setGroupType(GroupTypes.forValue(rnd.nextInt(4)));
-        return groupBuilder.build();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MatchMockGenerator.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MatchMockGenerator.java
deleted file mode 100644 (file)
index 8b603c2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder;
-
-import java.math.BigInteger;
-import java.util.Random;
-
-public class MatchMockGenerator {
-    private static final Random rnd = new Random();
-    private static final MatchBuilder matchBuilder = new MatchBuilder();
-    private static final IpMatchBuilder ipMatchBuilder = new IpMatchBuilder();
-    private static final MetadataBuilder metadataBuilder = new MetadataBuilder();
-
-    public static Match getRandomMatch() {
-        matchBuilder.setInPort(new NodeConnectorId("port." + rnd.nextInt(500)));
-        ipMatchBuilder.setIpDscp(new Dscp((short) rnd.nextInt(64))).build();
-        ipMatchBuilder.setIpEcn((short) rnd.nextInt(256));
-        ipMatchBuilder.setIpProtocol((short) rnd.nextInt(256));
-        matchBuilder.setIpMatch(ipMatchBuilder.build());
-        metadataBuilder.setMetadata(BigInteger.valueOf(TestUtils.nextLong(0, Long.MAX_VALUE)));
-        metadataBuilder.setMetadataMask(BigInteger.valueOf(TestUtils.nextLong(0, Long.MAX_VALUE)));
-        matchBuilder.setMetadata(metadataBuilder.build());
-        return matchBuilder.build();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MeterMockGenerator.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MeterMockGenerator.java
deleted file mode 100644 (file)
index 63ebcb0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.BandId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.MeterBandHeadersBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeader;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeaderBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeaderKey;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-public class MeterMockGenerator {
-    private static final Random rnd = new Random();
-    private static final MeterBuilder meterBuilder = new MeterBuilder();
-    private static final MeterBandHeaderBuilder meterBandHeaderBuilder = new MeterBandHeaderBuilder();
-    private static final MeterBandHeadersBuilder meterBandHeadersBuilder = new MeterBandHeadersBuilder();
-
-    public static Meter getRandomMeter() {
-        meterBandHeaderBuilder.setKey(new MeterBandHeaderKey(new BandId(TestUtils.nextLong(0, 4294967295L))));
-        meterBandHeaderBuilder.setBandBurstSize(TestUtils.nextLong(0, 4294967295L));
-        meterBandHeaderBuilder.setBandRate(TestUtils.nextLong(0, 4294967295L));
-        List<MeterBandHeader> meterBandHeaders = new ArrayList<>();
-        meterBuilder.setKey(new MeterKey(new MeterId(TestUtils.nextLong(0, 4294967295L))));
-        meterBuilder.setBarrier(rnd.nextBoolean());
-        meterBuilder.setContainerName("container." + rnd.nextInt(1000));
-        meterBuilder.setMeterName("meter." + rnd.nextInt(1000));
-        meterBuilder.setMeterBandHeaders(meterBandHeadersBuilder.setMeterBandHeader(meterBandHeaders).build());
-        return meterBuilder.build();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MockSchemaService.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/MockSchemaService.java
deleted file mode 100644 (file)
index f6f594b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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 test.mock.util;
-
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.util.ListenerRegistry;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
-
-public final class MockSchemaService implements SchemaService, SchemaContextProvider {
-
-    private SchemaContext schemaContext;
-
-    ListenerRegistry<SchemaContextListener> listeners = ListenerRegistry.create();
-
-    @Override
-    public void addModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public synchronized SchemaContext getGlobalContext() {
-        return schemaContext;
-    }
-
-    @Override
-    public synchronized SchemaContext getSessionContext() {
-        return schemaContext;
-    }
-
-    @Override
-    public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
-            final SchemaContextListener listener) {
-        return listeners.register(listener);
-    }
-
-    @Override
-    public void removeModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public synchronized SchemaContext getSchemaContext() {
-        return schemaContext;
-    }
-
-    public synchronized void changeSchema(final SchemaContext newContext) {
-        schemaContext = newContext;
-        for (ListenerRegistration<SchemaContextListener> listener : listeners) {
-            listener.getInstance().onGlobalContextUpdated(schemaContext);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/NotificationProviderServiceHelper.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/NotificationProviderServiceHelper.java
deleted file mode 100644 (file)
index 2d85f62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
-import org.opendaylight.controller.sal.binding.impl.NotificationBrokerImpl;
-import org.opendaylight.yangtools.yang.binding.Notification;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-public class NotificationProviderServiceHelper {
-    private NotificationBrokerImpl notifBroker = new NotificationBrokerImpl(SingletonHolder.getDefaultNotificationExecutor());
-
-    public NotificationBrokerImpl getNotifBroker() {
-        return notifBroker;
-    }
-
-    public void pushDelayedNotification(final Notification notification, int delay) {
-        new Timer().schedule(new TimerTask() {
-            @Override
-            public void run() {
-                notifBroker.publish(notification);
-            }
-        }, delay);
-    }
-
-    public void pushNotification(final Notification notification) {
-        notifBroker.publish(notification);
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightFlowStatisticsServiceMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightFlowStatisticsServiceMock.java
deleted file mode 100644 (file)
index f483881..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package test.mock.util;
-
-import com.google.common.util.concurrent.Futures;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-public class OpendaylightFlowStatisticsServiceMock implements OpendaylightFlowStatisticsService {
-    NotificationProviderServiceHelper notifService;
-
-    public OpendaylightFlowStatisticsServiceMock(NotificationProviderServiceHelper notifService) {
-        this.notifService = notifService;
-    }
-
-    @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput>> getAggregateFlowStatisticsFromFlowTableForAllFlows(GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
-        GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutputBuilder builder = new GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> getAggregateFlowStatisticsFromFlowTableForGivenMatch(GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
-        GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutputBuilder builder = new GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        AggregateFlowStatisticsUpdateBuilder afsuBuilder = new AggregateFlowStatisticsUpdateBuilder();
-        afsuBuilder.setMoreReplies(false);
-        afsuBuilder.setTransactionId(transId);
-        afsuBuilder.setByteCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        afsuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        notifService.pushDelayedNotification(afsuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetAllFlowStatisticsFromFlowTableOutput>> getAllFlowStatisticsFromFlowTable(GetAllFlowStatisticsFromFlowTableInput input) {
-        GetAllFlowStatisticsFromFlowTableOutputBuilder builder = new GetAllFlowStatisticsFromFlowTableOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetAllFlowsStatisticsFromAllFlowTablesOutput>> getAllFlowsStatisticsFromAllFlowTables(GetAllFlowsStatisticsFromAllFlowTablesInput input) {
-        GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder builder = new GetAllFlowsStatisticsFromAllFlowTablesOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        List<FlowAndStatisticsMapList> flowAndStatisticsMapLists = new ArrayList<>();
-        FlowsStatisticsUpdateBuilder flowsStatisticsUpdateBuilder = new FlowsStatisticsUpdateBuilder();
-        flowsStatisticsUpdateBuilder.setTransactionId(transId);
-        flowsStatisticsUpdateBuilder.setMoreReplies(false);
-        flowsStatisticsUpdateBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        FlowAndStatisticsMapListBuilder flowAndStatisticsMapListBuilder = new FlowAndStatisticsMapListBuilder(StatisticsManagerTest.getFlow());
-        flowAndStatisticsMapListBuilder.setTableId(StatisticsManagerTest.getFlow().getTableId());
-        flowAndStatisticsMapListBuilder.setContainerName(StatisticsManagerTest.getFlow().getContainerName());
-        flowAndStatisticsMapListBuilder.setBarrier(StatisticsManagerTest.getFlow().isBarrier());
-        flowAndStatisticsMapListBuilder.setByteCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        flowAndStatisticsMapLists.add(flowAndStatisticsMapListBuilder.build());
-        flowsStatisticsUpdateBuilder.setFlowAndStatisticsMapList(flowAndStatisticsMapLists);
-        notifService.pushDelayedNotification(flowsStatisticsUpdateBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetFlowStatisticsFromFlowTableOutput>> getFlowStatisticsFromFlowTable(GetFlowStatisticsFromFlowTableInput input) {
-        GetFlowStatisticsFromFlowTableOutputBuilder builder = new GetFlowStatisticsFromFlowTableOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        List<FlowAndStatisticsMapList> flowAndStatisticsMapLists = new ArrayList<>();
-        FlowsStatisticsUpdateBuilder flowsStatisticsUpdateBuilder = new FlowsStatisticsUpdateBuilder();
-        flowsStatisticsUpdateBuilder.setTransactionId(transId);
-        flowsStatisticsUpdateBuilder.setMoreReplies(false);
-        flowsStatisticsUpdateBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        FlowAndStatisticsMapListBuilder flowAndStatisticsMapListBuilder = new FlowAndStatisticsMapListBuilder(input);
-        flowAndStatisticsMapListBuilder.setTableId(input.getTableId());
-        flowAndStatisticsMapListBuilder.setContainerName(input.getContainerName());
-        flowAndStatisticsMapListBuilder.setBarrier(input.isBarrier());
-        flowAndStatisticsMapListBuilder.setByteCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        flowAndStatisticsMapLists.add(flowAndStatisticsMapListBuilder.build());
-        flowsStatisticsUpdateBuilder.setFlowAndStatisticsMapList(flowAndStatisticsMapLists);
-        notifService.pushDelayedNotification(flowsStatisticsUpdateBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightFlowTableStatisticsServiceMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightFlowTableStatisticsServiceMock.java
deleted file mode 100644 (file)
index ea9f403..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-package test.mock.util;
-
-import com.google.common.util.concurrent.Futures;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.GetFlowTablesStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.and.statistics.map.FlowTableAndStatisticsMapKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-public class OpendaylightFlowTableStatisticsServiceMock implements OpendaylightFlowTableStatisticsService {
-    NotificationProviderServiceHelper notifService;
-
-    public OpendaylightFlowTableStatisticsServiceMock(NotificationProviderServiceHelper notifService) {
-        this.notifService = notifService;
-    }
-
-    @Override
-    public Future<RpcResult<GetFlowTablesStatisticsOutput>> getFlowTablesStatistics(GetFlowTablesStatisticsInput input) {
-        GetFlowTablesStatisticsOutputBuilder builder = new GetFlowTablesStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        FlowTableStatisticsUpdateBuilder ftsBuilder = new FlowTableStatisticsUpdateBuilder();
-        FlowTableAndStatisticsMapBuilder ftasmBuilder = new FlowTableAndStatisticsMapBuilder();
-        List<FlowTableAndStatisticsMap> tableAndStatisticsMaps = new ArrayList<>();
-        ftasmBuilder.setKey(new FlowTableAndStatisticsMapKey(StatisticsManagerTest.getTableId()));
-        ftasmBuilder.setActiveFlows(StatisticsManagerTest.COUNTER_32_TEST_VALUE);
-        tableAndStatisticsMaps.add(ftasmBuilder.build());
-        ftsBuilder.setTransactionId(transId);
-        ftsBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        ftsBuilder.setFlowTableAndStatisticsMap(tableAndStatisticsMaps);
-        ftsBuilder.setMoreReplies(true);
-        notifService.pushDelayedNotification(ftsBuilder.build(), 0); // 1st notification
-        ftsBuilder.setMoreReplies(false);
-        ftasmBuilder.setPacketsLookedUp(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        tableAndStatisticsMaps.clear();
-        tableAndStatisticsMaps.add(ftasmBuilder.build());
-        ftsBuilder.setFlowTableAndStatisticsMap(tableAndStatisticsMaps);
-        notifService.pushDelayedNotification(ftsBuilder.build(), 0); // 2nd notification
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightGroupStatisticsServiceMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightGroupStatisticsServiceMock.java
deleted file mode 100644 (file)
index 4b9c047..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-package test.mock.util;
-
-import com.google.common.util.concurrent.Futures;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupDescStatsUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupFeaturesUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupStatisticsUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStatsKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply.GroupStatsKey;
-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.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-public class OpendaylightGroupStatisticsServiceMock implements OpendaylightGroupStatisticsService {
-    NotificationProviderServiceHelper notifService;
-
-    public OpendaylightGroupStatisticsServiceMock(NotificationProviderServiceHelper notifService) {
-        this.notifService = notifService;
-    }
-
-    @Override
-    public Future<RpcResult<GetAllGroupStatisticsOutput>> getAllGroupStatistics(GetAllGroupStatisticsInput input) {
-        GetAllGroupStatisticsOutputBuilder builder = new GetAllGroupStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        List<GroupStats> groupStats = new ArrayList<>();
-        GroupStatsBuilder gsBuilder = new GroupStatsBuilder();
-        GroupStatisticsUpdatedBuilder gsuBuilder = new GroupStatisticsUpdatedBuilder();
-        gsBuilder.setKey(new GroupStatsKey(StatisticsManagerTest.getGroup().getGroupId()));
-        gsBuilder.setByteCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        groupStats.add(gsBuilder.build());
-        builder.setGroupStats(groupStats);
-        gsuBuilder.setTransactionId(transId);
-        gsuBuilder.setMoreReplies(false);
-        gsuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        gsuBuilder.setGroupStats(groupStats);
-        notifService.pushDelayedNotification(gsuBuilder.build(), 500);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetGroupDescriptionOutput>> getGroupDescription(GetGroupDescriptionInput input) {
-        GetGroupDescriptionOutputBuilder builder = new GetGroupDescriptionOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        List<GroupDescStats> groupDescStats = new ArrayList<>();
-        GroupDescStatsUpdatedBuilder gdsuBuilder = new GroupDescStatsUpdatedBuilder();
-        GroupDescStatsBuilder gdsBuilder = new GroupDescStatsBuilder();
-        gdsBuilder.setKey(new GroupDescStatsKey(StatisticsManagerTest.getGroup().getGroupId()));
-        gdsBuilder.setBuckets(StatisticsManagerTest.getGroup().getBuckets());
-        gdsBuilder.setContainerName(StatisticsManagerTest.getGroup().getContainerName());
-        gdsBuilder.setGroupName(StatisticsManagerTest.getGroup().getGroupName());
-        gdsBuilder.setGroupType(StatisticsManagerTest.getGroup().getGroupType());
-        groupDescStats.add(gdsBuilder.build());
-        builder.setGroupDescStats(groupDescStats);
-        gdsuBuilder.setTransactionId(transId);
-        gdsuBuilder.setMoreReplies(false);
-        gdsuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        gdsuBuilder.setGroupDescStats(groupDescStats);
-        notifService.pushDelayedNotification(gdsuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetGroupFeaturesOutput>> getGroupFeatures(GetGroupFeaturesInput input) {
-        GetGroupFeaturesOutputBuilder builder = new GetGroupFeaturesOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        GroupFeaturesUpdatedBuilder gfuBuilder = new GroupFeaturesUpdatedBuilder();
-        gfuBuilder.setTransactionId(transId);
-        gfuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        gfuBuilder.setMoreReplies(false);
-        List<Long> maxGroups = new ArrayList<>();
-        maxGroups.add(StatisticsManagerTest.MAX_GROUPS_TEST_VALUE);
-        gfuBuilder.setMaxGroups(maxGroups);
-        notifService.pushDelayedNotification(gfuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetGroupStatisticsOutput>> getGroupStatistics(GetGroupStatisticsInput input) {
-        GetGroupStatisticsOutputBuilder builder = new GetGroupStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        GroupStatsBuilder gsBuilder = new GroupStatsBuilder();
-        List<GroupStats> groupStats = new ArrayList<>();
-        gsBuilder.setKey(new GroupStatsKey(input.getGroupId()));
-        gsBuilder.setByteCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        groupStats.add(gsBuilder.build());
-        GroupStatisticsUpdatedBuilder gsuBuilder = new GroupStatisticsUpdatedBuilder();
-        gsuBuilder.setTransactionId(transId);
-        gsuBuilder.setMoreReplies(false);
-        gsuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        gsuBuilder.setGroupStats(groupStats);
-        notifService.pushDelayedNotification(gsuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightMeterStatisticsServiceMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightMeterStatisticsServiceMock.java
deleted file mode 100644 (file)
index d5f0ce5..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-package test.mock.util;
-
-import com.google.common.util.concurrent.Futures;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterConfigStatsUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterFeaturesUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatisticsUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.config.stats.reply.MeterConfigStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.config.stats.reply.MeterConfigStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStatsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStatsKey;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-public class OpendaylightMeterStatisticsServiceMock implements OpendaylightMeterStatisticsService {
-    NotificationProviderServiceHelper notifService;
-
-    public OpendaylightMeterStatisticsServiceMock(NotificationProviderServiceHelper notifService) {
-        this.notifService = notifService;
-    }
-
-    @Override
-    public Future<RpcResult<GetAllMeterConfigStatisticsOutput>> getAllMeterConfigStatistics(GetAllMeterConfigStatisticsInput input) {
-        GetAllMeterConfigStatisticsOutputBuilder builder = new GetAllMeterConfigStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        List<MeterConfigStats> meterConfigStats = new ArrayList<>();
-        MeterConfigStatsBuilder mcsBuilder = new MeterConfigStatsBuilder();
-        mcsBuilder.setMeterId(StatisticsManagerTest.getMeter().getMeterId());
-        mcsBuilder.setMeterName(StatisticsManagerTest.getMeter().getMeterName());
-        mcsBuilder.setContainerName(StatisticsManagerTest.getMeter().getContainerName());
-        meterConfigStats.add(mcsBuilder.build());
-        builder.setMeterConfigStats(meterConfigStats);
-        MeterConfigStatsUpdatedBuilder mscuBuilder = new MeterConfigStatsUpdatedBuilder();
-        mscuBuilder.setTransactionId(transId);
-        mscuBuilder.setMoreReplies(false);
-        mscuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        mscuBuilder.setMeterConfigStats(meterConfigStats);
-        notifService.pushDelayedNotification(mscuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetAllMeterStatisticsOutput>> getAllMeterStatistics(GetAllMeterStatisticsInput input) {
-        GetAllMeterStatisticsOutputBuilder builder = new GetAllMeterStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        MeterStatsBuilder msBuilder = new MeterStatsBuilder();
-        msBuilder.setByteInCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        msBuilder.setPacketInCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        msBuilder.setKey(new MeterStatsKey(StatisticsManagerTest.getMeter().getMeterId()));
-        List<MeterStats> meterStats = new ArrayList<>();
-        meterStats.add(msBuilder.build());
-        MeterStatisticsUpdatedBuilder msuBuilder = new MeterStatisticsUpdatedBuilder();
-        msuBuilder.setTransactionId(transId);
-        msuBuilder.setMoreReplies(false);
-        msuBuilder.setMeterStats(meterStats);
-        msuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        notifService.pushDelayedNotification(msuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetMeterFeaturesOutput>> getMeterFeatures(GetMeterFeaturesInput input) {
-        GetMeterFeaturesOutputBuilder builder = new GetMeterFeaturesOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        MeterFeaturesUpdatedBuilder mfuBuilder = new MeterFeaturesUpdatedBuilder();
-        mfuBuilder.setTransactionId(transId);
-        mfuBuilder.setMoreReplies(false);
-        mfuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        mfuBuilder.setMaxMeter(StatisticsManagerTest.COUNTER_32_TEST_VALUE);
-        notifService.pushDelayedNotification(mfuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetMeterStatisticsOutput>> getMeterStatistics(GetMeterStatisticsInput input) {
-        GetMeterStatisticsOutputBuilder builder = new GetMeterStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        MeterStatsBuilder msBuilder = new MeterStatsBuilder();
-        msBuilder.setKey(new MeterStatsKey(input.getMeterId()));
-        msBuilder.setByteInCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        msBuilder.setPacketInCount(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        List<MeterStats> meterStats = new ArrayList<>();
-        meterStats.add(msBuilder.build());
-        MeterStatisticsUpdatedBuilder msuBuilder = new MeterStatisticsUpdatedBuilder();
-        msuBuilder.setTransactionId(transId);
-        msuBuilder.setMoreReplies(false);
-        msuBuilder.setMeterStats(meterStats);
-        msuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        notifService.pushDelayedNotification(msuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightPortStatisticsServiceMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightPortStatisticsServiceMock.java
deleted file mode 100644 (file)
index c3d13f4..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-package test.mock.util;
-
-import com.google.common.util.concurrent.Futures;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetAllNodeConnectorsStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.GetNodeConnectorStatisticsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapKey;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-public class OpendaylightPortStatisticsServiceMock implements OpendaylightPortStatisticsService {
-    NotificationProviderServiceHelper notifService;
-
-    public OpendaylightPortStatisticsServiceMock(NotificationProviderServiceHelper notifService) {
-        this.notifService = notifService;
-    }
-
-    @Override
-    public Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> getAllNodeConnectorsStatistics(GetAllNodeConnectorsStatisticsInput input) {
-        GetAllNodeConnectorsStatisticsOutputBuilder builder = new GetAllNodeConnectorsStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        NodeConnectorStatisticsUpdateBuilder ncsuBuilder = new NodeConnectorStatisticsUpdateBuilder();
-        NodeConnectorStatisticsAndPortNumberMapBuilder ncsapnmBuilder = new NodeConnectorStatisticsAndPortNumberMapBuilder();
-        List<NodeConnectorStatisticsAndPortNumberMap> nodeConnectorStatisticsAndPortNumberMaps = new ArrayList<>();
-        ncsapnmBuilder.setKey(new NodeConnectorStatisticsAndPortNumberMapKey(StatisticsManagerTest.getNodeConnectorId()));
-        ncsapnmBuilder.setReceiveDrops(StatisticsManagerTest.BIG_INTEGER_TEST_VALUE);
-        nodeConnectorStatisticsAndPortNumberMaps.add(ncsapnmBuilder.build());
-        ncsuBuilder.setTransactionId(transId);
-        ncsuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        ncsuBuilder.setNodeConnectorStatisticsAndPortNumberMap(nodeConnectorStatisticsAndPortNumberMaps);
-        ncsuBuilder.setMoreReplies(true);
-        notifService.pushDelayedNotification(ncsuBuilder.build(), 0); // 1st notification
-        ncsuBuilder.setMoreReplies(false);
-        ncsapnmBuilder.setCollisionCount(StatisticsManagerTest.BIG_INTEGER_TEST_VALUE);
-        nodeConnectorStatisticsAndPortNumberMaps.clear();
-        nodeConnectorStatisticsAndPortNumberMaps.add(ncsapnmBuilder.build());
-        ncsuBuilder.setNodeConnectorStatisticsAndPortNumberMap(nodeConnectorStatisticsAndPortNumberMaps);
-        notifService.pushDelayedNotification(ncsuBuilder.build(), 10); // 2nd notification
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetNodeConnectorStatisticsOutput>> getNodeConnectorStatistics(GetNodeConnectorStatisticsInput input) {
-        GetNodeConnectorStatisticsOutputBuilder builder = new GetNodeConnectorStatisticsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightQueueStatisticsServiceMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/OpendaylightQueueStatisticsServiceMock.java
deleted file mode 100644 (file)
index 8908dd5..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-package test.mock.util;
-
-import com.google.common.util.concurrent.Futures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-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.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromAllPortsOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromGivenPortInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromGivenPortOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetAllQueuesStatisticsFromGivenPortOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.GetQueueStatisticsFromGivenPortOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapKey;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Future;
-import java.util.concurrent.atomic.AtomicLong;
-
-public class OpendaylightQueueStatisticsServiceMock implements OpendaylightQueueStatisticsService {
-    NotificationProviderServiceHelper notifService;
-    AtomicLong transNum = new AtomicLong();
-
-    public OpendaylightQueueStatisticsServiceMock(NotificationProviderServiceHelper notifService) {
-        this.notifService = notifService;
-    }
-
-    @Override
-    public Future<RpcResult<GetAllQueuesStatisticsFromAllPortsOutput>> getAllQueuesStatisticsFromAllPorts(GetAllQueuesStatisticsFromAllPortsInput input) {
-        GetAllQueuesStatisticsFromAllPortsOutputBuilder builder = new GetAllQueuesStatisticsFromAllPortsOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        QueueStatisticsUpdateBuilder qsuBuilder = new QueueStatisticsUpdateBuilder();
-        QueueIdAndStatisticsMapBuilder qiasmBuilder = new QueueIdAndStatisticsMapBuilder();
-        List<QueueIdAndStatisticsMap> queueIdAndStatisticsMaps = new ArrayList<>();
-        qsuBuilder.setMoreReplies(false);
-        qsuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        qsuBuilder.setTransactionId(transId);
-        qiasmBuilder.setTransmittedBytes(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        qiasmBuilder.setKey(new QueueIdAndStatisticsMapKey(StatisticsManagerTest.getNodeConnectorId(), StatisticsManagerTest.getQueue().getQueueId()));
-        queueIdAndStatisticsMaps.add(qiasmBuilder.build());
-        qsuBuilder.setQueueIdAndStatisticsMap(queueIdAndStatisticsMaps);
-        notifService.pushDelayedNotification(qsuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetAllQueuesStatisticsFromGivenPortOutput>> getAllQueuesStatisticsFromGivenPort(GetAllQueuesStatisticsFromGivenPortInput input) {
-        GetAllQueuesStatisticsFromGivenPortOutputBuilder builder = new GetAllQueuesStatisticsFromGivenPortOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-
-    @Override
-    public Future<RpcResult<GetQueueStatisticsFromGivenPortOutput>> getQueueStatisticsFromGivenPort(GetQueueStatisticsFromGivenPortInput input) {
-        GetQueueStatisticsFromGivenPortOutputBuilder builder = new GetQueueStatisticsFromGivenPortOutputBuilder();
-        TransactionId transId = new TransactionId(BigInteger.valueOf(TestUtils.getNewTransactionId()));
-        builder.setTransactionId(transId);
-        QueueIdAndStatisticsMapBuilder qiasmBuilder = new QueueIdAndStatisticsMapBuilder();
-        List<QueueIdAndStatisticsMap> queueIdAndStatisticsMaps = new ArrayList<>();
-        qiasmBuilder.setKey(new QueueIdAndStatisticsMapKey(input.getNodeConnectorId(), input.getQueueId()));
-        qiasmBuilder.setTransmittedBytes(StatisticsManagerTest.COUNTER_64_TEST_VALUE);
-        queueIdAndStatisticsMaps.add(qiasmBuilder.build());
-        QueueStatisticsUpdateBuilder qsuBuilder = new QueueStatisticsUpdateBuilder();
-        qsuBuilder.setMoreReplies(false);
-        qsuBuilder.setTransactionId(transId);
-        qsuBuilder.setId(input.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId());
-        qsuBuilder.setQueueIdAndStatisticsMap(queueIdAndStatisticsMaps);
-        notifService.pushDelayedNotification(qsuBuilder.build(), 100);
-        return Futures.immediateFuture(RpcResultBuilder.success(builder.build()).build());
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/PortMockGenerator.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/PortMockGenerator.java
deleted file mode 100644 (file)
index 4c97217..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package test.mock.util;
-
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.CommonPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.Port;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortKey;
-
-import java.util.Random;
-
-public class PortMockGenerator {
-    private static final Random rnd = new Random();
-    private static final PortBuilder portBuilder = new PortBuilder();
-
-    public static Port getRandomPort() {
-        portBuilder.setKey(new PortKey(TestUtils.nextLong(0, 4294967295L)));
-        portBuilder.setBarrier(rnd.nextBoolean());
-        portBuilder.setPortNumber(new CommonPort.PortNumber(TestUtils.nextLong(0, 4294967295L)));
-        portBuilder.setConfiguration(new PortConfig(rnd.nextBoolean(), rnd.nextBoolean(), rnd.nextBoolean(), rnd.nextBoolean()));
-        return portBuilder.build();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/QueueMockGenerator.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/QueueMockGenerator.java
deleted file mode 100644 (file)
index f140776..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.QueueKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId;
-
-import java.util.Random;
-
-public class QueueMockGenerator {
-    private static final Random rnd = new Random();
-    private static final QueueBuilder queueBuilder = new QueueBuilder();
-
-    public static Queue getRandomQueue() {
-        queueBuilder.setKey(new QueueKey(new QueueId(TestUtils.nextLong(0, 4294967295L))));
-        queueBuilder.setPort(TestUtils.nextLong(0, 4294967295L));
-        queueBuilder.setProperty(rnd.nextInt(65535));
-        return queueBuilder.build();
-    }
-
-    public static Queue getRandomQueueWithPortNum(long portNum) {
-        queueBuilder.setKey(new QueueKey(new QueueId(TestUtils.nextLong(0, 4294967295L))));
-        queueBuilder.setPort(portNum);
-        queueBuilder.setProperty(rnd.nextInt(65535));
-        return queueBuilder.build();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/RpcProviderRegistryMock.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/RpcProviderRegistryMock.java
deleted file mode 100644 (file)
index 0b25486..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-package test.mock.util;
-
-import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.OpendaylightFlowTableStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.OpendaylightPortStatisticsService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.OpendaylightQueueStatisticsService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-
-public class RpcProviderRegistryMock implements RpcProviderRegistry {
-
-    OpendaylightFlowStatisticsServiceMock flowStatisticsServiceMock;
-    OpendaylightFlowTableStatisticsServiceMock flowTableStatisticsServiceMock;
-    OpendaylightGroupStatisticsServiceMock groupStatisticsServiceMock;
-    OpendaylightMeterStatisticsServiceMock meterStatisticsServiceMock;
-    OpendaylightPortStatisticsServiceMock portStatisticsServiceMock;
-    OpendaylightQueueStatisticsServiceMock queueStatisticsServiceMock;
-
-    public RpcProviderRegistryMock(NotificationProviderServiceHelper notificationProviderService) {
-        this.flowStatisticsServiceMock = new OpendaylightFlowStatisticsServiceMock(notificationProviderService);
-        this.flowTableStatisticsServiceMock = new OpendaylightFlowTableStatisticsServiceMock(notificationProviderService);
-        this.groupStatisticsServiceMock = new OpendaylightGroupStatisticsServiceMock(notificationProviderService);
-        this.meterStatisticsServiceMock = new OpendaylightMeterStatisticsServiceMock(notificationProviderService);
-        this.portStatisticsServiceMock = new OpendaylightPortStatisticsServiceMock(notificationProviderService);
-        this.queueStatisticsServiceMock = new OpendaylightQueueStatisticsServiceMock(notificationProviderService);
-    }
-
-    @Override
-    public <T extends RpcService> BindingAwareBroker.RpcRegistration<T> addRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
-        return null;
-    }
-
-    @Override
-    public <T extends RpcService> BindingAwareBroker.RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
-        return null;
-    }
-
-    @Override
-    public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(L listener) {
-        return null;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public <T extends RpcService> T getRpcService(Class<T> serviceInterface) {
-        if (serviceInterface.equals(OpendaylightFlowStatisticsService.class)) {
-            return (T)flowStatisticsServiceMock;
-        } else if (serviceInterface.equals(OpendaylightFlowTableStatisticsService.class)) {
-            return (T) flowTableStatisticsServiceMock;
-        } else if (serviceInterface.equals(OpendaylightGroupStatisticsService.class)) {
-            return (T) groupStatisticsServiceMock;
-        } else if (serviceInterface.equals(OpendaylightMeterStatisticsService.class)) {
-            return (T) meterStatisticsServiceMock;
-        } else if (serviceInterface.equals(OpendaylightPortStatisticsService.class)) {
-            return (T) portStatisticsServiceMock;
-        } else if (serviceInterface.equals(OpendaylightQueueStatisticsService.class)) {
-            return (T) queueStatisticsServiceMock;
-        } else {
-            return null;
-        }
-    }
-
-    public OpendaylightFlowStatisticsServiceMock getFlowStatisticsServiceMock() {
-        return flowStatisticsServiceMock;
-    }
-
-    public OpendaylightFlowTableStatisticsServiceMock getFlowTableStatisticsServiceMock() {
-        return flowTableStatisticsServiceMock;
-    }
-
-    public OpendaylightGroupStatisticsServiceMock getGroupStatisticsServiceMock() {
-        return groupStatisticsServiceMock;
-    }
-
-    public OpendaylightMeterStatisticsServiceMock getMeterStatisticsServiceMock() {
-        return meterStatisticsServiceMock;
-    }
-
-    public OpendaylightPortStatisticsServiceMock getPortStatisticsServiceMock() {
-        return portStatisticsServiceMock;
-    }
-
-    public OpendaylightQueueStatisticsServiceMock getQueueStatisticsServiceMock() {
-        return queueStatisticsServiceMock;
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/StatisticsManagerTest.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/StatisticsManagerTest.java
deleted file mode 100644 (file)
index 45765ed..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-package test.mock.util;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
-import org.opendaylight.controller.md.statistics.manager.impl.StatisticsManagerConfig;
-import org.opendaylight.controller.md.statistics.manager.impl.StatisticsManagerImpl;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter32;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter64;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
-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.TableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.Port;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.queues.Queue;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.NodeMeterFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.MeterFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public abstract class StatisticsManagerTest extends AbstractDataBrokerTest {
-
-    public static final Counter64 COUNTER_64_TEST_VALUE = new Counter64(BigInteger.valueOf(128));
-    public static final Counter32 COUNTER_32_TEST_VALUE = new Counter32(64L);
-    public static final Long MAX_GROUPS_TEST_VALUE = 2000L;
-    public static final BigInteger BIG_INTEGER_TEST_VALUE = BigInteger.valueOf(1000);
-
-    private static final int DEFAULT_MIN_REQUEST_NET_MONITOR_INTERVAL = 5000;
-    private static final int MAX_NODES_FOR_COLLECTOR = 16;
-
-    private static Flow flow;
-    private static Group group;
-    private static Meter meter;
-    private static Port port;
-    private static Queue queue;
-    private static TableId tableId;
-    private static NodeConnectorId nodeConnectorId;
-
-    private final NotificationProviderServiceHelper notificationMock = new NotificationProviderServiceHelper();
-    protected final NodeKey s1Key = new NodeKey(new NodeId("S1"));
-    protected RpcProviderRegistryMock rpcRegistry;
-
-    @BeforeClass
-    public static void setupTests() {
-        flow = FlowMockGenerator.getRandomFlow();
-        group = GroupMockGenerator.getRandomGroup();
-        meter = MeterMockGenerator.getRandomMeter();
-        port = PortMockGenerator.getRandomPort();
-        queue = QueueMockGenerator.getRandomQueueWithPortNum(port.getPortNumber().getUint32());
-        tableId = new TableId((short) 2);
-        nodeConnectorId = new NodeConnectorId("connector.1");
-    }
-
-    @Before
-    public void init() {
-        rpcRegistry = new RpcProviderRegistryMock(notificationMock);
-    }
-
-    // node with statistics capabilities will enable cyclic statistics collection
-    @SafeVarargs
-    protected final void addFlowCapableNodeWithFeatures(final NodeKey nodeKey, final Boolean hasMeterCapabilities,
-                                                     final Class<? extends FeatureCapability>... capabilities)
-            throws ExecutionException, InterruptedException {
-        final Nodes nodes = new NodesBuilder().setNode(Collections.<Node>emptyList()).build();
-        final InstanceIdentifier<Node> flowNodeIdentifier = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, nodeKey);
-
-        final FlowCapableNodeBuilder fcnBuilder = new FlowCapableNodeBuilder();
-        final SwitchFeaturesBuilder sfBuilder = new SwitchFeaturesBuilder();
-        final List<Class<? extends FeatureCapability>> capabilitiyList = new ArrayList<>();
-        for (final Class<? extends FeatureCapability> capability : capabilities) {
-            capabilitiyList.add(capability);
-        }
-        sfBuilder.setCapabilities(capabilitiyList);
-        sfBuilder.setMaxTables((short) 255);
-        final NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setKey(nodeKey);
-        fcnBuilder.setSwitchFeatures(sfBuilder.build());
-        final List<Table> tables = new ArrayList<>();
-        final TableBuilder tBuilder = new TableBuilder();
-        tBuilder.setId(getFlow().getTableId());
-        tables.add(tBuilder.build());
-        fcnBuilder.setTable(tables);
-        final FlowCapableNode flowCapableNode = fcnBuilder.build();
-        nodeBuilder.addAugmentation(FlowCapableNode.class, flowCapableNode);
-        final Node node = nodeBuilder.build();
-
-        final WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class), nodes);
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, flowNodeIdentifier, nodeBuilder.build());
-        if (hasMeterCapabilities) {
-            final NodeMeterFeaturesBuilder nmfBuilder = new NodeMeterFeaturesBuilder();
-            final MeterFeaturesBuilder mfBuilder = new MeterFeaturesBuilder();
-            mfBuilder.setMaxBands((short) 4);
-            nmfBuilder.setMeterFeatures(mfBuilder.build());
-            writeTx.put(LogicalDatastoreType.OPERATIONAL, flowNodeIdentifier.augmentation(NodeMeterFeatures.class),
-                    nmfBuilder.build());
-        }
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Nodes.class), nodes);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowNodeIdentifier, node);
-        assertCommit(writeTx.submit());
-
-        final NodeUpdatedBuilder nuBuilder = new NodeUpdatedBuilder(node);
-        final FlowCapableNodeUpdatedBuilder fcnuBuilder = new FlowCapableNodeUpdatedBuilder(flowCapableNode);
-        nuBuilder.setNodeRef(new NodeRef(flowNodeIdentifier));
-        nuBuilder.addAugmentation(FlowCapableNodeUpdated.class, fcnuBuilder.build());
-        notificationMock.pushNotification(nuBuilder.build());
-    }
-
-    public void addFlowCapableNode(final NodeKey nodeKey) throws ExecutionException, InterruptedException {
-        final Nodes nodes = new NodesBuilder().setNode(Collections.<Node>emptyList()).build();
-        final InstanceIdentifier<Node> flowNodeIdentifier = InstanceIdentifier.create(Nodes.class)
-                .child(Node.class, nodeKey);
-
-        final FlowCapableNodeBuilder fcnBuilder = new FlowCapableNodeBuilder();
-        final NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setKey(nodeKey);
-        final SwitchFeaturesBuilder sfBuilder = new SwitchFeaturesBuilder();
-        sfBuilder.setMaxTables((short) 255);
-        fcnBuilder.setSwitchFeatures(sfBuilder.build());
-        final FlowCapableNode flowCapableNode = fcnBuilder.build();
-        nodeBuilder.addAugmentation(FlowCapableNode.class, flowCapableNode);
-        final Node node = nodeBuilder.build();
-
-        final WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Nodes.class), nodes);
-        writeTx.put(LogicalDatastoreType.OPERATIONAL, flowNodeIdentifier, node);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(Nodes.class), nodes);
-        writeTx.put(LogicalDatastoreType.CONFIGURATION, flowNodeIdentifier, node);
-        assertCommit(writeTx.submit());
-
-        final NodeUpdatedBuilder nuBuilder = new NodeUpdatedBuilder(node);
-        final FlowCapableNodeUpdatedBuilder fcnuBuilder = new FlowCapableNodeUpdatedBuilder(flowCapableNode);
-        nuBuilder.setNodeRef(new NodeRef(flowNodeIdentifier));
-        nuBuilder.addAugmentation(FlowCapableNodeUpdated.class, fcnuBuilder.build());
-        notificationMock.pushNotification(nuBuilder.build());
-    }
-
-    protected void removeNode(final NodeKey nodeKey) throws ExecutionException, InterruptedException {
-        final InstanceIdentifier<Node> nodeII = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
-
-        final WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
-        writeTx.delete(LogicalDatastoreType.OPERATIONAL, nodeII);
-        writeTx.submit().get();
-
-        final NodeRemovedBuilder nrBuilder = new NodeRemovedBuilder();
-        nrBuilder.setNodeRef(new NodeRef(nodeII));
-        notificationMock.pushNotification(nrBuilder.build());
-    }
-
-    public StatisticsManager setupStatisticsManager() {
-        StatisticsManagerConfig.StatisticsManagerConfigBuilder confBuilder = StatisticsManagerConfig.builder();
-        confBuilder.setMaxNodesForCollector(MAX_NODES_FOR_COLLECTOR);
-        confBuilder.setMinRequestNetMonitorInterval(DEFAULT_MIN_REQUEST_NET_MONITOR_INTERVAL);
-        StatisticsManager statsProvider = new StatisticsManagerImpl(getDataBroker(), confBuilder.build());
-        statsProvider.start(notificationMock.getNotifBroker(), rpcRegistry);
-        return statsProvider;
-    }
-
-    public static Flow getFlow() {
-        return flow;
-    }
-
-    public static Group getGroup() {
-        return group;
-    }
-
-    public static Meter getMeter() {
-        return meter;
-    }
-
-    public static Port getPort() {
-        return port;
-    }
-
-    public static Queue getQueue() {
-        return queue;
-    }
-
-    public static TableId getTableId() {
-        return tableId;
-    }
-
-    public static NodeConnectorId getNodeConnectorId() {
-        return nodeConnectorId;
-    }
-}
-
diff --git a/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/TestUtils.java b/opendaylight/md-sal/statistics-manager/src/test/java/test/mock/util/TestUtils.java
deleted file mode 100644 (file)
index d18dc23..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package test.mock.util;
-
-import java.util.Random;
-import java.util.concurrent.atomic.AtomicLong;
-
-public class TestUtils {
-
-    private static AtomicLong transId = new AtomicLong();
-
-    private static Random rnd = new Random();
-
-    public static long nextLong(long RangeBottom, long rangeTop) {
-        return RangeBottom + ((long)(rnd.nextDouble()*(rangeTop - RangeBottom)));
-    }
-
-    public static long getNewTransactionId() {
-        return transId.incrementAndGet();
-    }
-}
diff --git a/opendaylight/md-sal/statistics-manager/src/test/resources/log4j-test.xml b/opendaylight/md-sal/statistics-manager/src/test/resources/log4j-test.xml
deleted file mode 100644 (file)
index bd3bf3c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">\r
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">\r
-\r
-    <appender name="console" class="org.apache.log4j.ConsoleAppender">\r
-        <layout class="org.apache.log4j.PatternLayout">\r
-            <param name="ConversionPattern" value="%-6p %d{HH:mm:ss.SSS} [%10.10t] %30.30c %x - %m%n" />\r
-        </layout>\r
-    </appender>\r
-\r
-    <logger name="org.opendaylight.controller.md.statistics" additivity="false">\r
-        <level value="DEBUG" />\r
-        <appender-ref ref="console" />\r
-    </logger>\r
-\r
-    <root>\r
-        <priority value="INFO" />\r
-        <appender-ref ref="console" />\r
-    </root>\r
-</log4j:configuration>\r
diff --git a/opendaylight/md-sal/topology-lldp-discovery/pom.xml b/opendaylight/md-sal/topology-lldp-discovery/pom.xml
deleted file mode 100644 (file)
index 70cd4b8..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-    <relativePath>../</relativePath>
-  </parent>
-  <groupId>org.opendaylight.controller.md</groupId>
-  <artifactId>topology-lldp-discovery</artifactId>
-  <packaging>bundle</packaging>
-  <properties>
-    <bundle.plugin.version>2.4.0</bundle.plugin.version>
-    <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
-  </properties>
-  <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.osgi</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>liblldp</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-base</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-Activator>org.opendaylight.md.controller.topology.lldp.LLDPActivator</Bundle-Activator>
-            <Export-Package>org.opendaylight.md.controller.topology.lldp.utils</Export-Package>
-            <Embed-Dependency>commons-lang</Embed-Dependency>
-            &gt;
-            <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </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>
-  </scm>
-</project>
diff --git a/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPActivator.java b/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPActivator.java
deleted file mode 100644 (file)
index 0e003db..0000000
+++ /dev/null
@@ -1,30 +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
- */
-package org.opendaylight.md.controller.topology.lldp;
-
-import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.osgi.framework.BundleContext;
-
-public class LLDPActivator extends AbstractBindingAwareProvider {
-    private static LLDPDiscoveryProvider provider = new LLDPDiscoveryProvider();
-
-    public void onSessionInitiated(final ProviderContext session) {
-        DataProviderService dataService = session.<DataProviderService>getSALService(DataProviderService.class);
-        provider.setDataService(dataService);
-        NotificationProviderService notificationService = session.<NotificationProviderService>getSALService(NotificationProviderService.class);
-        provider.setNotificationService(notificationService);
-        provider.start();
-    }
-
-    protected void stopImpl(final BundleContext context) {
-        provider.close();
-    }
-}
diff --git a/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPDiscoveryListener.java b/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPDiscoveryListener.java
deleted file mode 100644 (file)
index c539ac8..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.md.controller.topology.lldp;
-
-import org.opendaylight.md.controller.topology.lldp.utils.LLDPDiscoveryUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscoveredBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class LLDPDiscoveryListener implements PacketProcessingListener {
-    static Logger LOG = LoggerFactory.getLogger(LLDPDiscoveryListener.class);
-
-    private LLDPDiscoveryProvider manager;
-
-    LLDPDiscoveryListener(LLDPDiscoveryProvider manager) {
-        this.manager = manager;
-    }
-
-    public void onPacketReceived(PacketReceived lldp) {
-        NodeConnectorRef src = LLDPDiscoveryUtils.lldpToNodeConnectorRef(lldp.getPayload());
-        if(src != null) {
-            LinkDiscoveredBuilder ldb = new LinkDiscoveredBuilder();
-            ldb.setDestination(lldp.getIngress());
-            ldb.setSource(new NodeConnectorRef(src));
-            LinkDiscovered ld = ldb.build();
-
-            manager.getNotificationService().publish(ld);
-            LLDPLinkAger.getInstance().put(ld);
-        }
-    }
-
-}
diff --git a/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPDiscoveryProvider.java b/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPDiscoveryProvider.java
deleted file mode 100644 (file)
index 91db6e2..0000000
+++ /dev/null
@@ -1,58 +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
- */
-package org.opendaylight.md.controller.topology.lldp;
-
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LLDPDiscoveryProvider implements AutoCloseable {
-    private final static Logger LOG =  LoggerFactory.getLogger(LLDPDiscoveryProvider.class);
-    private DataProviderService dataService;
-    private NotificationProviderService notificationService;
-    private final LLDPDiscoveryListener commiter = new LLDPDiscoveryListener(LLDPDiscoveryProvider.this);
-    private ListenerRegistration<NotificationListener> listenerRegistration;
-
-    public DataProviderService getDataService() {
-        return this.dataService;
-    }
-
-    public void setDataService(final DataProviderService dataService) {
-        this.dataService = dataService;
-    }
-
-    public NotificationProviderService getNotificationService() {
-        return this.notificationService;
-    }
-
-    public void setNotificationService(final NotificationProviderService notificationService) {
-        this.notificationService = notificationService;
-    }
-
-    public void start() {
-        ListenerRegistration<NotificationListener> registerNotificationListener = this.getNotificationService().registerNotificationListener(this.commiter);
-        this.listenerRegistration = registerNotificationListener;
-        LLDPLinkAger.getInstance().setManager(this);
-        LOG.info("LLDPDiscoveryListener Started.");
-    }
-
-    public void close() {
-        try {
-            LOG.info("LLDPDiscoveryListener stopped.");
-            if (this.listenerRegistration!=null) {
-                this.listenerRegistration.close();
-            }
-            LLDPLinkAger.getInstance().close();
-        } catch (Exception e) {
-            throw new Error(e);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPLinkAger.java b/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/LLDPLinkAger.java
deleted file mode 100644 (file)
index face596..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.md.controller.topology.lldp;
-
-import java.util.Date;
-import java.util.Map;
-import java.util.Timer;
-import java.util.Map.Entry;
-import java.util.TimerTask;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.opendaylight.md.controller.topology.lldp.utils.LLDPDiscoveryUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemovedBuilder;
-
-
-public class LLDPLinkAger {
-    private static final LLDPLinkAger instance = new LLDPLinkAger();
-    private Map<LinkDiscovered,Date> linkToDate = new ConcurrentHashMap<LinkDiscovered,Date>();
-    private LLDPDiscoveryProvider manager;
-    private Timer timer = new Timer();
-
-    public LLDPDiscoveryProvider getManager() {
-        return manager;
-    }
-    public void setManager(LLDPDiscoveryProvider manager) {
-        this.manager = manager;
-    }
-    private LLDPLinkAger() {
-        timer.schedule(new LLDPAgingTask(), 0,LLDPDiscoveryUtils.LLDP_INTERVAL);
-    }
-    public static LLDPLinkAger getInstance() {
-        return instance;
-    }
-
-    public void put(LinkDiscovered link) {
-        Date expires = new Date();
-        expires.setTime(expires.getTime() + LLDPDiscoveryUtils.LLDP_EXPIRATION_TIME);
-        linkToDate.put(link, expires);
-    }
-
-    public void close() {
-        timer.cancel();
-    }
-
-    private class LLDPAgingTask extends TimerTask {
-
-        @Override
-        public void run() {
-            for (Entry<LinkDiscovered,Date> entry : linkToDate.entrySet()) {
-                LinkDiscovered link = entry.getKey();
-                Date expires = entry.getValue();
-                Date now = new Date();
-                if(now.after(expires)) {
-                    if(getInstance().getManager() != null) {
-                        LinkRemovedBuilder lrb = new LinkRemovedBuilder(link);
-                        getInstance().getManager().getNotificationService().publish(lrb.build());
-                        linkToDate.remove(link);
-                    }
-                }
-            }
-
-        }
-
-    }
-}
-
diff --git a/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/utils/LLDPDiscoveryUtils.java b/opendaylight/md-sal/topology-lldp-discovery/src/main/java/org/opendaylight/md/controller/topology/lldp/utils/LLDPDiscoveryUtils.java
deleted file mode 100644 (file)
index 0d1ba11..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.md.controller.topology.lldp.utils;
-
-import java.nio.charset.Charset;
-
-import org.opendaylight.controller.liblldp.Ethernet;
-import org.opendaylight.controller.liblldp.LLDP;
-import org.opendaylight.controller.liblldp.LLDPTLV;
-import org.opendaylight.controller.liblldp.NetUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-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.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-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.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LLDPDiscoveryUtils {
-    static Logger LOG = LoggerFactory.getLogger(LLDPDiscoveryUtils.class);
-
-    public static final Long LLDP_INTERVAL = (long) (1000*5); // Send LLDP every five seconds
-    public static final Long LLDP_EXPIRATION_TIME = LLDP_INTERVAL*3; // Let up to three intervals pass before we decide we are expired.
-
-    public static String macToString(byte[] mac) {
-        StringBuilder b = new StringBuilder();
-        for (int i = 0; i < mac.length; i++) {
-            b.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? ":" : ""));
-        }
-
-        return b.toString();
-    }
-
-    public static NodeConnectorRef lldpToNodeConnectorRef(byte[] payload)  {
-        Ethernet ethPkt = new Ethernet();
-        try {
-            ethPkt.deserialize(payload, 0,payload.length * NetUtils.NumBitsInAByte);
-        } catch (Exception e) {
-            LOG.warn("Failed to decode LLDP packet {}", e);
-        }
-
-        if (ethPkt.getPayload() instanceof LLDP) {
-            LLDP lldp = (LLDP) ethPkt.getPayload();
-
-            try {
-                NodeId srcNodeId = null;
-                NodeConnectorId srcNodeConnectorId = null;
-                for (LLDPTLV lldptlv : lldp.getOptionalTLVList()) {
-                    if (lldptlv.getType() == LLDPTLV.TLVType.Custom.getValue()) {
-                        srcNodeConnectorId = new NodeConnectorId(LLDPTLV.getCustomString(lldptlv.getValue(), lldptlv.getLength()));
-                    }
-                    if (lldptlv.getType() == LLDPTLV.TLVType.SystemName.getValue()) {
-                        String srcNodeIdString = new String(lldptlv.getValue(),Charset.defaultCharset());
-                        srcNodeId = new NodeId(srcNodeIdString);
-                    }
-                }
-                if(srcNodeId != null && srcNodeConnectorId != null) {
-                    InstanceIdentifier<NodeConnector> srcInstanceId = InstanceIdentifier.builder(Nodes.class)
-                            .child(Node.class,new NodeKey(srcNodeId))
-                            .child(NodeConnector.class, new NodeConnectorKey(srcNodeConnectorId))
-                            .toInstance();
-                    return new NodeConnectorRef(srcInstanceId);
-                }
-            } catch (Exception e) {
-                LOG.warn("Caught exception ", e);
-            }
-        }
-        return null;
-    }
-}
diff --git a/opendaylight/md-sal/topology-manager/pom.xml b/opendaylight/md-sal/topology-manager/pom.xml
deleted file mode 100644 (file)
index bfef646..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?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.2.0-SNAPSHOT</version>
-  </parent>
-  <groupId>org.opendaylight.controller.md</groupId>
-  <artifactId>topology-manager</artifactId>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-util</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-topology</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-all</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <Bundle-Activator>org.opendaylight.md.controller.topology.manager.FlowCapableTopologyProvider</Bundle-Activator>
-            <Private-Package>org.opendaylight.md.controller.topology.manager</Private-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:MD-SAL</url>
-  </scm>
-</project>
diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableNodeMapping.java
deleted file mode 100644 (file)
index bb406bb..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.md.controller.topology.manager;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-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.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder;
-
-public final class FlowCapableNodeMapping {
-
-    private FlowCapableNodeMapping() {
-        throw new UnsupportedOperationException("Utility class.");
-    }
-
-    public static NodeKey getNodeKey(final NodeRef ref) {
-        return ref.getValue().firstKeyOf(Node.class, NodeKey.class);
-    }
-
-    public static NodeKey getNodeKey(final NodeConnectorRef ref) {
-        return ref.getValue().firstKeyOf(Node.class, NodeKey.class);
-    }
-
-    public static NodeConnectorKey getNodeConnectorKey(final NodeConnectorRef ref) {
-        return ref.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
-    }
-
-    public static NodeId toTopologyNodeId(
-            final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId) {
-        return new NodeId(nodeId);
-    }
-
-    private static NodeId toTopologyNodeId(final NodeConnectorRef source) {
-        return toTopologyNodeId(getNodeKey(source).getId());
-    }
-
-    public static TpId toTerminationPointId(final NodeConnectorId id) {
-        return new TpId(id);
-    }
-
-    private static TpId toTerminationPointId(final NodeConnectorRef source) {
-        return toTerminationPointId(getNodeConnectorKey(source).getId());
-    }
-
-    public static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node toTopologyNode(
-            final NodeId nodeId, final NodeRef invNodeRef) {
-        return new NodeBuilder() //
-                .setNodeId(nodeId) //
-                .addAugmentation(InventoryNode.class, new InventoryNodeBuilder() //
-                        .setInventoryNodeRef(invNodeRef) //
-                        .build()) //
-                .build();
-    }
-
-    public static TerminationPoint toTerminationPoint(final TpId id, final NodeConnectorRef invNodeConnectorRef) {
-        return new TerminationPointBuilder() //
-                .setTpId(id) //
-                .addAugmentation(InventoryNodeConnector.class, new InventoryNodeConnectorBuilder() //
-                        .setInventoryNodeConnectorRef(invNodeConnectorRef) //
-                        .build()) //
-                .build();
-    }
-
-    public static Link toTopologyLink(
-            final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.Link link) {
-        return new LinkBuilder() //
-                .setSource(new SourceBuilder() //
-                        .setSourceNode(toTopologyNodeId(link.getSource())) //
-                        .setSourceTp(toTerminationPointId(link.getSource())) //
-                        .build()) //
-                .setDestination(new DestinationBuilder() //
-                        .setDestNode(toTopologyNodeId(link.getDestination())) //
-                        .setDestTp(toTerminationPointId(link.getDestination())) //
-                        .build()) //
-                .setLinkId(new LinkId(getNodeConnectorKey(link.getSource()).getId())) //
-                .build();
-    }
-}
diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.java
deleted file mode 100644 (file)
index bba4b4c..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * 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.md.controller.topology.manager;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkOverutilized;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkUtilizationNormal;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.OpendaylightInventoryListener;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collections;
-import java.util.List;
-
-import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.getNodeConnectorKey;
-import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.getNodeKey;
-import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTerminationPoint;
-import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTerminationPointId;
-import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyLink;
-import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyNode;
-import static org.opendaylight.md.controller.topology.manager.FlowCapableNodeMapping.toTopologyNodeId;
-
-class FlowCapableTopologyExporter implements FlowTopologyDiscoveryListener, OpendaylightInventoryListener {
-
-    private static final Logger LOG = LoggerFactory.getLogger(FlowCapableTopologyExporter.class);
-    private final InstanceIdentifier<Topology> topology;
-    private final OperationProcessor processor;
-
-    FlowCapableTopologyExporter(final OperationProcessor processor,
-            final InstanceIdentifier<Topology> topology) {
-        this.processor = Preconditions.checkNotNull(processor);
-        this.topology = Preconditions.checkNotNull(topology);
-    }
-
-    @Override
-    public void onNodeRemoved(final NodeRemoved notification) {
-
-        final NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeRef()).getId());
-        final InstanceIdentifier<Node> nodeInstance = toNodeIdentifier(notification.getNodeRef());
-
-        processor.enqueueOperation(new TopologyOperation() {
-            @Override
-            public void applyOperation(ReadWriteTransaction transaction) {
-                    removeAffectedLinks(nodeId, transaction);
-                    transaction.delete(LogicalDatastoreType.OPERATIONAL, nodeInstance);
-            }
-
-            @Override
-            public String toString() {
-                return "onNodeRemoved";
-            }
-        });
-    }
-
-    @Override
-    public void onNodeUpdated(final NodeUpdated notification) {
-        FlowCapableNodeUpdated fcnu = notification.getAugmentation(FlowCapableNodeUpdated.class);
-        if (fcnu != null) {
-            processor.enqueueOperation(new TopologyOperation() {
-                @Override
-                public void applyOperation(final ReadWriteTransaction transaction) {
-                    final Node node = toTopologyNode(toTopologyNodeId(notification.getId()), notification.getNodeRef());
-                    final InstanceIdentifier<Node> path = getNodePath(toTopologyNodeId(notification.getId()));
-                    transaction.merge(LogicalDatastoreType.OPERATIONAL, path, node, true);
-                }
-
-                @Override
-                public String toString() {
-                    return "onNodeUpdated";
-                }
-            });
-        }
-    }
-
-    @Override
-    public void onNodeConnectorRemoved(final NodeConnectorRemoved notification) {
-
-        final InstanceIdentifier<TerminationPoint> tpInstance = toTerminationPointIdentifier(
-                notification.getNodeConnectorRef());
-
-        final InstanceIdentifier<Node> node = tpInstance.firstIdentifierOf(Node.class);
-
-        final TpId tpId = toTerminationPointId(getNodeConnectorKey(
-                notification.getNodeConnectorRef()).getId());
-
-        processor.enqueueOperation(new TopologyOperation() {
-            @Override
-            public void applyOperation(ReadWriteTransaction transaction) {
-                Optional<Node> nodeOptional = Optional.absent();
-                try {
-                    nodeOptional = transaction.read(LogicalDatastoreType.OPERATIONAL, node).checkedGet();
-                } catch (ReadFailedException e) {
-                    LOG.error("Error occured when trying to read NodeConnector ", e);
-                }
-                if (nodeOptional.isPresent()) {
-                    removeAffectedLinks(tpId, transaction);
-                    transaction.delete(LogicalDatastoreType.OPERATIONAL, tpInstance);
-                }
-            }
-
-            @Override
-            public String toString() {
-                return "onNodeConnectorRemoved";
-            }
-        });
-    }
-
-    @Override
-    public void onNodeConnectorUpdated(final NodeConnectorUpdated notification) {
-        final FlowCapableNodeConnectorUpdated fcncu = notification.getAugmentation(
-                FlowCapableNodeConnectorUpdated.class);
-        if (fcncu != null) {
-            processor.enqueueOperation(new TopologyOperation() {
-                @Override
-                public void applyOperation(final ReadWriteTransaction transaction) {
-                    final NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeConnectorRef()).getId());
-                    TerminationPoint point = toTerminationPoint(toTerminationPointId(notification.getId()),
-                            notification.getNodeConnectorRef());
-                    final InstanceIdentifier<TerminationPoint> path = tpPath(nodeId, point.getKey().getTpId());
-                    transaction.merge(LogicalDatastoreType.OPERATIONAL, path, point, true);
-                    if ((fcncu.getState() != null && fcncu.getState().isLinkDown())
-                            || (fcncu.getConfiguration() != null && fcncu.getConfiguration().isPORTDOWN())) {
-                        removeAffectedLinks(point.getTpId(), transaction);
-                    }
-                }
-
-                @Override
-                public String toString() {
-                    return "onNodeConnectorUpdated";
-                }
-            });
-        }
-    }
-
-    @Override
-    public void onLinkDiscovered(final LinkDiscovered notification) {
-        processor.enqueueOperation(new TopologyOperation() {
-            @Override
-            public void applyOperation(final ReadWriteTransaction transaction) {
-                final Link link = toTopologyLink(notification);
-                final InstanceIdentifier<Link> path = linkPath(link);
-                transaction.merge(LogicalDatastoreType.OPERATIONAL, path, link, true);
-            }
-
-            @Override
-            public String toString() {
-                return "onLinkDiscovered";
-            }
-        });
-    }
-
-    @Override
-    public void onLinkOverutilized(final LinkOverutilized notification) {
-        // NOOP
-    }
-
-    @Override
-    public void onLinkRemoved(final LinkRemoved notification) {
-        processor.enqueueOperation(new TopologyOperation() {
-            @Override
-            public void applyOperation(final ReadWriteTransaction transaction) {
-                Optional<Link> linkOptional = Optional.absent();
-                try {
-                    // read that checks if link exists (if we do not do this we might get an exception on delete)
-                    linkOptional = transaction.read(LogicalDatastoreType.OPERATIONAL,
-                            linkPath(toTopologyLink(notification))).checkedGet();
-                } catch (ReadFailedException e) {
-                    LOG.error("Error occured when trying to read Link ", e);
-                }
-                if (linkOptional.isPresent()) {
-                    transaction.delete(LogicalDatastoreType.OPERATIONAL, linkPath(toTopologyLink(notification)));
-                }
-            }
-
-            @Override
-            public String toString() {
-                return "onLinkRemoved";
-            }
-        });
-    }
-
-    @Override
-    public void onLinkUtilizationNormal(final LinkUtilizationNormal notification) {
-        // NOOP
-    }
-
-    private InstanceIdentifier<Node> toNodeIdentifier(final NodeRef ref) {
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey invNodeKey = getNodeKey(ref);
-        NodeKey nodeKey = new NodeKey(toTopologyNodeId(invNodeKey.getId()));
-        return topology.child(Node.class, nodeKey);
-    }
-
-    private InstanceIdentifier<TerminationPoint> toTerminationPointIdentifier(final NodeConnectorRef ref) {
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey invNodeKey = getNodeKey(ref);
-        NodeConnectorKey invNodeConnectorKey = getNodeConnectorKey(ref);
-        return tpPath(toTopologyNodeId(invNodeKey.getId()), toTerminationPointId(invNodeConnectorKey.getId()));
-    }
-
-    private void removeAffectedLinks(final NodeId id, final ReadWriteTransaction transaction) {
-        Optional<Topology> topologyOptional = Optional.absent();
-        try {
-            topologyOptional = transaction.read(LogicalDatastoreType.OPERATIONAL, topology).checkedGet();
-        } catch (ReadFailedException e) {
-            LOG.error("Error reading topology data for topology {}", topology, e);
-        }
-        if (topologyOptional.isPresent()) {
-            removeAffectedLinks(id, topologyOptional, transaction);
-        }
-    }
-
-    private void removeAffectedLinks(final NodeId id, Optional<Topology> topologyOptional, ReadWriteTransaction transaction) {
-        if (!topologyOptional.isPresent()) {
-            return;
-        }
-
-        List<Link> linkList = topologyOptional.get().getLink() != null ?
-                topologyOptional.get().getLink() : Collections.<Link> emptyList();
-        for (Link link : linkList) {
-            if (id.equals(link.getSource().getSourceNode()) ||
-                    id.equals(link.getDestination().getDestNode())) {
-                transaction.delete(LogicalDatastoreType.OPERATIONAL, linkPath(link));
-            }
-        }
-    }
-
-    private void removeAffectedLinks(final TpId id, final ReadWriteTransaction transaction) {
-        Optional<Topology> topologyOptional = Optional.absent();
-        try {
-            topologyOptional = transaction.read(LogicalDatastoreType.OPERATIONAL, topology).checkedGet();
-        } catch (ReadFailedException e) {
-            LOG.error("Error reading topology data for topology {}", topology, e);
-        }
-        if (topologyOptional.isPresent()) {
-            removeAffectedLinks(id, topologyOptional, transaction);
-        }
-    }
-
-    private void removeAffectedLinks(final TpId id, Optional<Topology> topologyOptional, ReadWriteTransaction transaction) {
-        if (!topologyOptional.isPresent()) {
-            return;
-        }
-
-        List<Link> linkList = topologyOptional.get().getLink() != null
-                ? topologyOptional.get().getLink() : Collections.<Link> emptyList();
-        for (Link link : linkList) {
-            if (id.equals(link.getSource().getSourceTp()) ||
-                    id.equals(link.getDestination().getDestTp())) {
-                transaction.delete(LogicalDatastoreType.OPERATIONAL, linkPath(link));
-            }
-        }
-    }
-
-    private InstanceIdentifier<Node> getNodePath(final NodeId nodeId) {
-        return topology.child(Node.class, new NodeKey(nodeId));
-    }
-
-    private InstanceIdentifier<TerminationPoint> tpPath(final NodeId nodeId, final TpId tpId) {
-        NodeKey nodeKey = new NodeKey(nodeId);
-        TerminationPointKey tpKey = new TerminationPointKey(tpId);
-        return topology.child(Node.class, nodeKey).child(TerminationPoint.class, tpKey);
-    }
-
-    private InstanceIdentifier<Link> linkPath(final Link link) {
-        return topology.child(Link.class, link.getKey());
-    }
-}
diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.java
deleted file mode 100644 (file)
index 5560470..0000000
+++ /dev/null
@@ -1,100 +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
- */
-package org.opendaylight.md.controller.topology.manager;
-
-import java.util.concurrent.ExecutionException;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implements AutoCloseable {
-    private final static Logger LOG = LoggerFactory.getLogger(FlowCapableTopologyProvider.class);
-    private ListenerRegistration<NotificationListener> listenerRegistration;
-    private Thread thread;
-
-    /**
-     * Gets called on start of a bundle.
-     *
-     * @param session
-     */
-    @Override
-    public synchronized void onSessionInitiated(final ProviderContext session) {
-        final DataBroker dataBroker = session.getSALService(DataBroker.class);
-        final NotificationProviderService notificationService = session.getSALService(NotificationProviderService.class);
-
-        final String name = "flow:1";
-        final TopologyKey key = new TopologyKey(new TopologyId(name));
-        final InstanceIdentifier<Topology> path = InstanceIdentifier
-                .create(NetworkTopology.class)
-                .child(Topology.class, key);
-
-        final OperationProcessor processor = new OperationProcessor(dataBroker);
-        final FlowCapableTopologyExporter listener = new FlowCapableTopologyExporter(processor, path);
-        this.listenerRegistration = notificationService.registerNotificationListener(listener);
-
-        final ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
-        tx.put(LogicalDatastoreType.OPERATIONAL, path, new TopologyBuilder().setKey(key).build(), true);
-        try {
-            tx.submit().get();
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Initial topology export failed, continuing anyway", e);
-        }
-
-        thread = new Thread(processor);
-        thread.setDaemon(true);
-        thread.setName("FlowCapableTopologyExporter-" + name);
-        thread.start();
-    }
-
-    @Override
-    public synchronized void close() throws InterruptedException {
-        LOG.info("FlowCapableTopologyProvider stopped.");
-        if (this.listenerRegistration != null) {
-            try {
-                this.listenerRegistration.close();
-            } catch (Exception e) {
-                LOG.error("Failed to close listener registration", e);
-            }
-            listenerRegistration = null;
-        }
-        if (thread != null) {
-            thread.interrupt();
-            thread.join();
-            thread = null;
-        }
-    }
-
-    /**
-     * Gets called during stop bundle
-     *
-     * @param context The execution context of the bundle being stopped.
-     */
-    @Override
-    public void stopImpl(final BundleContext context) {
-        try {
-            this.close();
-        } catch (InterruptedException e) {
-            LOG.error("Failed to stop provider", e);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/OperationProcessor.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/OperationProcessor.java
deleted file mode 100644 (file)
index c009433..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * 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.md.controller.topology.manager;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-final class OperationProcessor implements AutoCloseable, Runnable, TransactionChainListener {
-    private static final Logger LOG = LoggerFactory.getLogger(OperationProcessor.class);
-    private static final int MAX_TRANSACTION_OPERATIONS = 100;
-    private static final int OPERATION_QUEUE_DEPTH = 500;
-
-    private final BlockingQueue<TopologyOperation> queue = new LinkedBlockingQueue<>(OPERATION_QUEUE_DEPTH);
-    private final DataBroker dataBroker;
-    private BindingTransactionChain transactionChain;
-    private volatile boolean finishing = false;
-
-    OperationProcessor(final DataBroker dataBroker) {
-        this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        transactionChain = this.dataBroker.createTransactionChain(this);
-    }
-
-    void enqueueOperation(final TopologyOperation task) {
-        try {
-            queue.put(task);
-        } catch (InterruptedException e) {
-            LOG.warn("Interrupted while submitting task {}", task, e);
-        }
-    }
-
-    @Override
-    public void run() {
-            while (!finishing) {
-                try {
-                    TopologyOperation op = queue.take();
-
-                    LOG.debug("New {} operation available, starting transaction", op);
-
-                    final ReadWriteTransaction tx = transactionChain.newReadWriteTransaction();
-
-                    int ops = 0;
-                    do {
-                        op.applyOperation(tx);
-
-                        ops++;
-                        if (ops < MAX_TRANSACTION_OPERATIONS) {
-                            op = queue.poll();
-                        } else {
-                            op = null;
-                        }
-
-                        LOG.debug("Next operation {}", op);
-                    } while (op != null);
-
-                    LOG.debug("Processed {} operations, submitting transaction", ops);
-
-                    try {
-                        tx.submit().checkedGet();
-                    } catch (final TransactionCommitFailedException e) {
-                        LOG.warn("Stat DataStoreOperation unexpected State!", e);
-                        transactionChain.close();
-                        transactionChain = dataBroker.createTransactionChain(this);
-                        cleanDataStoreOperQueue();
-                    }
-
-                } catch (final IllegalStateException e) {
-                    LOG.warn("Stat DataStoreOperation unexpected State!", e);
-                    transactionChain.close();
-                    transactionChain = dataBroker.createTransactionChain(this);
-                    cleanDataStoreOperQueue();
-                } catch (final InterruptedException e) {
-                    LOG.warn("Stat Manager DS Operation thread interupted!", e);
-                    finishing = true;
-                } catch (final Exception e) {
-                    LOG.warn("Stat DataStore Operation executor fail!", e);
-                }
-            }
-        // Drain all events, making sure any blocked threads are unblocked
-        cleanDataStoreOperQueue();
-    }
-
-    private void cleanDataStoreOperQueue() {
-        while (!queue.isEmpty()) {
-            queue.poll();
-        }
-    }
-
-    @Override
-    public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction, Throwable cause) {
-        LOG.error("Failed to export Topology manager operations, Transaction {} failed.", transaction.getIdentifier(), cause);
-        transactionChain.close();
-        transactionChain = dataBroker.createTransactionChain(this);
-        cleanDataStoreOperQueue();
-    }
-
-    @Override
-    public void onTransactionChainSuccessful(TransactionChain<?, ?> chain) {
-        //NOOP
-    }
-
-    @Override
-    public void close() throws Exception {
-        if (transactionChain != null) {
-            transactionChain.close();
-        }
-
-    }
-}
diff --git a/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/TopologyOperation.java b/opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/TopologyOperation.java
deleted file mode 100644 (file)
index bbb8a74..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.md.controller.topology.manager;
-
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-
-/**
- * Internal interface for submitted operations. Implementations of this
- * interface are enqueued and batched into data store transactions.
- */
-interface TopologyOperation {
-    /**
-     * Execute the operation on top of the transaction.
-     *
-     * @param transaction Datastore transaction
-     */
-    void applyOperation(ReadWriteTransaction transaction);
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/topology-manager/src/test/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporterTest.java b/opendaylight/md-sal/topology-manager/src/test/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporterTest.java
deleted file mode 100644 (file)
index e1d643c..0000000
+++ /dev/null
@@ -1,729 +0,0 @@
-/*
- * Copyright (c) 2014 Brocade Communications 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.md.controller.topology.manager;
-
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.SettableFuture;
-import com.google.common.util.concurrent.Uninterruptibles;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.InOrder;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscoveredBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.StateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdatedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.topology.inventory.rev131030.InventoryNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.Destination;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.DestinationBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.Source;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.link.attributes.SourceBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.LinkKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.atLeast;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
-public class FlowCapableTopologyExporterTest {
-
-    @Mock
-    private DataBroker mockDataBroker;
-
-    @Mock
-    private BindingTransactionChain mockTxChain;
-
-    private OperationProcessor processor;
-
-    private FlowCapableTopologyExporter exporter;
-
-    private InstanceIdentifier<Topology> topologyIID;
-
-    private final ExecutorService executor = Executors.newFixedThreadPool(1);
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-
-        doReturn(mockTxChain).when(mockDataBroker)
-                .createTransactionChain(any(TransactionChainListener.class));
-
-        processor = new OperationProcessor(mockDataBroker);
-
-        topologyIID = InstanceIdentifier.create(NetworkTopology.class)
-                .child(Topology.class, new TopologyKey(new TopologyId("test")));
-        exporter = new FlowCapableTopologyExporter(processor, topologyIID);
-
-        executor.execute(processor);
-    }
-
-    @After
-    public void tearDown() {
-        executor.shutdownNow();
-    }
-
-    @SuppressWarnings({ "rawtypes" })
-    @Test
-    public void testOnNodeRemoved() {
-
-        NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
-        InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
-        Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                                                                nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
-        InstanceIdentifier<?> invNodeID = InstanceIdentifier.create(Nodes.class).child(
-                org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
-                nodeKey);
-
-        List<Link> linkList = Arrays.asList(
-                newLink("link1", newSourceNode("node1"), newDestNode("dest")),
-                newLink("link2", newSourceNode("source"), newDestNode("node1")),
-                newLink("link2", newSourceNode("source2"), newDestNode("dest2")));
-        final Topology topology = new TopologyBuilder().setLink(linkList).build();
-
-        InstanceIdentifier[] expDeletedIIDs = {
-                topologyIID.child(Link.class, linkList.get(0).getKey()),
-                topologyIID.child(Link.class, linkList.get(1).getKey()),
-                topologyIID.child(Node.class, new NodeKey(new NodeId("node1")))
-            };
-
-        SettableFuture<Optional<Topology>> readFuture = SettableFuture.create();
-        readFuture.set(Optional.of(topology));
-        ReadWriteTransaction mockTx1 = mock(ReadWriteTransaction.class);
-        doReturn(Futures.makeChecked(readFuture, ReadFailedException.MAPPER)).when(mockTx1)
-                .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
-
-        SettableFuture<Optional<Node>> readFutureNode = SettableFuture.create();
-        readFutureNode.set(Optional.of(topoNode));
-        doReturn(Futures.makeChecked(readFutureNode, ReadFailedException.MAPPER)).when(mockTx1)
-                .read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
-
-        CountDownLatch submitLatch1 = setupStubbedSubmit(mockTx1);
-
-        int expDeleteCalls = expDeletedIIDs.length;
-        CountDownLatch deleteLatch = new CountDownLatch(expDeleteCalls);
-        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
-                ArgumentCaptor.forClass(InstanceIdentifier.class);
-        setupStubbedDeletes(mockTx1, deletedLinkIDs, deleteLatch);
-
-        doReturn(mockTx1).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeRemoved(new NodeRemovedBuilder().setNodeRef(new NodeRef(invNodeID)).build());
-
-        waitForSubmit(submitLatch1);
-
-        setReadFutureAsync(topology, readFuture);
-
-        waitForDeletes(expDeleteCalls, deleteLatch);
-
-        assertDeletedIDs(expDeletedIIDs, deletedLinkIDs);
-
-        verifyMockTx(mockTx1);
-    }
-
-    @SuppressWarnings({ "rawtypes" })
-    @Test
-    public void testOnNodeRemovedWithNoTopology() {
-
-        NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
-        InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
-        Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
-        InstanceIdentifier<?> invNodeID = InstanceIdentifier.create(Nodes.class).child(
-                org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
-                nodeKey);
-
-        InstanceIdentifier[] expDeletedIIDs = {
-                topologyIID.child(Node.class, new NodeKey(new NodeId("node1")))
-            };
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(mockTx)
-                .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
-        CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
-
-        SettableFuture<Optional<Node>> readFutureNode = SettableFuture.create();
-        readFutureNode.set(Optional.of(topoNode));
-        doReturn(Futures.makeChecked(readFutureNode, ReadFailedException.MAPPER)).when(mockTx)
-                .read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
-
-        CountDownLatch deleteLatch = new CountDownLatch(1);
-        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
-                ArgumentCaptor.forClass(InstanceIdentifier.class);
-        setupStubbedDeletes(mockTx, deletedLinkIDs, deleteLatch);
-
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeRemoved(new NodeRemovedBuilder().setNodeRef(new NodeRef(invNodeID)).build());
-
-        waitForSubmit(submitLatch);
-
-        waitForDeletes(1, deleteLatch);
-
-        assertDeletedIDs(expDeletedIIDs, deletedLinkIDs);
-    }
-
-    @SuppressWarnings("rawtypes")
-    @Test
-    public void testOnNodeConnectorRemoved() {
-
-        NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
-        TerminationPointKey terminationPointKey = new TerminationPointKey(new TpId("tp1"));
-
-        InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
-        Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                                                                  nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey ncKey =
-                newInvNodeConnKey(terminationPointKey.getTpId().getValue());
-
-        InstanceIdentifier<?> invNodeConnID = newNodeConnID(nodeKey, ncKey);
-
-        List<Link> linkList = Arrays.asList(
-                newLink("link1", newSourceTp("tp1"), newDestTp("dest")),
-                newLink("link2", newSourceTp("source"), newDestTp("tp1")),
-                newLink("link3", newSourceTp("source2"), newDestTp("dest2")));
-        final Topology topology = new TopologyBuilder().setLink(linkList).build();
-
-        InstanceIdentifier[] expDeletedIIDs = {
-                topologyIID.child(Link.class, linkList.get(0).getKey()),
-                topologyIID.child(Link.class, linkList.get(1).getKey()),
-                topologyIID.child(Node.class, new NodeKey(new NodeId("node1")))
-                        .child(TerminationPoint.class, new TerminationPointKey(new TpId("tp1")))
-            };
-
-        final SettableFuture<Optional<Topology>> readFuture = SettableFuture.create();
-        readFuture.set(Optional.of(topology));
-        ReadWriteTransaction mockTx1 = mock(ReadWriteTransaction.class);
-        doReturn(Futures.makeChecked(readFuture, ReadFailedException.MAPPER)).when(mockTx1)
-                .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
-
-        SettableFuture<Optional<Node>> readFutureNode = SettableFuture.create();
-        readFutureNode.set(Optional.of(topoNode));
-        doReturn(Futures.makeChecked(readFutureNode, ReadFailedException.MAPPER)).when(mockTx1)
-                .read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
-
-        CountDownLatch submitLatch1 = setupStubbedSubmit(mockTx1);
-
-        int expDeleteCalls = expDeletedIIDs.length;
-        CountDownLatch deleteLatch = new CountDownLatch(expDeleteCalls);
-        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
-                ArgumentCaptor.forClass(InstanceIdentifier.class);
-        setupStubbedDeletes(mockTx1, deletedLinkIDs, deleteLatch);
-
-        doReturn(mockTx1).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeConnectorRemoved(new NodeConnectorRemovedBuilder().setNodeConnectorRef(
-                new NodeConnectorRef(invNodeConnID)).build());
-
-        waitForSubmit(submitLatch1);
-
-        setReadFutureAsync(topology, readFuture);
-
-        waitForDeletes(expDeleteCalls, deleteLatch);
-
-        assertDeletedIDs(expDeletedIIDs, deletedLinkIDs);
-
-        verifyMockTx(mockTx1);
-    }
-
-    @SuppressWarnings("rawtypes")
-    @Test
-    public void testOnNodeConnectorRemovedWithNoTopology() {
-
-        NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
-        TerminationPointKey terminationPointKey = new TerminationPointKey(new TpId("tp1"));
-
-        InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
-        Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey ncKey =
-                newInvNodeConnKey(terminationPointKey.getTpId().getValue());
-
-        InstanceIdentifier<?> invNodeConnID = newNodeConnID(nodeKey, ncKey);
-
-        InstanceIdentifier[] expDeletedIIDs = {
-                topologyIID.child(Node.class, new NodeKey(new NodeId("node1")))
-                        .child(TerminationPoint.class, new TerminationPointKey(new TpId("tp1")))
-            };
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(mockTx)
-                .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
-        CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
-
-        SettableFuture<Optional<Node>> readFutureNode = SettableFuture.create();
-        readFutureNode.set(Optional.of(topoNode));
-        doReturn(Futures.makeChecked(readFutureNode, ReadFailedException.MAPPER)).when(mockTx)
-                .read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
-
-        CountDownLatch deleteLatch = new CountDownLatch(1);
-        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
-                ArgumentCaptor.forClass(InstanceIdentifier.class);
-        setupStubbedDeletes(mockTx, deletedLinkIDs, deleteLatch);
-
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeConnectorRemoved(new NodeConnectorRemovedBuilder().setNodeConnectorRef(
-                new NodeConnectorRef(invNodeConnID)).build());
-
-        waitForSubmit(submitLatch);
-
-        waitForDeletes(1, deleteLatch);
-
-        assertDeletedIDs(expDeletedIIDs, deletedLinkIDs);
-    }
-
-    @Test
-    public void testOnNodeUpdated() {
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                                                            nodeKey = newInvNodeKey("node1");
-        InstanceIdentifier<?> invNodeID = InstanceIdentifier.create(Nodes.class).child(
-                org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
-                nodeKey);
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeUpdated(new NodeUpdatedBuilder().setNodeRef(new NodeRef(invNodeID))
-                .setId(nodeKey.getId()).addAugmentation(FlowCapableNodeUpdated.class,
-                        new FlowCapableNodeUpdatedBuilder().build()).build());
-
-        waitForSubmit(submitLatch);
-
-        ArgumentCaptor<Node> mergedNode = ArgumentCaptor.forClass(Node.class);
-        NodeId expNodeId = new NodeId("node1");
-        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(Node.class,
-                new NodeKey(expNodeId))), mergedNode.capture(), eq(true));
-        assertEquals("getNodeId", expNodeId, mergedNode.getValue().getNodeId());
-        InventoryNode augmentation = mergedNode.getValue().getAugmentation(InventoryNode.class);
-        assertNotNull("Missing augmentation", augmentation);
-        assertEquals("getInventoryNodeRef", new NodeRef(invNodeID), augmentation.getInventoryNodeRef());
-    }
-
-    @Test
-    public void testOnNodeConnectorUpdated() {
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                                                                 nodeKey = newInvNodeKey("node1");
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey ncKey =
-                newInvNodeConnKey("tp1");
-
-        InstanceIdentifier<?> invNodeConnID = newNodeConnID(nodeKey, ncKey);
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeConnectorUpdated(new NodeConnectorUpdatedBuilder().setNodeConnectorRef(
-                new NodeConnectorRef(invNodeConnID)).setId(ncKey.getId()).addAugmentation(
-                        FlowCapableNodeConnectorUpdated.class,
-                        new FlowCapableNodeConnectorUpdatedBuilder().build()).build());
-
-        waitForSubmit(submitLatch);
-
-        ArgumentCaptor<TerminationPoint> mergedNode = ArgumentCaptor.forClass(TerminationPoint.class);
-        NodeId expNodeId = new NodeId("node1");
-        TpId expTpId = new TpId("tp1");
-        InstanceIdentifier<TerminationPoint> expTpPath = topologyIID.child(
-                Node.class, new NodeKey(expNodeId)).child(TerminationPoint.class,
-                        new TerminationPointKey(expTpId));
-        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(expTpPath),
-                mergedNode.capture(), eq(true));
-        assertEquals("getTpId", expTpId, mergedNode.getValue().getTpId());
-        InventoryNodeConnector augmentation = mergedNode.getValue().getAugmentation(
-                InventoryNodeConnector.class);
-        assertNotNull("Missing augmentation", augmentation);
-        assertEquals("getInventoryNodeConnectorRef", new NodeConnectorRef(invNodeConnID),
-                augmentation.getInventoryNodeConnectorRef());
-    }
-
-    @SuppressWarnings("rawtypes")
-    @Test
-    public void testOnNodeConnectorUpdatedWithLinkStateDown() {
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                                                                 nodeKey = newInvNodeKey("node1");
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey ncKey =
-                newInvNodeConnKey("tp1");
-
-        InstanceIdentifier<?> invNodeConnID = newNodeConnID(nodeKey, ncKey);
-
-        List<Link> linkList = Arrays.asList(newLink("link1", newSourceTp("tp1"), newDestTp("dest")));
-        Topology topology = new TopologyBuilder().setLink(linkList).build();
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        doReturn(Futures.immediateCheckedFuture(Optional.of(topology))).when(mockTx)
-                .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
-        setupStubbedSubmit(mockTx);
-
-        CountDownLatch deleteLatch = new CountDownLatch(1);
-        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
-                ArgumentCaptor.forClass(InstanceIdentifier.class);
-        setupStubbedDeletes(mockTx, deletedLinkIDs, deleteLatch);
-
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeConnectorUpdated(new NodeConnectorUpdatedBuilder().setNodeConnectorRef(
-                new NodeConnectorRef(invNodeConnID)).setId(ncKey.getId()).addAugmentation(
-                        FlowCapableNodeConnectorUpdated.class,
-                        new FlowCapableNodeConnectorUpdatedBuilder().setState(
-                                new StateBuilder().setLinkDown(true).build()).build()).build());
-
-        waitForDeletes(1, deleteLatch);
-
-        InstanceIdentifier<TerminationPoint> expTpPath = topologyIID.child(
-                Node.class, new NodeKey(new NodeId("node1"))).child(TerminationPoint.class,
-                        new TerminationPointKey(new TpId("tp1")));
-
-        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(expTpPath),
-                any(TerminationPoint.class), eq(true));
-
-        assertDeletedIDs(new InstanceIdentifier[]{topologyIID.child(Link.class,
-                linkList.get(0).getKey())}, deletedLinkIDs);
-    }
-
-
-    @SuppressWarnings("rawtypes")
-    @Test
-    public void testOnNodeConnectorUpdatedWithPortDown() {
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                                                                 nodeKey = newInvNodeKey("node1");
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey ncKey =
-                newInvNodeConnKey("tp1");
-
-        InstanceIdentifier<?> invNodeConnID = newNodeConnID(nodeKey, ncKey);
-
-        List<Link> linkList = Arrays.asList(newLink("link1", newSourceTp("tp1"), newDestTp("dest")));
-        Topology topology = new TopologyBuilder().setLink(linkList).build();
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        doReturn(Futures.immediateCheckedFuture(Optional.of(topology))).when(mockTx)
-                .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
-        setupStubbedSubmit(mockTx);
-
-        CountDownLatch deleteLatch = new CountDownLatch(1);
-        ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
-                ArgumentCaptor.forClass(InstanceIdentifier.class);
-        setupStubbedDeletes(mockTx, deletedLinkIDs, deleteLatch);
-
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onNodeConnectorUpdated(new NodeConnectorUpdatedBuilder().setNodeConnectorRef(
-                new NodeConnectorRef(invNodeConnID)).setId(ncKey.getId()).addAugmentation(
-                        FlowCapableNodeConnectorUpdated.class,
-                        new FlowCapableNodeConnectorUpdatedBuilder().setConfiguration(
-                                new PortConfig(true, true, true, true)).build()).build());
-
-        waitForDeletes(1, deleteLatch);
-
-        InstanceIdentifier<TerminationPoint> expTpPath = topologyIID.child(
-                Node.class, new NodeKey(new NodeId("node1"))).child(TerminationPoint.class,
-                        new TerminationPointKey(new TpId("tp1")));
-
-        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(expTpPath),
-                any(TerminationPoint.class), eq(true));
-
-        assertDeletedIDs(new InstanceIdentifier[]{topologyIID.child(Link.class,
-                linkList.get(0).getKey())}, deletedLinkIDs);
-    }
-
-    @Test
-    public void testOnLinkDiscovered() {
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                sourceNodeKey = newInvNodeKey("sourceNode");
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
-                sourceNodeConnKey = newInvNodeConnKey("sourceTP");
-        InstanceIdentifier<?> sourceConnID = newNodeConnID(sourceNodeKey, sourceNodeConnKey);
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                destNodeKey = newInvNodeKey("destNode");
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
-                destNodeConnKey = newInvNodeConnKey("destTP");
-        InstanceIdentifier<?> destConnID = newNodeConnID(destNodeKey, destNodeConnKey);
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-
-        exporter.onLinkDiscovered(new LinkDiscoveredBuilder().setSource(
-                new NodeConnectorRef(sourceConnID)).setDestination(
-                        new NodeConnectorRef(destConnID)).build());
-
-        waitForSubmit(submitLatch);
-
-        ArgumentCaptor<Link> mergedNode = ArgumentCaptor.forClass(Link.class);
-        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(
-                        Link.class, new LinkKey(new LinkId(sourceNodeConnKey.getId())))),
-                mergedNode.capture(), eq(true));
-        assertEquals("Source node ID", "sourceNode",
-                mergedNode.getValue().getSource().getSourceNode().getValue());
-        assertEquals("Dest TP ID", "sourceTP",
-                mergedNode.getValue().getSource().getSourceTp().getValue());
-        assertEquals("Dest node ID", "destNode",
-                mergedNode.getValue().getDestination().getDestNode().getValue());
-        assertEquals("Dest TP ID", "destTP",
-                mergedNode.getValue().getDestination().getDestTp().getValue());
-    }
-
-    @Test
-    public void testOnLinkRemoved() {
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                sourceNodeKey = newInvNodeKey("sourceNode");
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
-                sourceNodeConnKey = newInvNodeConnKey("sourceTP");
-        InstanceIdentifier<?> sourceConnID = newNodeConnID(sourceNodeKey, sourceNodeConnKey);
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                destNodeKey = newInvNodeKey("destNode");
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
-                destNodeConnKey = newInvNodeConnKey("destTP");
-        InstanceIdentifier<?> destConnID = newNodeConnID(destNodeKey, destNodeConnKey);
-
-        Link link = newLink(sourceNodeConnKey.getId().getValue(), newSourceTp(sourceNodeConnKey.getId().getValue()),
-                newDestTp(destNodeConnKey.getId().getValue()));
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-        doReturn(Futures.immediateCheckedFuture(Optional.of(link))).when(mockTx).read(LogicalDatastoreType.OPERATIONAL, topologyIID.child(
-                Link.class, new LinkKey(new LinkId(sourceNodeConnKey.getId()))));
-
-        exporter.onLinkRemoved(new LinkRemovedBuilder().setSource(
-                new NodeConnectorRef(sourceConnID)).setDestination(
-                new NodeConnectorRef(destConnID)).build());
-
-        waitForSubmit(submitLatch);
-
-        verify(mockTx).delete(LogicalDatastoreType.OPERATIONAL, topologyIID.child(
-                Link.class, new LinkKey(new LinkId(sourceNodeConnKey.getId()))));
-    }
-
-    @Test
-    public void testOnLinkRemovedLinkDoesNotExist() {
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                sourceNodeKey = newInvNodeKey("sourceNode");
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
-                sourceNodeConnKey = newInvNodeConnKey("sourceTP");
-        InstanceIdentifier<?> sourceConnID = newNodeConnID(sourceNodeKey, sourceNodeConnKey);
-
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                destNodeKey = newInvNodeKey("destNode");
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey
-                destNodeConnKey = newInvNodeConnKey("destTP");
-        InstanceIdentifier<?> destConnID = newNodeConnID(destNodeKey, destNodeConnKey);
-
-        ReadWriteTransaction mockTx = mock(ReadWriteTransaction.class);
-        CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
-        doReturn(mockTx).when(mockTxChain).newReadWriteTransaction();
-        doReturn(Futures.immediateCheckedFuture(Optional.<Link>absent())).when(mockTx).read(LogicalDatastoreType.OPERATIONAL, topologyIID.child(
-                Link.class, new LinkKey(new LinkId(sourceNodeConnKey.getId()))));
-
-        exporter.onLinkRemoved(new LinkRemovedBuilder().setSource(
-                new NodeConnectorRef(sourceConnID)).setDestination(
-                new NodeConnectorRef(destConnID)).build());
-
-        waitForSubmit(submitLatch);
-
-        verify(mockTx, never()).delete(LogicalDatastoreType.OPERATIONAL, topologyIID.child(
-                Link.class, new LinkKey(new LinkId(sourceNodeConnKey.getId()))));
-    }
-
-    private void verifyMockTx(ReadWriteTransaction mockTx) {
-        InOrder inOrder = inOrder(mockTx);
-        inOrder.verify(mockTx, atLeast(0)).submit();
-        inOrder.verify(mockTx, never()).delete(eq(LogicalDatastoreType.OPERATIONAL),
-              any(InstanceIdentifier.class));
-    }
-
-    @SuppressWarnings("rawtypes")
-    private void assertDeletedIDs(InstanceIdentifier[] expDeletedIIDs,
-            ArgumentCaptor<InstanceIdentifier> deletedLinkIDs) {
-        Set<InstanceIdentifier> actualIIDs = new HashSet<>(deletedLinkIDs.getAllValues());
-        for(InstanceIdentifier id: expDeletedIIDs) {
-            assertTrue("Missing expected deleted IID " + id, actualIIDs.contains(id));
-        }
-    }
-
-    private void setReadFutureAsync(final Topology topology,
-            final SettableFuture<Optional<Topology>> readFuture) {
-        new Thread() {
-            @Override
-            public void run() {
-                Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
-                readFuture.set(Optional.of(topology));
-            }
-
-        }.start();
-    }
-
-    private void waitForSubmit(CountDownLatch latch) {
-        assertEquals("Transaction submitted", true,
-                Uninterruptibles.awaitUninterruptibly(latch, 5, TimeUnit.SECONDS));
-    }
-
-    private void waitForDeletes(int expDeleteCalls, final CountDownLatch latch) {
-        boolean done = Uninterruptibles.awaitUninterruptibly(latch, 5, TimeUnit.SECONDS);
-        if(!done) {
-            fail("Expected " + expDeleteCalls + " delete calls. Actual: " +
-                    (expDeleteCalls - latch.getCount()));
-        }
-    }
-
-    private CountDownLatch setupStubbedSubmit(ReadWriteTransaction mockTx) {
-        final CountDownLatch latch = new CountDownLatch(1);
-        doAnswer(new Answer<CheckedFuture<Void, TransactionCommitFailedException>>() {
-            @Override
-            public CheckedFuture<Void, TransactionCommitFailedException> answer(
-                                                            InvocationOnMock invocation) {
-                latch.countDown();
-                return Futures.immediateCheckedFuture(null);
-            }
-        }).when(mockTx).submit();
-
-        return latch;
-    }
-
-    @SuppressWarnings("rawtypes")
-    private void setupStubbedDeletes(ReadWriteTransaction mockTx,
-            ArgumentCaptor<InstanceIdentifier> deletedLinkIDs, final CountDownLatch latch) {
-        doAnswer(new Answer<Void>() {
-            @Override
-            public Void answer(InvocationOnMock invocation) {
-                latch.countDown();
-                return null;
-            }
-        }).when(mockTx).delete(eq(LogicalDatastoreType.OPERATIONAL), deletedLinkIDs.capture());
-    }
-
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-                                                                        newInvNodeKey(String id) {
-        org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey nodeKey =
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey(
-                        new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.
-                                                                      rev130819.NodeId(id));
-        return nodeKey;
-    }
-
-    private NodeConnectorKey newInvNodeConnKey(String id) {
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.
-                                                               NodeConnectorId(id));
-    }
-
-    private KeyedInstanceIdentifier<NodeConnector, NodeConnectorKey> newNodeConnID(
-            org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey nodeKey,
-            org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey ncKey) {
-        return InstanceIdentifier.create(Nodes.class).child(
-                org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
-                nodeKey).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.
-                        rev130819.node.NodeConnector.class, ncKey);
-    }
-
-    private Link newLink(String id, Source source, Destination dest) {
-        return new LinkBuilder().setLinkId(new LinkId(id))
-                .setSource(source).setDestination(dest).build();
-    }
-
-    private Destination newDestTp(String id) {
-        return new DestinationBuilder().setDestTp(new TpId(id)).build();
-    }
-
-    private Source newSourceTp(String id) {
-        return new SourceBuilder().setSourceTp(new TpId(id)).build();
-    }
-
-    private Destination newDestNode(String id) {
-        return new DestinationBuilder().setDestNode(new NodeId(id)).build();
-    }
-
-    private Source newSourceNode(String id) {
-        return new SourceBuilder().setSourceNode(new NodeId(id)).build();
-    }
-}
index a62af7651eb74e7b009d302af1c577ac9fc121cf..fd07b1ad0490ce1bd5f07ae5e12238e78d46fb8b 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
+import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
 import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlCodecProvider;
 import org.opendaylight.yangtools.yang.data.impl.schema.transform.FromNormalizedNodeSerializer;
 import org.opendaylight.yangtools.yang.data.impl.schema.transform.FromNormalizedNodeSerializerFactory;
@@ -97,6 +98,11 @@ public final class CliOutputFromNormalizedNodeSerializerFactory implements FromN
         return mapEntryNodeSerializer;
     }
 
+    @Override
+    public FromNormalizedNodeSerializer<String, UnkeyedListNode, ListSchemaNode> getUnkeyedListNodeSerializer() {
+        return null;
+    }
+
     @Override
     public FromNormalizedNodeSerializer<String, MapNode, ListSchemaNode> getMapNodeSerializer() {
         return mapNodeSerializer;
index 15f86a788bfc2fe5b3eff1dc2c03ee96c888dbe7..87048dc795a933fc798958a8b35bc68ad0896101 100644 (file)
@@ -14,11 +14,11 @@ import java.util.Map.Entry;
 import org.opendaylight.controller.netconf.cli.writer.OutFormatter;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializer.MapEntryNodeBaseSerializer;
+import org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializer.ListEntryNodeBaseSerializer;
 import org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializer.NodeSerializerDispatcher;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 
-final class MapEntryNodeCliSerializer extends MapEntryNodeBaseSerializer<String> {
+final class MapEntryNodeCliSerializer extends ListEntryNodeBaseSerializer<String,MapEntryNode> {
 
     private final NodeSerializerDispatcher<String> dispatcher;
     private final OutFormatter out;
diff --git a/opendaylight/networkconfiguration/neutron/features/pom.xml b/opendaylight/networkconfiguration/neutron/features/pom.xml
deleted file mode 100644 (file)
index cd7dce5..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<?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.5.0-SNAPSHOT</version>
-    <relativePath>../../opendaylight/commons/opendaylight</relativePath>
-  </parent>
-  <artifactId>features-neutron</artifactId>
-  <version>${networkconfig.neutron.version}</version>
-  <packaging>jar</packaging>
-
-  <properties>
-    <features.file>features.xml</features.file>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.aaa</groupId>
-      <artifactId>features-aaa</artifactId>
-      <version>${aaa.version}</version>
-      <classifier>features</classifier>
-      <type>xml</type>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.moxy</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-net</groupId>
-      <artifactId>commons-net</artifactId>
-    </dependency>
-    <!-- test to validate features.xml -->
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>features-test</artifactId>
-    </dependency>
-  </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>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <systemPropertyVariables>
-            <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
-            <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
-            <karaf.distro.version>${commons.opendaylight.version}</karaf.distro.version>
-          </systemPropertyVariables>
-          <dependenciesToScan>
-           <dependency>org.opendaylight.yangtools:features-test</dependency>
-          </dependenciesToScan>
-        </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:MD-SAL</url>
-  </scm>
-</project>
diff --git a/opendaylight/networkconfiguration/neutron/features/src/main/resources/features.xml b/opendaylight/networkconfiguration/neutron/features/src/main/resources/features.xml
deleted file mode 100644 (file)
index b244d4d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<features name="odl-neutron-${networkconfig.neutron.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">
-   <repository>mvn:org.opendaylight.aaa/features-aaa/${aaa.version}/xml/features</repository>
-   <feature name='odl-neutron-all' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: API">
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-api</feature>
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-northbound</feature>
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-implementation</feature>
-  </feature>
-  <feature name='odl-neutron-northbound' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: Northbound">
-    <feature version='${aaa.version}'>odl-aaa-authn</feature>
-    <feature>war</feature>
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-api</feature>
-    <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.moxy/${eclipse.persistence.version}</bundle>
-    <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.core/${eclipse.persistence.version}</bundle>
-    <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.antlr/${eclipse.persistence.version}</bundle>
-    <bundle>mvn:org.opendaylight.controller/networkconfig.neutron.northbound/${networkconfig.neutron.northbound.version}</bundle>
-    <bundle>mvn:com.sun.jersey/jersey-core/${jersey.version}</bundle>
-    <bundle>mvn:com.sun.jersey/jersey-server/${jersey.version}</bundle>
-    <bundle>mvn:com.sun.jersey/jersey-servlet/${jersey.version}</bundle>
-    <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
-  </feature>
-
-  <feature name='odl-neutron-api' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: API">
-    <bundle>mvn:org.opendaylight.controller/networkconfig.neutron/${networkconfig.neutron.version}</bundle>
-    <bundle>mvn:commons-net/commons-net/${commons.net.version}</bundle>
-    <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
-  </feature>
-  <feature name='odl-neutron-implementation' version='${networkconfig.neutron.version}' description="OpenDaylight :: Neutron :: Implementation">
-    <feature version='${networkconfig.neutron.version}'>odl-neutron-api</feature>
-    <feature>war</feature>
-    <bundle>mvn:org.opendaylight.controller/networkconfig.neutron.implementation/${networkconfig.neutron.implementation.version}</bundle>
-    <bundle>mvn:org.osgi/org.osgi.core/${osgi.core.version}</bundle>
-  </feature>
-</features>
diff --git a/opendaylight/networkconfiguration/neutron/implementation/pom.xml b/opendaylight/networkconfiguration/neutron/implementation/pom.xml
deleted file mode 100644 (file)
index 9eaebb2..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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.5.0-SNAPSHOT</version>
-    <relativePath>../../../commons/opendaylight</relativePath>
-  </parent>
-  <artifactId>networkconfig.neutron.implementation</artifactId>
-  <version>0.5.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>*</Import-Package>
-            <Bundle-Activator>org.opendaylight.controller.networkconfig.neutron.implementation.Activator</Bundle-Activator>
-          </instructions>
-          <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
-        </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>
-
-  <distributionManagement>
-    <!-- OpenDayLight Released artifact -->
-    <repository>
-      <id>opendaylight-release</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.release}/</url>
-    </repository>
-    <!-- OpenDayLight Snapshot artifact -->
-    <snapshotRepository>
-      <id>opendaylight-snapshot</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.snapshot}/</url>
-    </snapshotRepository>
-    <!-- Site deployment -->
-    <site>
-      <id>website</id>
-      <url>${sitedeploy}</url>
-    </site>
-  </distributionManagement>
-</project>
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/Activator.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/Activator.java
deleted file mode 100644 (file)
index 0fbf933..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.implementation;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolMemberCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityGroupCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class Activator implements BundleActivator {
-    protected static final Logger logger = LoggerFactory
-    .getLogger(Activator.class);
-    private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
-
-    @Override
-    public void start(BundleContext context) throws Exception {
-        NeutronRouterInterface neutronRouterInterface = new NeutronRouterInterface();
-        ServiceRegistration<INeutronRouterCRUD> neutronRouterInterfaceRegistration = context.registerService(INeutronRouterCRUD.class, neutronRouterInterface, null);
-        if(neutronRouterInterfaceRegistration != null) {
-            registrations.add(neutronRouterInterfaceRegistration);
-        }
-        NeutronPortInterface neutronPortInterface = new NeutronPortInterface();
-        ServiceRegistration<INeutronPortCRUD> neutronPortInterfaceRegistration = context.registerService(INeutronPortCRUD.class, neutronPortInterface, null);
-        if(neutronPortInterfaceRegistration != null) {
-            registrations.add(neutronPortInterfaceRegistration);
-        }
-
-        NeutronSubnetInterface neutronSubnetInterface = new NeutronSubnetInterface();
-        ServiceRegistration<INeutronSubnetCRUD> neutronSubnetInterfaceRegistration = context.registerService(INeutronSubnetCRUD.class, neutronSubnetInterface, null);
-        if(neutronSubnetInterfaceRegistration != null) {
-            registrations.add(neutronSubnetInterfaceRegistration);
-        }
-
-        NeutronNetworkInterface neutronNetworkInterface = new NeutronNetworkInterface();
-        ServiceRegistration<INeutronNetworkCRUD> neutronNetworkInterfaceRegistration = context.registerService(INeutronNetworkCRUD.class, neutronNetworkInterface, null);
-        if(neutronNetworkInterfaceRegistration != null) {
-            registrations.add(neutronNetworkInterfaceRegistration);
-        }
-
-        NeutronSecurityGroupInterface neutronSecurityGroupInterface = new NeutronSecurityGroupInterface();
-        ServiceRegistration<INeutronSecurityGroupCRUD> neutronSecurityGroupInterfaceRegistration = context.registerService(INeutronSecurityGroupCRUD.class, neutronSecurityGroupInterface, null);
-        if(neutronSecurityGroupInterfaceRegistration != null) {
-            registrations.add(neutronSecurityGroupInterfaceRegistration);
-        }
-
-        NeutronSecurityRuleInterface neutronSecurityRuleInterface = new NeutronSecurityRuleInterface();
-        ServiceRegistration<INeutronSecurityRuleCRUD> neutronSecurityRuleInterfaceRegistration = context.registerService(INeutronSecurityRuleCRUD.class, neutronSecurityRuleInterface, null);
-        if(neutronSecurityRuleInterfaceRegistration != null) {
-            registrations.add(neutronSecurityRuleInterfaceRegistration);
-        }
-
-        NeutronFirewallInterface neutronFirewallInterface = new NeutronFirewallInterface();
-        ServiceRegistration<INeutronFirewallCRUD> neutronFirewallInterfaceRegistration = context.registerService(INeutronFirewallCRUD.class, neutronFirewallInterface, null);
-        if(neutronFirewallInterfaceRegistration != null) {
-            registrations.add(neutronFirewallInterfaceRegistration);
-        }
-
-        NeutronFirewallPolicyInterface neutronFirewallPolicyInterface = new NeutronFirewallPolicyInterface();
-        ServiceRegistration<INeutronFirewallPolicyCRUD> neutronFirewallPolicyInterfaceRegistration = context.registerService(INeutronFirewallPolicyCRUD.class, neutronFirewallPolicyInterface, null);
-        if(neutronFirewallPolicyInterfaceRegistration != null) {
-            registrations.add(neutronFirewallPolicyInterfaceRegistration);
-        }
-
-        NeutronFirewallRuleInterface neutronFirewallRuleInterface = new NeutronFirewallRuleInterface();
-        ServiceRegistration<INeutronFirewallRuleCRUD> neutronFirewallRuleInterfaceRegistration = context.registerService(INeutronFirewallRuleCRUD.class, neutronFirewallRuleInterface, null);
-        if(neutronFirewallRuleInterfaceRegistration != null) {
-            registrations.add(neutronFirewallRuleInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerInterface neutronLoadBalancerInterface = new NeutronLoadBalancerInterface();
-        ServiceRegistration<INeutronLoadBalancerCRUD> neutronLoadBalancerInterfaceRegistration = context.registerService(INeutronLoadBalancerCRUD.class, neutronLoadBalancerInterface, null);
-        if(neutronFirewallInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerPoolInterface neutronLoadBalancerPoolInterface = new NeutronLoadBalancerPoolInterface();
-        ServiceRegistration<INeutronLoadBalancerPoolCRUD> neutronLoadBalancerPoolInterfaceRegistration = context.registerService(INeutronLoadBalancerPoolCRUD.class, neutronLoadBalancerPoolInterface, null);
-        if(neutronLoadBalancerPoolInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerPoolInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerListenerInterface neutronLoadBalancerListenerInterface = new NeutronLoadBalancerListenerInterface();
-        ServiceRegistration<INeutronLoadBalancerListenerCRUD> neutronLoadBalancerListenerInterfaceRegistration = context.registerService(INeutronLoadBalancerListenerCRUD.class, neutronLoadBalancerListenerInterface, null);
-        if(neutronLoadBalancerListenerInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerListenerInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerHealthMonitorInterface neutronLoadBalancerHealthMonitorInterface = new NeutronLoadBalancerHealthMonitorInterface();
-        ServiceRegistration<INeutronLoadBalancerHealthMonitorCRUD> neutronLoadBalancerHealthMonitorInterfaceRegistration = context.registerService(INeutronLoadBalancerHealthMonitorCRUD.class, neutronLoadBalancerHealthMonitorInterface, null);
-        if(neutronLoadBalancerHealthMonitorInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerHealthMonitorInterfaceRegistration);
-        }
-
-        NeutronLoadBalancerPoolMemberInterface neutronLoadBalancerPoolMemberInterface = new NeutronLoadBalancerPoolMemberInterface();
-        ServiceRegistration<INeutronLoadBalancerPoolMemberCRUD> neutronLoadBalancerPoolMemberInterfaceRegistration = context.registerService(INeutronLoadBalancerPoolMemberCRUD.class, neutronLoadBalancerPoolMemberInterface, null);
-        if(neutronLoadBalancerPoolMemberInterfaceRegistration != null) {
-            registrations.add(neutronLoadBalancerPoolMemberInterfaceRegistration);
-        }
-
-    }
-
-    @Override
-    public void stop(BundleContext context) throws Exception {
-       for(ServiceRegistration registration : registrations) {
-           if(registration != null) {
-               registration.unregister();
-           }
-       }
-
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallInterface.java
deleted file mode 100644 (file)
index 421f850..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewall;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronFirewallInterface implements INeutronFirewallCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFirewallInterface.class);
-
-    private ConcurrentMap<String, NeutronFirewall> firewallDB  = new ConcurrentHashMap<String, NeutronFirewall>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronFirewallExists(String uuid) {
-        return firewallDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFirewall getNeutronFirewall(String uuid) {
-        if (!neutronFirewallExists(uuid)) {
-            logger.debug("No Firewall Have Been Defined");
-            return null;
-        }
-        return firewallDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFirewall> getAllNeutronFirewalls() {
-        Set<NeutronFirewall> allFirewalls = new HashSet<NeutronFirewall>();
-        for (Entry<String, NeutronFirewall> entry : firewallDB.entrySet()) {
-            NeutronFirewall firewall = entry.getValue();
-            allFirewalls.add(firewall);
-        }
-        logger.debug("Exiting getFirewalls, Found {} OpenStackFirewall", allFirewalls.size());
-        List<NeutronFirewall> ans = new ArrayList<NeutronFirewall>();
-        ans.addAll(allFirewalls);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronFirewall(NeutronFirewall input) {
-        if (neutronFirewallExists(input.getFirewallUUID())) {
-            return false;
-        }
-        firewallDB.putIfAbsent(input.getFirewallUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronFirewall(String uuid) {
-        if (!neutronFirewallExists(uuid)) {
-            return false;
-        }
-        firewallDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronFirewall(String uuid, NeutronFirewall delta) {
-        if (!neutronFirewallExists(uuid)) {
-            return false;
-        }
-        NeutronFirewall target = firewallDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronFirewallInUse(String firewallUUID) {
-        return !neutronFirewallExists(firewallUUID);
-    }
-
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallPolicyInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallPolicyInterface.java
deleted file mode 100644 (file)
index 886d7fd..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallPolicy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronFirewallPolicyInterface implements INeutronFirewallPolicyCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFirewallPolicyInterface.class);
-
-    private ConcurrentMap<String, NeutronFirewallPolicy> firewallPolicyDB  = new ConcurrentHashMap<String, NeutronFirewallPolicy>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronFirewallPolicyExists(String uuid) {
-        return firewallPolicyDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFirewallPolicy getNeutronFirewallPolicy(String uuid) {
-        if (!neutronFirewallPolicyExists(uuid)) {
-            logger.debug("No Firewall Rule Have Been Defined");
-            return null;
-        }
-        return firewallPolicyDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFirewallPolicy> getAllNeutronFirewallPolicies() {
-        Set<NeutronFirewallPolicy> allFirewallPolicies = new HashSet<NeutronFirewallPolicy>();
-        for (Entry<String, NeutronFirewallPolicy> entry : firewallPolicyDB.entrySet()) {
-            NeutronFirewallPolicy firewallPolicy = entry.getValue();
-            allFirewallPolicies.add(firewallPolicy);
-        }
-        logger.debug("Exiting getFirewallPolicies, Found {} OpenStackFirewallPolicy", allFirewallPolicies.size());
-        List<NeutronFirewallPolicy> ans = new ArrayList<NeutronFirewallPolicy>();
-        ans.addAll(allFirewallPolicies);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronFirewallPolicy(NeutronFirewallPolicy input) {
-        if (neutronFirewallPolicyExists(input.getFirewallPolicyUUID())) {
-            return false;
-        }
-        firewallPolicyDB.putIfAbsent(input.getFirewallPolicyUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronFirewallPolicy(String uuid) {
-        if (!neutronFirewallPolicyExists(uuid)) {
-            return false;
-        }
-        firewallPolicyDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronFirewallPolicy(String uuid, NeutronFirewallPolicy delta) {
-        if (!neutronFirewallPolicyExists(uuid)) {
-            return false;
-        }
-        NeutronFirewallPolicy target = firewallPolicyDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronFirewallPolicyInUse(String firewallPolicyUUID) {
-        return !neutronFirewallPolicyExists(firewallPolicyUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallRuleInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFirewallRuleInterface.java
deleted file mode 100644 (file)
index cd0f39a..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronFirewallRuleInterface implements INeutronFirewallRuleCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFirewallRuleInterface.class);
-
-    private ConcurrentMap<String, NeutronFirewallRule> firewallRuleDB = new ConcurrentHashMap<String, NeutronFirewallRule>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronFirewallRuleExists(String uuid) {
-        return firewallRuleDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFirewallRule getNeutronFirewallRule(String uuid) {
-        if (!neutronFirewallRuleExists(uuid)) {
-            logger.debug("No Firewall Rule Have Been Defined");
-            return null;
-        }
-        return firewallRuleDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFirewallRule> getAllNeutronFirewallRules() {
-        Set<NeutronFirewallRule> allFirewallRules = new HashSet<NeutronFirewallRule>();
-        for (Entry<String, NeutronFirewallRule> entry : firewallRuleDB.entrySet()) {
-            NeutronFirewallRule firewallRule = entry.getValue();
-            allFirewallRules.add(firewallRule);
-        }
-        logger.debug("Exiting getFirewallRules, Found {} OpenStackFirewallRule", allFirewallRules.size());
-        List<NeutronFirewallRule> ans = new ArrayList<NeutronFirewallRule>();
-        ans.addAll(allFirewallRules);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronFirewallRule(NeutronFirewallRule input) {
-        if (neutronFirewallRuleExists(input.getFirewallRuleUUID())) {
-            return false;
-        }
-        firewallRuleDB.putIfAbsent(input.getFirewallRuleUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronFirewallRule(String uuid) {
-        if (!neutronFirewallRuleExists(uuid)) {
-            return false;
-        }
-        firewallRuleDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronFirewallRule(String uuid, NeutronFirewallRule delta) {
-        if (!neutronFirewallRuleExists(uuid)) {
-            return false;
-        }
-        NeutronFirewallRule target = firewallRuleDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronFirewallRuleInUse(String firewallRuleUUID) {
-        return !neutronFirewallRuleExists(firewallRuleUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFloatingIPInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronFloatingIPInterface.java
deleted file mode 100644 (file)
index 51824d6..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronFloatingIPInterface implements INeutronFloatingIPCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronFloatingIPInterface.class);
-
-    private ConcurrentMap<String, NeutronFloatingIP> floatingIPDB  = new ConcurrentHashMap<String, NeutronFloatingIP>();
-
-    // this method uses reflection to update an object from it's delta.
-
-    @SuppressWarnings("unused")
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    // IfNBFloatingIPCRUD interface methods
-
-    @Override
-    public boolean floatingIPExists(String uuid) {
-        return floatingIPDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronFloatingIP getFloatingIP(String uuid) {
-        if (!floatingIPExists(uuid)) {
-            return null;
-        }
-        return floatingIPDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronFloatingIP> getAllFloatingIPs() {
-        Set<NeutronFloatingIP> allIPs = new HashSet<NeutronFloatingIP>();
-        for (Entry<String, NeutronFloatingIP> entry : floatingIPDB.entrySet()) {
-            NeutronFloatingIP floatingip = entry.getValue();
-            allIPs.add(floatingip);
-        }
-        logger.debug("Exiting getAllFloatingIPs, Found {} FloatingIPs", allIPs.size());
-        List<NeutronFloatingIP> ans = new ArrayList<NeutronFloatingIP>();
-        ans.addAll(allIPs);
-        return ans;
-    }
-
-    @Override
-    public boolean addFloatingIP(NeutronFloatingIP input) {
-        INeutronNetworkCRUD networkCRUD = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-        INeutronSubnetCRUD subnetCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-
-        if (floatingIPExists(input.getID())) {
-            return false;
-        }
-        //if floating_ip_address isn't there, allocate from the subnet pool
-        NeutronSubnet subnet = subnetCRUD.getSubnet(networkCRUD.getNetwork(input.getFloatingNetworkUUID()).getSubnets().get(0));
-        if (input.getFloatingIPAddress() == null) {
-            input.setFloatingIPAddress(subnet.getLowAddr());
-        }
-        subnet.allocateIP(input.getFloatingIPAddress());
-
-        //if port_id is there, bind port to this floating ip
-        if (input.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(input.getPortUUID());
-            port.addFloatingIP(input.getFixedIPAddress(), input);
-        }
-
-        floatingIPDB.putIfAbsent(input.getID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeFloatingIP(String uuid) {
-        INeutronNetworkCRUD networkCRUD = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-        INeutronSubnetCRUD subnetCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-
-        if (!floatingIPExists(uuid)) {
-            return false;
-        }
-        NeutronFloatingIP floatIP = getFloatingIP(uuid);
-        //if floating_ip_address isn't there, allocate from the subnet pool
-        NeutronSubnet subnet = subnetCRUD.getSubnet(networkCRUD.getNetwork(floatIP.getFloatingNetworkUUID()).getSubnets().get(0));
-        subnet.releaseIP(floatIP.getFloatingIPAddress());
-        if (floatIP.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(floatIP.getPortUUID());
-            port.removeFloatingIP(floatIP.getFixedIPAddress());
-        }
-        floatingIPDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateFloatingIP(String uuid, NeutronFloatingIP delta) {
-        INeutronPortCRUD portCRUD = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-
-        if (!floatingIPExists(uuid)) {
-            return false;
-        }
-        NeutronFloatingIP target = floatingIPDB.get(uuid);
-        if (target.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(target.getPortUUID());
-            port.removeFloatingIP(target.getFixedIPAddress());
-        }
-
-        //if port_id is there, bind port to this floating ip
-        if (delta.getPortUUID() != null) {
-            NeutronPort port = portCRUD.getPort(delta.getPortUUID());
-            port.addFloatingIP(delta.getFixedIPAddress(), delta);
-        }
-
-        target.setPortUUID(delta.getPortUUID());
-        target.setFixedIPAddress(delta.getFixedIPAddress());
-        return true;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerHealthMonitorInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerHealthMonitorInterface.java
deleted file mode 100644 (file)
index ecf3994..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerHealthMonitor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerHealthMonitorInterface implements INeutronLoadBalancerHealthMonitorCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerHealthMonitorInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerHealthMonitor> loadBalancerHealthMonitorDB = new ConcurrentHashMap<String, NeutronLoadBalancerHealthMonitor>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerHealthMonitorExists(String uuid) {
-        return loadBalancerHealthMonitorDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerHealthMonitor getNeutronLoadBalancerHealthMonitor(String uuid) {
-        if (!neutronLoadBalancerHealthMonitorExists(uuid)) {
-            logger.debug("No LoadBalancerHealthMonitor has Been Defined");
-            return null;
-        }
-        return loadBalancerHealthMonitorDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerHealthMonitor> getAllNeutronLoadBalancerHealthMonitors() {
-        Set<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = new HashSet<NeutronLoadBalancerHealthMonitor>();
-        for (Entry<String, NeutronLoadBalancerHealthMonitor> entry : loadBalancerHealthMonitorDB.entrySet()) {
-            NeutronLoadBalancerHealthMonitor loadBalancerHealthMonitor = entry.getValue();
-            allLoadBalancerHealthMonitors.add(loadBalancerHealthMonitor);
-        }
-        logger.debug("Exiting getLoadBalancerHealthMonitors, Found {} OpenStackLoadBalancerHealthMonitor", allLoadBalancerHealthMonitors.size());
-        List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<NeutronLoadBalancerHealthMonitor>();
-        ans.addAll(allLoadBalancerHealthMonitors);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerHealthMonitor(NeutronLoadBalancerHealthMonitor input) {
-        if (neutronLoadBalancerHealthMonitorExists(input.getLoadBalancerHealthMonitorID())) {
-            return false;
-        }
-        loadBalancerHealthMonitorDB.putIfAbsent(input.getLoadBalancerHealthMonitorID(), input);
-        //TODO: add code to find INeutronLoadBalancerHealthMonitorAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerHealthMonitor(String uuid) {
-        if (!neutronLoadBalancerHealthMonitorExists(uuid)) {
-            return false;
-        }
-        loadBalancerHealthMonitorDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerHealthMonitorAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerHealthMonitor(String uuid, NeutronLoadBalancerHealthMonitor delta) {
-        if (!neutronLoadBalancerHealthMonitorExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerHealthMonitor target = loadBalancerHealthMonitorDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerHealthMonitorInUse(String loadBalancerHealthMonitorUUID) {
-        return !neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorUUID);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerInterface.java
deleted file mode 100644 (file)
index 472de90..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerInterface implements INeutronLoadBalancerCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancer> loadBalancerDB  = new ConcurrentHashMap<String, NeutronLoadBalancer>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerExists(String uuid) {
-        return loadBalancerDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancer getNeutronLoadBalancer(String uuid) {
-        if (!neutronLoadBalancerExists(uuid)) {
-            logger.debug("No LoadBalancer Have Been Defined");
-            return null;
-        }
-        return loadBalancerDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancer> getAllNeutronLoadBalancers() {
-        Set<NeutronLoadBalancer> allLoadBalancers = new HashSet<NeutronLoadBalancer>();
-        for (Entry<String, NeutronLoadBalancer> entry : loadBalancerDB.entrySet()) {
-            NeutronLoadBalancer loadBalancer = entry.getValue();
-            allLoadBalancers.add(loadBalancer);
-        }
-        logger.debug("Exiting getLoadBalancers, Found {} OpenStackLoadBalancer", allLoadBalancers.size());
-        List<NeutronLoadBalancer> ans = new ArrayList<NeutronLoadBalancer>();
-        ans.addAll(allLoadBalancers);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancer(NeutronLoadBalancer input) {
-        if (neutronLoadBalancerExists(input.getLoadBalancerID())) {
-            return false;
-        }
-        loadBalancerDB.putIfAbsent(input.getLoadBalancerID(), input);
-        //TODO: add code to find INeutronLoadBalancerAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancer(String uuid) {
-        if (!neutronLoadBalancerExists(uuid)) {
-            return false;
-        }
-        loadBalancerDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancer(String uuid, NeutronLoadBalancer delta) {
-        if (!neutronLoadBalancerExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancer target = loadBalancerDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerInUse(String loadBalancerUUID) {
-        return !neutronLoadBalancerExists(loadBalancerUUID);
-    }
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerListenerInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerListenerInterface.java
deleted file mode 100644 (file)
index 6acc06d..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerListenerInterface implements INeutronLoadBalancerListenerCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerListenerInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerListener> loadBalancerListenerDB  = new ConcurrentHashMap<String, NeutronLoadBalancerListener>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerListenerExists(String uuid) {
-        return loadBalancerListenerDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerListener getNeutronLoadBalancerListener(String uuid) {
-        if (!neutronLoadBalancerListenerExists(uuid)) {
-            logger.debug("No LoadBalancerListener Have Been Defined");
-            return null;
-        }
-        return loadBalancerListenerDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerListener> getAllNeutronLoadBalancerListeners() {
-        Set<NeutronLoadBalancerListener> allLoadBalancerListeners = new HashSet<NeutronLoadBalancerListener>();
-        for (Entry<String, NeutronLoadBalancerListener> entry : loadBalancerListenerDB.entrySet()) {
-            NeutronLoadBalancerListener loadBalancerListener = entry.getValue();
-            allLoadBalancerListeners.add(loadBalancerListener);
-        }
-        logger.debug("Exiting getLoadBalancerListeners, Found {} OpenStackLoadBalancerListener", allLoadBalancerListeners.size());
-        List<NeutronLoadBalancerListener> ans = new ArrayList<NeutronLoadBalancerListener>();
-        ans.addAll(allLoadBalancerListeners);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerListener(NeutronLoadBalancerListener input) {
-        if (neutronLoadBalancerListenerExists(input.getLoadBalancerListenerID())) {
-            return false;
-        }
-        loadBalancerListenerDB.putIfAbsent(input.getLoadBalancerListenerID(), input);
-        //TODO: add code to find INeutronLoadBalancerListenerAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerListener(String uuid) {
-        if (!neutronLoadBalancerListenerExists(uuid)) {
-            return false;
-        }
-        loadBalancerListenerDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerListenerAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerListener(String uuid, NeutronLoadBalancerListener delta) {
-        if (!neutronLoadBalancerListenerExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerListener target = loadBalancerListenerDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerListenerInUse(String loadBalancerListenerUUID) {
-        return !neutronLoadBalancerListenerExists(loadBalancerListenerUUID);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolInterface.java
deleted file mode 100644 (file)
index 03c9cd9..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPool;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerPoolInterface implements INeutronLoadBalancerPoolCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerPoolInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerPool> loadBalancerPoolDB = new ConcurrentHashMap<String, NeutronLoadBalancerPool>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolExists(String uuid) {
-        return loadBalancerPoolDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerPool getNeutronLoadBalancerPool(String uuid) {
-        if (!neutronLoadBalancerPoolExists(uuid)) {
-            logger.debug("No LoadBalancerPool has Been Defined");
-            return null;
-        }
-        return loadBalancerPoolDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerPool> getAllNeutronLoadBalancerPools() {
-        Set<NeutronLoadBalancerPool> allLoadBalancerPools = new HashSet<NeutronLoadBalancerPool>();
-        for (Entry<String, NeutronLoadBalancerPool> entry : loadBalancerPoolDB.entrySet()) {
-            NeutronLoadBalancerPool loadBalancerPool = entry.getValue();
-            allLoadBalancerPools.add(loadBalancerPool);
-        }
-        logger.debug("Exiting getLoadBalancerPools, Found {} OpenStackLoadBalancerPool", allLoadBalancerPools.size());
-        List<NeutronLoadBalancerPool> ans = new ArrayList<NeutronLoadBalancerPool>();
-        ans.addAll(allLoadBalancerPools);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerPool(NeutronLoadBalancerPool input) {
-        if (neutronLoadBalancerPoolExists(input.getLoadBalancerPoolID())) {
-            return false;
-        }
-        loadBalancerPoolDB.putIfAbsent(input.getLoadBalancerPoolID(), input);
-        //TODO: add code to find INeutronLoadBalancerPoolAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerPool(String uuid) {
-        if (!neutronLoadBalancerPoolExists(uuid)) {
-            return false;
-        }
-        loadBalancerPoolDB.remove(uuid);
-        //TODO: add code to find INeutronLoadBalancerPoolAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerPool(String uuid, NeutronLoadBalancerPool delta) {
-        if (!neutronLoadBalancerPoolExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerPool target = loadBalancerPoolDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolInUse(String loadBalancerPoolUUID) {
-        return !neutronLoadBalancerPoolExists(loadBalancerPoolUUID);
-    }
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolMemberInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronLoadBalancerPoolMemberInterface.java
deleted file mode 100644 (file)
index 8ed3a36..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolMemberCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class NeutronLoadBalancerPoolMemberInterface
-        implements INeutronLoadBalancerPoolMemberCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancerPoolMemberInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerPoolMember> loadBalancerPoolMemberDB  = new ConcurrentHashMap<String, NeutronLoadBalancerPoolMember>();
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch(Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolMemberExists(String uuid) {
-        return loadBalancerPoolMemberDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronLoadBalancerPoolMember getNeutronLoadBalancerPoolMember(String uuid) {
-        if (!neutronLoadBalancerPoolMemberExists(uuid)) {
-            logger.debug("No LoadBalancerPoolMember Have Been Defined");
-            return null;
-        }
-        return loadBalancerPoolMemberDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronLoadBalancerPoolMember> getAllNeutronLoadBalancerPoolMembers() {
-        Set<NeutronLoadBalancerPoolMember> allLoadBalancerPoolMembers = new HashSet<NeutronLoadBalancerPoolMember>();
-        for (Map.Entry<String, NeutronLoadBalancerPoolMember> entry : loadBalancerPoolMemberDB.entrySet()) {
-            NeutronLoadBalancerPoolMember loadBalancerPoolMember = entry.getValue();
-            allLoadBalancerPoolMembers.add(loadBalancerPoolMember);
-        }
-        logger.debug("Exiting getLoadBalancerPoolMembers, Found {} OpenStackLoadBalancerPoolMember",
-                allLoadBalancerPoolMembers.size());
-        List<NeutronLoadBalancerPoolMember> ans = new ArrayList<NeutronLoadBalancerPoolMember>();
-        ans.addAll(allLoadBalancerPoolMembers);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronLoadBalancerPoolMember(NeutronLoadBalancerPoolMember input) {
-        if (neutronLoadBalancerPoolMemberExists(input.getPoolMemberID())) {
-            return false;
-        }
-        loadBalancerPoolMemberDB.putIfAbsent(input.getPoolMemberID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronLoadBalancerPoolMember(String uuid) {
-        if (!neutronLoadBalancerPoolMemberExists(uuid)) {
-            return false;
-        }
-        loadBalancerPoolMemberDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronLoadBalancerPoolMember(String uuid, NeutronLoadBalancerPoolMember delta) {
-        if (!neutronLoadBalancerPoolMemberExists(uuid)) {
-            return false;
-        }
-        NeutronLoadBalancerPoolMember target = loadBalancerPoolMemberDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronLoadBalancerPoolMemberInUse(String loadBalancerPoolMemberID) {
-        return !neutronLoadBalancerPoolMemberExists(loadBalancerPoolMemberID);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronNetworkInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronNetworkInterface.java
deleted file mode 100644 (file)
index c9e1549..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronNetworkInterface implements INeutronNetworkCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronNetworkInterface.class);
-    private ConcurrentMap<String, NeutronNetwork> networkDB = new ConcurrentHashMap<String, NeutronNetwork>();
-
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    // IfNBNetworkCRUD methods
-
-    @Override
-    public boolean networkExists(String uuid) {
-        return networkDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronNetwork getNetwork(String uuid) {
-        if (!networkExists(uuid)) {
-            return null;
-        }
-        return networkDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronNetwork> getAllNetworks() {
-        Set<NeutronNetwork> allNetworks = new HashSet<NeutronNetwork>();
-        for (Entry<String, NeutronNetwork> entry : networkDB.entrySet()) {
-            NeutronNetwork network = entry.getValue();
-            allNetworks.add(network);
-        }
-        logger.debug("Exiting getAllNetworks, Found {} OpenStackNetworks", allNetworks.size());
-        List<NeutronNetwork> ans = new ArrayList<NeutronNetwork>();
-        ans.addAll(allNetworks);
-        return ans;
-    }
-
-    @Override
-    public boolean addNetwork(NeutronNetwork input) {
-        if (networkExists(input.getID())) {
-            return false;
-        }
-        networkDB.putIfAbsent(input.getID(), input);
-      //TODO: add code to find INeutronNetworkAware services and call newtorkCreated on them
-        return true;
-    }
-
-    @Override
-    public boolean removeNetwork(String uuid) {
-        if (!networkExists(uuid)) {
-            return false;
-        }
-        networkDB.remove(uuid);
-      //TODO: add code to find INeutronNetworkAware services and call newtorkDeleted on them
-        return true;
-    }
-
-    @Override
-    public boolean updateNetwork(String uuid, NeutronNetwork delta) {
-        if (!networkExists(uuid)) {
-            return false;
-        }
-        NeutronNetwork target = networkDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean networkInUse(String netUUID) {
-        if (!networkExists(netUUID)) {
-            return true;
-        }
-        NeutronNetwork target = networkDB.get(netUUID);
-        if (target.getPortsOnNetwork().size() > 0) {
-            return true;
-        }
-        return false;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java
deleted file mode 100644 (file)
index 5c87800..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronPortInterface implements INeutronPortCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronPortInterface.class);
-    private ConcurrentMap<String, NeutronPort> portDB = new ConcurrentHashMap<String, NeutronPort>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    // IfNBPortCRUD methods
-
-    @Override
-    public boolean portExists(String uuid) {
-        return portDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronPort getPort(String uuid) {
-        if (!portExists(uuid)) {
-            return null;
-        }
-        return portDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronPort> getAllPorts() {
-        Set<NeutronPort> allPorts = new HashSet<NeutronPort>();
-        for (Entry<String, NeutronPort> entry : portDB.entrySet()) {
-            NeutronPort port = entry.getValue();
-            allPorts.add(port);
-        }
-        logger.debug("Exiting getAllPorts, Found {} OpenStackPorts", allPorts.size());
-        List<NeutronPort> ans = new ArrayList<NeutronPort>();
-        ans.addAll(allPorts);
-        return ans;
-    }
-
-    @Override
-    public boolean addPort(NeutronPort input) {
-        if (portExists(input.getID())) {
-            return false;
-        }
-        portDB.putIfAbsent(input.getID(), input);
-        // if there are no fixed IPs, allocate one for each subnet in the network
-        INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        if (input.getFixedIPs() == null){
-           input.setFixedIPs(new ArrayList<Neutron_IPs>());
-        }
-        if (input.getFixedIPs().size() == 0) {
-            List<Neutron_IPs> list = input.getFixedIPs();
-            Iterator<NeutronSubnet> subnetIterator = systemCRUD.getAllSubnets().iterator();
-            while (subnetIterator.hasNext()) {
-                NeutronSubnet subnet = subnetIterator.next();
-                if (subnet.getNetworkUUID().equals(input.getNetworkUUID())) {
-                    list.add(new Neutron_IPs(subnet.getID()));
-                }
-            }
-        }
-        Iterator<Neutron_IPs> fixedIPIterator = input.getFixedIPs().iterator();
-        while (fixedIPIterator.hasNext()) {
-            Neutron_IPs ip = fixedIPIterator.next();
-            NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-            if (ip.getIpAddress() == null) {
-                ip.setIpAddress(subnet.getLowAddr());
-            }
-            if (!ip.getIpAddress().equals(subnet.getGatewayIP())) {
-                subnet.allocateIP(ip.getIpAddress());
-            }
-            else {
-                subnet.setGatewayIPAllocated();
-            }
-            subnet.addPort(input);
-        }
-        INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-
-        NeutronNetwork network = networkIf.getNetwork(input.getNetworkUUID());
-        network.addPort(input);
-        return true;
-    }
-
-    @Override
-    public boolean removePort(String uuid) {
-        if (!portExists(uuid)) {
-            return false;
-        }
-        NeutronPort port = getPort(uuid);
-        portDB.remove(uuid);
-        INeutronNetworkCRUD networkCRUD = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-        INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-
-        NeutronNetwork network = networkCRUD.getNetwork(port.getNetworkUUID());
-        network.removePort(port);
-        Iterator<Neutron_IPs> fixedIPIterator = port.getFixedIPs().iterator();
-        while (fixedIPIterator.hasNext()) {
-            Neutron_IPs ip = fixedIPIterator.next();
-            NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-            if (!ip.getIpAddress().equals(subnet.getGatewayIP())) {
-                subnet.releaseIP(ip.getIpAddress());
-            }
-            else {
-                subnet.resetGatewayIPAllocated();
-            }
-            subnet.removePort(port);
-        }
-        return true;
-    }
-
-    @Override
-    public boolean updatePort(String uuid, NeutronPort delta) {
-        if (!portExists(uuid)) {
-            return false;
-        }
-        NeutronPort target = portDB.get(uuid);
-        // remove old Fixed_IPs
-        if (delta.getFixedIPs() != null) {
-            NeutronPort port = getPort(uuid);
-            INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-            for (Neutron_IPs ip: port.getFixedIPs()) {
-                NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-                subnet.releaseIP(ip.getIpAddress());
-            }
-
-            // allocate new Fixed_IPs
-            for (Neutron_IPs ip: delta.getFixedIPs()) {
-                NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());
-                if (ip.getIpAddress() == null) {
-                    ip.setIpAddress(subnet.getLowAddr());
-                }
-                subnet.allocateIP(ip.getIpAddress());
-            }
-        }
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean macInUse(String macAddress) {
-        List<NeutronPort> ports = getAllPorts();
-        Iterator<NeutronPort> portIterator = ports.iterator();
-        while (portIterator.hasNext()) {
-            NeutronPort port = portIterator.next();
-            if (macAddress.equalsIgnoreCase(port.getMacAddress())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public NeutronPort getGatewayPort(String subnetUUID) {
-        INeutronSubnetCRUD systemCRUD = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        NeutronSubnet subnet = systemCRUD.getSubnet(subnetUUID);
-        Iterator<NeutronPort> portIterator = getAllPorts().iterator();
-        while (portIterator.hasNext()) {
-            NeutronPort port = portIterator.next();
-            List<Neutron_IPs> fixedIPs = port.getFixedIPs();
-            if (fixedIPs.size() == 1) {
-                if (subnet.getGatewayIP().equals(fixedIPs.get(0).getIpAddress())) {
-                    return port;
-                }
-            }
-        }
-        return null;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronRouterInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronRouterInterface.java
deleted file mode 100644 (file)
index 5e4c5a4..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronRouterInterface implements INeutronRouterCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronRouterInterface.class);
-    private ConcurrentMap<String, NeutronRouter> routerDB  = new ConcurrentHashMap<String, NeutronRouter>();
-    // methods needed for creating caches
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-
-    // IfNBRouterCRUD Interface methods
-
-    @Override
-    public boolean routerExists(String uuid) {
-        return routerDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronRouter getRouter(String uuid) {
-        if (!routerExists(uuid)) {
-            return null;
-        }
-        return routerDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronRouter> getAllRouters() {
-        Set<NeutronRouter> allRouters = new HashSet<NeutronRouter>();
-        for (Entry<String, NeutronRouter> entry : routerDB.entrySet()) {
-            NeutronRouter router = entry.getValue();
-            allRouters.add(router);
-        }
-        logger.debug("Exiting getAllRouters, Found {} Routers", allRouters.size());
-        List<NeutronRouter> ans = new ArrayList<NeutronRouter>();
-        ans.addAll(allRouters);
-        return ans;
-    }
-
-    @Override
-    public boolean addRouter(NeutronRouter input) {
-        if (routerExists(input.getID())) {
-            return false;
-        }
-        routerDB.putIfAbsent(input.getID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeRouter(String uuid) {
-        if (!routerExists(uuid)) {
-            return false;
-        }
-        routerDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateRouter(String uuid, NeutronRouter delta) {
-        if (!routerExists(uuid)) {
-            return false;
-        }
-        NeutronRouter target = routerDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean routerInUse(String routerUUID) {
-        if (!routerExists(routerUUID)) {
-            return true;
-        }
-        NeutronRouter target = routerDB.get(routerUUID);
-        return (target.getInterfaces().size() > 0);
-    }
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityGroupInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityGroupInterface.java
deleted file mode 100644 (file)
index d59bf9e..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Map.Entry;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityGroupCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityGroup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class NeutronSecurityGroupInterface implements INeutronSecurityGroupCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronSecurityGroupInterface.class);
-    private ConcurrentMap<String, NeutronSecurityGroup> securityGroupDB  = new ConcurrentHashMap<String, NeutronSecurityGroup>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronSecurityGroupExists(String uuid) {
-        return securityGroupDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronSecurityGroup getNeutronSecurityGroup(String uuid) {
-        if (!neutronSecurityGroupExists(uuid)) {
-            logger.debug("No Security Groups Have Been Defined");
-            return null;
-        }
-        return securityGroupDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronSecurityGroup> getAllNeutronSecurityGroups() {
-        Set<NeutronSecurityGroup> allSecurityGroups = new HashSet<NeutronSecurityGroup>();
-        for (Entry<String, NeutronSecurityGroup> entry : securityGroupDB.entrySet()) {
-            NeutronSecurityGroup securityGroup = entry.getValue();
-            allSecurityGroups.add(securityGroup);
-        }
-        logger.debug("Exiting getSecurityGroups, Found {} OpenStackSecurityGroup", allSecurityGroups.size());
-        List<NeutronSecurityGroup> ans = new ArrayList<NeutronSecurityGroup>();
-        ans.addAll(allSecurityGroups);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronSecurityGroup(NeutronSecurityGroup input) {
-        if (neutronSecurityGroupExists(input.getSecurityGroupUUID())) {
-            return false;
-        }
-        securityGroupDB.putIfAbsent(input.getSecurityGroupUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronSecurityGroup(String uuid) {
-        if (!neutronSecurityGroupExists(uuid)) {
-            return false;
-        }
-        securityGroupDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronSecurityGroup(String uuid, NeutronSecurityGroup delta) {
-        if (!neutronSecurityGroupExists(uuid)) {
-            return false;
-        }
-        NeutronSecurityGroup target = securityGroupDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronSecurityGroupInUse(String securityGroupUUID) {
-        return !neutronSecurityGroupExists(securityGroupUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityRuleInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSecurityRuleInterface.java
deleted file mode 100644 (file)
index 884d15f..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Map.Entry;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityRule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class NeutronSecurityRuleInterface implements INeutronSecurityRuleCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronSecurityRuleInterface.class);
-    private ConcurrentMap<String, NeutronSecurityRule> securityRuleDB  = new ConcurrentHashMap<String, NeutronSecurityRule>();
-
-    // this method uses reflection to update an object from it's delta.
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for (Method toMethod : methods) {
-            if (toMethod.getDeclaringClass().equals(target.getClass())
-                && toMethod.getName().startsWith("set")) {
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[]) null);
-                    if (value != null) {
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean neutronSecurityRuleExists(String uuid) {
-        return securityRuleDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronSecurityRule getNeutronSecurityRule(String uuid) {
-        if (!neutronSecurityRuleExists(uuid)) {
-            logger.debug("No Security Rules Have Been Defined");
-            return null;
-        }
-        return securityRuleDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronSecurityRule> getAllNeutronSecurityRules() {
-        Set<NeutronSecurityRule> allSecurityRules = new HashSet<NeutronSecurityRule>();
-        for (Entry<String, NeutronSecurityRule> entry : securityRuleDB.entrySet()) {
-            NeutronSecurityRule securityRule = entry.getValue();
-            allSecurityRules.add(securityRule);
-        }
-        logger.debug("Exiting getSecurityRule, Found {} OpenStackSecurityRule", allSecurityRules.size());
-        List<NeutronSecurityRule> ans = new ArrayList<NeutronSecurityRule>();
-        ans.addAll(allSecurityRules);
-        return ans;
-    }
-
-    @Override
-    public boolean addNeutronSecurityRule(NeutronSecurityRule input) {
-        if (neutronSecurityRuleExists(input.getSecurityRuleUUID())) {
-            return false;
-        }
-        securityRuleDB.putIfAbsent(input.getSecurityRuleUUID(), input);
-        return true;
-    }
-
-    @Override
-    public boolean removeNeutronSecurityRule(String uuid) {
-        if (!neutronSecurityRuleExists(uuid)) {
-            return false;
-        }
-        securityRuleDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateNeutronSecurityRule(String uuid, NeutronSecurityRule delta) {
-        if (!neutronSecurityRuleExists(uuid)) {
-            return false;
-        }
-        NeutronSecurityRule target = securityRuleDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean neutronSecurityRuleInUse(String securityRuleUUID) {
-        return !neutronSecurityRuleExists(securityRuleUUID);
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSubnetInterface.java b/opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronSubnetInterface.java
deleted file mode 100644 (file)
index 81fa107..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.implementation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronSubnetInterface implements INeutronSubnetCRUD {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronSubnetInterface.class);
-    private ConcurrentMap<String, NeutronSubnet> subnetDB  = new ConcurrentHashMap<String, NeutronSubnet>();
-
-
-
-    // this method uses reflection to update an object from it's delta.
-
-    private boolean overwrite(Object target, Object delta) {
-        Method[] methods = target.getClass().getMethods();
-
-        for(Method toMethod: methods){
-            if(toMethod.getDeclaringClass().equals(target.getClass())
-                    && toMethod.getName().startsWith("set")){
-
-                String toName = toMethod.getName();
-                String fromName = toName.replace("set", "get");
-
-                try {
-                    Method fromMethod = delta.getClass().getMethod(fromName);
-                    Object value = fromMethod.invoke(delta, (Object[])null);
-                    if(value != null){
-                        toMethod.invoke(target, value);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-
-    // IfNBSubnetCRUD methods
-
-    @Override
-    public boolean subnetExists(String uuid) {
-        return subnetDB.containsKey(uuid);
-    }
-
-    @Override
-    public NeutronSubnet getSubnet(String uuid) {
-        if (!subnetExists(uuid)) {
-            return null;
-        }
-        return subnetDB.get(uuid);
-    }
-
-    @Override
-    public List<NeutronSubnet> getAllSubnets() {
-        Set<NeutronSubnet> allSubnets = new HashSet<NeutronSubnet>();
-        for (Entry<String, NeutronSubnet> entry : subnetDB.entrySet()) {
-            NeutronSubnet subnet = entry.getValue();
-            allSubnets.add(subnet);
-        }
-        logger.debug("Exiting getAllSubnets, Found {} OpenStackSubnets", allSubnets.size());
-        List<NeutronSubnet> ans = new ArrayList<NeutronSubnet>();
-        ans.addAll(allSubnets);
-        return ans;
-    }
-
-    @Override
-    public boolean addSubnet(NeutronSubnet input) {
-        String id = input.getID();
-        if (subnetExists(id)) {
-            return false;
-        }
-        subnetDB.putIfAbsent(id, input);
-        INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-
-        NeutronNetwork targetNet = networkIf.getNetwork(input.getNetworkUUID());
-        targetNet.addSubnet(id);
-        return true;
-    }
-
-    @Override
-    public boolean removeSubnet(String uuid) {
-        if (!subnetExists(uuid)) {
-            return false;
-        }
-        NeutronSubnet target = subnetDB.get(uuid);
-        INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-
-        NeutronNetwork targetNet = networkIf.getNetwork(target.getNetworkUUID());
-        targetNet.removeSubnet(uuid);
-        subnetDB.remove(uuid);
-        return true;
-    }
-
-    @Override
-    public boolean updateSubnet(String uuid, NeutronSubnet delta) {
-        if (!subnetExists(uuid)) {
-            return false;
-        }
-        NeutronSubnet target = subnetDB.get(uuid);
-        return overwrite(target, delta);
-    }
-
-    @Override
-    public boolean subnetInUse(String subnetUUID) {
-        if (!subnetExists(subnetUUID)) {
-            return true;
-        }
-        NeutronSubnet target = subnetDB.get(subnetUUID);
-        return (target.getPortsInSubnet().size() > 0);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/enunciate.xml b/opendaylight/networkconfiguration/neutron/northbound/enunciate.xml
deleted file mode 100644 (file)
index 6616025..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.28.xsd">
-
-  <services>
-    <rest defaultRestSubcontext="/controller/nb/v2/neutron"/>
-  </services>
-
-  <modules>
-    <docs docsDir="rest" title="OpenStack Neutron REST API" includeExampleXml="false" includeExampleJson="true"/>
-   </modules>
-</enunciate>
diff --git a/opendaylight/networkconfiguration/neutron/northbound/pom.xml b/opendaylight/networkconfiguration/neutron/northbound/pom.xml
deleted file mode 100644 (file)
index 1e7bcf0..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?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>enunciate-parent</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../../commons/enunciate-parent</relativePath>
-  </parent>
-  <artifactId>networkconfig.neutron.northbound</artifactId>
-  <version>0.5.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.enunciate</groupId>
-      <artifactId>enunciate-core-annotations</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.persistence</groupId>
-      <artifactId>org.eclipse.persistence.moxy</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>networkconfig.neutron</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>org.opendaylight.controller.networkconfig.neutron,
-                            org.eclipse.persistence.jaxb.rs,
-                            com.sun.jersey.spi.container.servlet,
-                            javax.ws.rs,
-                            javax.ws.rs.ext,
-                            javax.ws.rs.core,
-                            javax.xml.bind.annotation,
-                            javax.xml.bind,
-                            org.slf4j,
-                            org.osgi.framework,
-                            !org.codehaus.enunciate.jaxrs</Import-Package>
-            <Web-ContextPath>/controller/nb/v2/neutron</Web-ContextPath>
-          </instructions>
-          <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
-        </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>
-
-  <distributionManagement>
-    <!-- OpenDayLight Released artifact -->
-    <repository>
-      <id>opendaylight-release</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.release}/</url>
-    </repository>
-    <!-- OpenDayLight Snapshot artifact -->
-    <snapshotRepository>
-      <id>opendaylight-snapshot</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.snapshot}/</url>
-    </snapshotRepository>
-    <!-- Site deployment -->
-    <site>
-      <id>website</id>
-      <url>${sitedeploy}</url>
-    </site>
-  </distributionManagement>
-</project>
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/BadRequestException.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/BadRequestException.java
deleted file mode 100644 (file)
index 9db8633..0000000
+++ /dev/null
@@ -1,27 +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
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-/**
- * Status Code 400 (Bad Request)
- *
- * The request could not be understood by the server due to malformed syntax.
- * The client SHOULD NOT repeat the request without modifications.
- */
-public class BadRequestException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    public BadRequestException(String string) {
-        super(Response.status(Response.Status.BAD_REQUEST).entity(string).type(MediaType.TEXT_PLAIN).build());
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/INeutronRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/INeutronRequest.java
deleted file mode 100644 (file)
index 8325d84..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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
- *
- *  Authors : Dave Tucker
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronObject;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for Neutron Requests
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.northbound.api.INeutronRequest}
- */
-@Deprecated
-public interface INeutronRequest<T extends INeutronObject> {
-    public T getSingleton();
-    public boolean isSingleton();
-    public List<T> getBulk();
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/InternalServerErrorException.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/InternalServerErrorException.java
deleted file mode 100644 (file)
index 5a40a18..0000000
+++ /dev/null
@@ -1,38 +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
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Status Code 500 (Internal Server Error)
- *
- * The server encountered an unexpected condition which prevented
- * it from fulfilling the request.
- *
- *
- *
- */
-public class InternalServerErrorException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Constructor for the INTERNAL_SERVER_ERROR custom handler
-     *
-     * @param string Error message to specify further the
-     * INTERNAL_SERVER_ERROR response
-     *
-     */
-    public InternalServerErrorException(String string) {
-        super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
-                string).type(MediaType.TEXT_PLAIN).build());
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallNorthbound.java
deleted file mode 100644 (file)
index b97a554..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewall;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Neutron Northbound REST APIs for Firewall.<br>
- * This class provides REST APIs for managing neutron Firewall
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/fw/firewalls")
-public class NeutronFirewallNorthbound {
-
-    private NeutronFirewall extractFields(NeutronFirewall o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Firewalls */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack firewall attributes
-            @QueryParam("id") String queryFirewallUUID,
-            @QueryParam("tenant_id") String queryFirewallTenantID,
-            @QueryParam("name") String queryFirewallName,
-            @QueryParam("description") String queryFirewallDescription,
-            @QueryParam("shared") Boolean queryFirewallAdminStateIsUp,
-            @QueryParam("status") String queryFirewallStatus,
-            @QueryParam("shared") Boolean queryFirewallIsShared,
-            @QueryParam("firewall_policy_id") String queryFirewallPolicyID,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFirewall> allFirewalls = firewallInterface.getAllNeutronFirewalls();
-        List<NeutronFirewall> ans = new ArrayList<NeutronFirewall>();
-        Iterator<NeutronFirewall> i = allFirewalls.iterator();
-        while (i.hasNext()) {
-            NeutronFirewall nsg = i.next();
-            if ((queryFirewallUUID == null ||
-                queryFirewallUUID.equals(nsg.getFirewallUUID())) &&
-                (queryFirewallTenantID == null ||
-                    queryFirewallTenantID.equals(nsg.getFirewallTenantID())) &&
-                (queryFirewallName == null ||
-                    queryFirewallName.equals(nsg.getFirewallName())) &&
-                (queryFirewallDescription == null ||
-                    queryFirewallDescription.equals(nsg.getFirewallDescription())) &&
-                (queryFirewallAdminStateIsUp == null ||
-                    queryFirewallAdminStateIsUp.equals(nsg.getFirewallAdminStateIsUp())) &&
-                (queryFirewallStatus == null ||
-                    queryFirewallStatus.equals(nsg.getFirewallStatus())) &&
-                (queryFirewallIsShared == null ||
-                    queryFirewallIsShared.equals(nsg.getFirewallIsShared())) &&
-                (queryFirewallPolicyID == null ||
-                    queryFirewallPolicyID.equals(nsg.getFirewallPolicyID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFirewallRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Firewall */
-
-    @Path("{firewallUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showFirewall(@PathParam("firewallUUID") String firewallUUID,
-                                      // return fields
-                                      @QueryParam("fields") List<String> fields) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!firewallInterface.neutronFirewallExists(firewallUUID)) {
-            throw new ResourceNotFoundException("Firewall UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronFirewall ans = firewallInterface.getNeutronFirewall(firewallUUID);
-            return Response.status(200).entity(
-                    new NeutronFirewallRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronFirewallRequest(firewallInterface.getNeutronFirewall(firewallUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Firewall */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createFirewalls(final NeutronFirewallRequest input) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronFirewall singleton = input.getSingleton();
-
-            /*
-             *  Verify that the Firewall doesn't already exist.
-             */
-            if (firewallInterface.neutronFirewallExists(singleton.getFirewallUUID())) {
-                throw new BadRequestException("Firewall UUID already exists");
-            }
-            firewallInterface.addNeutronFirewall(singleton);
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                        int status = service.canCreateNeutronFirewall(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            firewallInterface.addNeutronFirewall(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                    service.neutronFirewallCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronFirewall> bulk = input.getBulk();
-            Iterator<NeutronFirewall> i = bulk.iterator();
-            HashMap<String, NeutronFirewall> testMap = new HashMap<String, NeutronFirewall>();
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-            while (i.hasNext()) {
-                NeutronFirewall test = i.next();
-
-                /*
-                 *  Verify that the secruity group doesn't already exist
-                 */
-                if (firewallInterface.neutronFirewallExists(test.getFirewallUUID())) {
-                    throw new BadRequestException("Firewall UUID already is already created");
-                }
-                if (testMap.containsKey(test.getFirewallUUID())) {
-                    throw new BadRequestException("Firewall UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                            int status = service.canCreateNeutronFirewall(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronFirewall test = i.next();
-                firewallInterface.addNeutronFirewall(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                        service.neutronFirewallCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Firewall */
-
-    @Path("{firewallUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateFirewall(
-            @PathParam("firewallUUID") String firewallUUID, final NeutronFirewallRequest input) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall exists and there is only one delta provided
-         */
-        if (!firewallInterface.neutronFirewallExists(firewallUUID)) {
-            throw new ResourceNotFoundException("Firewall UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronFirewall delta = input.getSingleton();
-        NeutronFirewall original = firewallInterface.getNeutronFirewall(firewallUUID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getFirewallUUID() != null ||
-                delta.getFirewallTenantID() != null ||
-                delta.getFirewallName() != null ||
-                delta.getFirewallDescription() != null ||
-                delta.getFirewallAdminStateIsUp() != null ||
-                delta.getFirewallStatus() != null ||
-                delta.getFirewallIsShared() != null ||
-                delta.getFirewallPolicyID() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                    int status = service.canUpdateNeutronFirewall(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        firewallInterface.updateNeutronFirewall(firewallUUID, delta);
-        NeutronFirewall updatedFirewall = firewallInterface.getNeutronFirewall(firewallUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                service.neutronFirewallUpdated(updatedFirewall);
-            }
-        }
-        return Response.status(200).entity(new NeutronFirewallRequest(firewallInterface.getNeutronFirewall(firewallUUID))).build();
-    }
-
-    /**
-     * Deletes a Firewall */
-
-    @Path("{firewallUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteFirewall(
-            @PathParam("firewallUUID") String firewallUUID) {
-        INeutronFirewallCRUD firewallInterface = NeutronCRUDInterfaces.getINeutronFirewallCRUD(this);
-        if (firewallInterface == null) {
-            throw new ServiceUnavailableException("Firewall CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall exists and it isn't currently in use
-         */
-        if (!firewallInterface.neutronFirewallExists(firewallUUID)) {
-            throw new ResourceNotFoundException("Firewall UUID does not exist.");
-        }
-        if (firewallInterface.neutronFirewallInUse(firewallUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronFirewall singleton = firewallInterface.getNeutronFirewall(firewallUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                    int status = service.canDeleteNeutronFirewall(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * remove it and return 204 status
-         */
-        firewallInterface.removeNeutronFirewall(firewallUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallAware service = (INeutronFirewallAware) instance;
-                service.neutronFirewallDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java
deleted file mode 100644 (file)
index e9b813d..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallPolicy;
-
-/**
- * Neutron Northbound REST APIs for Firewall Policies.<br>
- * This class provides REST APIs for managing neutron Firewall Policies
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/fw/firewalls_policies")
-public class NeutronFirewallPolicyNorthbound {
-
-    private NeutronFirewallPolicy extractFields(NeutronFirewallPolicy o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Firewall Policies */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack Firewall Policy attributes
-            @QueryParam("id") String queryFirewallPolicyUUID,
-            @QueryParam("tenant_id") String queryFirewallPolicyTenantID,
-            @QueryParam("name") String queryFirewallPolicyName,
-            @QueryParam("description") String querySecurityPolicyDescription,
-            @QueryParam("shared") String querySecurityPolicyIsShared,
-            @QueryParam("firewall_rules") List<String> querySecurityPolicyFirewallRules,
-            @QueryParam("audited") Boolean querySecurityPolicyIsAudited,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFirewallPolicy> allFirewallPolicies = firewallPolicyInterface.getAllNeutronFirewallPolicies();
-        List<NeutronFirewallPolicy> ans = new ArrayList<NeutronFirewallPolicy>();
-        Iterator<NeutronFirewallPolicy> i = allFirewallPolicies.iterator();
-        while (i.hasNext()) {
-            NeutronFirewallPolicy nsg = i.next();
-            if ((queryFirewallPolicyUUID == null ||
-                queryFirewallPolicyUUID.equals(nsg.getFirewallPolicyUUID())) &&
-                (queryFirewallPolicyTenantID == null ||
-                    queryFirewallPolicyTenantID.equals(nsg.getFirewallPolicyTenantID())) &&
-                (queryFirewallPolicyName == null ||
-                    queryFirewallPolicyName.equals(nsg.getFirewallPolicyName())) &&
-                (querySecurityPolicyDescription == null ||
-                    querySecurityPolicyDescription.equals(nsg.getFirewallPolicyDescription())) &&
-                (querySecurityPolicyIsShared == null ||
-                    querySecurityPolicyIsShared.equals(nsg.getFirewallPolicyIsShared())) &&
-                (querySecurityPolicyFirewallRules.size() == 0 ||
-                    querySecurityPolicyFirewallRules.equals(nsg.getFirewallPolicyRules())) &&
-                (querySecurityPolicyIsAudited == null ||
-                    querySecurityPolicyIsAudited.equals(nsg.getFirewallPolicyIsAudited()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        } // ans.add((NeutronFirewallPolicy) rules);
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFirewallPolicyRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Firewall Policy */
-
-    @Path("{firewallPolicyUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID,
-                                      // return fields
-                                      @QueryParam("fields") List<String> fields) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!firewallPolicyInterface.neutronFirewallPolicyExists(firewallPolicyUUID)) {
-            throw new ResourceNotFoundException("Firewall Policy UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronFirewallPolicy ans = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-            return Response.status(200).entity(
-                    new NeutronFirewallPolicyRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronFirewallPolicyRequest(firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Firewall Policy
-     * */
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createFirewallPolicies(final NeutronFirewallPolicyRequest input) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronFirewallPolicy singleton = input.getSingleton();
-
-            /*
-             *  Verify that the Firewall Policy doesn't already exist.
-             */
-            if (firewallPolicyInterface.neutronFirewallPolicyExists(singleton.getFirewallPolicyUUID())) {
-                throw new BadRequestException("Firewall Policy UUID already exists");
-            }
-            firewallPolicyInterface.addNeutronFirewallPolicy(singleton);
-
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                        int status = service.canCreateNeutronFirewallPolicy(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            firewallPolicyInterface.addNeutronFirewallPolicy(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                    service.neutronFirewallPolicyCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronFirewallPolicy> bulk = input.getBulk();
-            Iterator<NeutronFirewallPolicy> i = bulk.iterator();
-            HashMap<String, NeutronFirewallPolicy> testMap = new HashMap<String, NeutronFirewallPolicy>();
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-            while (i.hasNext()) {
-                NeutronFirewallPolicy test = i.next();
-
-                /*
-                 *  Verify that the firewall policy doesn't already exist
-                 */
-
-                if (firewallPolicyInterface.neutronFirewallPolicyExists(test.getFirewallPolicyUUID())) {
-                    throw new BadRequestException("Firewall Policy UUID already is already created");
-                }
-                if (testMap.containsKey(test.getFirewallPolicyUUID())) {
-                    throw new BadRequestException("Firewall Policy UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                            int status = service.canCreateNeutronFirewallPolicy(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronFirewallPolicy test = i.next();
-                firewallPolicyInterface.addNeutronFirewallPolicy(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                        service.neutronFirewallPolicyCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Firewall Policy
-     */
-    @Path("{firewallPolicyUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateFirewallPolicy(
-            @PathParam("firewallPolicyUUID") String firewallPolicyUUID, final NeutronFirewallPolicyRequest input) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall Policy exists and there is only one delta provided
-         */
-        if (!firewallPolicyInterface.neutronFirewallPolicyExists(firewallPolicyUUID)) {
-            throw new ResourceNotFoundException("Firewall Policy UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronFirewallPolicy delta = input.getSingleton();
-        NeutronFirewallPolicy original = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getFirewallPolicyUUID() != null ||
-                delta.getFirewallPolicyTenantID() != null ||
-                delta.getFirewallPolicyName() != null ||
-                delta.getFirewallPolicyDescription() != null ||
-                delta.getFirewallPolicyIsShared() != null ||
-                delta.getFirewallPolicyRules().size() > 0 ||
-                delta.getFirewallPolicyIsAudited() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                    int status = service.canUpdateNeutronFirewallPolicy(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        firewallPolicyInterface.updateNeutronFirewallPolicy(firewallPolicyUUID, delta);
-        NeutronFirewallPolicy updatedFirewallPolicy = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                service.neutronFirewallPolicyUpdated(updatedFirewallPolicy);
-            }
-        }
-        return Response.status(200).entity(new NeutronFirewallPolicyRequest(firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID))).build();
-    }
-
-    /**
-     * Deletes a Firewall Policy */
-
-    @Path("{firewallPolicyUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteFirewallPolicy(
-            @PathParam("firewallPolicyUUID") String firewallPolicyUUID) {
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall Policy exists and it isn't currently in use
-         */
-        if (!firewallPolicyInterface.neutronFirewallPolicyExists(firewallPolicyUUID)) {
-            throw new ResourceNotFoundException("Firewall Policy UUID does not exist.");
-        }
-        if (firewallPolicyInterface.neutronFirewallPolicyInUse(firewallPolicyUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronFirewallPolicy singleton = firewallPolicyInterface.getNeutronFirewallPolicy(firewallPolicyUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallPolicyAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                    int status = service.canDeleteNeutronFirewallPolicy(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        firewallPolicyInterface.removeNeutronFirewallPolicy(firewallPolicyUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallPolicyAware service = (INeutronFirewallPolicyAware) instance;
-                service.neutronFirewallPolicyDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyRequest.java
deleted file mode 100644 (file)
index 473846a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallPolicy;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallPolicyRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="firewall_policy")
-    NeutronFirewallPolicy singletonFirewallPolicy;
-
-    @XmlElement(name="firewall_policies")
-    List<NeutronFirewallPolicy> bulkRequest;
-
-    NeutronFirewallPolicyRequest() {
-    }
-
-    NeutronFirewallPolicyRequest(List<NeutronFirewallPolicy> bulk) {
-        bulkRequest = bulk;
-        singletonFirewallPolicy = null;
-    }
-
-    NeutronFirewallPolicyRequest(NeutronFirewallPolicy group) {
-        singletonFirewallPolicy = group;
-    }
-
-    public List<NeutronFirewallPolicy> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronFirewallPolicy getSingleton() {
-        return singletonFirewallPolicy;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFirewallPolicy != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRequest.java
deleted file mode 100644 (file)
index 11a7836..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewall;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="firewall")
-    NeutronFirewall singletonFirewall;
-
-    @XmlElement(name="firewalls")
-    List<NeutronFirewall> bulkRequest;
-
-    NeutronFirewallRequest() {
-    }
-
-    NeutronFirewallRequest(List<NeutronFirewall> bulk) {
-        bulkRequest = bulk;
-        singletonFirewall = null;
-    }
-
-    NeutronFirewallRequest(NeutronFirewall group) {
-        singletonFirewall = group;
-    }
-
-    public List<NeutronFirewall> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronFirewall getSingleton() {
-        return singletonFirewall;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFirewall != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRuleRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRuleRequest.java
deleted file mode 100644 (file)
index 19e67dd..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallRuleRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="firewall_rule")
-    NeutronFirewallRule singletonFirewallRule;
-
-    @XmlElement(name="firewall_rules")
-    List<NeutronFirewallRule> bulkRequest;
-
-    NeutronFirewallRuleRequest() {
-    }
-
-    NeutronFirewallRuleRequest(List<NeutronFirewallRule> bulk) {
-        bulkRequest = bulk;
-        singletonFirewallRule = null;
-    }
-
-    NeutronFirewallRuleRequest(NeutronFirewallRule group) {
-        singletonFirewallRule = group;
-    }
-
-    public List<NeutronFirewallRule> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronFirewallRule getSingleton() {
-        return singletonFirewallRule;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFirewallRule != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRulesNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRulesNorthbound.java
deleted file mode 100644 (file)
index 40b830d..0000000
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule;
-
-/**
- * Neutron Northbound REST APIs for Firewall Rule.<br>
- * This class provides REST APIs for managing neutron Firewall Rule
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- */
-
-@Path("fw/firewalls_rules")
-public class NeutronFirewallRulesNorthbound {
-
-    private NeutronFirewallRule extractFields(NeutronFirewallRule o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Firewall Rules
-     */
-    @GET
-    @Produces({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response listRules(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack firewall rule attributes
-            @QueryParam("id") String queryFirewallRuleUUID,
-            @QueryParam("tenant_id") String queryFirewallRuleTenantID,
-            @QueryParam("name") String queryFirewallRuleName,
-            @QueryParam("description") String queryFirewallRuleDescription,
-            @QueryParam("admin_state_up") Boolean queryFirewallRuleAdminStateIsUp,
-            @QueryParam("status") String queryFirewallRuleStatus,
-            @QueryParam("shared") Boolean queryFirewallRuleIsShared,
-            @QueryParam("firewall_policy_id") String queryFirewallRulePolicyID,
-            @QueryParam("protocol") String queryFirewallRuleProtocol,
-            @QueryParam("ip_version") Integer queryFirewallRuleIpVer,
-            @QueryParam("source_ip_address") String queryFirewallRuleSrcIpAddr,
-            @QueryParam("destination_ip_address") String queryFirewallRuleDstIpAddr,
-            @QueryParam("source_port") Integer queryFirewallRuleSrcPort,
-            @QueryParam("destination_port") Integer queryFirewallRuleDstPort,
-            @QueryParam("position") Integer queryFirewallRulePosition,
-            @QueryParam("action") String queryFirewallRuleAction,
-            @QueryParam("enabled") Boolean queryFirewallRuleIsEnabled,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFirewallRule> allFirewallRules = firewallRuleInterface.getAllNeutronFirewallRules();
-        List<NeutronFirewallRule> ans = new ArrayList<NeutronFirewallRule>();
-        Iterator<NeutronFirewallRule> i = allFirewallRules.iterator();
-        while (i.hasNext()) {
-            NeutronFirewallRule nsr = i.next();
-            if ((queryFirewallRuleUUID == null ||
-                    queryFirewallRuleUUID.equals(nsr.getFirewallRuleUUID())) &&
-                    (queryFirewallRuleTenantID == null ||
-                            queryFirewallRuleTenantID.equals(nsr.getFirewallRuleTenantID())) &&
-                    (queryFirewallRuleName == null ||
-                            queryFirewallRuleName.equals(nsr.getFirewallRuleName())) &&
-                    (queryFirewallRuleDescription == null ||
-                            queryFirewallRuleDescription.equals(nsr.getFirewallRuleDescription())) &&
-                    (queryFirewallRuleAdminStateIsUp == null ||
-                            queryFirewallRuleAdminStateIsUp.equals(nsr.getFirewallRuleAdminStateIsUp())) &&
-                    (queryFirewallRuleStatus == null ||
-                            queryFirewallRuleStatus.equals(nsr.getFirewallRuleStatus())) &&
-                    (queryFirewallRuleIsShared == null ||
-                            queryFirewallRuleIsShared.equals(nsr.getFirewallRuleIsShared())) &&
-                    (queryFirewallRulePolicyID == null ||
-                            queryFirewallRulePolicyID.equals(nsr.getFirewallRulePolicyID())) &&
-                    (queryFirewallRuleProtocol == null ||
-                            queryFirewallRuleProtocol.equals(nsr.getFirewallRuleProtocol())) &&
-                    (queryFirewallRuleIpVer == null ||
-                            queryFirewallRuleIpVer.equals(nsr.getFirewallRuleIpVer())) &&
-                    (queryFirewallRuleSrcIpAddr == null ||
-                            queryFirewallRuleSrcIpAddr.equals(nsr.getFirewallRuleSrcIpAddr())) &&
-                    (queryFirewallRuleDstIpAddr == null ||
-                            queryFirewallRuleDstIpAddr.equals(nsr.getFirewallRuleDstIpAddr())) &&
-                    (queryFirewallRuleSrcPort == null ||
-                            queryFirewallRuleSrcPort.equals(nsr.getFirewallRuleSrcPort())) &&
-                    (queryFirewallRuleDstPort == null ||
-                            queryFirewallRuleDstPort.equals(nsr.getFirewallRuleDstPort())) &&
-                    (queryFirewallRulePosition == null ||
-                            queryFirewallRulePosition.equals(nsr.getFirewallRulePosition())) &&
-                    (queryFirewallRuleAction == null ||
-                            queryFirewallRuleAction.equals(nsr.getFirewallRuleAction())) &&
-                    (queryFirewallRuleIsEnabled == null ||
-                            queryFirewallRuleIsEnabled.equals(nsr.getFirewallRuleIsEnabled()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsr, fields));
-                } else {
-                    ans.add(nsr);
-                }
-            }
-        }
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFirewallRuleRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Firewall Rule
-     */
-
-    @Path("{firewallRuleUUID}")
-    @GET
-    @Produces({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response showFirewallRule(@PathParam("firewallRuleUUID") String firewallRuleUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!firewallRuleInterface.neutronFirewallRuleExists(firewallRuleUUID)) {
-            throw new ResourceNotFoundException("Firewall Rule UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronFirewallRule ans = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-            return Response.status(200).entity(
-                    new NeutronFirewallRuleRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200)
-                    .entity(new NeutronFirewallRuleRequest(
-                            firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID)))
-                    .build();
-        }
-    }
-
-    /**
-     * Creates new Firewall Rule
-     */
-
-    @POST
-    @Produces({MediaType.APPLICATION_JSON})
-    @Consumes({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response createFirewallRules(final NeutronFirewallRuleRequest input) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this);
-        if (firewallPolicyInterface == null) {
-            throw new ServiceUnavailableException("Firewall Policy CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        if (input.isSingleton()) {
-            NeutronFirewallRule singleton = input.getSingleton();
-            if (firewallRuleInterface.neutronFirewallRuleExists(singleton.getFirewallRuleUUID())) {
-                throw new BadRequestException("Firewall Rule UUID already exists");
-            }
-            firewallRuleInterface.addNeutronFirewallRule(singleton);
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                        int status = service.canCreateNeutronFirewallRule(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            // add rule to cache
-            singleton.initDefaults();
-            firewallRuleInterface.addNeutronFirewallRule(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                    service.neutronFirewallRuleCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronFirewallRule> bulk = input.getBulk();
-            Iterator<NeutronFirewallRule> i = bulk.iterator();
-            HashMap<String, NeutronFirewallRule> testMap = new HashMap<String, NeutronFirewallRule>();
-            Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-            while (i.hasNext()) {
-                NeutronFirewallRule test = i.next();
-
-                /*
-                 *  Verify that the Firewall rule doesn't already exist
-                 */
-
-                if (firewallRuleInterface.neutronFirewallRuleExists(test.getFirewallRuleUUID())) {
-                    throw new BadRequestException("Firewall Rule UUID already exists");
-                }
-                if (testMap.containsKey(test.getFirewallRuleUUID())) {
-                    throw new BadRequestException("Firewall Rule UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                            int status = service.canCreateNeutronFirewallRule(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronFirewallRule test = i.next();
-                firewallRuleInterface.addNeutronFirewallRule(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                        service.neutronFirewallRuleCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Firewall Rule
-     */
-    @Path("{firewallRuleUUID}")
-    @PUT
-    @Produces({MediaType.APPLICATION_JSON})
-    @Consumes({MediaType.APPLICATION_JSON})
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response updateFirewallRule(
-            @PathParam("firewallRuleUUID") String firewallRuleUUID, final NeutronFirewallRuleRequest input) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        /*
-         * verify the Firewall Rule exists
-         */
-        if (!firewallRuleInterface.neutronFirewallRuleExists(firewallRuleUUID)) {
-            throw new ResourceNotFoundException("Firewall Rule UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronFirewallRule delta = input.getSingleton();
-        NeutronFirewallRule original = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-
-        /*
-         * updates restricted by Neutron
-         *
-         */
-        if (delta.getFirewallRuleUUID() != null ||
-                delta.getFirewallRuleTenantID() != null ||
-                delta.getFirewallRuleName() != null ||
-                delta.getFirewallRuleDescription() != null ||
-                delta.getFirewallRuleAdminStateIsUp() != null ||
-                delta.getFirewallRuleStatus() != null ||
-                delta.getFirewallRuleIsShared() != null ||
-                delta.getFirewallRulePolicyID() != null ||
-                delta.getFirewallRuleProtocol() != null ||
-                delta.getFirewallRuleIpVer() != null ||
-                delta.getFirewallRuleSrcIpAddr() != null ||
-                delta.getFirewallRuleDstIpAddr() != null ||
-                delta.getFirewallRuleSrcPort() != null ||
-                delta.getFirewallRuleDstPort() != null ||
-                delta.getFirewallRulePosition() != null ||
-                delta.getFirewallRuleAction() != null ||
-                delta.getFirewallRuleIsEnabled() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                    int status = service.canUpdateNeutronFirewallRule(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        firewallRuleInterface.updateNeutronFirewallRule(firewallRuleUUID, delta);
-        NeutronFirewallRule updatedFirewallRule = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                service.neutronFirewallRuleUpdated(updatedFirewallRule);
-            }
-        }
-        return Response.status(200)
-                .entity(new NeutronFirewallRuleRequest(firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID)))
-                .build();
-    }
-
-    /**
-     * Deletes a Firewall Rule
-     */
-
-    @Path("{firewallRuleUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented")})
-    public Response deleteFirewallRule(
-            @PathParam("firewallRuleUUID") String firewallRuleUUID) {
-        INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this);
-        if (firewallRuleInterface == null) {
-            throw new ServiceUnavailableException("Firewall Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Firewall Rule exists and it isn't currently in use
-         */
-        if (!firewallRuleInterface.neutronFirewallRuleExists(firewallRuleUUID)) {
-            throw new ResourceNotFoundException("Firewall Rule UUID does not exist.");
-        }
-        if (firewallRuleInterface.neutronFirewallRuleInUse(firewallRuleUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronFirewallRule singleton = firewallRuleInterface.getNeutronFirewallRule(firewallRuleUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFirewallRuleAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                    int status = service.canDeleteNeutronFirewallRule(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * remove it and return 204 status
-         */
-        firewallRuleInterface.removeNeutronFirewallRule(firewallRuleUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance;
-                service.neutronFirewallRuleDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPRequest.java
deleted file mode 100644 (file)
index efb86e0..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronFloatingIPRequest {
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="floatingip")
-    NeutronFloatingIP singletonFloatingIP;
-
-    @XmlElement(name="floatingips")
-    List<NeutronFloatingIP> bulkRequest;
-
-    NeutronFloatingIPRequest() {
-    }
-
-    NeutronFloatingIPRequest(List<NeutronFloatingIP> bulk) {
-        bulkRequest = bulk;
-        singletonFloatingIP = null;
-    }
-
-    NeutronFloatingIPRequest(NeutronFloatingIP singleton) {
-        bulkRequest = null;
-        singletonFloatingIP = singleton;
-    }
-
-    public NeutronFloatingIP getSingleton() {
-        return singletonFloatingIP;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFloatingIP != null);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java
deleted file mode 100644 (file)
index 3e6c2a4..0000000
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronFloatingIPCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs;
-
-/**
- * Neutron Northbound REST APIs.<br>
- * This class provides REST APIs for managing Neutron Floating IPs
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-@Path("/floatingips")
-public class NeutronFloatingIPsNorthbound {
-
-    private NeutronFloatingIP extractFields(NeutronFloatingIP o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all FloatingIPs */
-
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response listFloatingIPs(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // note: openstack isn't clear about filtering on lists, so we aren't handling them
-            @QueryParam("id") String queryID,
-            @QueryParam("floating_network_id") String queryFloatingNetworkId,
-            @QueryParam("port_id") String queryPortId,
-            @QueryParam("fixed_ip_address") String queryFixedIPAddress,
-            @QueryParam("floating_ip_address") String queryFloatingIPAddress,
-            @QueryParam("tenant_id") String queryTenantID,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-            ) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronFloatingIP> allFloatingIPs = floatingIPInterface.getAllFloatingIPs();
-        List<NeutronFloatingIP> ans = new ArrayList<NeutronFloatingIP>();
-        Iterator<NeutronFloatingIP> i = allFloatingIPs.iterator();
-        while (i.hasNext()) {
-            NeutronFloatingIP oSS = i.next();
-            //match filters: TODO provider extension and router extension
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryFloatingNetworkId == null || queryFloatingNetworkId.equals(oSS.getFloatingNetworkUUID())) &&
-                    (queryPortId == null || queryPortId.equals(oSS.getPortUUID())) &&
-                    (queryFixedIPAddress == null || queryFixedIPAddress.equals(oSS.getFixedIPAddress())) &&
-                    (queryFloatingIPAddress == null || queryFloatingIPAddress.equals(oSS.getFloatingIPAddress())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantUUID()))) {
-                if (fields.size() > 0)
-                    ans.add(extractFields(oSS,fields));
-                else
-                    ans.add(oSS);
-            }
-        }
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronFloatingIPRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific FloatingIP */
-
-    @Path("{floatingipUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields ) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!floatingIPInterface.floatingIPExists(floatingipUUID))
-            throw new ResourceNotFoundException("Floating IP UUID doesn't exist.");
-        if (fields.size() > 0) {
-            NeutronFloatingIP ans = floatingIPInterface.getFloatingIP(floatingipUUID);
-            return Response.status(200).entity(
-                    new NeutronFloatingIPRequest(extractFields(ans, fields))).build();
-        } else
-            return Response.status(200).entity(
-                    new NeutronFloatingIPRequest(floatingIPInterface.getFloatingIP(floatingipUUID))).build();
-
-    }
-
-    /**
-     * Creates new FloatingIPs */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-        @ResponseCode(code = 201, condition = "Created"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 409, condition = "Conflict"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createFloatingIPs(final NeutronFloatingIPRequest input) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD( this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronFloatingIP singleton = input.getSingleton();
-            // check existence of id in cache and return badrequest if exists
-            if (floatingIPInterface.floatingIPExists(singleton.getID()))
-                throw new BadRequestException("Floating IP UUID already exists.");
-            // check if the external network is specified, exists, and is an external network
-            String externalNetworkUUID = singleton.getFloatingNetworkUUID();
-            if (externalNetworkUUID == null)
-                throw new BadRequestException("external network UUID doesn't exist.");
-            if (!networkInterface.networkExists(externalNetworkUUID))
-                throw new BadRequestException("external network UUID doesn't exist.");
-            NeutronNetwork externNetwork = networkInterface.getNetwork(externalNetworkUUID);
-            if (!externNetwork.isRouterExternal())
-                throw new BadRequestException("external network isn't marked router:external");
-            // if floating IP is specified, make sure it can come from the network
-            String floatingIP = singleton.getFloatingIPAddress();
-            if (floatingIP != null) {
-                if (externNetwork.getSubnets().size() != 1)
-                    throw new BadRequestException("external network doesn't have a subnet");
-                NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0));
-                if (!externSubnet.isValidIP(floatingIP))
-                    throw new BadRequestException("external IP isn't valid for the specified subnet.");
-                if (externSubnet.isIPInUse(floatingIP))
-                    throw new ResourceConflictException("floating IP is in use.");
-            }
-            // if port_id is specified, then check that the port exists and has at least one IP
-            String port_id = singleton.getPortUUID();
-            if (port_id != null) {
-                String fixedIP = null;        // used for the fixedIP calculation
-                if (!portInterface.portExists(port_id))
-                    throw new ResourceNotFoundException("Port UUID doesn't exist.");
-                NeutronPort port = portInterface.getPort(port_id);
-                if (port.getFixedIPs().size() < 1)
-                    throw new BadRequestException("port UUID doesn't have an IP address.");
-                // if there is more than one fixed IP then check for fixed_ip_address
-                // and that it is in the list of port addresses
-                if (port.getFixedIPs().size() > 1) {
-                    fixedIP = singleton.getFixedIPAddress();
-                    if (fixedIP == null)
-                        throw new BadRequestException("fixed IP address doesn't exist.");
-                    Iterator<Neutron_IPs> i = port.getFixedIPs().iterator();
-                    boolean validFixedIP = false;
-                    while (i.hasNext() && !validFixedIP) {
-                        Neutron_IPs ip = i.next();
-                        if (ip.getIpAddress().equals(fixedIP))
-                            validFixedIP = true;
-                    }
-                    if (!validFixedIP)
-                        throw new BadRequestException("can't find a valid fixed IP address");
-                } else {
-                    fixedIP = port.getFixedIPs().get(0).getIpAddress();
-                    if (singleton.getFixedIPAddress() != null && !fixedIP.equalsIgnoreCase(singleton.getFixedIPAddress()))
-                        throw new BadRequestException("mismatched fixed IP address in request");
-                }
-                //lastly check that this fixed IP address isn't already used
-                if (port.isBoundToFloatingIP(fixedIP))
-                    throw new ResourceConflictException("fixed IP is in use.");
-                singleton.setFixedIPAddress(fixedIP);
-            }
-            Object[] instances = NeutronUtil.getInstances(INeutronFloatingIPAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                        int status = service.canCreateFloatingIP(singleton);
-                        if (status < 200 || status > 299)
-                            return Response.status(status).build();
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            floatingIPInterface.addFloatingIP(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                    service.neutronFloatingIPCreated(singleton);
-                }
-            }
-        } else {
-            throw new BadRequestException("only singleton requests allowed.");
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a FloatingIP */
-
-    @Path("{floatingipUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID,
-            NeutronFloatingIPRequest input
-            ) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD( this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!floatingIPInterface.floatingIPExists(floatingipUUID))
-            throw new ResourceNotFoundException("Floating IP UUID doesn't exist.");
-
-        NeutronFloatingIP sourceFloatingIP = floatingIPInterface.getFloatingIP(floatingipUUID);
-        if (!input.isSingleton())
-            throw new BadRequestException("only singleton requests allowed.");
-        NeutronFloatingIP singleton = input.getSingleton();
-        if (singleton.getID() == null)
-            throw new BadRequestException("singleton UUID doesn't exist.");
-
-        NeutronNetwork externNetwork = networkInterface.getNetwork(
-                sourceFloatingIP.getFloatingNetworkUUID());
-
-        // if floating IP is specified, make sure it can come from the network
-        String floatingIP = singleton.getFloatingIPAddress();
-        if (floatingIP != null) {
-            if (externNetwork.getSubnets().size() != 1)
-                throw new BadRequestException("external network doesn't have a subnet.");
-            NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0));
-            if (!externSubnet.isValidIP(floatingIP))
-                throw new BadRequestException("floating IP not valid for external subnet");
-            if (externSubnet.isIPInUse(floatingIP))
-                throw new ResourceConflictException("floating IP is in use.");
-        }
-
-        // if port_id is specified, then check that the port exists and has at least one IP
-        String port_id = singleton.getPortUUID();
-        if (port_id != null) {
-            String fixedIP = null;        // used for the fixedIP calculation
-            if (!portInterface.portExists(port_id))
-                throw new ResourceNotFoundException("Port UUID doesn't exist.");
-            NeutronPort port = portInterface.getPort(port_id);
-            if (port.getFixedIPs().size() < 1)
-                throw new BadRequestException("port ID doesn't have a fixed IP address.");
-            // if there is more than one fixed IP then check for fixed_ip_address
-            // and that it is in the list of port addresses
-            if (port.getFixedIPs().size() > 1) {
-                fixedIP = singleton.getFixedIPAddress();
-                if (fixedIP == null)
-                    throw new BadRequestException("request doesn't have a fixed IP address");
-                Iterator<Neutron_IPs> i = port.getFixedIPs().iterator();
-                boolean validFixedIP = false;
-                while (i.hasNext() && !validFixedIP) {
-                    Neutron_IPs ip = i.next();
-                    if (ip.getIpAddress().equals(fixedIP))
-                        validFixedIP = true;
-                }
-                if (!validFixedIP)
-                    throw new BadRequestException("couldn't find a valid fixed IP address");
-            } else {
-                fixedIP = port.getFixedIPs().get(0).getIpAddress();
-                if (singleton.getFixedIPAddress() != null &&
-                        !fixedIP.equalsIgnoreCase(singleton.getFixedIPAddress()))
-                    throw new BadRequestException("mismatch in fixed IP addresses");
-            }
-            //lastly check that this fixed IP address isn't already used
-            if (port.isBoundToFloatingIP(fixedIP))
-                throw new ResourceConflictException("fixed IP is in use.");
-            singleton.setFixedIPAddress(fixedIP);
-        }
-        NeutronFloatingIP target = floatingIPInterface.getFloatingIP(floatingipUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFloatingIPAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                    int status = service.canUpdateFloatingIP(singleton, target);
-                    if (status < 200 || status > 299)
-                        return Response.status(status).build();
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        floatingIPInterface.updateFloatingIP(floatingipUUID, singleton);
-        target = floatingIPInterface.getFloatingIP(floatingipUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                service.neutronFloatingIPUpdated(target);
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronFloatingIPRequest(target)).build();
-
-    }
-
-    /**
-     * Deletes a FloatingIP */
-
-    @Path("{floatingipUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteFloatingIP(
-            @PathParam("floatingipUUID") String floatingipUUID) {
-        INeutronFloatingIPCRUD floatingIPInterface = NeutronCRUDInterfaces.getINeutronFloatingIPCRUD(this);
-        if (floatingIPInterface == null) {
-            throw new ServiceUnavailableException("Floating IP CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!floatingIPInterface.floatingIPExists(floatingipUUID))
-            throw new ResourceNotFoundException("Floating IP UUID doesn't exist.");
-        // TODO: need to undo port association if it exists
-        NeutronFloatingIP singleton = floatingIPInterface.getFloatingIP(floatingipUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronFloatingIPAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                    int status = service.canDeleteFloatingIP(singleton);
-                    if (status < 200 || status > 299)
-                        return Response.status(status).build();
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        floatingIPInterface.removeFloatingIP(floatingipUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronFloatingIPAware service = (INeutronFloatingIPAware) instance;
-                service.neutronFloatingIPDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorNorthbound.java
deleted file mode 100644 (file)
index aa30e94..0000000
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerHealthMonitorCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancer;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerHealthMonitor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Neutron Northbound REST APIs for Load Balancer HealthMonitor.<br>
- * This class provides REST APIs for managing neutron LoadBalancerHealthMonitor
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/healthmonitors")
-public class NeutronLoadBalancerHealthMonitorNorthbound {
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancer.class);
-
-    private NeutronLoadBalancerHealthMonitor extractFields(NeutronLoadBalancerHealthMonitor o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancerHealthMonitor */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancerHealthMonitor attributes
-            @QueryParam("id") String queryLoadBalancerHealthMonitorID,
-            @QueryParam("tenant_id") String queryLoadBalancerHealthMonitorTenantID,
-            // TODO "type" is being a property by the JSON parser.
-            @QueryParam("type") String queryLoadBalancerHealthMonitorType,
-            @QueryParam("delay") Integer queryLoadBalancerHealthMonitorDelay,
-            @QueryParam("timeout") Integer queryLoadBalancerHealthMonitorTimeout,
-            @QueryParam("max_retries") Integer queryLoadBalancerHealthMonitorMaxRetries,
-            @QueryParam("http_method") String queryLoadBalancerHealthMonitorHttpMethod,
-            @QueryParam("url_path") String queryLoadBalancerHealthMonitorUrlPath,
-            @QueryParam("expected_codes") String queryLoadBalancerHealthMonitorExpectedCodes,
-            @QueryParam("admin_state_up") Boolean queryLoadBalancerHealthMonitorIsAdminStateUp,
-            @QueryParam("status") String queryLoadBalancerHealthMonitorStatus,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces
-                .getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = loadBalancerHealthMonitorInterface.getAllNeutronLoadBalancerHealthMonitors();
-        List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<NeutronLoadBalancerHealthMonitor>();
-        Iterator<NeutronLoadBalancerHealthMonitor> i = allLoadBalancerHealthMonitors.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerHealthMonitor nsg = i.next();
-            if ((queryLoadBalancerHealthMonitorID == null ||
-                    queryLoadBalancerHealthMonitorID.equals(nsg.getLoadBalancerHealthMonitorID())) &&
-                    (queryLoadBalancerHealthMonitorTenantID == null ||
-                            queryLoadBalancerHealthMonitorTenantID.equals
-                                    (nsg.getLoadBalancerHealthMonitorTenantID())) &&
-                    (queryLoadBalancerHealthMonitorType == null ||
-                            queryLoadBalancerHealthMonitorType.equals
-                                    (nsg.getLoadBalancerHealthMonitorType())) &&
-                    (queryLoadBalancerHealthMonitorDelay == null ||
-                            queryLoadBalancerHealthMonitorDelay.equals
-                                    (nsg.getLoadBalancerHealthMonitorDelay())) &&
-                    (queryLoadBalancerHealthMonitorTimeout == null ||
-                            queryLoadBalancerHealthMonitorTimeout.equals
-                                    (nsg.getLoadBalancerHealthMonitorTimeout())) &&
-                    (queryLoadBalancerHealthMonitorMaxRetries == null ||
-                            queryLoadBalancerHealthMonitorMaxRetries.equals
-                                    (nsg.getLoadBalancerHealthMonitorMaxRetries())) &&
-                    (queryLoadBalancerHealthMonitorHttpMethod == null ||
-                            queryLoadBalancerHealthMonitorHttpMethod.equals
-                                    (nsg.getLoadBalancerHealthMonitorHttpMethod())) &&
-                    (queryLoadBalancerHealthMonitorUrlPath == null ||
-                            queryLoadBalancerHealthMonitorUrlPath.equals
-                                    (nsg.getLoadBalancerHealthMonitorUrlPath())) &&
-                    (queryLoadBalancerHealthMonitorExpectedCodes == null ||
-                            queryLoadBalancerHealthMonitorExpectedCodes.equals
-                                    (nsg.getLoadBalancerHealthMonitorExpectedCodes())) &&
-                    (queryLoadBalancerHealthMonitorIsAdminStateUp == null ||
-                            queryLoadBalancerHealthMonitorIsAdminStateUp.equals
-                                    (nsg.getLoadBalancerHealthMonitorAdminStateIsUp())) &&
-                    (queryLoadBalancerHealthMonitorStatus == null ||
-                            queryLoadBalancerHealthMonitorStatus.equals
-                                    (nsg.getLoadBalancerHealthMonitorStatus()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerHealthMonitorRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancerHealthMonitor */
-
-    @Path("{loadBalancerHealthMonitorID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancerHealthMonitor(@PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorID)) {
-            throw new ResourceNotFoundException("LoadBalancerHealthMonitor UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancerHealthMonitor ans = loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerHealthMonitorRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerHealthMonitorRequest(loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancerHealthMonitor */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancerHealthMonitors(final NeutronLoadBalancerHealthMonitorRequest input) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancerHealthMonitor singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancerHealthMonitor doesn't already exist.
-             */
-            if (loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(singleton.getLoadBalancerHealthMonitorID())) {
-                throw new BadRequestException("LoadBalancerHealthMonitor UUID already exists");
-            }
-            loadBalancerHealthMonitorInterface.addNeutronLoadBalancerHealthMonitor(singleton);
-
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerHealthMonitor(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            loadBalancerHealthMonitorInterface.addNeutronLoadBalancerHealthMonitor(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                    service.neutronLoadBalancerHealthMonitorCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancerHealthMonitor> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancerHealthMonitor> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancerHealthMonitor> testMap = new HashMap<String, NeutronLoadBalancerHealthMonitor>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancerHealthMonitor test = i.next();
-
-                /*
-                 *  Verify that the firewall policy doesn't already exist
-                 */
-
-                if (loadBalancerHealthMonitorInterface
-                        .neutronLoadBalancerHealthMonitorExists(test.getLoadBalancerHealthMonitorID())) {
-                    throw new BadRequestException("LoadBalancerHealthMonitor UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerHealthMonitorID())) {
-                    throw new BadRequestException("LoadBalancerHealthMonitor UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                            int status = service.canCreateNeutronLoadBalancerHealthMonitor(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronLoadBalancerHealthMonitor test = i.next();
-                loadBalancerHealthMonitorInterface.addNeutronLoadBalancerHealthMonitor(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                        service.neutronLoadBalancerHealthMonitorCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a LoadBalancerHealthMonitor Policy
-     */
-    @Path("{loadBalancerHealthMonitorID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateLoadBalancerHealthMonitor(
-            @PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
-            final NeutronLoadBalancerHealthMonitorRequest input) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces
-                .getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerHealthMonitor exists and there is only one delta provided
-         */
-        if (!loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorID)) {
-            throw new ResourceNotFoundException("LoadBalancerHealthMonitor UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronLoadBalancerHealthMonitor delta = input.getSingleton();
-        NeutronLoadBalancerHealthMonitor original = loadBalancerHealthMonitorInterface
-                .getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getLoadBalancerHealthMonitorID() != null ||
-                delta.getLoadBalancerHealthMonitorTenantID() != null ||
-                delta.getLoadBalancerHealthMonitorType() != null ||
-                delta.getLoadBalancerHealthMonitorDelay() != null ||
-                delta.getLoadBalancerHealthMonitorTimeout() != null ||
-                delta.getLoadBalancerHealthMonitorMaxRetries() != null ||
-                delta.getLoadBalancerHealthMonitorHttpMethod() != null ||
-                delta.getLoadBalancerHealthMonitorUrlPath() != null ||
-                delta.getLoadBalancerHealthMonitorExpectedCodes() != null ||
-                delta.getLoadBalancerHealthMonitorAdminStateIsUp() != null ||
-                delta.getLoadBalancerHealthMonitorStatus() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                    int status = service.canUpdateNeutronLoadBalancerHealthMonitor(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        loadBalancerHealthMonitorInterface.updateNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID, delta);
-        NeutronLoadBalancerHealthMonitor updatedLoadBalancerHealthMonitor = loadBalancerHealthMonitorInterface
-                .getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                service.neutronLoadBalancerHealthMonitorUpdated(updatedLoadBalancerHealthMonitor);
-            }
-        }
-        return Response.status(200).entity(new NeutronLoadBalancerHealthMonitorRequest
-                (loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor
-                        (loadBalancerHealthMonitorID))).build();
-    }
-
-
-
-    /**
-     * Deletes a LoadBalancerHealthMonitor
-     * */
-    @Path("{loadBalancerHealthMonitorID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteLoadBalancerHealthMonitor(
-            @PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID) {
-        INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerHealthMonitorCRUD(this);
-        if (loadBalancerHealthMonitorInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerHealthMonitor CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        /*
-         * verify the LoadBalancerHealthMonitor exists and it isn't currently in use
-         */
-        if (!loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorExists(loadBalancerHealthMonitorID)) {
-            throw new ResourceNotFoundException("LoadBalancerHealthMonitor UUID does not exist.");
-        }
-        if (loadBalancerHealthMonitorInterface.neutronLoadBalancerHealthMonitorInUse(loadBalancerHealthMonitorID)) {
-            return Response.status(409).build();
-        }
-        NeutronLoadBalancerHealthMonitor singleton = loadBalancerHealthMonitorInterface.getNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerHealthMonitorAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                    int status = service.canDeleteNeutronLoadBalancerHealthMonitor(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        loadBalancerHealthMonitorInterface.removeNeutronLoadBalancerHealthMonitor(loadBalancerHealthMonitorID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerHealthMonitorAware service = (INeutronLoadBalancerHealthMonitorAware) instance;
-                service.neutronLoadBalancerHealthMonitorDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerHealthMonitorRequest.java
deleted file mode 100644 (file)
index dc4af2f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerHealthMonitor;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerHealthMonitorRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="healthmonitor")
-    NeutronLoadBalancerHealthMonitor singletonLoadBalancerHealthMonitor;
-
-    @XmlElement(name="healthmonitors")
-    List<NeutronLoadBalancerHealthMonitor> bulkRequest;
-
-    NeutronLoadBalancerHealthMonitorRequest() {
-    }
-
-    NeutronLoadBalancerHealthMonitorRequest(List<NeutronLoadBalancerHealthMonitor> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerHealthMonitor = null;
-    }
-
-    NeutronLoadBalancerHealthMonitorRequest(NeutronLoadBalancerHealthMonitor group) {
-        singletonLoadBalancerHealthMonitor = group;
-    }
-
-    public List<NeutronLoadBalancerHealthMonitor> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerHealthMonitor getSingleton() {
-        return singletonLoadBalancerHealthMonitor;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerHealthMonitor != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerNorthbound.java
deleted file mode 100644 (file)
index 5d877c5..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerListenerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerListener;
-
-/**
- * Neutron Northbound REST APIs for LoadBalancerListener Policies.<br>
- * This class provides REST APIs for managing neutron LoadBalancerListener Policies
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/listeners")
-public class NeutronLoadBalancerListenerNorthbound {
-
-    private NeutronLoadBalancerListener extractFields(NeutronLoadBalancerListener o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancerListener */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancerListener attributes
-            @QueryParam("id") String queryLoadBalancerListenerID,
-            @QueryParam("default_pool_id") String queryLoadBalancerListenerDefaultPoolID,
-            @QueryParam("tenant_id") String queryLoadBalancerListenerTenantID,
-            @QueryParam("name") String queryLoadBalancerListenerName,
-            @QueryParam("description") String queryLoadBalancerListenerDescription,
-            @QueryParam("shared") String queryLoadBalancerListenerIsShared,
-            @QueryParam("protocol") String queryLoadBalancerListenerProtocol,
-            @QueryParam("protocol_port") String queryLoadBalancerListenerProtocolPort,
-            @QueryParam("load_balancer_id") String queryLoadBalancerListenerLoadBalancerID,
-            @QueryParam("admin_state_up") String queryLoadBalancerListenerAdminIsUp,
-            @QueryParam("status") String queryLoadBalancerListenerStatus,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        //        INeutronLoadBalancerListenerRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerRuleCRUD(this);
-
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancerListener> allLoadBalancerListeners = loadBalancerListenerInterface.getAllNeutronLoadBalancerListeners();
-        //        List<NeutronLoadBalancerListenerRule> allLoadBalancerListenerRules = firewallRuleInterface.getAllNeutronLoadBalancerListenerRules();
-        List<NeutronLoadBalancerListener> ans = new ArrayList<NeutronLoadBalancerListener>();
-        //        List<NeutronLoadBalancerListenerRule> rules = new ArrayList<NeutronLoadBalancerListenerRule>();
-        Iterator<NeutronLoadBalancerListener> i = allLoadBalancerListeners.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerListener nsg = i.next();
-            if ((queryLoadBalancerListenerID == null ||
-                    queryLoadBalancerListenerID.equals(nsg.getLoadBalancerListenerID())) &&
-                    (queryLoadBalancerListenerDefaultPoolID == null ||
-                            queryLoadBalancerListenerDefaultPoolID.equals(nsg.getNeutronLoadBalancerListenerDefaultPoolID())) &&
-                    (queryLoadBalancerListenerTenantID == null ||
-                            queryLoadBalancerListenerTenantID.equals(nsg.getLoadBalancerListenerTenantID())) &&
-                    (queryLoadBalancerListenerName == null ||
-                            queryLoadBalancerListenerName.equals(nsg.getLoadBalancerListenerName())) &&
-                    (queryLoadBalancerListenerDescription == null ||
-                            queryLoadBalancerListenerDescription.equals(nsg.getLoadBalancerListenerDescription())) &&
-                    (queryLoadBalancerListenerIsShared == null ||
-                            queryLoadBalancerListenerIsShared.equals(nsg.getLoadBalancerListenerIsShared())) &&
-                    (queryLoadBalancerListenerProtocol == null ||
-                            queryLoadBalancerListenerProtocol.equals(nsg.getNeutronLoadBalancerListenerProtocol())) &&
-                    (queryLoadBalancerListenerProtocolPort == null ||
-                            queryLoadBalancerListenerProtocolPort.equals(nsg.getNeutronLoadBalancerListenerProtocolPort())) &&
-                    (queryLoadBalancerListenerLoadBalancerID == null ||
-                            queryLoadBalancerListenerLoadBalancerID.equals(nsg.getNeutronLoadBalancerListenerLoadBalancerID())) &&
-                    (queryLoadBalancerListenerAdminIsUp == null ||
-                            queryLoadBalancerListenerAdminIsUp.equals(nsg.getLoadBalancerListenerAdminStateIsUp())) &&
-                    (queryLoadBalancerListenerStatus == null ||
-                            queryLoadBalancerListenerStatus.equals(nsg.getLoadBalancerListenerStatus()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerListenerRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancerListener */
-
-    @Path("{loadBalancerListenerID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancerListener(@PathParam("loadBalancerListenerID") String loadBalancerListenerID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerListenerInterface.neutronLoadBalancerListenerExists(loadBalancerListenerID)) {
-            throw new ResourceNotFoundException("LoadBalancerListener UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancerListener ans = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerListenerRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerListenerRequest(loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancerListener */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancerListeners(final NeutronLoadBalancerListenerRequest input) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancerListener singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancerListener doesn't already exist.
-             */
-            if (loadBalancerListenerInterface.neutronLoadBalancerListenerExists(singleton.getLoadBalancerListenerID())) {
-                throw new BadRequestException("LoadBalancerListener UUID already exists");
-            }
-            loadBalancerListenerInterface.addNeutronLoadBalancerListener(singleton);
-
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerListener(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            loadBalancerListenerInterface.addNeutronLoadBalancerListener(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                    service.neutronLoadBalancerListenerCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancerListener> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancerListener> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancerListener> testMap = new HashMap<String, NeutronLoadBalancerListener>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancerListener test = i.next();
-
-                /*
-                 *  Verify that the firewall policy doesn't already exist
-                 */
-
-                if (loadBalancerListenerInterface.neutronLoadBalancerListenerExists(test.getLoadBalancerListenerID())) {
-                    throw new BadRequestException("LoadBalancerListener UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerListenerID())) {
-                    throw new BadRequestException("LoadBalancerListener UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                            int status = service.canCreateNeutronLoadBalancerListener(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronLoadBalancerListener test = i.next();
-                loadBalancerListenerInterface.addNeutronLoadBalancerListener(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                        service.neutronLoadBalancerListenerCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a LoadBalancerListener Policy
-     */
-    @Path("{loadBalancerListenerID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateLoadBalancerListener(
-            @PathParam("loadBalancerListenerID") String loadBalancerListenerID, final NeutronLoadBalancerListenerRequest input) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerListener exists and there is only one delta provided
-         */
-        if (!loadBalancerListenerInterface.neutronLoadBalancerListenerExists(loadBalancerListenerID)) {
-            throw new ResourceNotFoundException("LoadBalancerListener UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronLoadBalancerListener delta = input.getSingleton();
-        NeutronLoadBalancerListener original = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getLoadBalancerListenerID() != null ||
-                delta.getNeutronLoadBalancerListenerDefaultPoolID() != null ||
-                delta.getLoadBalancerListenerTenantID() != null ||
-                delta.getLoadBalancerListenerName() != null ||
-                delta.getLoadBalancerListenerDescription() != null ||
-                delta.getLoadBalancerListenerIsShared() != null ||
-                delta.getNeutronLoadBalancerListenerProtocol() != null ||
-                delta.getNeutronLoadBalancerListenerProtocolPort() != null ||
-                delta.getNeutronLoadBalancerListenerLoadBalancerID() != null ||
-                delta.getLoadBalancerListenerAdminStateIsUp() != null ||
-                delta.getLoadBalancerListenerStatus() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                    int status = service.canUpdateNeutronLoadBalancerListener(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        loadBalancerListenerInterface.updateNeutronLoadBalancerListener(loadBalancerListenerID, delta);
-        NeutronLoadBalancerListener updatedLoadBalancerListener = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                service.neutronLoadBalancerListenerUpdated(updatedLoadBalancerListener);
-            }
-        }
-        return Response.status(200).entity(new NeutronLoadBalancerListenerRequest(loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID))).build();
-    }
-
-    /**
-     * Deletes a LoadBalancerListener */
-
-    @Path("{loadBalancerListenerID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteLoadBalancerListener(
-            @PathParam("loadBalancerListenerID") String loadBalancerListenerID) {
-        INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerListenerCRUD(this);
-        if (loadBalancerListenerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerListener CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerListener exists and it isn't currently in use
-         */
-        if (!loadBalancerListenerInterface.neutronLoadBalancerListenerExists(loadBalancerListenerID)) {
-            throw new ResourceNotFoundException("LoadBalancerListener UUID does not exist.");
-        }
-        if (loadBalancerListenerInterface.neutronLoadBalancerListenerInUse(loadBalancerListenerID)) {
-            return Response.status(409).build();
-        }
-        NeutronLoadBalancerListener singleton = loadBalancerListenerInterface.getNeutronLoadBalancerListener(loadBalancerListenerID);
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerListenerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                    int status = service.canDeleteNeutronLoadBalancerListener(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        loadBalancerListenerInterface.removeNeutronLoadBalancerListener(loadBalancerListenerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerListenerAware service = (INeutronLoadBalancerListenerAware) instance;
-                service.neutronLoadBalancerListenerDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerListenerRequest.java
deleted file mode 100644 (file)
index ba375af..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerListener;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerListenerRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="listener")
-    NeutronLoadBalancerListener singletonLoadBalancerListener;
-
-    @XmlElement(name="listeners")
-    List<NeutronLoadBalancerListener> bulkRequest;
-
-    NeutronLoadBalancerListenerRequest() {
-    }
-
-    NeutronLoadBalancerListenerRequest(List<NeutronLoadBalancerListener> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerListener = null;
-    }
-
-    NeutronLoadBalancerListenerRequest(NeutronLoadBalancerListener group) {
-        singletonLoadBalancerListener = group;
-    }
-
-    public List<NeutronLoadBalancerListener> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerListener getSingleton() {
-        return singletonLoadBalancerListener;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerListener != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerNorthbound.java
deleted file mode 100644 (file)
index 67557ce..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancer;
-
-/**
- * Neutron Northbound REST APIs for LoadBalancers.<br>
- * This class provides REST APIs for managing neutron LoadBalancers
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-@Path("/loadbalancers")
-public class NeutronLoadBalancerNorthbound {
-
-    private NeutronLoadBalancer extractFields(NeutronLoadBalancer o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancer */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancer attributes
-            @QueryParam("id") String queryLoadBalancerID,
-            @QueryParam("tenant_id") String queryLoadBalancerTenantID,
-            @QueryParam("name") String queryLoadBalancerName,
-            @QueryParam("description") String queryLoadBalancerDescription,
-            @QueryParam("status") String queryLoadBalancerStatus,
-            @QueryParam("vip_address") String queryLoadBalancerVipAddress,
-            @QueryParam("vip_subnet") String queryLoadBalancerVipSubnet,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(this);
-
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancer> allLoadBalancers = loadBalancerInterface.getAllNeutronLoadBalancers();
-        //        List<NeutronLoadBalancerRule> allLoadBalancerRules = firewallRuleInterface.getAllNeutronLoadBalancerRules();
-        List<NeutronLoadBalancer> ans = new ArrayList<NeutronLoadBalancer>();
-        //        List<NeutronLoadBalancerRule> rules = new ArrayList<NeutronLoadBalancerRule>();
-        Iterator<NeutronLoadBalancer> i = allLoadBalancers.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancer nsg = i.next();
-            if ((queryLoadBalancerID == null ||
-                    queryLoadBalancerID.equals(nsg.getLoadBalancerID())) &&
-                    (queryLoadBalancerTenantID == null ||
-                            queryLoadBalancerTenantID.equals(nsg.getLoadBalancerTenantID())) &&
-                    (queryLoadBalancerName == null ||
-                            queryLoadBalancerName.equals(nsg.getLoadBalancerName())) &&
-                    (queryLoadBalancerDescription == null ||
-                            queryLoadBalancerDescription.equals(nsg.getLoadBalancerDescription())) &&
-                    (queryLoadBalancerVipAddress == null ||
-                            queryLoadBalancerVipAddress.equals(nsg.getLoadBalancerVipAddress())) &&
-                    (queryLoadBalancerVipSubnet == null ||
-                            queryLoadBalancerVipSubnet.equals(nsg.getLoadBalancerVipSubnetID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancer */
-
-    @Path("{loadBalancerID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerInterface.neutronLoadBalancerExists(loadBalancerID)) {
-            throw new ResourceNotFoundException("LoadBalancer UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancer ans = loadBalancerInterface.getNeutronLoadBalancer(loadBalancerID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerRequest(loadBalancerInterface.getNeutronLoadBalancer(
-                    loadBalancerID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancer */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancers(final NeutronLoadBalancerRequest input) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancer singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancer doesn't already exist.
-             */
-            if (loadBalancerInterface.neutronLoadBalancerExists(singleton.getLoadBalancerID())) {
-                throw new BadRequestException("LoadBalancer UUID already exists");
-            }
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                        int status = service.canCreateNeutronLoadBalancer(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-
-            loadBalancerInterface.addNeutronLoadBalancer(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                    service.neutronLoadBalancerCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancer> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancer> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancer> testMap = new HashMap<String, NeutronLoadBalancer>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancer test = i.next();
-
-                /*
-                 *  Verify that the loadbalancer doesn't already exist
-                 */
-
-                if (loadBalancerInterface.neutronLoadBalancerExists(test.getLoadBalancerID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                            int status = service.canCreateNeutronLoadBalancer(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronLoadBalancer test = i.next();
-                loadBalancerInterface.addNeutronLoadBalancer(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                        service.neutronLoadBalancerCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a LoadBalancer Policy
-     */
-    @Path("{loadBalancerID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateLoadBalancer(
-            @PathParam("loadBalancerID") String loadBalancerID, final NeutronLoadBalancerRequest input) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancer exists and there is only one delta provided
-         */
-        if (!loadBalancerInterface.neutronLoadBalancerExists(loadBalancerID)) {
-            throw new ResourceNotFoundException("LoadBalancer UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronLoadBalancer delta = input.getSingleton();
-        NeutronLoadBalancer original = loadBalancerInterface.getNeutronLoadBalancer(loadBalancerID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getLoadBalancerID() != null ||
-                delta.getLoadBalancerTenantID() != null ||
-                delta.getLoadBalancerName() != null ||
-                delta.getLoadBalancerDescription() != null ||
-                delta.getLoadBalancerStatus() != null ||
-                delta.getLoadBalancerVipAddress() != null ||
-                delta.getLoadBalancerVipSubnetID() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                    int status = service.canUpdateNeutronLoadBalancer(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        loadBalancerInterface.updateNeutronLoadBalancer(loadBalancerID, delta);
-        NeutronLoadBalancer updatedLoadBalancer = loadBalancerInterface.getNeutronLoadBalancer(
-                loadBalancerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                service.neutronLoadBalancerUpdated(updatedLoadBalancer);
-            }
-        }
-        return Response.status(200).entity(new NeutronLoadBalancerRequest(loadBalancerInterface.getNeutronLoadBalancer(
-                loadBalancerID))).build();
-    }
-
-    /**
-     * Deletes a LoadBalancer */
-
-    @Path("{loadBalancerID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteLoadBalancer(
-            @PathParam("loadBalancerID") String loadBalancerID) {
-        INeutronLoadBalancerCRUD loadBalancerInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerCRUD(
-                this);
-        if (loadBalancerInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancer CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancer exists and it isn't currently in use
-         */
-        if (!loadBalancerInterface.neutronLoadBalancerExists(loadBalancerID)) {
-            throw new ResourceNotFoundException("LoadBalancer UUID does not exist.");
-        }
-        if (loadBalancerInterface.neutronLoadBalancerInUse(loadBalancerID)) {
-            return Response.status(409).build();
-        }
-        NeutronLoadBalancer singleton = loadBalancerInterface.getNeutronLoadBalancer(loadBalancerID);
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                    int status = service.canDeleteNeutronLoadBalancer(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-
-        loadBalancerInterface.removeNeutronLoadBalancer(loadBalancerID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerAware service = (INeutronLoadBalancerAware) instance;
-                service.neutronLoadBalancerDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMemberRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMemberRequest.java
deleted file mode 100644 (file)
index 9b949da..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-
-import javax.xml.bind.annotation.XmlElement;
-import java.util.List;
-
-public class NeutronLoadBalancerPoolMemberRequest {
-
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="member")
-    NeutronLoadBalancerPoolMember singletonLoadBalancerPoolMember;
-
-    @XmlElement(name="members")
-    List<NeutronLoadBalancerPoolMember> bulkRequest;
-
-    NeutronLoadBalancerPoolMemberRequest() {
-    }
-
-    NeutronLoadBalancerPoolMemberRequest(List<NeutronLoadBalancerPoolMember> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerPoolMember = null;
-    }
-
-    NeutronLoadBalancerPoolMemberRequest(NeutronLoadBalancerPoolMember group) {
-        singletonLoadBalancerPoolMember = group;
-    }
-
-    public List<NeutronLoadBalancerPoolMember> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerPoolMember getSingleton() {
-        return singletonLoadBalancerPoolMember;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerPoolMember != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMembersNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolMembersNorthbound.java
deleted file mode 100644 (file)
index 22d118a..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright (C) 2014 SDN Hub, LLC.
- *
- * 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
- *
- * Authors : Srini Seetharaman
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolMemberAware;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPool;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-
-@Path("/pools/{loadBalancerPoolUUID}/members")
-public class NeutronLoadBalancerPoolMembersNorthbound {
-    private NeutronLoadBalancerPoolMember extractFields(NeutronLoadBalancerPoolMember o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-/**
- * Returns a list of all LoadBalancerPoolMembers in specified pool
- */
-@GET
-@Produces({MediaType.APPLICATION_JSON})
-@StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 501, condition = "Not Implemented")})
-
-public Response listMembers(
-        //Path param
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-
-        // return fields
-        @QueryParam("fields") List<String> fields,
-
-        // OpenStack LoadBalancerPool attributes
-        @QueryParam("id") String queryLoadBalancerPoolMemberID,
-        @QueryParam("tenant_id") String queryLoadBalancerPoolMemberTenantID,
-        @QueryParam("address") String queryLoadBalancerPoolMemberAddress,
-        @QueryParam("protocol_port") String queryLoadBalancerPoolMemberProtoPort,
-        @QueryParam("admin_state_up") String queryLoadBalancerPoolMemberAdminStateUp,
-        @QueryParam("weight") String queryLoadBalancerPoolMemberWeight,
-        @QueryParam("subnet_id") String queryLoadBalancerPoolMemberSubnetID,
-        @QueryParam("status") String queryLoadBalancerPoolMemberStatus,
-
-        // pagination
-        @QueryParam("limit") String limit,
-        @QueryParam("marker") String marker,
-        @QueryParam("page_reverse") String pageReverse
-        // sorting not supported
-) {
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces
-            .getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-    List<NeutronLoadBalancerPoolMember> members =
-                loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-    List<NeutronLoadBalancerPoolMember> ans = new ArrayList<NeutronLoadBalancerPoolMember>();
-    Iterator<NeutronLoadBalancerPoolMember> i = members.iterator();
-    while (i.hasNext()) {
-        NeutronLoadBalancerPoolMember nsg = i.next();
-        if ((queryLoadBalancerPoolMemberID == null ||
-                queryLoadBalancerPoolMemberID.equals(nsg.getPoolMemberID())) &&
-                loadBalancerPoolUUID.equals(nsg.getPoolID()) &&
-                (queryLoadBalancerPoolMemberTenantID == null ||
-                        queryLoadBalancerPoolMemberTenantID.equals(nsg.getPoolMemberTenantID())) &&
-                (queryLoadBalancerPoolMemberAddress == null ||
-                        queryLoadBalancerPoolMemberAddress.equals(nsg.getPoolMemberAddress())) &&
-                (queryLoadBalancerPoolMemberAdminStateUp == null ||
-                        queryLoadBalancerPoolMemberAdminStateUp.equals(nsg.getPoolMemberAdminStateIsUp())) &&
-                (queryLoadBalancerPoolMemberWeight == null ||
-                        queryLoadBalancerPoolMemberWeight.equals(nsg.getPoolMemberWeight())) &&
-                (queryLoadBalancerPoolMemberSubnetID == null ||
-                        queryLoadBalancerPoolMemberSubnetID.equals(nsg.getPoolMemberSubnetID())) &&
-                (queryLoadBalancerPoolMemberStatus == null ||
-                        queryLoadBalancerPoolMemberStatus.equals(nsg.getPoolMemberStatus()))) {
-            if (fields.size() > 0) {
-                ans.add(extractFields(nsg, fields));
-            } else {
-                ans.add(nsg);
-            }
-        }
-    }
-    return Response.status(200).entity(
-            new NeutronLoadBalancerPoolMemberRequest(ans)).build();
-}
-
-/**
- * Returns a specific LoadBalancerPoolMember
- */
-
-@Path("{loadBalancerPoolMemberUUID}")
-@GET
-@Produces({ MediaType.APPLICATION_JSON })
-//@TypeHint(OpenStackLoadBalancerPoolMembers.class)
-@StatusCodes({
-    @ResponseCode(code = 200, condition = "Operation successful"),
-    @ResponseCode(code = 401, condition = "Unauthorized"),
-    @ResponseCode(code = 404, condition = "Not Found"),
-    @ResponseCode(code = 501, condition = "Not Implemented") })
-public Response showLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
-        // return fields
-        @QueryParam("fields") List<String> fields ) {
-
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces
-            .getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-    List<NeutronLoadBalancerPoolMember> members =
-                loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-    for (NeutronLoadBalancerPoolMember ans: members) {
-        if (!ans.getPoolMemberID().equals(loadBalancerPoolMemberUUID))
-            continue;
-
-        if (fields.size() > 0) {
-            return Response.status(200).entity(
-                new NeutronLoadBalancerPoolMemberRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(
-                new NeutronLoadBalancerPoolMemberRequest(ans)).build();
-        }
-    }
-    return Response.status(204).build();
-}
-
-/**
- * Adds a Member to an LBaaS Pool member
- */
-@PUT
-@Produces({MediaType.APPLICATION_JSON})
-@Consumes({MediaType.APPLICATION_JSON})
-@StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 501, condition = "Not Implemented")})
-public Response createLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        final NeutronLoadBalancerPoolMemberRequest input) {
-
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-    // Verify that the loadBalancerPool exists, for the member to be added to its cache
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-    NeutronLoadBalancerPool singletonPool = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID);
-
-    if (input.isSingleton()) {
-        NeutronLoadBalancerPoolMember singleton = input.getSingleton();
-        singleton.setPoolID(loadBalancerPoolUUID);
-        String loadBalancerPoolMemberUUID = singleton.getPoolMemberID();
-
-        /*
-         *  Verify that the LoadBalancerPoolMember doesn't already exist.
-         */
-        List<NeutronLoadBalancerPoolMember> members = singletonPool.getLoadBalancerPoolMembers();
-        for (NeutronLoadBalancerPoolMember member: members) {
-            if (member.getPoolMemberID().equals(loadBalancerPoolMemberUUID))
-                throw new BadRequestException("LoadBalancerPoolMember UUID already exists");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolMemberAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                    int status = service.canCreateNeutronLoadBalancerPoolMember(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                service.neutronLoadBalancerPoolMemberCreated(singleton);
-            }
-        }
-
-        /**
-         * Add the member from the neutron load balancer pool as well
-         */
-        singletonPool.addLoadBalancerPoolMember(singleton);
-
-    } else {
-        List<NeutronLoadBalancerPoolMember> bulk = input.getBulk();
-        Iterator<NeutronLoadBalancerPoolMember> i = bulk.iterator();
-        HashMap<String, NeutronLoadBalancerPoolMember> testMap = new HashMap<String, NeutronLoadBalancerPoolMember>();
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolMemberAware.class, this);
-        while (i.hasNext()) {
-            NeutronLoadBalancerPoolMember test = i.next();
-            String loadBalancerPoolMemberUUID = test.getPoolMemberID();
-
-            /*
-             *  Verify that the LoadBalancerPoolMember doesn't already exist.
-             */
-            List<NeutronLoadBalancerPoolMember> members = singletonPool.getLoadBalancerPoolMembers();
-            for (NeutronLoadBalancerPoolMember member: members) {
-                if (member.getPoolMemberID().equals(loadBalancerPoolMemberUUID))
-                    throw new BadRequestException("LoadBalancerPoolMember UUID already exists");
-            }
-
-            if (testMap.containsKey(test.getPoolMemberID())) {
-                throw new BadRequestException("Load Balancer PoolMember UUID already exists");
-            }
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerPoolMember(test);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-        }
-        /*
-         * now, each element of the bulk request can be added to the cache
-         */
-        i = bulk.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerPoolMember test = i.next();
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                    service.neutronLoadBalancerPoolMemberCreated(test);
-                }
-            }
-            singletonPool.addLoadBalancerPoolMember(test);
-        }
-    }
-    return Response.status(201).entity(input).build();
-}
-
-/**
- * Updates a LB member pool
- */
-
-@Path("{loadBalancerPoolMemberUUID}")
-@PUT
-@Produces({ MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_JSON })
-@StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 403, condition = "Forbidden"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-public Response updateLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
-        final NeutronLoadBalancerPoolMemberRequest input) {
-
-    //TODO: Implement update LB member pool
-    return Response.status(501).entity(input).build();
-}
-
-/**
- * Deletes a LoadBalancerPoolMember
- */
-
-@Path("{loadBalancerPoolMemberUUID}")
-@DELETE
-@StatusCodes({
-    @ResponseCode(code = 204, condition = "No Content"),
-    @ResponseCode(code = 401, condition = "Unauthorized"),
-    @ResponseCode(code = 403, condition = "Forbidden"),
-    @ResponseCode(code = 404, condition = "Not Found"),
-    @ResponseCode(code = 501, condition = "Not Implemented") })
-public Response deleteLoadBalancerPoolMember(
-        @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
-        @PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID) {
-    INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-    if (loadBalancerPoolInterface == null) {
-        throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                + RestMessages.SERVICEUNAVAILABLE.toString());
-    }
-
-    // Verify that the loadBalancerPool exists, for the member to be removed from its cache
-    if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-        throw new ResourceNotFoundException("loadBalancerPool UUID does not exist.");
-    }
-
-    //Verify that the LB pool member exists
-    NeutronLoadBalancerPoolMember singleton = null;
-    List<NeutronLoadBalancerPoolMember> members =
-            loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
-    for (NeutronLoadBalancerPoolMember member: members) {
-        if (member.getPoolMemberID().equals(loadBalancerPoolMemberUUID)) {
-            singleton = member;
-            break;
-        }
-    }
-    if (singleton == null)
-        throw new BadRequestException("LoadBalancerPoolMember UUID does not exist.");
-
-    Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolMemberAware.class, this);
-    if (instances != null) {
-        if (instances.length > 0) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-                int status = service.canDeleteNeutronLoadBalancerPoolMember(singleton);
-                if (status < 200 || status > 299) {
-                    return Response.status(status).build();
-                }
-            }
-        } else {
-            throw new ServiceUnavailableException("No providers registered.  Please try again later");
-        }
-    } else {
-        throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-    }
-
-    if (instances != null) {
-        for (Object instance : instances) {
-            INeutronLoadBalancerPoolMemberAware service = (INeutronLoadBalancerPoolMemberAware) instance;
-            service.neutronLoadBalancerPoolMemberDeleted(singleton);
-        }
-    }
-
-    /**
-     * Remove the member from the neutron load balancer pool
-     */
-    NeutronLoadBalancerPool singletonPool = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID);
-    singletonPool.removeLoadBalancerPoolMember(singleton);
-
-    return Response.status(204).build();
-}
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolNorthbound.java
deleted file mode 100644 (file)
index ea4e2d1..0000000
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (C) 2014 SDN Hub, LLC.
- *
- * 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
- *
- * Authors : Srini Seetharaman
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPool;
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember;
-
-/**
- * Neutron Northbound REST APIs for LoadBalancerPool Policies.<br>
- * This class provides REST APIs for managing neutron LoadBalancerPool Policies
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-/**
- * For now, the LB pool member data is maintained with the INeutronLoadBalancerPoolCRUD,
- * and not duplicated within the INeutronLoadBalancerPoolMemberCRUD's cache.
- */
-
-@Path("/pools")
-public class NeutronLoadBalancerPoolNorthbound {
-
-    private NeutronLoadBalancerPool extractFields(NeutronLoadBalancerPool o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all LoadBalancerPool
-     * */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-
-    public Response listGroups(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // OpenStack LoadBalancerPool attributes
-            @QueryParam("id") String queryLoadBalancerPoolID,
-            @QueryParam("tenant_id") String queryLoadBalancerPoolTenantID,
-            @QueryParam("name") String queryLoadBalancerPoolName,
-            @QueryParam("description") String queryLoadBalancerDescription,
-            @QueryParam("protocol") String queryLoadBalancerProtocol,
-            @QueryParam("lb_algorithm") String queryLoadBalancerPoolLbAlgorithm,
-            @QueryParam("healthmonitor_id") String queryLoadBalancerPoolHealthMonitorID,
-            @QueryParam("admin_state_up") String queryLoadBalancerIsAdminStateUp,
-            @QueryParam("status") String queryLoadBalancerPoolStatus,
-            @QueryParam("members") List<NeutronLoadBalancerPoolMember> queryLoadBalancerPoolMembers,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-    ) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronLoadBalancerPool> allLoadBalancerPools = loadBalancerPoolInterface.getAllNeutronLoadBalancerPools();
-        List<NeutronLoadBalancerPool> ans = new ArrayList<NeutronLoadBalancerPool>();
-        Iterator<NeutronLoadBalancerPool> i = allLoadBalancerPools.iterator();
-        while (i.hasNext()) {
-            NeutronLoadBalancerPool nsg = i.next();
-            if ((queryLoadBalancerPoolID == null ||
-                    queryLoadBalancerPoolID.equals(nsg.getLoadBalancerPoolID())) &&
-                    (queryLoadBalancerPoolTenantID == null ||
-                            queryLoadBalancerPoolTenantID.equals(nsg.getLoadBalancerPoolTenantID())) &&
-                    (queryLoadBalancerPoolName == null ||
-                            queryLoadBalancerPoolName.equals(nsg.getLoadBalancerPoolName())) &&
-                    (queryLoadBalancerDescription == null ||
-                            queryLoadBalancerDescription.equals(nsg.getLoadBalancerPoolDescription())) &&
-                    (queryLoadBalancerPoolLbAlgorithm == null ||
-                            queryLoadBalancerPoolLbAlgorithm.equals(nsg.getLoadBalancerPoolLbAlgorithm())) &&
-                    (queryLoadBalancerPoolHealthMonitorID == null ||
-                            queryLoadBalancerPoolHealthMonitorID.equals(nsg.getNeutronLoadBalancerPoolHealthMonitorID())) &&
-                    (queryLoadBalancerIsAdminStateUp == null ||
-                            queryLoadBalancerIsAdminStateUp.equals(nsg.getLoadBalancerPoolAdminIsStateIsUp())) &&
-                    (queryLoadBalancerPoolStatus == null ||
-                            queryLoadBalancerPoolStatus.equals(nsg.getLoadBalancerPoolStatus())) &&
-                    (queryLoadBalancerPoolMembers.size() == 0 ||
-                            queryLoadBalancerPoolMembers.equals(nsg.getLoadBalancerPoolMembers()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg,fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronLoadBalancerPoolRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific LoadBalancerPool */
-
-    @Path("{loadBalancerPoolID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showLoadBalancerPool(@PathParam("loadBalancerPoolID") String loadBalancerPoolID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolID)) {
-            throw new ResourceNotFoundException("LoadBalancerPool UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronLoadBalancerPool ans = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolID);
-            return Response.status(200).entity(
-                    new NeutronLoadBalancerPoolRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronLoadBalancerPoolRequest(loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolID))).build();
-        }
-    }
-
-    /**
-     * Creates new LoadBalancerPool */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createLoadBalancerPools(final NeutronLoadBalancerPoolRequest input) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronLoadBalancerPool singleton = input.getSingleton();
-
-            /*
-             *  Verify that the LoadBalancerPool doesn't already exist.
-             */
-            if (loadBalancerPoolInterface.neutronLoadBalancerPoolExists(singleton.getLoadBalancerPoolID())) {
-                throw new BadRequestException("LoadBalancerPool UUID already exists");
-            }
-
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                        int status = service.canCreateNeutronLoadBalancerPool(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            loadBalancerPoolInterface.addNeutronLoadBalancerPool(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                    service.neutronLoadBalancerPoolCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronLoadBalancerPool> bulk = input.getBulk();
-            Iterator<NeutronLoadBalancerPool> i = bulk.iterator();
-            HashMap<String, NeutronLoadBalancerPool> testMap = new HashMap<String, NeutronLoadBalancerPool>();
-            Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolAware.class, this);
-            while (i.hasNext()) {
-                NeutronLoadBalancerPool test = i.next();
-
-                /*
-                 *  Verify that the loadBalancerPool doesn't already exist
-                 */
-
-                if (loadBalancerPoolInterface.neutronLoadBalancerPoolExists(test.getLoadBalancerPoolID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already is already created");
-                }
-                if (testMap.containsKey(test.getLoadBalancerPoolID())) {
-                    throw new BadRequestException("Load Balancer Pool UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                            int status = service.canCreateNeutronLoadBalancerPool(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronLoadBalancerPool test = i.next();
-                loadBalancerPoolInterface.addNeutronLoadBalancerPool(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                        service.neutronLoadBalancerPoolCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a LoadBalancerPool Policy
-     */
-    @Path("{loadBalancerPoolID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateLoadBalancerPool(
-            @PathParam("loadBalancerPoolID") String loadBalancerPoolID, final NeutronLoadBalancerPoolRequest input) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerPool exists and there is only one delta provided
-         */
-        if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolID)) {
-            throw new ResourceNotFoundException("LoadBalancerPool UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronLoadBalancerPool delta = input.getSingleton();
-        NeutronLoadBalancerPool original = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getLoadBalancerPoolID() != null ||
-                delta.getLoadBalancerPoolTenantID() != null ||
-                delta.getLoadBalancerPoolName() != null ||
-                delta.getLoadBalancerPoolDescription() != null ||
-                delta.getLoadBalancerPoolProtocol() != null ||
-                delta.getLoadBalancerPoolLbAlgorithm() != null ||
-                delta.getNeutronLoadBalancerPoolHealthMonitorID() != null ||
-                delta.getLoadBalancerPoolAdminIsStateIsUp() != null ||
-                delta.getLoadBalancerPoolStatus() != null ||
-                delta.getLoadBalancerPoolMembers() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                    int status = service.canUpdateNeutronLoadBalancerPool(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        loadBalancerPoolInterface.updateNeutronLoadBalancerPool(loadBalancerPoolID, delta);
-        NeutronLoadBalancerPool updatedLoadBalancerPool = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                service.neutronLoadBalancerPoolUpdated(updatedLoadBalancerPool);
-            }
-        }
-        return Response.status(200).entity(new NeutronLoadBalancerPoolRequest(loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolID))).build();
-    }
-
-    /**
-     * Deletes a LoadBalancerPool
-     */
-
-    @Path("{loadBalancerPoolUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteLoadBalancerPool(
-            @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID) {
-        INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = NeutronCRUDInterfaces.getINeutronLoadBalancerPoolCRUD(this);
-        if (loadBalancerPoolInterface == null) {
-            throw new ServiceUnavailableException("LoadBalancerPool CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the LoadBalancerPool exists and it isn't currently in use
-         */
-        if (!loadBalancerPoolInterface.neutronLoadBalancerPoolExists(loadBalancerPoolUUID)) {
-            throw new ResourceNotFoundException("LoadBalancerPool UUID does not exist.");
-        }
-        if (loadBalancerPoolInterface.neutronLoadBalancerPoolInUse(loadBalancerPoolUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronLoadBalancerPool singleton = loadBalancerPoolInterface.getNeutronLoadBalancerPool(loadBalancerPoolUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronLoadBalancerPoolAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                    int status = service.canDeleteNeutronLoadBalancerPool(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * remove it and return 204 status
-         */
-        loadBalancerPoolInterface.removeNeutronLoadBalancerPool(loadBalancerPoolUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronLoadBalancerPoolAware service = (INeutronLoadBalancerPoolAware) instance;
-                service.neutronLoadBalancerPoolDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerPoolRequest.java
deleted file mode 100644 (file)
index a1cdc41..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPool;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerPoolRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="pool")
-    NeutronLoadBalancerPool singletonLoadBalancerPool;
-
-    @XmlElement(name="pools")
-    List<NeutronLoadBalancerPool> bulkRequest;
-
-    NeutronLoadBalancerPoolRequest() {
-    }
-
-    NeutronLoadBalancerPoolRequest(List<NeutronLoadBalancerPool> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerPool = null;
-    }
-
-    NeutronLoadBalancerPoolRequest(NeutronLoadBalancerPool group) {
-        singletonLoadBalancerPool = group;
-    }
-
-    public List<NeutronLoadBalancerPool> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerPool getSingleton() {
-        return singletonLoadBalancerPool;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerPool != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronLoadBalancerRequest.java
deleted file mode 100644 (file)
index 1cf4e70..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancer;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="loadbalancer")
-    NeutronLoadBalancer singletonLoadBalancer;
-
-    @XmlElement(name="loadbalancers")
-    List<NeutronLoadBalancer> bulkRequest;
-
-    NeutronLoadBalancerRequest() {
-    }
-
-    NeutronLoadBalancerRequest(List<NeutronLoadBalancer> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancer = null;
-    }
-
-    NeutronLoadBalancerRequest(NeutronLoadBalancer group) {
-        singletonLoadBalancer = group;
-    }
-
-    public List<NeutronLoadBalancer> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancer getSingleton() {
-        return singletonLoadBalancer;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancer != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworkRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworkRequest.java
deleted file mode 100644 (file)
index 2001fb7..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronNetworkRequest implements INeutronRequest<NeutronNetwork> {
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="network")
-    NeutronNetwork singletonNetwork;
-
-    @XmlElement(name="networks")
-    List<NeutronNetwork> bulkRequest;
-
-    @XmlElement(name="networks_links")
-    List<NeutronPageLink> links;
-
-    NeutronNetworkRequest() {
-    }
-
-    NeutronNetworkRequest(List<NeutronNetwork> bulkRequest, List<NeutronPageLink> links) {
-        this.bulkRequest = bulkRequest;
-        this.links = links;
-        this.singletonNetwork = null;
-    }
-
-    NeutronNetworkRequest(List<NeutronNetwork> bulk) {
-        bulkRequest = bulk;
-        singletonNetwork = null;
-    }
-
-    NeutronNetworkRequest(NeutronNetwork net) {
-        singletonNetwork = net;
-    }
-
-    @Override
-    public NeutronNetwork getSingleton() {
-        return singletonNetwork;
-    }
-
-    @Override
-    public boolean isSingleton() {
-        return (singletonNetwork != null);
-    }
-
-    @Override
-    public List<NeutronNetwork> getBulk() {
-        return bulkRequest;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNetworksNorthbound.java
deleted file mode 100644 (file)
index 3a3c657..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.codehaus.enunciate.jaxrs.TypeHint;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-
-/**
- * Neutron Northbound REST APIs for Network.<br>
- * This class provides REST APIs for managing neutron Networks
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-@Path("/networks")
-public class NeutronNetworksNorthbound {
-
-    @Context
-    UriInfo uriInfo;
-
-    private NeutronNetwork extractFields(NeutronNetwork o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Networks */
-
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized")})
-    public Response listNetworks(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // note: openstack isn't clear about filtering on lists, so we aren't handling them
-            @QueryParam("id") String queryID,
-            @QueryParam("name") String queryName,
-            @QueryParam("admin_state_up") String queryAdminStateUp,
-            @QueryParam("status") String queryStatus,
-            @QueryParam("shared") String queryShared,
-            @QueryParam("tenant_id") String queryTenantID,
-            @QueryParam("router_external") String queryRouterExternal,
-            @QueryParam("provider_network_type") String queryProviderNetworkType,
-            @QueryParam("provider_physical_network") String queryProviderPhysicalNetwork,
-            @QueryParam("provider_segmentation_id") String queryProviderSegmentationID,
-            // linkTitle
-            @QueryParam("limit") Integer limit,
-            @QueryParam("marker") String marker,
-            @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
-            // sorting not supported
-            ) {
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronNetwork> allNetworks = networkInterface.getAllNetworks();
-        List<NeutronNetwork> ans = new ArrayList<NeutronNetwork>();
-        Iterator<NeutronNetwork> i = allNetworks.iterator();
-        while (i.hasNext()) {
-            NeutronNetwork oSN = i.next();
-            //match filters: TODO provider extension
-            Boolean bAdminStateUp = null;
-            Boolean bShared = null;
-            Boolean bRouterExternal = null;
-            if (queryAdminStateUp != null) {
-                bAdminStateUp = Boolean.valueOf(queryAdminStateUp);
-            }
-            if (queryShared != null) {
-                bShared = Boolean.valueOf(queryShared);
-            }
-            if (queryRouterExternal != null) {
-                bRouterExternal = Boolean.valueOf(queryRouterExternal);
-            }
-            if ((queryID == null || queryID.equals(oSN.getID())) &&
-                    (queryName == null || queryName.equals(oSN.getNetworkName())) &&
-                    (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp()) &&
-                    (queryStatus == null || queryStatus.equals(oSN.getStatus())) &&
-                    (bShared == null || bShared.booleanValue() == oSN.isShared()) &&
-                    (bRouterExternal == null || bRouterExternal.booleanValue() == oSN.isRouterExternal()) &&
-                    (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(oSN,fields));
-                } else {
-                    ans.add(oSN);
-                }
-            }
-        }
-
-        if (limit != null && ans.size() > 1) {
-            // Return a paginated request
-            NeutronNetworkRequest request = (NeutronNetworkRequest) PaginatedRequestFactory.createRequest(limit,
-                    marker, pageReverse, uriInfo, ans, NeutronNetwork.class);
-            return Response.status(200).entity(request).build();
-        }
-
-    return Response.status(200).entity(new NeutronNetworkRequest(ans)).build();
-
-    }
-
-    /**
-     * Returns a specific Network */
-
-    @Path("{netUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 404, condition = "Not Found") })
-    public Response showNetwork(
-            @PathParam("netUUID") String netUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields
-            ) {
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!networkInterface.networkExists(netUUID)) {
-            throw new ResourceNotFoundException("network UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronNetwork ans = networkInterface.getNetwork(netUUID);
-            return Response.status(200).entity(
-                    new NeutronNetworkRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(
-                    new NeutronNetworkRequest(networkInterface.getNetwork(netUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Networks */
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    @TypeHint(NeutronNetwork.class)
-    @StatusCodes({
-        @ResponseCode(code = 201, condition = "Created"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 401, condition = "Unauthorized") })
-    public Response createNetworks(final NeutronNetworkRequest input) {
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronNetwork singleton = input.getSingleton();
-
-            /*
-             * network ID can't already exist
-             */
-            if (networkInterface.networkExists(singleton.getID())) {
-                throw new BadRequestException("network UUID already exists");
-            }
-
-            Object[] instances = NeutronUtil.getInstances(INeutronNetworkAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                        int status = service.canCreateNetwork(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-
-            // add network to cache
-            singleton.initDefaults();
-            networkInterface.addNetwork(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                    service.neutronNetworkCreated(singleton);
-                }
-            }
-
-        } else {
-            List<NeutronNetwork> bulk = input.getBulk();
-            Iterator<NeutronNetwork> i = bulk.iterator();
-            HashMap<String, NeutronNetwork> testMap = new HashMap<String, NeutronNetwork>();
-            Object[] instances = NeutronUtil.getInstances(INeutronNetworkAware.class, this);
-            while (i.hasNext()) {
-                NeutronNetwork test = i.next();
-
-                /*
-                 * network ID can't already exist, nor can there be an entry for this UUID
-                 * already in this bulk request
-                 */
-                if (networkInterface.networkExists(test.getID())) {
-                    throw new BadRequestException("network UUID already exists");
-                }
-                if (testMap.containsKey(test.getID())) {
-                    throw new BadRequestException("network UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance: instances) {
-                            INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                            int status = service.canCreateNetwork(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-                testMap.put(test.getID(),test);
-            }
-
-            // now that everything passed, add items to the cache
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronNetwork test = i.next();
-                test.initDefaults();
-                networkInterface.addNetwork(test);
-                if (instances != null) {
-                    for (Object instance: instances) {
-                        INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                        service.neutronNetworkCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Network */
-    @Path("{netUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackNetworks.class)
-    @StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 403, condition = "Forbidden"),
-        @ResponseCode(code = 404, condition = "Not Found"), })
-    public Response updateNetwork(
-            @PathParam("netUUID") String netUUID, final NeutronNetworkRequest input
-            ) {
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * network has to exist and only a single delta is supported
-         */
-        if (!networkInterface.networkExists(netUUID)) {
-            throw new ResourceNotFoundException("network UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("only singleton edits supported");
-        }
-        NeutronNetwork delta = input.getSingleton();
-
-        /*
-         * transitions forbidden by Neutron
-         */
-        if (delta.getID() != null || delta.getTenantID() != null ||
-                delta.getStatus() != null) {
-            throw new BadRequestException("attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronNetworkAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                    NeutronNetwork original = networkInterface.getNetwork(netUUID);
-                    int status = service.canUpdateNetwork(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        // update network object and return the modified object
-                networkInterface.updateNetwork(netUUID, delta);
-                NeutronNetwork updatedSingleton = networkInterface.getNetwork(netUUID);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                        service.neutronNetworkUpdated(updatedSingleton);
-                    }
-                }
-                return Response.status(200).entity(
-                        new NeutronNetworkRequest(networkInterface.getNetwork(netUUID))).build();
-    }
-
-    /**
-     * Deletes a Network */
-
-    @Path("{netUUID}")
-    @DELETE
-    @StatusCodes({
-        @ResponseCode(code = 204, condition = "No Content"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 409, condition = "Network In Use") })
-    public Response deleteNetwork(
-            @PathParam("netUUID") String netUUID) {
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * network has to exist and not be in use before it can be removed
-         */
-        if (!networkInterface.networkExists(netUUID)) {
-            throw new ResourceNotFoundException("network UUID does not exist.");
-        }
-        if (networkInterface.networkInUse(netUUID)) {
-            throw new ResourceConflictException("Network ID in use");
-        }
-
-        NeutronNetwork singleton = networkInterface.getNetwork(netUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronNetworkAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                    int status = service.canDeleteNetwork(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        networkInterface.removeNetwork(netUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronNetworkAware service = (INeutronNetworkAware) instance;
-                service.neutronNetworkDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java
deleted file mode 100644 (file)
index 052d3dc..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
-
-import javax.ws.rs.core.Application;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * This class is an instance of javax.ws.rs.core.Application and is used to return the classes
- * that will be instantiated for JAXRS processing. This is necessary
- * because package scanning in jersey doesn't yet work in OSGi environment.
- *
- */
-public class NeutronNorthboundRSApplication extends Application {
-    @Override
-    public Set<Class<?>> getClasses() {
-        Set<Class<?>> classes = new HashSet<Class<?>>();
-// northbound URIs
-        classes.add(NeutronNetworksNorthbound.class);
-        classes.add(NeutronSubnetsNorthbound.class);
-        classes.add(NeutronPortsNorthbound.class);
-        classes.add(NeutronRoutersNorthbound.class);
-        classes.add(NeutronFloatingIPsNorthbound.class);
-        classes.add(NeutronSecurityGroupsNorthbound.class);
-        classes.add(NeutronSecurityRulesNorthbound.class);
-        classes.add(NeutronFirewallNorthbound.class);
-        classes.add(NeutronFirewallPolicyNorthbound.class);
-        classes.add(NeutronFirewallRulesNorthbound.class);
-        classes.add(NeutronLoadBalancerNorthbound.class);
-        classes.add(NeutronLoadBalancerListenerNorthbound.class);
-        classes.add(NeutronLoadBalancerPoolNorthbound.class);
-        classes.add(NeutronLoadBalancerHealthMonitorNorthbound.class);
-        classes.add(NeutronLoadBalancerPoolMembersNorthbound.class);
-      classes.add(MOXyJsonProvider.class);
-        return classes;
-    }
-
-    @Override
-    public Set<Object> getSingletons() {
-        MOXyJsonProvider moxyJsonProvider = new MOXyJsonProvider();
-
-        moxyJsonProvider.setAttributePrefix("@");
-        moxyJsonProvider.setFormattedOutput(true);
-        moxyJsonProvider.setIncludeRoot(false);
-        moxyJsonProvider.setMarshalEmptyCollections(true);
-        moxyJsonProvider.setValueWrapper("$");
-
-        Map<String, String> namespacePrefixMapper = new HashMap<String, String>(3);
-        namespacePrefixMapper.put("router", "router");        // FIXME: fill in with XSD
-        namespacePrefixMapper.put("provider", "provider");    // FIXME: fill in with XSD
-        namespacePrefixMapper.put("binding", "binding");
-        moxyJsonProvider.setNamespacePrefixMapper(namespacePrefixMapper);
-        moxyJsonProvider.setNamespaceSeparator(':');
-
-        HashSet<Object> set = new HashSet<Object>(1);
-        set.add(moxyJsonProvider);
-        return set;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPageLink.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPageLink.java
deleted file mode 100644 (file)
index f65d7f6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2014 Hewlett-Packard Development Company L.P
- *
- * 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
- *
- * Authors : Dave Tucker
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronPageLink {
-
-    @XmlElement(name="ref")
-    String ref;
-
-    @XmlElement (name="href")
-    String href;
-
-    public String getRef() {
-        return ref;
-    }
-
-    public void setRef(String ref) {
-        this.ref = ref;
-    }
-
-    public String getHref() {
-        return href;
-    }
-
-    public void setHref(String href) {
-        this.href = href;
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortRequest.java
deleted file mode 100644 (file)
index 3bfac8a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronPortRequest implements INeutronRequest<NeutronPort> {
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="port")
-    NeutronPort singletonPort;
-
-    @XmlElement(name="ports")
-    List<NeutronPort> bulkRequest;
-
-    @XmlElement(name="ports_links")
-    List<NeutronPageLink> links;
-
-    NeutronPortRequest() {
-    }
-
-    public NeutronPortRequest(List<NeutronPort> bulkRequest, List<NeutronPageLink> links) {
-        this.bulkRequest = bulkRequest;
-        this.links = links;
-        this.singletonPort = null;
-    }
-
-    NeutronPortRequest(List<NeutronPort> bulk) {
-        bulkRequest = bulk;
-        singletonPort = null;
-    }
-
-    NeutronPortRequest(NeutronPort port) {
-        singletonPort = port;
-    }
-
-    @Override
-    public NeutronPort getSingleton() {
-        return singletonPort;
-    }
-
-    @Override
-    public boolean isSingleton() {
-        return (singletonPort != null);
-    }
-
-    @Override
-    public List<NeutronPort> getBulk() {
-        return bulkRequest;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java
deleted file mode 100644 (file)
index 5ff3de5..0000000
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-import org.opendaylight.controller.networkconfig.neutron.Neutron_IPs;
-
-/**
- * Neutron Northbound REST APIs.<br>
- * This class provides REST APIs for managing neutron port objects
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-@Path("/ports")
-public class NeutronPortsNorthbound {
-
-    final String mac_regex="^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$";
-
-    private NeutronPort extractFields(NeutronPort o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    @Context
-    UriInfo uriInfo;
-
-    /**
-     * Returns a list of all Ports */
-
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response listPorts(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // note: openstack isn't clear about filtering on lists, so we aren't handling them
-            @QueryParam("id") String queryID,
-            @QueryParam("network_id") String queryNetworkID,
-            @QueryParam("name") String queryName,
-            @QueryParam("admin_state_up") String queryAdminStateUp,
-            @QueryParam("status") String queryStatus,
-            @QueryParam("mac_address") String queryMACAddress,
-            @QueryParam("device_id") String queryDeviceID,
-            @QueryParam("device_owner") String queryDeviceOwner,
-            @QueryParam("tenant_id") String queryTenantID,
-            // linkTitle
-            @QueryParam("limit") Integer limit,
-            @QueryParam("marker") String marker,
-            @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
-            // sorting not supported
-            ) {
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronPort> allPorts = portInterface.getAllPorts();
-        List<NeutronPort> ans = new ArrayList<NeutronPort>();
-        Iterator<NeutronPort> i = allPorts.iterator();
-        while (i.hasNext()) {
-            NeutronPort oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp())) &&
-                    (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
-                    (queryMACAddress == null || queryMACAddress.equals(oSS.getMacAddress())) &&
-                    (queryDeviceID == null || queryDeviceID.equals(oSS.getDeviceID())) &&
-                    (queryDeviceOwner == null || queryDeviceOwner.equals(oSS.getDeviceOwner())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
-                } else {
-                    ans.add(oSS);
-                }
-            }
-        }
-
-        if (limit != null && ans.size() > 1) {
-            // Return a paginated request
-            NeutronPortRequest request = (NeutronPortRequest) PaginatedRequestFactory.createRequest(limit,
-                    marker, pageReverse, uriInfo, ans, NeutronPort.class);
-            return Response.status(200).entity(request).build();
-        }
-
-        return Response.status(200).entity(
-                new NeutronPortRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Port */
-
-    @Path("{portUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showPort(
-            @PathParam("portUUID") String portUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields ) {
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!portInterface.portExists(portUUID)) {
-            throw new ResourceNotFoundException("port UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronPort ans = portInterface.getPort(portUUID);
-            return Response.status(200).entity(
-                    new NeutronPortRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(
-                    new NeutronPortRequest(portInterface.getPort(portUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Ports */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = 201, condition = "Created"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 403, condition = "Forbidden"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 409, condition = "Conflict"),
-        @ResponseCode(code = 501, condition = "Not Implemented"),
-        @ResponseCode(code = 503, condition = "MAC generation failure") })
-    public Response createPorts(final NeutronPortRequest input) {
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronPort singleton = input.getSingleton();
-
-            /*
-             * the port must be part of an existing network, must not already exist,
-             * have a valid MAC and the MAC not be in use
-             */
-            if (singleton.getNetworkUUID() == null) {
-                throw new BadRequestException("network UUID musy be specified");
-            }
-            if (portInterface.portExists(singleton.getID())) {
-                throw new BadRequestException("port UUID already exists");
-            }
-            if (!networkInterface.networkExists(singleton.getNetworkUUID())) {
-                throw new ResourceNotFoundException("network UUID does not exist.");
-            }
-            if (singleton.getMacAddress() == null ||
-                    !singleton.getMacAddress().matches(mac_regex)) {
-                throw new BadRequestException("MAC address not properly formatted");
-            }
-            if (portInterface.macInUse(singleton.getMacAddress())) {
-                throw new ResourceConflictException("MAC Address is in use.");
-            }
-            /*
-             * if fixed IPs are specified, each one has to have an existing subnet ID
-             * that is in the same scoping network as the port.  In addition, if an IP
-             * address is specified it has to be a valid address for the subnet and not
-             * already in use
-             */
-            List<Neutron_IPs> fixedIPs = singleton.getFixedIPs();
-            if (fixedIPs != null && fixedIPs.size() > 0) {
-                Iterator<Neutron_IPs> fixedIPIterator = fixedIPs.iterator();
-                while (fixedIPIterator.hasNext()) {
-                    Neutron_IPs ip = fixedIPIterator.next();
-                    if (ip.getSubnetUUID() == null) {
-                        throw new BadRequestException("subnet UUID not specified");
-                    }
-                    if (!subnetInterface.subnetExists(ip.getSubnetUUID())) {
-                        throw new BadRequestException("subnet UUID must exists");
-                    }
-                    NeutronSubnet subnet = subnetInterface.getSubnet(ip.getSubnetUUID());
-                    if (!singleton.getNetworkUUID().equalsIgnoreCase(subnet.getNetworkUUID())) {
-                        throw new BadRequestException("network UUID must match that of subnet");
-                    }
-                    if (ip.getIpAddress() != null) {
-                        if (!subnet.isValidIP(ip.getIpAddress())) {
-                            throw new BadRequestException("IP address is not valid");
-                        }
-                        if (subnet.isIPInUse(ip.getIpAddress())) {
-                            throw new ResourceConflictException("IP address is in use.");
-                        }
-                    }
-                }
-            }
-
-            Object[] instances = NeutronUtil.getInstances(INeutronPortAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronPortAware service = (INeutronPortAware) instance;
-                        int status = service.canCreatePort(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-
-            // add the port to the cache
-            portInterface.addPort(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronPortAware service = (INeutronPortAware) instance;
-                    service.neutronPortCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronPort> bulk = input.getBulk();
-            Iterator<NeutronPort> i = bulk.iterator();
-            HashMap<String, NeutronPort> testMap = new HashMap<String, NeutronPort>();
-            Object[] instances = NeutronUtil.getInstances(INeutronPortAware.class, this);
-            while (i.hasNext()) {
-                NeutronPort test = i.next();
-
-                /*
-                 * the port must be part of an existing network, must not already exist,
-                 * have a valid MAC and the MAC not be in use.  Further the bulk request
-                 * can't already contain a new port with the same UUID
-                 */
-                if (portInterface.portExists(test.getID())) {
-                    throw new BadRequestException("port UUID already exists");
-                }
-                if (testMap.containsKey(test.getID())) {
-                    throw new BadRequestException("port UUID already exists");
-                }
-                for (NeutronPort check : testMap.values()) {
-                    if (test.getMacAddress().equalsIgnoreCase(check.getMacAddress())) {
-                        throw new ResourceConflictException("MAC address already allocated");
-                    }
-                    for (Neutron_IPs test_fixedIP : test.getFixedIPs()) {
-                        for (Neutron_IPs check_fixedIP : check.getFixedIPs()) {
-                            if (test_fixedIP.getIpAddress().equals(check_fixedIP.getIpAddress())) {
-                                throw new ResourceConflictException("IP address already allocated");
-                            }
-                        }
-                    }
-                }
-                testMap.put(test.getID(), test);
-                if (!networkInterface.networkExists(test.getNetworkUUID())) {
-                    throw new ResourceNotFoundException("network UUID does not exist.");
-                }
-                if (!test.getMacAddress().matches(mac_regex)) {
-                    throw new BadRequestException("MAC address not properly formatted");
-                }
-                if (portInterface.macInUse(test.getMacAddress())) {
-                    throw new ResourceConflictException("MAC address in use");
-                }
-
-                /*
-                 * if fixed IPs are specified, each one has to have an existing subnet ID
-                 * that is in the same scoping network as the port.  In addition, if an IP
-                 * address is specified it has to be a valid address for the subnet and not
-                 * already in use (or be the gateway IP address of the subnet)
-                 */
-                List<Neutron_IPs> fixedIPs = test.getFixedIPs();
-                if (fixedIPs != null && fixedIPs.size() > 0) {
-                    Iterator<Neutron_IPs> fixedIPIterator = fixedIPs.iterator();
-                    while (fixedIPIterator.hasNext()) {
-                        Neutron_IPs ip = fixedIPIterator.next();
-                        if (ip.getSubnetUUID() == null) {
-                            throw new BadRequestException("subnet UUID must be specified");
-                        }
-                        if (!subnetInterface.subnetExists(ip.getSubnetUUID())) {
-                            throw new BadRequestException("subnet UUID doesn't exists");
-                        }
-                        NeutronSubnet subnet = subnetInterface.getSubnet(ip.getSubnetUUID());
-                        if (!test.getNetworkUUID().equalsIgnoreCase(subnet.getNetworkUUID())) {
-                            throw new BadRequestException("network UUID must match that of subnet");
-                        }
-                        if (ip.getIpAddress() != null) {
-                            if (!subnet.isValidIP(ip.getIpAddress())) {
-                                throw new BadRequestException("ip address not valid");
-                            }
-                            //TODO: need to add consideration for a fixed IP being assigned the same address as a allocated IP in the
-                            //same bulk create
-                            if (subnet.isIPInUse(ip.getIpAddress())) {
-                                throw new ResourceConflictException("IP address in use");
-                            }
-                        }
-                    }
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronPortAware service = (INeutronPortAware) instance;
-                            int status = service.canCreatePort(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-
-            //once everything has passed, then we can add to the cache
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronPort test = i.next();
-                portInterface.addPort(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronPortAware service = (INeutronPortAware) instance;
-                        service.neutronPortCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Port */
-
-    @Path("{portUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackPorts.class)
-    @StatusCodes({
-        @ResponseCode(code = 200, condition = "Operation successful"),
-        @ResponseCode(code = 400, condition = "Bad Request"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 403, condition = "Forbidden"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 409, condition = "Conflict"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updatePort(
-            @PathParam("portUUID") String portUUID,
-            NeutronPortRequest input
-            ) {
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        // port has to exist and only a single delta is supported
-        if (!portInterface.portExists(portUUID)) {
-            throw new ResourceNotFoundException("port UUID does not exist.");
-        }
-        NeutronPort target = portInterface.getPort(portUUID);
-        if (!input.isSingleton()) {
-            throw new BadRequestException("only singleton edit suported");
-        }
-        NeutronPort singleton = input.getSingleton();
-        NeutronPort original = portInterface.getPort(portUUID);
-
-        // deltas restricted by Neutron
-        if (singleton.getID() != null || singleton.getTenantID() != null ||
-                singleton.getStatus() != null) {
-            throw new BadRequestException("attribute change blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronPortAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronPortAware service = (INeutronPortAware) instance;
-                    int status = service.canUpdatePort(singleton, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        // Verify the new fixed ips are valid
-        List<Neutron_IPs> fixedIPs = singleton.getFixedIPs();
-        if (fixedIPs != null && fixedIPs.size() > 0) {
-            Iterator<Neutron_IPs> fixedIPIterator = fixedIPs.iterator();
-            while (fixedIPIterator.hasNext()) {
-                Neutron_IPs ip = fixedIPIterator.next();
-                if (ip.getSubnetUUID() == null) {
-                    throw new BadRequestException("subnet UUID must be specified");
-                }
-                if (!subnetInterface.subnetExists(ip.getSubnetUUID())) {
-                    throw new BadRequestException("subnet UUID doesn't exist.");
-                }
-                NeutronSubnet subnet = subnetInterface.getSubnet(ip.getSubnetUUID());
-                if (!target.getNetworkUUID().equalsIgnoreCase(subnet.getNetworkUUID())) {
-                    throw new BadRequestException("network UUID must match that of subnet");
-                }
-                if (ip.getIpAddress() != null) {
-                    if (!subnet.isValidIP(ip.getIpAddress())) {
-                        throw new BadRequestException("invalid IP address");
-                    }
-                    if (subnet.isIPInUse(ip.getIpAddress())) {
-                        throw new ResourceConflictException("IP address in use");
-                    }
-                }
-            }
-        }
-
-        //        TODO: Support change of security groups
-        // update the port and return the modified object
-        portInterface.updatePort(portUUID, singleton);
-        NeutronPort updatedPort = portInterface.getPort(portUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronPortAware service = (INeutronPortAware) instance;
-                service.neutronPortUpdated(updatedPort);
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronPortRequest(updatedPort)).build();
-
-    }
-
-    /**
-     * Deletes a Port */
-
-    @Path("{portUUID}")
-    @DELETE
-    @StatusCodes({
-        @ResponseCode(code = 204, condition = "No Content"),
-        @ResponseCode(code = 401, condition = "Unauthorized"),
-        @ResponseCode(code = 403, condition = "Forbidden"),
-        @ResponseCode(code = 404, condition = "Not Found"),
-        @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deletePort(
-            @PathParam("portUUID") String portUUID) {
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        // port has to exist and not be owned by anyone.  then it can be removed from the cache
-        if (!portInterface.portExists(portUUID)) {
-            throw new ResourceNotFoundException("port UUID does not exist.");
-        }
-        NeutronPort port = portInterface.getPort(portUUID);
-        if (port.getDeviceID() != null ||
-                port.getDeviceOwner() != null) {
-            Response.status(403).build();
-        }
-        NeutronPort singleton = portInterface.getPort(portUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronPortAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronPortAware service = (INeutronPortAware) instance;
-                    int status = service.canDeletePort(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        portInterface.removePort(portUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronPortAware service = (INeutronPortAware) instance;
-                service.neutronPortDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRouterRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRouterRequest.java
deleted file mode 100644 (file)
index 806fd69..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronRouterRequest {
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="router")
-    NeutronRouter singletonRouter;
-
-    @XmlElement(name="routers")
-    List<NeutronRouter> bulkRequest;
-
-    NeutronRouterRequest() {
-    }
-
-    NeutronRouterRequest(List<NeutronRouter> bulk) {
-        bulkRequest = bulk;
-        singletonRouter = null;
-    }
-
-    NeutronRouterRequest(NeutronRouter router) {
-        singletonRouter = router;
-    }
-
-    public List<NeutronRouter> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronRouter getSingleton() {
-        return singletonRouter;
-    }
-
-    public boolean isSingleton() {
-        return (singletonRouter != null);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java
deleted file mode 100644 (file)
index ccf5ddd..0000000
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronRouterAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronRouterCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronRouter;
-import org.opendaylight.controller.networkconfig.neutron.NeutronRouter_Interface;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-
-
-/**
- * Neutron Northbound REST APIs.<br>
- * This class provides REST APIs for managing neutron routers
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-@Path("/routers")
-public class NeutronRoutersNorthbound {
-
-    private NeutronRouter extractFields(NeutronRouter o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Routers */
-
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response listRouters(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // note: openstack isn't clear about filtering on lists, so we aren't handling them
-            @QueryParam("id") String queryID,
-            @QueryParam("name") String queryName,
-            @QueryParam("admin_state_up") String queryAdminStateUp,
-            @QueryParam("status") String queryStatus,
-            @QueryParam("tenant_id") String queryTenantID,
-            @QueryParam("external_gateway_info") String queryExternalGatewayInfo,
-            // pagination
-            @QueryParam("limit") String limit,
-            @QueryParam("marker") String marker,
-            @QueryParam("page_reverse") String pageReverse
-            // sorting not supported
-            ) {
-        INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this);
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException("Router CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronRouter> allRouters = routerInterface.getAllRouters();
-        List<NeutronRouter> ans = new ArrayList<NeutronRouter>();
-        Iterator<NeutronRouter> i = allRouters.iterator();
-        while (i.hasNext()) {
-            NeutronRouter oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp())) &&
-                    (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
-                    (queryExternalGatewayInfo == null || queryExternalGatewayInfo.equals(oSS.getExternalGatewayInfo())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
-                if (fields.size() > 0)
-                    ans.add(extractFields(oSS,fields));
-                else
-                    ans.add(oSS);
-            }
-        }
-        //TODO: apply pagination to results
-        return Response.status(200).entity(
-                new NeutronRouterRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Router */
-
-    @Path("{routerUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showRouter(
-            @PathParam("routerUUID") String routerUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this);
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException("Router CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!routerInterface.routerExists(routerUUID)) {
-            throw new ResourceNotFoundException("Router UUID not found");
-        }
-        if (fields.size() > 0) {
-            NeutronRouter ans = routerInterface.getRouter(routerUUID);
-            return Response.status(200).entity(
-                    new NeutronRouterRequest(extractFields(ans, fields))).build();
-        } else
-            return Response.status(200).entity(
-                    new NeutronRouterRequest(routerInterface.getRouter(routerUUID))).build();
-    }
-
-    /**
-     * Creates new Routers */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createRouters(final NeutronRouterRequest input) {
-        INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this);
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException("Router CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronRouter singleton = input.getSingleton();
-
-            /*
-             * verify that the router doesn't already exist (issue: is deeper inspection necessary?)
-             * if there is external gateway information provided, verify that the specified network
-             * exists and has been designated as "router:external"
-             */
-            if (routerInterface.routerExists(singleton.getID()))
-                throw new BadRequestException("router UUID already exists");
-            if (singleton.getExternalGatewayInfo() != null) {
-                String externNetworkPtr = singleton.getExternalGatewayInfo().getNetworkID();
-                if (!networkInterface.networkExists(externNetworkPtr))
-                    throw new BadRequestException("External Network Pointer doesn't exist");
-                NeutronNetwork externNetwork = networkInterface.getNetwork(externNetworkPtr);
-                if (!externNetwork.isRouterExternal())
-                    throw new BadRequestException("External Network Pointer isn't marked as router:external");
-            }
-            Object[] instances = NeutronUtil.getInstances(INeutronRouterAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronRouterAware service = (INeutronRouterAware) instance;
-                        int status = service.canCreateRouter(singleton);
-                        if (status < 200 || status > 299)
-                            return Response.status(status).build();
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-
-            /*
-             * add router to the cache
-             */
-            routerInterface.addRouter(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronRouterAware service = (INeutronRouterAware) instance;
-                    service.neutronRouterCreated(singleton);
-                }
-            }
-        } else {
-
-            /*
-             * only singleton router creates supported
-             */
-            throw new BadRequestException("Only singleton router creates supported");
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Router */
-
-    @Path("{routerUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackRouters.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateRouter(
-            @PathParam("routerUUID") String routerUUID,
-            NeutronRouterRequest input
-            ) {
-        INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this);
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException("Router CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * router has to exist and only a single delta can be supplied
-         */
-        if (!routerInterface.routerExists(routerUUID))
-            throw new ResourceNotFoundException("Router UUID not found");
-        if (!input.isSingleton())
-            throw new BadRequestException("Only single router deltas supported");
-        NeutronRouter singleton = input.getSingleton();
-        NeutronRouter original = routerInterface.getRouter(routerUUID);
-
-        /*
-         * attribute changes blocked by Neutron
-         */
-        if (singleton.getID() != null || singleton.getTenantID() != null ||
-                singleton.getStatus() != null)
-            throw new BadRequestException("Request attribute change not allowed");
-
-        Object[] instances = NeutronUtil.getInstances(INeutronRouterAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronRouterAware service = (INeutronRouterAware) instance;
-                    int status = service.canUpdateRouter(singleton, original);
-                    if (status < 200 || status > 299)
-                        return Response.status(status).build();
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        /*
-         * if the external gateway info is being changed, verify that the new network
-         * exists and has been designated as an external network
-         */
-        if (singleton.getExternalGatewayInfo() != null) {
-            String externNetworkPtr = singleton.getExternalGatewayInfo().getNetworkID();
-            if (!networkInterface.networkExists(externNetworkPtr))
-                throw new BadRequestException("External Network Pointer does not exist");
-            NeutronNetwork externNetwork = networkInterface.getNetwork(externNetworkPtr);
-            if (!externNetwork.isRouterExternal())
-                throw new BadRequestException("External Network Pointer isn't marked as router:external");
-        }
-
-        /*
-         * update the router entry and return the modified object
-         */
-        routerInterface.updateRouter(routerUUID, singleton);
-        NeutronRouter updatedRouter = routerInterface.getRouter(routerUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronRouterAware service = (INeutronRouterAware) instance;
-                service.neutronRouterUpdated(updatedRouter);
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronRouterRequest(routerInterface.getRouter(routerUUID))).build();
-
-    }
-
-    /**
-     * Deletes a Router */
-
-    @Path("{routerUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteRouter(
-            @PathParam("routerUUID") String routerUUID) {
-        INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this);
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException("Router CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify that the router exists and is not in use before removing it
-         */
-        if (!routerInterface.routerExists(routerUUID))
-            throw new ResourceNotFoundException("Router UUID not found");
-        if (routerInterface.routerInUse(routerUUID))
-            throw new ResourceConflictException("Router UUID in Use");
-        NeutronRouter singleton = routerInterface.getRouter(routerUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronRouterAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronRouterAware service = (INeutronRouterAware) instance;
-                    int status = service.canDeleteRouter(singleton);
-                    if (status < 200 || status > 299)
-                        return Response.status(status).build();
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-        routerInterface.removeRouter(routerUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronRouterAware service = (INeutronRouterAware) instance;
-                service.neutronRouterDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-
-    /**
-     * Adds an interface to a router */
-
-    @Path("{routerUUID}/add_router_interface")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackRouterInterfaces.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response addRouterInterface(
-            @PathParam("routerUUID") String routerUUID,
-            NeutronRouter_Interface input
-            ) {
-        INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this);
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException("Router CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         *  While the Neutron specification says that the router has to exist and the input can only specify either a subnet id
-         *  or a port id, but not both, this code assumes that the plugin has filled everything in for us and so both must be present
-         */
-        if (!routerInterface.routerExists(routerUUID))
-            throw new BadRequestException("Router UUID doesn't exist");
-        NeutronRouter target = routerInterface.getRouter(routerUUID);
-        if (input.getSubnetUUID() == null ||
-                    input.getPortUUID() == null)
-            throw new BadRequestException("Must specify at subnet id, port id or both");
-
-        // check that the port is part of the subnet
-        NeutronSubnet targetSubnet = subnetInterface.getSubnet(input.getSubnetUUID());
-        if (targetSubnet == null)
-            throw new BadRequestException("Subnet id doesn't exist");
-        NeutronPort targetPort = portInterface.getPort(input.getPortUUID());
-        if (targetPort == null)
-            throw new BadRequestException("Port id doesn't exist");
-        if (!targetSubnet.getPortsInSubnet().contains(targetPort))
-            throw new BadRequestException("Port id not part of subnet id");
-
-        if (targetPort.getFixedIPs().size() != 1)
-            throw new BadRequestException("Port id must have a single fixedIP address");
-        if (targetPort.getDeviceID() != null ||
-                targetPort.getDeviceOwner() != null)
-            throw new ResourceConflictException("Target Port already allocated");
-        Object[] instances = NeutronUtil.getInstances(INeutronRouterAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronRouterAware service = (INeutronRouterAware) instance;
-                    int status = service.canAttachInterface(target, input);
-                    if (status < 200 || status > 299)
-                        return Response.status(status).build();
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        //mark the port device id and device owner fields
-        targetPort.setDeviceOwner("network:router_interface");
-        targetPort.setDeviceID(routerUUID);
-
-        target.addInterface(input.getPortUUID(), input);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronRouterAware service = (INeutronRouterAware) instance;
-                service.neutronRouterInterfaceAttached(target, input);
-            }
-        }
-
-        return Response.status(200).entity(input).build();
-    }
-
-    /**
-     * Removes an interface to a router */
-
-    @Path("{routerUUID}/remove_router_interface")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackRouterInterfaces.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response removeRouterInterface(
-            @PathParam("routerUUID") String routerUUID,
-            NeutronRouter_Interface input
-            ) {
-        INeutronRouterCRUD routerInterface = NeutronCRUDInterfaces.getINeutronRouterCRUD(this);
-        if (routerInterface == null) {
-            throw new ServiceUnavailableException("Router CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronPortCRUD portInterface = NeutronCRUDInterfaces.getINeutronPortCRUD(this);
-        if (portInterface == null) {
-            throw new ServiceUnavailableException("Port CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        // verify the router exists
-        if (!routerInterface.routerExists(routerUUID))
-            throw new BadRequestException("Router does not exist");
-        NeutronRouter target = routerInterface.getRouter(routerUUID);
-
-        /*
-         * remove by subnet id.  Collect information about the impacted router for the response and
-         * remove the port corresponding to the gateway IP address of the subnet
-         */
-        if (input.getPortUUID() == null &&
-                input.getSubnetUUID() != null) {
-            NeutronPort port = portInterface.getGatewayPort(input.getSubnetUUID());
-            if (port == null)
-                throw new ResourceNotFoundException("Port UUID not found");
-            input.setPortUUID(port.getID());
-            input.setID(target.getID());
-            input.setTenantID(target.getTenantID());
-
-            Object[] instances = NeutronUtil.getInstances(INeutronRouterAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronRouterAware service = (INeutronRouterAware) instance;
-                        int status = service.canDetachInterface(target, input);
-                        if (status < 200 || status > 299)
-                            return Response.status(status).build();
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-
-            // reset the port ownership
-            port.setDeviceID(null);
-            port.setDeviceOwner(null);
-
-            target.removeInterface(input.getPortUUID());
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronRouterAware service = (INeutronRouterAware) instance;
-                    service.neutronRouterInterfaceDetached(target, input);
-                }
-            }
-            return Response.status(200).entity(input).build();
-        }
-
-        /*
-         * remove by port id. collect information about the impacted router for the response
-         * remove the interface and reset the port ownership
-         */
-        if (input.getPortUUID() != null &&
-                input.getSubnetUUID() == null) {
-            NeutronRouter_Interface targetInterface = target.getInterfaces().get(input.getPortUUID());
-            if (targetInterface == null) {
-                throw new ResourceNotFoundException("Router interface not found for given Port UUID");
-            }
-            input.setSubnetUUID(targetInterface.getSubnetUUID());
-            input.setID(target.getID());
-            input.setTenantID(target.getTenantID());
-            Object[] instances = NeutronUtil.getInstances(INeutronRouterAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronRouterAware service = (INeutronRouterAware) instance;
-                        int status = service.canDetachInterface(target, input);
-                        if (status < 200 || status > 299)
-                            return Response.status(status).build();
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            NeutronPort port = portInterface.getPort(input.getPortUUID());
-            port.setDeviceID(null);
-            port.setDeviceOwner(null);
-            target.removeInterface(input.getPortUUID());
-            for (Object instance : instances) {
-                INeutronRouterAware service = (INeutronRouterAware) instance;
-                service.neutronRouterInterfaceDetached(target, input);
-            }
-            return Response.status(200).entity(input).build();
-        }
-
-        /*
-         * remove by both port and subnet ID.  Verify that the first fixed IP of the port is a valid
-         * IP address for the subnet, and then remove the interface, collecting information about the
-         * impacted router for the response and reset port ownership
-         */
-        if (input.getPortUUID() != null &&
-                input.getSubnetUUID() != null) {
-            NeutronPort port = portInterface.getPort(input.getPortUUID());
-            if (port == null) {
-                throw new ResourceNotFoundException("Port UUID not found");
-            }
-            if (port.getFixedIPs() == null) {
-                throw new ResourceNotFoundException("Port UUID has no fixed IPs");
-            }
-            NeutronSubnet subnet = subnetInterface.getSubnet(input.getSubnetUUID());
-            if (subnet == null) {
-                throw new ResourceNotFoundException("Subnet UUID not found");
-            }
-            if (!subnet.isValidIP(port.getFixedIPs().get(0).getIpAddress()))
-                throw new ResourceConflictException("Target Port IP not in Target Subnet");
-            Object[] instances = NeutronUtil.getInstances(INeutronRouterAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronRouterAware service = (INeutronRouterAware) instance;
-                        int status = service.canDetachInterface(target, input);
-                        if (status < 200 || status > 299)
-                            return Response.status(status).build();
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            input.setID(target.getID());
-            input.setTenantID(target.getTenantID());
-            port.setDeviceID(null);
-            port.setDeviceOwner(null);
-            target.removeInterface(input.getPortUUID());
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronRouterAware service = (INeutronRouterAware) instance;
-                    service.canDetachInterface(target, input);
-                }
-            }            for (Object instance : instances) {
-                INeutronRouterAware service = (INeutronRouterAware) instance;
-                service.neutronRouterInterfaceDetached(target, input);
-            }
-            return Response.status(200).entity(input).build();
-        }
-
-        // have to specify either a port ID or a subnet ID
-        throw new BadRequestException("Must specify port id or subnet id or both");
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupRequest.java
deleted file mode 100644 (file)
index 6e779d6..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityGroup;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType (XmlAccessType.NONE)
-
-public class NeutronSecurityGroupRequest {
-    /**
-    * See OpenStack Network API v2.0 Reference for a
-    * description of annotated attributes and operations
-    */
-
-    @XmlElement (name = "security_group")
-    NeutronSecurityGroup singletonSecurityGroup;
-
-    @XmlElement (name = "security_groups")
-    List<NeutronSecurityGroup> bulkRequest;
-
-    NeutronSecurityGroupRequest() {
-    }
-
-    NeutronSecurityGroupRequest(List<NeutronSecurityGroup> bulk) {
-        bulkRequest = bulk;
-        singletonSecurityGroup = null;
-    }
-
-    NeutronSecurityGroupRequest(NeutronSecurityGroup group) {
-        singletonSecurityGroup = group;
-    }
-
-    public List<NeutronSecurityGroup> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronSecurityGroup getSingleton() {
-        return singletonSecurityGroup;
-    }
-
-    public boolean isSingleton() {
-        return (singletonSecurityGroup != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupsNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityGroupsNorthbound.java
deleted file mode 100644 (file)
index d9ca6d4..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityGroupAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityGroupCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityGroup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Neutron Northbound REST APIs for Security Group.<br>
- * This class provides REST APIs for managing neutron Security Group
- * <p/>
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- */
-@Path ("/security-groups")
-public class NeutronSecurityGroupsNorthbound {
-    static final Logger logger = LoggerFactory.getLogger(NeutronSecurityGroupsNorthbound.class);
-
-    private NeutronSecurityGroup extractFields(NeutronSecurityGroup o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Security Groups
-     */
-    @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 200, condition = "Operation successful"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-
-    public Response listGroups(
-            // return fields
-            @QueryParam ("fields") List<String> fields,
-            // OpenStack security group attributes
-            @QueryParam ("id") String querySecurityGroupUUID,
-            @QueryParam ("name") String querySecurityGroupName,
-            @QueryParam ("description") String querySecurityDescription,
-            @QueryParam ("tenant_id") String querySecurityTenantID,
-            @QueryParam ("limit") String limit,
-            @QueryParam ("marker") String marker,
-            @QueryParam ("page_reverse") String pageReverse
-    ) {
-        INeutronSecurityGroupCRUD securityGroupInterface = NeutronCRUDInterfaces.getINeutronSecurityGroupCRUD(this);
-
-        if (securityGroupInterface == null) {
-            throw new ServiceUnavailableException("Security Group CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronSecurityGroup> allSecurityGroups = securityGroupInterface.getAllNeutronSecurityGroups();
-        List<NeutronSecurityGroup> ans = new ArrayList<NeutronSecurityGroup>();
-        Iterator<NeutronSecurityGroup> i = allSecurityGroups.iterator();
-        while (i.hasNext()) {
-            NeutronSecurityGroup nsg = i.next();
-            if ((querySecurityGroupUUID == null ||
-                    querySecurityGroupUUID.equals(nsg.getSecurityGroupUUID())) &&
-                    (querySecurityGroupName == null ||
-                            querySecurityGroupName.equals(nsg.getSecurityGroupName())) &&
-                    (querySecurityDescription == null ||
-                            querySecurityDescription.equals(nsg.getSecurityGroupDescription())) &&
-                    (querySecurityTenantID == null ||
-                            querySecurityTenantID.equals(nsg.getSecurityGroupTenantID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsg, fields));
-                } else {
-                    ans.add(nsg);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronSecurityGroupRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Security Group
-     */
-
-    @Path ("{securityGroupUUID}")
-    @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 200, condition = "Operation successful"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response showSecurityGroup(@PathParam ("securityGroupUUID") String securityGroupUUID,
-                                      // return fields
-                                      @QueryParam ("fields") List<String> fields) {
-        INeutronSecurityGroupCRUD securityGroupInterface = NeutronCRUDInterfaces.getINeutronSecurityGroupCRUD(this);
-        if (securityGroupInterface == null) {
-            throw new ServiceUnavailableException("Security Group CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!securityGroupInterface.neutronSecurityGroupExists(securityGroupUUID)) {
-            throw new ResourceNotFoundException("Security Group UUID does not exist.");
-        }
-        if (!fields.isEmpty()) {
-            NeutronSecurityGroup ans = securityGroupInterface.getNeutronSecurityGroup(securityGroupUUID);
-            return Response.status(200).entity(
-                    new NeutronSecurityGroupRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronSecurityGroupRequest(securityGroupInterface.getNeutronSecurityGroup(securityGroupUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Security Group
-     */
-
-    @POST
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 201, condition = "Created"),
-            @ResponseCode (code = 400, condition = "Bad Request"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 403, condition = "Forbidden"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 409, condition = "Conflict"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response createSecurityGroups(final NeutronSecurityGroupRequest input) {
-        INeutronSecurityGroupCRUD securityGroupInterface = NeutronCRUDInterfaces.getINeutronSecurityGroupCRUD(this);
-        if (securityGroupInterface == null) {
-            throw new ServiceUnavailableException("Security Group CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        if (input.isSingleton()) {
-            NeutronSecurityGroup singleton = input.getSingleton();
-
-            /*
-             *  Verify that the Security Group doesn't already exist.
-             */
-            if (securityGroupInterface.neutronSecurityGroupExists(singleton.getSecurityGroupUUID())) {
-                throw new BadRequestException("Security Group UUID already exists");
-            }
-
-            Object[] instances = NeutronUtil.getInstances(INeutronSecurityGroupAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                        int status = service.canCreateNeutronSecurityGroup(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            // Add to Neutron cache
-            securityGroupInterface.addNeutronSecurityGroup(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                    service.neutronSecurityGroupCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronSecurityGroup> bulk = input.getBulk();
-            Iterator<NeutronSecurityGroup> i = bulk.iterator();
-            HashMap<String, NeutronSecurityGroup> testMap = new HashMap<String, NeutronSecurityGroup>();
-            Object[] instances = NeutronUtil.getInstances(INeutronSecurityGroupAware.class, this);
-            while (i.hasNext()) {
-                NeutronSecurityGroup test = i.next();
-
-                /*
-                 *  Verify that the security group doesn't already exist
-                 */
-
-                if (securityGroupInterface.neutronSecurityGroupExists(test.getSecurityGroupUUID())) {
-                    throw new BadRequestException("Security Group UUID already is already created");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                            int status = service.canCreateNeutronSecurityGroup(test);
-                            if ((status < 200) || (status > 299)) return Response.status(status).build();
-                        }
-                    } else {
-                        throw new BadRequestException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronSecurityGroup test = i.next();
-                securityGroupInterface.addNeutronSecurityGroup(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                        service.neutronSecurityGroupCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Security Group
-     */
-
-    @Path ("{securityGroupUUID}")
-    @PUT
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 200, condition = "Operation successful"),
-            @ResponseCode (code = 400, condition = "Bad Request"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 403, condition = "Forbidden"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response updateSecurityGroup(
-            @PathParam ("securityGroupUUID") String securityGroupUUID, final NeutronSecurityGroupRequest input) {
-        INeutronSecurityGroupCRUD securityGroupInterface = NeutronCRUDInterfaces.getINeutronSecurityGroupCRUD(this);
-        if (securityGroupInterface == null) {
-            throw new ServiceUnavailableException("Security Group CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Security Group exists and there is only one delta provided
-         */
-        if (!securityGroupInterface.neutronSecurityGroupExists(securityGroupUUID)) {
-            throw new ResourceNotFoundException("Security Group UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronSecurityGroup delta = input.getSingleton();
-        NeutronSecurityGroup original = securityGroupInterface.getNeutronSecurityGroup(securityGroupUUID);
-
-        if (delta.getSecurityGroupUUID() != null ||
-                delta.getSecurityGroupTenantID() != null ||
-                delta.getSecurityGroupName() != null ||
-                delta.getSecurityGroupDescription() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances =  NeutronUtil.getInstances(INeutronSecurityGroupAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                    int status = service.canUpdateNeutronSecurityGroup(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        securityGroupInterface.updateNeutronSecurityGroup(securityGroupUUID, delta);
-        NeutronSecurityGroup updatedSecurityGroup = securityGroupInterface.getNeutronSecurityGroup(securityGroupUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                service.neutronSecurityGroupUpdated(updatedSecurityGroup);
-            }
-        }
-        return Response.status(200).entity(new NeutronSecurityGroupRequest(securityGroupInterface.getNeutronSecurityGroup(securityGroupUUID))).build();
-    }
-
-    /**
-     * Deletes a Security Group
-     */
-
-    @Path ("{securityGroupUUID}")
-    @DELETE
-    @StatusCodes ({
-            @ResponseCode (code = 204, condition = "No Content"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 409, condition = "Conflict"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response deleteSecurityGroup(
-            @PathParam ("securityGroupUUID") String securityGroupUUID) {
-        INeutronSecurityGroupCRUD securityGroupInterface = NeutronCRUDInterfaces.getINeutronSecurityGroupCRUD(this);
-        if (securityGroupInterface == null) {
-            throw new ServiceUnavailableException("Security Group CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Security Group exists and it isn't currently in use
-         */
-        if (!securityGroupInterface.neutronSecurityGroupExists(securityGroupUUID)) {
-            throw new ResourceNotFoundException("Security Group UUID does not exist.");
-        }
-        if (securityGroupInterface.neutronSecurityGroupInUse(securityGroupUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronSecurityGroup singleton = securityGroupInterface.getNeutronSecurityGroup(securityGroupUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronSecurityGroupAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                    int status = service.canDeleteNeutronSecurityGroup(singleton);
-                    if ((status < 200) || (status > 299)) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * remove it and return 204 status
-         */
-        securityGroupInterface.removeNeutronSecurityGroup(securityGroupUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronSecurityGroupAware service = (INeutronSecurityGroupAware) instance;
-                service.neutronSecurityGroupDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRuleRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRuleRequest.java
deleted file mode 100644 (file)
index b805bd6..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityRule;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronSecurityRuleRequest {
-    /**
-     * See OpenStack Network API v2.0 Reference for a
-     * description of annotated attributes and operations
-     */
-
-    @XmlElement(name="security_group_rule")
-    NeutronSecurityRule singletonSecurityRule;
-
-    @XmlElement(name="security_group_rules")
-    List<NeutronSecurityRule> bulkRequest;
-
-    NeutronSecurityRuleRequest() {
-    }
-
-    NeutronSecurityRuleRequest(List<NeutronSecurityRule> bulk) {
-        bulkRequest = bulk;
-        singletonSecurityRule = null;
-    }
-
-    NeutronSecurityRuleRequest(NeutronSecurityRule rule) {
-        singletonSecurityRule = rule;
-    }
-
-    public NeutronSecurityRule getSingleton() {
-        return singletonSecurityRule;
-    }
-
-    public boolean isSingleton() {
-        return (singletonSecurityRule != null);
-    }
-    public List<NeutronSecurityRule> getBulk() {
-        return bulkRequest;
-    }
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRulesNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSecurityRulesNorthbound.java
deleted file mode 100644 (file)
index 9ce98e2..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityGroupCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityRuleAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSecurityRuleCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityRule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Neutron Northbound REST APIs for Security Rule.<br>
- * This class provides REST APIs for managing neutron Security Rule
- * <p/>
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- */
-
-@Path ("/security-group-rules")
-public class NeutronSecurityRulesNorthbound {
-    static final Logger logger = LoggerFactory.getLogger(NeutronSecurityRulesNorthbound.class);
-
-    private NeutronSecurityRule extractFields(NeutronSecurityRule o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    /**
-     * Returns a list of all Security Rules
-     */
-    @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 200, condition = "Operation successful"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response listRules(
-            // return fields
-            @QueryParam ("fields") List<String> fields,
-            // OpenStack security rule attributes
-            @QueryParam ("id") String querySecurityRuleUUID,
-            @QueryParam ("direction") String querySecurityRuleDirection,
-            @QueryParam ("protocol") String querySecurityRuleProtocol,
-            @QueryParam ("port_range_min") Integer querySecurityRulePortMin,
-            @QueryParam ("port_range_max") Integer querySecurityRulePortMax,
-            @QueryParam ("ethertype") String querySecurityRuleEthertype,
-            @QueryParam ("remote_ip_prefix") String querySecurityRuleIpPrefix,
-            @QueryParam ("remote_group_id") String querySecurityRemoteGroupID,
-            @QueryParam ("security_group_id") String querySecurityRuleGroupID,
-            @QueryParam ("tenant_id") String querySecurityRuleTenantID,
-            @QueryParam ("limit") String limit,
-            @QueryParam ("marker") String marker,
-            @QueryParam ("page_reverse") String pageReverse
-    ) {
-        INeutronSecurityRuleCRUD securityRuleInterface = NeutronCRUDInterfaces.getINeutronSecurityRuleCRUD(this);
-        if (securityRuleInterface == null) {
-            throw new ServiceUnavailableException("Security Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronSecurityRule> allSecurityRules = securityRuleInterface.getAllNeutronSecurityRules();
-        List<NeutronSecurityRule> ans = new ArrayList<NeutronSecurityRule>();
-        Iterator<NeutronSecurityRule> i = allSecurityRules.iterator();
-        while (i.hasNext()) {
-            NeutronSecurityRule nsr = i.next();
-            if ((querySecurityRuleUUID == null ||
-                    querySecurityRuleUUID.equals(nsr.getSecurityRuleUUID())) &&
-                    (querySecurityRuleDirection == null ||
-                            querySecurityRuleDirection.equals(nsr.getSecurityRuleDirection())) &&
-                    (querySecurityRuleProtocol == null ||
-                            querySecurityRuleProtocol.equals(nsr.getSecurityRuleProtocol())) &&
-                    (querySecurityRulePortMin == null ||
-                            querySecurityRulePortMin.equals(nsr.getSecurityRulePortMin())) &&
-                    (querySecurityRulePortMax == null ||
-                            querySecurityRulePortMax.equals(nsr.getSecurityRulePortMax())) &&
-                    (querySecurityRuleEthertype == null ||
-                            querySecurityRuleEthertype.equals(nsr.getSecurityRuleEthertype())) &&
-                    (querySecurityRuleIpPrefix == null ||
-                            querySecurityRuleIpPrefix.equals(nsr.getSecurityRuleRemoteIpPrefix())) &&
-                    (querySecurityRuleGroupID == null ||
-                            querySecurityRuleGroupID.equals(nsr.getSecurityRuleGroupID())) &&
-                    (querySecurityRemoteGroupID == null ||
-                            querySecurityRemoteGroupID.equals(nsr.getSecurityRemoteGroupID())) &&
-                    (querySecurityRuleTenantID == null ||
-                            querySecurityRuleTenantID.equals(nsr.getSecurityRuleTenantID()))) {
-                if (fields.size() > 0) {
-                    ans.add(extractFields(nsr, fields));
-                } else {
-                    ans.add(nsr);
-                }
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronSecurityRuleRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Security Rule
-     */
-
-    @Path ("{securityRuleUUID}")
-    @GET
-    @Produces ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 200, condition = "Operation successful"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response showSecurityRule(@PathParam ("securityRuleUUID") String securityRuleUUID,
-                                     // return fields
-                                     @QueryParam ("fields") List<String> fields) {
-        INeutronSecurityRuleCRUD securityRuleInterface = NeutronCRUDInterfaces.getINeutronSecurityRuleCRUD(this);
-        if (securityRuleInterface == null) {
-            throw new ServiceUnavailableException("Security Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!securityRuleInterface.neutronSecurityRuleExists(securityRuleUUID)) {
-            throw new ResourceNotFoundException("Security Rule UUID does not exist.");
-        }
-        if (!fields.isEmpty()) {
-            NeutronSecurityRule ans = securityRuleInterface.getNeutronSecurityRule(securityRuleUUID);
-            return Response.status(200).entity(
-                    new NeutronSecurityRuleRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(new NeutronSecurityRuleRequest(securityRuleInterface.getNeutronSecurityRule(securityRuleUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Security Rule
-     */
-
-    @POST
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 201, condition = "Created"),
-            @ResponseCode (code = 400, condition = "Bad Request"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 403, condition = "Forbidden"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 409, condition = "Conflict"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response createSecurityRules(final NeutronSecurityRuleRequest input) {
-        INeutronSecurityRuleCRUD securityRuleInterface = NeutronCRUDInterfaces.getINeutronSecurityRuleCRUD(this);
-        if (securityRuleInterface == null) {
-            throw new ServiceUnavailableException("Security Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronSecurityGroupCRUD securityGroupInterface = NeutronCRUDInterfaces.getINeutronSecurityGroupCRUD(this);
-        if (securityGroupInterface == null) {
-            throw new ServiceUnavailableException("Security Group CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * Existing entry checks
-        */
-
-        if (input.isSingleton()) {
-            NeutronSecurityRule singleton = input.getSingleton();
-
-            if (securityRuleInterface.neutronSecurityRuleExists(singleton.getSecurityRuleUUID())) {
-                throw new BadRequestException("Security Rule UUID already exists");
-            }
-            Object[] instances = NeutronUtil.getInstances(INeutronSecurityRuleAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                        int status = service.canCreateNeutronSecurityRule(singleton);
-                        if ((status < 200) || (status > 299)) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-
-            // add rule to cache
-            singleton.initDefaults();
-            securityRuleInterface.addNeutronSecurityRule(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                    service.neutronSecurityRuleCreated(singleton);
-                }
-            }
-
-            securityRuleInterface.addNeutronSecurityRule(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                    service.neutronSecurityRuleCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronSecurityRule> bulk = input.getBulk();
-            Iterator<NeutronSecurityRule> i = bulk.iterator();
-            HashMap<String, NeutronSecurityRule> testMap = new HashMap<String, NeutronSecurityRule>();
-            Object[] instances = NeutronUtil.getInstances(INeutronSecurityRuleAware.class, this);
-            while (i.hasNext()) {
-                NeutronSecurityRule test = i.next();
-
-                /*
-                 *  Verify that the security rule doesn't already exist
-                 */
-
-                if (securityRuleInterface.neutronSecurityRuleExists(test.getSecurityRuleUUID())) {
-                    throw new BadRequestException("Security Rule UUID already exists");
-                }
-                if (testMap.containsKey(test.getSecurityRuleUUID())) {
-                    throw new BadRequestException("Security Rule UUID already exists");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                            int status = service.canCreateNeutronSecurityRule(test);
-                            if ((status < 200) || (status > 299)) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronSecurityRule test = i.next();
-                securityRuleInterface.addNeutronSecurityRule(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                        service.neutronSecurityRuleCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Security Rule
-     */
-
-    @Path ("{securityRuleUUID}")
-    @PUT
-    @Produces ({MediaType.APPLICATION_JSON})
-    @Consumes ({MediaType.APPLICATION_JSON})
-    @StatusCodes ({
-            @ResponseCode (code = 200, condition = "Operation successful"),
-            @ResponseCode (code = 400, condition = "Bad Request"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 403, condition = "Forbidden"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response updateSecurityRule(
-            @PathParam ("securityRuleUUID") String securityRuleUUID, final NeutronSecurityRuleRequest input) {
-        INeutronSecurityRuleCRUD securityRuleInterface = NeutronCRUDInterfaces.getINeutronSecurityRuleCRUD(this);
-        if (securityRuleInterface == null) {
-            throw new ServiceUnavailableException("Security Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Security Rule exists and there is only one delta provided
-         */
-        if (!securityRuleInterface.neutronSecurityRuleExists(securityRuleUUID)) {
-            throw new ResourceNotFoundException("Security Rule UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronSecurityRule delta = input.getSingleton();
-        NeutronSecurityRule original = securityRuleInterface.getNeutronSecurityRule(securityRuleUUID);
-
-        /*
-         * updates restricted by Neutron
-         *
-         */
-        if (delta.getSecurityRuleUUID() != null ||
-                delta.getSecurityRuleDirection() != null ||
-                delta.getSecurityRuleProtocol() != null ||
-                delta.getSecurityRulePortMin() != null ||
-                delta.getSecurityRulePortMax() != null ||
-                delta.getSecurityRuleEthertype() != null ||
-                delta.getSecurityRuleRemoteIpPrefix() != null ||
-                delta.getSecurityRuleGroupID() != null ||
-                delta.getSecurityRemoteGroupID() != null ||
-                delta.getSecurityRuleTenantID() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronSecurityRuleAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                    int status = service.canUpdateNeutronSecurityRule(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        securityRuleInterface.updateNeutronSecurityRule(securityRuleUUID, delta);
-        NeutronSecurityRule updatedSecurityRule = securityRuleInterface.getNeutronSecurityRule(securityRuleUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                service.neutronSecurityRuleUpdated(updatedSecurityRule);
-            }
-        }
-        return Response.status(200).entity(new NeutronSecurityRuleRequest(securityRuleInterface.getNeutronSecurityRule(securityRuleUUID))).build();
-    }
-
-    /**
-     * Deletes a Security Rule
-     */
-
-    @Path ("{securityRuleUUID}")
-    @DELETE
-    @StatusCodes ({
-            @ResponseCode (code = 204, condition = "No Content"),
-            @ResponseCode (code = 401, condition = "Unauthorized"),
-            @ResponseCode (code = 404, condition = "Not Found"),
-            @ResponseCode (code = 409, condition = "Conflict"),
-            @ResponseCode (code = 501, condition = "Not Implemented")})
-    public Response deleteSecurityRule(
-            @PathParam ("securityRuleUUID") String securityRuleUUID) {
-        INeutronSecurityRuleCRUD securityRuleInterface = NeutronCRUDInterfaces.getINeutronSecurityRuleCRUD(this);
-        if (securityRuleInterface == null) {
-            throw new ServiceUnavailableException("Security Rule CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the Security Rule exists and it isn't currently in use
-         */
-        if (!securityRuleInterface.neutronSecurityRuleExists(securityRuleUUID)) {
-            throw new ResourceNotFoundException("Security Rule UUID does not exist.");
-        }
-        if (securityRuleInterface.neutronSecurityRuleInUse(securityRuleUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronSecurityRule singleton = securityRuleInterface.getNeutronSecurityRule(securityRuleUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronSecurityRuleAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                    int status = service.canDeleteNeutronSecurityRule(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-
-        /*
-         * remove it and return 204 status
-         */
-        securityRuleInterface.removeNeutronSecurityRule(securityRuleUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronSecurityRuleAware service = (INeutronSecurityRuleAware) instance;
-                service.neutronSecurityRuleDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetRequest.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetRequest.java
deleted file mode 100644 (file)
index 4c230c5..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron.northbound;
-
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronSubnetRequest implements INeutronRequest<NeutronSubnet> {
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="subnet")
-    NeutronSubnet singletonSubnet;
-
-    @XmlElement(name="subnets")
-    List<NeutronSubnet> bulkRequest;
-
-    @XmlElement(name="subnets_links")
-    List<NeutronPageLink> links;
-
-    NeutronSubnetRequest() {
-    }
-
-    public NeutronSubnetRequest(List<NeutronSubnet> bulkRequest, List<NeutronPageLink> links) {
-        this.bulkRequest = bulkRequest;
-        this.links = links;
-        this.singletonSubnet = null;
-    }
-
-    NeutronSubnetRequest(List<NeutronSubnet> bulk) {
-        bulkRequest = bulk;
-        singletonSubnet = null;
-        links = null;
-    }
-
-    NeutronSubnetRequest(NeutronSubnet subnet) {
-        singletonSubnet = subnet;
-        bulkRequest = null;
-        links = null;
-    }
-
-    @Override
-    public NeutronSubnet getSingleton() {
-        return singletonSubnet;
-    }
-
-    @Override
-    public List<NeutronSubnet> getBulk() {
-        return bulkRequest;
-    }
-
-    @Override
-    public boolean isSingleton() {
-        return (singletonSubnet != null);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronSubnetsNorthbound.java
deleted file mode 100644 (file)
index fa66501..0000000
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Copyright IBM Corporation and others, 2013.  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.networkconfig.neutron.northbound;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetAware;
-import org.opendaylight.controller.networkconfig.neutron.INeutronSubnetCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-
-/**
- * Neutron Northbound REST APIs for Subnets.<br>
- * This class provides REST APIs for managing neutron Subnets
- *
- * <br>
- * <br>
- * Authentication scheme : <b>HTTP Basic</b><br>
- * Authentication realm : <b>opendaylight</b><br>
- * Transport : <b>HTTP and HTTPS</b><br>
- * <br>
- * HTTPS Authentication is disabled by default. Administrator can enable it in
- * tomcat-server.xml after adding a proper keystore / SSL certificate from a
- * trusted authority.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- *
- */
-
-@Path("/subnets")
-public class NeutronSubnetsNorthbound {
-
-    private NeutronSubnet extractFields(NeutronSubnet o, List<String> fields) {
-        return o.extractFields(fields);
-    }
-
-    @Context
-    UriInfo uriInfo;
-
-    /**
-     * Returns a list of all Subnets */
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response listSubnets(
-            // return fields
-            @QueryParam("fields") List<String> fields,
-            // note: openstack isn't clear about filtering on lists, so we aren't handling them
-            @QueryParam("id") String queryID,
-            @QueryParam("network_id") String queryNetworkID,
-            @QueryParam("name") String queryName,
-            @QueryParam("ip_version") String queryIPVersion,
-            @QueryParam("cidr") String queryCIDR,
-            @QueryParam("gateway_ip") String queryGatewayIP,
-            @QueryParam("enable_dhcp") String queryEnableDHCP,
-            @QueryParam("tenant_id") String queryTenantID,
-            @QueryParam("ipv6_address_mode") String queryIpV6AddressMode,
-            @QueryParam("ipv6_ra_mode") String queryIpV6RaMode,
-            // linkTitle
-            @QueryParam("limit") Integer limit,
-            @QueryParam("marker") String marker,
-            @DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
-            // sorting not supported
-            ) {
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        List<NeutronSubnet> allNetworks = subnetInterface.getAllSubnets();
-        List<NeutronSubnet> ans = new ArrayList<NeutronSubnet>();
-        Iterator<NeutronSubnet> i = allNetworks.iterator();
-        while (i.hasNext()) {
-            NeutronSubnet oSS = i.next();
-            if ((queryID == null || queryID.equals(oSS.getID())) &&
-                    (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID())) &&
-                    (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryIPVersion == null || queryIPVersion.equals(oSS.getIpVersion())) &&
-                    (queryCIDR == null || queryCIDR.equals(oSS.getCidr())) &&
-                    (queryGatewayIP == null || queryGatewayIP.equals(oSS.getGatewayIP())) &&
-                    (queryEnableDHCP == null || queryEnableDHCP.equals(oSS.getEnableDHCP())) &&
-                    (queryTenantID == null || queryTenantID.equals(oSS.getTenantID())) &&
-                    (queryIpV6AddressMode == null || queryIpV6AddressMode.equals(oSS.getIpV6AddressMode())) &&
-                    (queryIpV6RaMode == null || queryIpV6RaMode.equals(oSS.getIpV6RaMode()))){
-                if (fields.size() > 0) {
-                    ans.add(extractFields(oSS,fields));
-                } else {
-                    ans.add(oSS);
-                }
-            }
-        }
-
-        if (limit != null && ans.size() > 1) {
-            // Return a paginated request
-            NeutronSubnetRequest request = (NeutronSubnetRequest) PaginatedRequestFactory.createRequest(limit,
-                    marker, pageReverse, uriInfo, ans, NeutronSubnet.class);
-            return Response.status(200).entity(request).build();
-        }
-
-        return Response.status(200).entity(
-                new NeutronSubnetRequest(ans)).build();
-    }
-
-    /**
-     * Returns a specific Subnet */
-
-    @Path("{subnetUUID}")
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response showSubnet(
-            @PathParam("subnetUUID") String subnetUUID,
-            // return fields
-            @QueryParam("fields") List<String> fields) {
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (!subnetInterface.subnetExists(subnetUUID)) {
-            throw new ResourceNotFoundException("subnet UUID does not exist.");
-        }
-        if (fields.size() > 0) {
-            NeutronSubnet ans = subnetInterface.getSubnet(subnetUUID);
-            return Response.status(200).entity(
-                    new NeutronSubnetRequest(extractFields(ans, fields))).build();
-        } else {
-            return Response.status(200).entity(
-                    new NeutronSubnetRequest(subnetInterface.getSubnet(subnetUUID))).build();
-        }
-    }
-
-    /**
-     * Creates new Subnets */
-
-    @POST
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = 201, condition = "Created"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response createSubnets(final NeutronSubnetRequest input) {
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        INeutronNetworkCRUD networkInterface = NeutronCRUDInterfaces.getINeutronNetworkCRUD( this);
-        if (networkInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-        if (input.isSingleton()) {
-            NeutronSubnet singleton = input.getSingleton();
-
-            /*
-             *  Verify that the subnet doesn't already exist (Issue: is a deeper check necessary?)
-             *  the specified network exists, the subnet has a valid network address,
-             *  and that the gateway IP doesn't overlap with the allocation pools
-             *  *then* add the subnet to the cache
-             */
-            if (subnetInterface.subnetExists(singleton.getID())) {
-                throw new BadRequestException("subnet UUID already exists");
-            }
-            if (!networkInterface.networkExists(singleton.getNetworkUUID())) {
-                throw new ResourceNotFoundException("network UUID does not exist.");
-            }
-            if (!singleton.isValidCIDR()) {
-                throw new BadRequestException("invaild CIDR");
-            }
-            if (!singleton.initDefaults()) {
-                throw new InternalServerErrorException("subnet object could not be initialized properly");
-            }
-            if (singleton.gatewayIP_Pool_overlap()) {
-                throw new ResourceConflictException("IP pool overlaps with gateway");
-            }
-            Object[] instances = NeutronUtil.getInstances(INeutronSubnetAware.class, this);
-            if (instances != null) {
-                if (instances.length > 0) {
-                    for (Object instance : instances) {
-                        INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                        int status = service.canCreateSubnet(singleton);
-                        if (status < 200 || status > 299) {
-                            return Response.status(status).build();
-                        }
-                    }
-                } else {
-                    throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                }
-            } else {
-                throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-            }
-            subnetInterface.addSubnet(singleton);
-            if (instances != null) {
-                for (Object instance : instances) {
-                    INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                    service.neutronSubnetCreated(singleton);
-                }
-            }
-        } else {
-            List<NeutronSubnet> bulk = input.getBulk();
-            Iterator<NeutronSubnet> i = bulk.iterator();
-            HashMap<String, NeutronSubnet> testMap = new HashMap<String, NeutronSubnet>();
-            Object[] instances = NeutronUtil.getInstances(INeutronSubnetAware.class, this);
-            while (i.hasNext()) {
-                NeutronSubnet test = i.next();
-
-                /*
-                 *  Verify that the subnet doesn't already exist (Issue: is a deeper check necessary?)
-                 *  the specified network exists, the subnet has a valid network address,
-                 *  and that the gateway IP doesn't overlap with the allocation pools,
-                 *  and that the bulk request doesn't already contain a subnet with this id
-                 */
-
-                if (!test.initDefaults()) {
-                    throw new InternalServerErrorException("subnet object could not be initialized properly");
-                }
-                if (subnetInterface.subnetExists(test.getID())) {
-                    throw new BadRequestException("subnet UUID already exists");
-                }
-                if (testMap.containsKey(test.getID())) {
-                    throw new BadRequestException("subnet UUID already exists");
-                }
-                testMap.put(test.getID(), test);
-                if (!networkInterface.networkExists(test.getNetworkUUID())) {
-                    throw new ResourceNotFoundException("network UUID does not exist.");
-                }
-                if (!test.isValidCIDR()) {
-                    throw new BadRequestException("Invalid CIDR");
-                }
-                if (test.gatewayIP_Pool_overlap()) {
-                    throw new ResourceConflictException("IP pool overlaps with gateway");
-                }
-                if (instances != null) {
-                    if (instances.length > 0) {
-                        for (Object instance : instances) {
-                            INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                            int status = service.canCreateSubnet(test);
-                            if (status < 200 || status > 299) {
-                                return Response.status(status).build();
-                            }
-                        }
-                    } else {
-                        throw new ServiceUnavailableException("No providers registered.  Please try again later");
-                    }
-                } else {
-                    throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-                }
-            }
-
-            /*
-             * now, each element of the bulk request can be added to the cache
-             */
-            i = bulk.iterator();
-            while (i.hasNext()) {
-                NeutronSubnet test = i.next();
-                subnetInterface.addSubnet(test);
-                if (instances != null) {
-                    for (Object instance : instances) {
-                        INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                        service.neutronSubnetCreated(test);
-                    }
-                }
-            }
-        }
-        return Response.status(201).entity(input).build();
-    }
-
-    /**
-     * Updates a Subnet */
-
-    @Path("{subnetUUID}")
-    @PUT
-    @Produces({ MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_JSON })
-    //@TypeHint(OpenStackSubnets.class)
-    @StatusCodes({
-            @ResponseCode(code = 200, condition = "Operation successful"),
-            @ResponseCode(code = 400, condition = "Bad Request"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 403, condition = "Forbidden"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response updateSubnet(
-            @PathParam("subnetUUID") String subnetUUID, final NeutronSubnetRequest input
-            ) {
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Subnet CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the subnet exists and there is only one delta provided
-         */
-        if (!subnetInterface.subnetExists(subnetUUID)) {
-            throw new ResourceNotFoundException("subnet UUID does not exist.");
-        }
-        if (!input.isSingleton()) {
-            throw new BadRequestException("Only singleton edit supported");
-        }
-        NeutronSubnet delta = input.getSingleton();
-        NeutronSubnet original = subnetInterface.getSubnet(subnetUUID);
-
-        /*
-         * updates restricted by Neutron
-         */
-        if (delta.getID() != null || delta.getTenantID() != null ||
-                delta.getIpVersion() != null || delta.getCidr() != null ||
-                delta.getAllocationPools() != null) {
-            throw new BadRequestException("Attribute edit blocked by Neutron");
-        }
-
-        Object[] instances = NeutronUtil.getInstances(INeutronSubnetAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                    int status = service.canUpdateSubnet(delta, original);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * update the object and return it
-         */
-        subnetInterface.updateSubnet(subnetUUID, delta);
-        NeutronSubnet updatedSubnet = subnetInterface.getSubnet(subnetUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                service.neutronSubnetUpdated(updatedSubnet);
-            }
-        }
-        return Response.status(200).entity(
-                new NeutronSubnetRequest(subnetInterface.getSubnet(subnetUUID))).build();
-    }
-
-    /**
-     * Deletes a Subnet */
-
-    @Path("{subnetUUID}")
-    @DELETE
-    @StatusCodes({
-            @ResponseCode(code = 204, condition = "No Content"),
-            @ResponseCode(code = 401, condition = "Unauthorized"),
-            @ResponseCode(code = 404, condition = "Not Found"),
-            @ResponseCode(code = 409, condition = "Conflict"),
-            @ResponseCode(code = 501, condition = "Not Implemented") })
-    public Response deleteSubnet(
-            @PathParam("subnetUUID") String subnetUUID) {
-        INeutronSubnetCRUD subnetInterface = NeutronCRUDInterfaces.getINeutronSubnetCRUD( this);
-        if (subnetInterface == null) {
-            throw new ServiceUnavailableException("Network CRUD Interface "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        /*
-         * verify the subnet exists and it isn't currently in use
-         */
-        if (!subnetInterface.subnetExists(subnetUUID)) {
-            throw new ResourceNotFoundException("subnet UUID does not exist.");
-        }
-        if (subnetInterface.subnetInUse(subnetUUID)) {
-            return Response.status(409).build();
-        }
-        NeutronSubnet singleton = subnetInterface.getSubnet(subnetUUID);
-        Object[] instances = NeutronUtil.getInstances(INeutronSubnetAware.class, this);
-        if (instances != null) {
-            if (instances.length > 0) {
-                for (Object instance : instances) {
-                    INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                    int status = service.canDeleteSubnet(singleton);
-                    if (status < 200 || status > 299) {
-                        return Response.status(status).build();
-                    }
-                }
-            } else {
-                throw new ServiceUnavailableException("No providers registered.  Please try again later");
-            }
-        } else {
-            throw new ServiceUnavailableException("Couldn't get providers list.  Please try again later");
-        }
-
-        /*
-         * remove it and return 204 status
-         */
-        subnetInterface.removeSubnet(subnetUUID);
-        if (instances != null) {
-            for (Object instance : instances) {
-                INeutronSubnetAware service = (INeutronSubnetAware) instance;
-                service.neutronSubnetDeleted(singleton);
-            }
-        }
-        return Response.status(204).build();
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronUtil.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronUtil.java
deleted file mode 100644 (file)
index 481d95a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronUtil {
-    private static final Logger logger = LoggerFactory
-            .getLogger(NeutronUtil.class);
-    public static Object[] getInstances(Class<?> clazz,Object bundle) {
-        Object instances[] = null;
-        try {
-            BundleContext bCtx = FrameworkUtil.getBundle(bundle.getClass())
-                    .getBundleContext();
-
-            ServiceReference<?>[] services = null;
-                services = bCtx.getServiceReferences(clazz.getName(),
-                        null);
-            if (services != null) {
-                instances = new Object[services.length];
-                for (int i = 0; i < services.length; i++) {
-                    instances[i] = bCtx.getService(services[i]);
-                }
-            }
-        } catch (Exception e) {
-            logger.error("Instance reference is NULL");
-        }
-        return instances;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/PaginatedRequestFactory.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/PaginatedRequestFactory.java
deleted file mode 100644 (file)
index 25b5da1..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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
- *
- *  Authors : Dave Tucker
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import javax.ws.rs.core.UriInfo;
-
-import org.opendaylight.controller.networkconfig.neutron.INeutronObject;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;
-
-public class PaginatedRequestFactory {
-    private static final Comparator<INeutronObject> NEUTRON_OBJECT_COMPARATOR = new Comparator<INeutronObject>() {
-        @Override
-        public int compare(INeutronObject o1, INeutronObject o2) {
-            return o1.getID().compareTo(o2.getID());
-        }
-    };
-
-    public static class PaginationResults<T extends INeutronObject> {
-        List<T> collection;
-        List<NeutronPageLink> links;
-
-        public PaginationResults(List<T> collection, List<NeutronPageLink> links) {
-            this.collection = collection;
-            this.links = links;
-        }
-    }
-
-    private static final class MarkerObject implements INeutronObject {
-        private final String id;
-
-        MarkerObject(String id) {
-            this.id = id;
-        }
-
-        @Override
-        public String getID() {
-            return id;
-        }
-
-        @Override
-        public void setID(String id) {
-            throw new UnsupportedOperationException("Marker has constant ID");
-        }
-    }
-
-    /*
-     * SuppressWarnings is needed because the compiler does not understand that we
-     * are actually safe here.
-     *
-     * FIXME: the only caller performs a cast back, so this is not actually necessary.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T extends INeutronObject> INeutronRequest<T> createRequest(Integer limit, String marker,
-                                                                           Boolean pageReverse,
-                                                                           UriInfo uriInfo,
-                                                                           List<T> collection,
-                                                                           Class<T> clazz) {
-        PaginationResults<T> results = _paginate(limit, marker, pageReverse, uriInfo, collection);
-
-        if (clazz.equals(NeutronNetwork.class)){
-            return (INeutronRequest<T>) new NeutronNetworkRequest((List<NeutronNetwork>) results.collection, results.links);
-        }
-        if (clazz.equals(NeutronSubnet.class)){
-            return (INeutronRequest<T>) new NeutronSubnetRequest((List<NeutronSubnet>) results.collection, results.links);
-        }
-        if (clazz.equals(NeutronPort.class)){
-            return (INeutronRequest<T>) new NeutronPortRequest((List<NeutronPort>) results.collection, results.links);
-        }
-        return null;
-    }
-
-    private static <T extends INeutronObject> PaginationResults<T> _paginate(Integer limit, String marker, Boolean pageReverse, UriInfo uriInfo, List<T> collection) {
-        List<NeutronPageLink> links = new ArrayList<>();
-        final int startPos;
-        String startMarker;
-        String endMarker;
-        Boolean firstPage = false;
-        Boolean lastPage = false;
-
-        Collections.sort(collection, NEUTRON_OBJECT_COMPARATOR);
-
-        if (marker != null) {
-            int offset = Collections.binarySearch(collection, new MarkerObject(marker), NEUTRON_OBJECT_COMPARATOR);
-            if (offset < 0) {
-                throw new ResourceNotFoundException("UUID for marker: " + marker + " could not be found");
-            }
-
-            if (!pageReverse) {
-                startPos = offset + 1;
-            }
-            else {
-                startPos = offset - limit;
-            }
-        }
-        else {
-            startPos = 0;
-        }
-
-        if (startPos == 0){
-            firstPage = true;
-        }
-
-        if (startPos + limit >= collection.size()) {
-            collection = collection.subList(startPos, collection.size());
-            startMarker = collection.get(0).getID();
-            endMarker = collection.get(collection.size() - 1).getID();
-            lastPage = true;
-        }
-        else if (startPos < 0) {
-            if (startPos + limit > 0) {
-                collection = collection.subList(0, startPos + limit);
-                startMarker = collection.get(0).getID();
-                endMarker = collection.get(collection.size() - 1).getID();
-                firstPage = true;
-            }
-            else {
-                throw new BadRequestException("Requested page is out of bounds. Please check the supplied limit and marker");
-            }
-        }
-        else {
-            collection = collection.subList(startPos, startPos + limit);
-            startMarker = collection.get(0).getID();
-            endMarker = collection.get(limit-1).getID();
-        }
-
-        if (!lastPage) {
-            NeutronPageLink next = new NeutronPageLink();
-            next.setRef("next");
-            next.setHref(uriInfo.getAbsolutePath().toString() + "?limit=" + limit.toString() + "&marker=" + endMarker);
-            links.add(next);
-        }
-
-        if (!firstPage) {
-            NeutronPageLink previous = new NeutronPageLink();
-            previous.setRef("previous");
-            previous.setHref(uriInfo.getAbsolutePath().toString() + "?limit=" + limit.toString() + "&marker=" + startMarker + "&page_reverse=True");
-            links.add(previous);
-        }
-
-        return new PaginationResults<T>(collection, links);
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceConflictException.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceConflictException.java
deleted file mode 100644 (file)
index d9644df..0000000
+++ /dev/null
@@ -1,37 +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
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Status Code 409 (Conflict)
- *
- * The request could not be completed due to a conflict with the
- * current state of the resource. This code is only allowed in
- * situations where it is expected that the user might be able to
- * resolve the conflict and resubmit the request. The response body
- * SHOULD include enough information for the user to recognize the
- * source of the conflict. Ideally, the response entity would include
- * enough information for the user or user agent to fix the problem;
- * however, that might not be possible and is not required.
- *
- *
- *
- */
-public class ResourceConflictException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    public ResourceConflictException(String string) {
-        super(Response.status(Response.Status.CONFLICT).entity(string).type(
-                MediaType.TEXT_PLAIN).build());
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceNotFoundException.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ResourceNotFoundException.java
deleted file mode 100644 (file)
index 3f39eb7..0000000
+++ /dev/null
@@ -1,37 +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
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Status Code 404 (Not Found)
- *
- * The server has not found anything matching the Request-URI.
- * No indication is given of whether the condition is temporary or permanent.
- * The 410 (Gone) status code SHOULD be used if the server knows,
- * through some internally configurable mechanism, that an old resource
- * is permanently unavailable and has no forwarding address.
- * This status code is commonly used when the server does not wish to
- * reveal exactly why the request has been refused, or when no other
- * response is applicable.
- *
- *
- *
- */
-public class ResourceNotFoundException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    public ResourceNotFoundException(String string) {
-        super(Response.status(Response.Status.NOT_FOUND).entity(string).type(
-                MediaType.TEXT_PLAIN).build());
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/RestMessages.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/RestMessages.java
deleted file mode 100644 (file)
index e619974..0000000
+++ /dev/null
@@ -1,33 +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
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-public enum RestMessages {
-    SUCCESS("Success"), NOCONTAINER("Container does not exist"), NOSUBNET("Subnet does not exist"), NOSTATICROUTE(
-            "Static Route does not exist"), NOHOST("Host does not exist"), NOFLOW("Flow does not exist"), NONODE(
-            "Node does not exist"), NOPOLICY("Policy does not exist"), NORESOURCE("Resource does not exist"), RESOURCECONFLICT(
-            "Operation failed due to Resource Conflict"), NODEFAULT("Container default is not a custom container"), DEFAULTDISABLED(
-            "Container(s) are configured. Container default is not operational"), NOTALLOWEDONDEFAULT(
-            "Container default is a static resource, no modification allowed on it"), UNKNOWNACTION("Unknown action"), INVALIDJSON(
-            "JSON message is invalid"), INVALIDADDRESS("Invalid InetAddress"), AVAILABLESOON(
-            "Resource is not implemented yet"), INTERNALERROR("Internal Error"), SERVICEUNAVAILABLE(
-            "Service is not available. Could be down for maintanence"), INVALIDDATA(
-            "Data is invalid or conflicts with URI");
-
-    private String message;
-
-    private RestMessages(String msg) {
-        message = msg;
-    }
-
-    @Override
-    public String toString() {
-        return message;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ServiceUnavailableException.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/ServiceUnavailableException.java
deleted file mode 100644 (file)
index 2d899a0..0000000
+++ /dev/null
@@ -1,39 +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
- */
-
-package org.opendaylight.controller.networkconfig.neutron.northbound;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Status Code 503 (Service Unavailable Error)
- *
- * The server is currently unable to handle the request due to a temporary
- * overloading or maintenance of the server.
- * The implication is that this is a temporary condition which will be alleviated
- * after some delay.
- *
- *
- */
-public class ServiceUnavailableException extends WebApplicationException {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Constructor for the SERVICE_UNAVAILABLE custom handler
-     *
-     * @param string Error message to specify further the
-     * SERVICE_UNAVAILABLE response
-     *
-     */
-    public ServiceUnavailableException(String string) {
-        super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(
-                string).type(MediaType.TEXT_PLAIN).build());
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml b/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/WEB-INF/web.xml
deleted file mode 100644 (file)
index 08a314a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>\r
-<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"\r
-        version="3.0">\r
-  <servlet>\r
-    <servlet-name>JAXRSNeutron</servlet-name>\r
-    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>\r
-    <init-param>\r
-      <param-name>javax.ws.rs.Application</param-name>\r
-      <param-value>org.opendaylight.controller.networkconfig.neutron.northbound.NeutronNorthboundRSApplication</param-value>\r
-    </init-param>\r
-    <!-- AAA Auth Filter -->\r
-    <init-param>\r
-      <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>\r
-      <param-value> org.opendaylight.aaa.sts.TokenAuthFilter</param-value>\r
-    </init-param>\r
-    <load-on-startup>1</load-on-startup>\r
-  </servlet>\r
-\r
-  <servlet-mapping>\r
-    <servlet-name>JAXRSNeutron</servlet-name>\r
-    <url-pattern>/*</url-pattern>\r
-  </servlet-mapping>\r
-\r
-  <filter>\r
-    <filter-name>cross-origin-restconf</filter-name>\r
-    <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>\r
-    <init-param>\r
-      <param-name>allowedOrigins</param-name>\r
-      <param-value>*</param-value>\r
-    </init-param>\r
-    <init-param>\r
-      <param-name>allowedMethods</param-name>\r
-      <param-value>GET,POST,OPTIONS,DELETE,PUT,HEAD</param-value>\r
-    </init-param>\r
-    <init-param>\r
-      <param-name>allowedHeaders</param-name>\r
-      <param-value>origin, content-type, accept, authorization</param-value>\r
-    </init-param>\r
-  </filter>\r
-  <filter-mapping>\r
-    <filter-name>cross-origin-restconf</filter-name>\r
-    <url-pattern>/*</url-pattern>\r
-  </filter-mapping>\r
-  <security-constraint>\r
-    <web-resource-collection>\r
-      <web-resource-name>NB api</web-resource-name>\r
-      <url-pattern>/*</url-pattern>\r
-      <http-method>POST</http-method>\r
-      <http-method>GET</http-method>\r
-      <http-method>PUT</http-method>\r
-      <http-method>PATCH</http-method>\r
-      <http-method>DELETE</http-method>\r
-      <http-method>HEAD</http-method>\r
-    </web-resource-collection>\r
-  </security-constraint>\r
-</web-app>\r
diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/org/opendaylight/controller/networkconfig/neutron/northbound/jaxb.properties b/opendaylight/networkconfiguration/neutron/northbound/src/main/resources/org/opendaylight/controller/networkconfig/neutron/northbound/jaxb.properties
deleted file mode 100644 (file)
index 5837a4c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/pom.xml b/opendaylight/networkconfiguration/neutron/pom.xml
deleted file mode 100644 (file)
index ee206d4..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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.5.0-SNAPSHOT</version>
-    <relativePath>../../commons/opendaylight</relativePath>
-  </parent>
-  <artifactId>networkconfig.neutron</artifactId>
-  <version>0.5.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>commons-net</groupId>
-      <artifactId>commons-net</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>*</Import-Package>
-          </instructions>
-          <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
-        </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>
-  <distributionManagement>
-    <!-- OpenDayLight Released artifact -->
-    <repository>
-      <id>opendaylight-release</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.release}/</url>
-    </repository>
-    <!-- OpenDayLight Snapshot artifact -->
-    <snapshotRepository>
-      <id>opendaylight-snapshot</id>
-      <url>${nexusproxy}/repositories/${nexus.repository.snapshot}/</url>
-    </snapshotRepository>
-    <!-- Site deployment -->
-    <site>
-      <id>website</id>
-      <url>${sitedeploy}</url>
-    </site>
-  </distributionManagement>
-</project>
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallAware.java
deleted file mode 100644 (file)
index e0a5909..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Firewall Rules needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFirewallAware}
- */
-
-@Deprecated
-public interface INeutronFirewallAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified firewall can be created
-     *
-     * @param firewall
-     *            instance of proposed new Firewall object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronFirewall(NeutronFirewall firewall);
-
-    /**
-     * Services provide this interface method for taking action after a firewall has been created
-     *
-     * @param firewall
-     *            instance of new Firewall object
-     * @return void
-     */
-    public void neutronFirewallCreated(NeutronFirewall firewall);
-
-    /**
-     * Services provide this interface method to indicate if the specified firewall can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the firewall object using patch semantics
-     * @param original
-     *            instance of the Firewall object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronFirewall(NeutronFirewall delta, NeutronFirewall original);
-
-    /**
-     * Services provide this interface method for taking action after a firewall has been updated
-     *
-     * @param firewall
-     *            instance of modified Firewall object
-     * @return void
-     */
-    public void neutronFirewallUpdated(NeutronFirewall firewall);
-
-    /**
-     * Services provide this interface method to indicate if the specified firewall can be deleted
-     *
-     * @param firewall
-     *            instance of the Firewall object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronFirewall(NeutronFirewall firewall);
-
-    /**
-     * Services provide this interface method for taking action after a firewall has been deleted
-     *
-     * @param firewall
-     *            instance of deleted Firewall object
-     * @return void
-     */
-    public void neutronFirewallDeleted(NeutronFirewall firewall);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallCRUD.java
deleted file mode 100644 (file)
index 5e7fbb2..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack Firewall objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFirewallCRUD}
- */
-
-@Deprecated
-public interface INeutronFirewallCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     *Firewall object exists
-     *
-     * @param uuid
-     *            UUID of the Firewall object
-     * @return boolean
-     */
-
-    public boolean neutronFirewallExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * Firewall object exists
-     *
-     * @param uuid
-     *            UUID of the Firewall object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronFirewall}
-     *          OpenStackFirewall class
-     */
-
-    public NeutronFirewall getNeutronFirewall(String uuid);
-
-    /**
-     * Applications call this interface method to return all Firewall objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronFirewall> getAllNeutronFirewalls();
-
-    /**
-     * Applications call this interface method to add a Firewall object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronFirewall(NeutronFirewall input);
-
-    /**
-     * Applications call this interface method to remove a Neutron Firewall object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the Firewall object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronFirewall(String uuid);
-
-    /**
-     * Applications call this interface method to edit a Firewall object
-     *
-     * @param uuid
-     *            identifier of the Firewall object
-     * @param delta
-     *            OpenStackFirewall object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronFirewall(String uuid, NeutronFirewall delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the Firewall object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronFirewallInUse(String uuid);
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyAware.java
deleted file mode 100644 (file)
index ba46783..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Firewall Policys needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFirewallPolicyAware}
- */
-
-@Deprecated
-public interface INeutronFirewallPolicyAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified firewallPolicy can be created
-     *
-     * @param firewallPolicy
-     *            instance of proposed new Firewall Policy object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronFirewallPolicy(NeutronFirewallPolicy firewallPolicy);
-
-    /**
-     * Services provide this interface method for taking action after a firewallPolicy has been created
-     *
-     * @param firewallPolicy
-     *            instance of new Firewall Policy object
-     * @return void
-     */
-    public void neutronFirewallPolicyCreated(NeutronFirewallPolicy firewallPolicy);
-
-    /**
-     * Services provide this interface method to indicate if the specified firewallPolicy can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the firewallPolicy object using patch semantics
-     * @param original
-     *            instance of the Firewall Policy object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronFirewallPolicy(NeutronFirewallPolicy delta, NeutronFirewallPolicy original);
-
-    /**
-     * Services provide this interface method for taking action after a firewallPolicy has been updated
-     *
-     * @param firewallPolicy
-     *            instance of modified Firewall Policy object
-     * @return void
-     */
-    public void neutronFirewallPolicyUpdated(NeutronFirewallPolicy firewallPolicy);
-
-    /**
-     * Services provide this interface method to indicate if the specified firewallPolicy can be deleted
-     *
-     * @param firewallPolicy
-     *            instance of the Firewall Policy object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronFirewallPolicy(NeutronFirewallPolicy firewallPolicy);
-
-    /**
-     * Services provide this interface method for taking action after a firewallPolicy has been deleted
-     *
-     * @param firewallPolicy
-     *            instance of deleted Firewall Policy object
-     * @return void
-     */
-    public void neutronFirewallPolicyDeleted(NeutronFirewallPolicy firewallPolicy);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallPolicyCRUD.java
deleted file mode 100644 (file)
index f280ff2..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack Firewall Policy objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFirewallPolicyCRUD}
- */
-
-@Deprecated
-public interface INeutronFirewallPolicyCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     *FirewallPolicy object exists
-     *
-     * @param uuid
-     *            UUID of the Firewall Policy object
-     * @return boolean
-     */
-
-    public boolean neutronFirewallPolicyExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * FirewallPolicy object exists
-     *
-     * @param uuid
-     *            UUID of the Firewall Policy object
-     * @return {@link NeutronFirewallPolicy}
-     *          OpenStackFirewallPolicy class
-     */
-
-    public NeutronFirewallPolicy getNeutronFirewallPolicy(String uuid);
-
-    /**
-     * Applications call this interface method to return all Firewall Policy objects
-     *
-     * @return List of OpenStack Firewall Policy objects
-     */
-
-    public List<NeutronFirewallPolicy> getAllNeutronFirewallPolicies();
-
-    /**
-     * Applications call this interface method to add a Firewall Policy object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronFirewallPolicy(NeutronFirewallPolicy input);
-
-    /**
-     * Applications call this interface method to remove a Neutron FirewallPolicy object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the Firewall Policy object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronFirewallPolicy(String uuid);
-
-    /**
-     * Applications call this interface method to edit a FirewallPolicy object
-     *
-     * @param uuid
-     *            identifier of the Firewall Policy object
-     * @param delta
-     *            OpenStackFirewallPolicy object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronFirewallPolicy(String uuid, NeutronFirewallPolicy delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the Firewall Policy object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronFirewallPolicyInUse(String uuid);
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleAware.java
deleted file mode 100644 (file)
index 5863cdd..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Firewall Rules needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFirewallRuleAware}
- */
-
-@Deprecated
-public interface INeutronFirewallRuleAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified firewallRule can be created
-     *
-     * @param firewallRule
-     *            instance of proposed new Firewall Rule object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronFirewallRule(NeutronFirewallRule firewallRule);
-
-    /**
-     * Services provide this interface method for taking action after a firewallRule has been created
-     *
-     * @param firewallRule
-     *            instance of new Firewall Rule object
-     * @return void
-     */
-    public void neutronFirewallRuleCreated(NeutronFirewallRule firewallRule);
-
-    /**
-     * Services provide this interface method to indicate if the specified firewallRule can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the firewallRule object using patch semantics
-     * @param original
-     *            instance of the Firewall Rule object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronFirewallRule(NeutronFirewallRule delta, NeutronFirewallRule original);
-
-    /**
-     * Services provide this interface method for taking action after a firewallRule has been updated
-     *
-     * @param firewallRule
-     *            instance of modified Firewall Rule object
-     * @return void
-     */
-    public void neutronFirewallRuleUpdated(NeutronFirewallRule firewallRule);
-
-    /**
-     * Services provide this interface method to indicate if the specified firewallRule can be deleted
-     *
-     * @param firewallRule
-     *            instance of the Firewall Rule object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronFirewallRule(NeutronFirewallRule firewallRule);
-
-    /**
-     * Services provide this interface method for taking action after a firewallRule has been deleted
-     *
-     * @param firewallRule
-     *            instance of deleted Firewall Rule object
-     * @return void
-     */
-    public void neutronFirewallRuleDeleted(NeutronFirewallRule firewallRule);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFirewallRuleCRUD.java
deleted file mode 100644 (file)
index b0c8c61..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack Firewall Rule objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFirewallRuleCRUD}
- */
-
-@Deprecated
-public interface INeutronFirewallRuleCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     *FirewallRule object exists
-     *
-     * @param uuid
-     *            UUID of the Firewall Rule object
-     * @return boolean
-     */
-
-    public boolean neutronFirewallRuleExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * FirewallRule object exists
-     *
-     * @param uuid
-     *            UUID of the Firewall Rule object
-     * @return {@link NeutronFirewallRule}
-     *          OpenStackFirewall Rule class
-     */
-
-    public NeutronFirewallRule getNeutronFirewallRule(String uuid);
-
-    /**
-     * Applications call this interface method to return all Firewall Rule objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronFirewallRule> getAllNeutronFirewallRules();
-
-    /**
-     * Applications call this interface method to add a Firewall Rule object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronFirewallRule(NeutronFirewallRule input);
-
-    /**
-     * Applications call this interface method to remove a Neutron FirewallRule object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the Firewall Rule object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronFirewallRule(String uuid);
-
-    /**
-     * Applications call this interface method to edit a FirewallRule object
-     *
-     * @param uuid
-     *            identifier of the Firewall Rule object
-     * @param delta
-     *            OpenStackFirewallRule object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronFirewallRule(String uuid, NeutronFirewallRule delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the Firewall Rule object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronFirewallRuleInUse(String uuid);
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPAware.java
deleted file mode 100644 (file)
index 0a6c76c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Neutron FloatingIPs needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFloatingIPAware}
- */
-
-@Deprecated
-public interface INeutronFloatingIPAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified floatingIP can be created
-     *
-     * @param floatingIP
-     *            instance of proposed new Neutron FloatingIP object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateFloatingIP(NeutronFloatingIP floatingIP);
-
-    /**
-     * Services provide this interface method for taking action after a floatingIP has been created
-     *
-     * @param floatingIP
-     *            instance of new Neutron FloatingIP object
-     * @return void
-     */
-    public void neutronFloatingIPCreated(NeutronFloatingIP floatingIP);
-
-    /**
-     * Services provide this interface method to indicate if the specified floatingIP can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the floatingIP object using patch semantics
-     * @param floatingIP
-     *            instance of the Neutron FloatingIP object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateFloatingIP(NeutronFloatingIP delta, NeutronFloatingIP original);
-
-    /**
-     * Services provide this interface method for taking action after a floatingIP has been updated
-     *
-     * @param floatingIP
-     *            instance of modified Neutron FloatingIP object
-     * @return void
-     */
-    public void neutronFloatingIPUpdated(NeutronFloatingIP floatingIP);
-
-    /**
-     * Services provide this interface method to indicate if the specified floatingIP can be deleted
-     *
-     * @param floatingIP
-     *            instance of the Neutron FloatingIP object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteFloatingIP(NeutronFloatingIP floatingIP);
-
-    /**
-     * Services provide this interface method for taking action after a floatingIP has been deleted
-     *
-     * @param floatingIP
-     *            instance of deleted Neutron FloatingIP object
-     * @return void
-     */
-    public void neutronFloatingIPDeleted(NeutronFloatingIP floatingIP);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronFloatingIPCRUD.java
deleted file mode 100644 (file)
index 561e1da..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB FloatingIP objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronFloatingIPCRUD}
- */
-
-@Deprecated
-public interface INeutronFloatingIPCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     * FloatingIP object exists
-     *
-     * @param uuid
-     *            UUID of the FloatingIP object
-     * @return boolean
-     */
-
-    public boolean floatingIPExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * FloatingIP object exists
-     *
-     * @param uuid
-     *            UUID of the FloatingIP object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronFloatingIP.OpenStackFloatingIPs}
-     *          OpenStack FloatingIP class
-     */
-
-    public NeutronFloatingIP getFloatingIP(String uuid);
-
-    /**
-     * Applications call this interface method to return all FloatingIP objects
-     *
-     * @return a Set of OpenStackFloatingIPs objects
-     */
-
-    public List<NeutronFloatingIP> getAllFloatingIPs();
-
-    /**
-     * Applications call this interface method to add a FloatingIP object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackFloatingIP object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addFloatingIP(NeutronFloatingIP input);
-
-    /**
-     * Applications call this interface method to remove a FloatingIP object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the FloatingIP object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeFloatingIP(String uuid);
-
-    /**
-     * Applications call this interface method to edit a FloatingIP object
-     *
-     * @param uuid
-     *            identifier of the FloatingIP object
-     * @param delta
-     *            OpenStackFloatingIP object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateFloatingIP(String uuid, NeutronFloatingIP delta);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerAware.java
deleted file mode 100644 (file)
index 7202b01..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of LoadBalancer Rules needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerAware}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancer can be created
-     *
-     * @param loadBalancer
-     *            instance of proposed new LoadBalancer object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronLoadBalancer(NeutronLoadBalancer loadBalancer);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancer has been created
-     *
-     * @param loadBalancer
-     *            instance of new LoadBalancer object
-     * @return void
-     */
-    public void neutronLoadBalancerCreated(NeutronLoadBalancer loadBalancer);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancer can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the loadBalancer object using patch semantics
-     * @param original
-     *            instance of the LoadBalancer object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronLoadBalancer(NeutronLoadBalancer delta, NeutronLoadBalancer original);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancer has been updated
-     *
-     * @param loadBalancer
-     *            instance of modified LoadBalancer object
-     * @return void
-     */
-    public void neutronLoadBalancerUpdated(NeutronLoadBalancer loadBalancer);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancer can be deleted
-     *
-     * @param loadBalancer
-     *            instance of the LoadBalancer object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronLoadBalancer(NeutronLoadBalancer loadBalancer);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancer has been deleted
-     *
-     * @param loadBalancer
-     *            instance of deleted LoadBalancer object
-     * @return void
-     */
-    public void neutronLoadBalancerDeleted(NeutronLoadBalancer loadBalancer);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerCRUD.java
deleted file mode 100644 (file)
index 394622f..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack LoadBalancer objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerCRUD}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     *LoadBalancer object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancer object
-     * @return boolean
-     */
-
-    public boolean neutronLoadBalancerExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * LoadBalancer object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancer object
-     * @return {@link NeutronLoadBalancer}
-     *          OpenStackLoadBalancer class
-     */
-
-    public NeutronLoadBalancer getNeutronLoadBalancer(String uuid);
-
-    /**
-     * Applications call this interface method to return all LoadBalancer objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronLoadBalancer> getAllNeutronLoadBalancers();
-
-    /**
-     * Applications call this interface method to add a LoadBalancer object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronLoadBalancer(NeutronLoadBalancer input);
-
-    /**
-     * Applications call this interface method to remove a Neutron LoadBalancer object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the LoadBalancer object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronLoadBalancer(String uuid);
-
-    /**
-     * Applications call this interface method to edit a LoadBalancer object
-     *
-     * @param uuid
-     *            identifier of the LoadBalancer object
-     * @param delta
-     *            OpenStackLoadBalancer object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronLoadBalancer(String uuid, NeutronLoadBalancer delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the LoadBalancer object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronLoadBalancerInUse(String uuid);
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorAware.java
deleted file mode 100644 (file)
index 2259435..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of LoadBalancerHealthMonitor Rules needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerHealthMonitorAware}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerHealthMonitorAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerHealthMonitor can be created
-     *
-     * @param loadBalancerHealthMonitor
-     *            instance of proposed new LoadBalancerHealthMonitor object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronLoadBalancerHealthMonitor(NeutronLoadBalancerHealthMonitor loadBalancerHealthMonitor);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerHealthMonitor has been created
-     *
-     * @param loadBalancerHealthMonitor
-     *            instance of new LoadBalancerHealthMonitor object
-     * @return void
-     */
-    public void neutronLoadBalancerHealthMonitorCreated(NeutronLoadBalancerHealthMonitor loadBalancerHealthMonitor);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerHealthMonitor can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the loadBalancerHealthMonitor object using patch semantics
-     * @param original
-     *            instance of the LoadBalancerHealthMonitor object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronLoadBalancerHealthMonitor(NeutronLoadBalancerHealthMonitor delta,
-            NeutronLoadBalancerHealthMonitor original);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerHealthMonitor has been updated
-     *
-     * @param loadBalancerHealthMonitor
-     *            instance of modified LoadBalancerHealthMonitor object
-     * @return void
-     */
-    public void neutronLoadBalancerHealthMonitorUpdated(NeutronLoadBalancerHealthMonitor loadBalancerHealthMonitor);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerHealthMonitor can be deleted
-     *
-     * @param loadBalancerHealthMonitor
-     *            instance of the LoadBalancerHealthMonitor object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronLoadBalancerHealthMonitor(NeutronLoadBalancerHealthMonitor loadBalancerHealthMonitor);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerHealthMonitor has been deleted
-     *
-     * @param loadBalancerHealthMonitor
-     *            instance of deleted LoadBalancerHealthMonitor object
-     * @return void
-     */
-    public void neutronLoadBalancerHealthMonitorDeleted(NeutronLoadBalancerHealthMonitor loadBalancerHealthMonitor);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerHealthMonitorCRUD.java
deleted file mode 100644 (file)
index f7b11a5..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack LoadBalancerHealthMonitor objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerHealthMonitorCRUD}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerHealthMonitorCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     *LoadBalancerHealthMonitor object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancerHealthMonitor object
-     * @return boolean
-     */
-
-    public boolean neutronLoadBalancerHealthMonitorExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * LoadBalancerHealthMonitor object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancerHealthMonitor object
-     * @return {@link NeutronLoadBalancerHealthMonitor}
-     *          OpenStackLoadBalancerHealthMonitor class
-     */
-
-    public NeutronLoadBalancerHealthMonitor getNeutronLoadBalancerHealthMonitor(String uuid);
-
-    /**
-     * Applications call this interface method to return all LoadBalancerHealthMonitor objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronLoadBalancerHealthMonitor> getAllNeutronLoadBalancerHealthMonitors();
-
-    /**
-     * Applications call this interface method to add a LoadBalancerHealthMonitor object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronLoadBalancerHealthMonitor(NeutronLoadBalancerHealthMonitor input);
-
-    /**
-     * Applications call this interface method to remove a Neutron LoadBalancerHealthMonitor object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the LoadBalancerHealthMonitor object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronLoadBalancerHealthMonitor(String uuid);
-
-    /**
-     * Applications call this interface method to edit a LoadBalancerHealthMonitor object
-     *
-     * @param uuid
-     *            identifier of the LoadBalancerHealthMonitor object
-     * @param delta
-     *            OpenStackLoadBalancerHealthMonitor object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronLoadBalancerHealthMonitor(String uuid, NeutronLoadBalancerHealthMonitor delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the LoadBalancerHealthMonitor object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronLoadBalancerHealthMonitorInUse(String uuid);
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerAware.java
deleted file mode 100644 (file)
index 2043878..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of LoadBalancerListener Rules needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerListenerAware}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerListenerAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerListener can be created
-     *
-     * @param loadBalancerListener
-     *            instance of proposed new LoadBalancerListener object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronLoadBalancerListener(NeutronLoadBalancerListener loadBalancerListener);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerListener has been created
-     *
-     * @param loadBalancerListener
-     *            instance of new LoadBalancerListener object
-     * @return void
-     */
-    public void neutronLoadBalancerListenerCreated(NeutronLoadBalancerListener loadBalancerListener);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerListener can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the loadBalancerListener object using patch semantics
-     * @param original
-     *            instance of the LoadBalancerListener object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronLoadBalancerListener(NeutronLoadBalancerListener delta,
-            NeutronLoadBalancerListener original);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerListener has been updated
-     *
-     * @param loadBalancerListener
-     *            instance of modified LoadBalancerListener object
-     * @return void
-     */
-    public void neutronLoadBalancerListenerUpdated(NeutronLoadBalancerListener loadBalancerListener);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerListener can be deleted
-     *
-     * @param loadBalancerListener
-     *            instance of the LoadBalancerListener object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronLoadBalancerListener(NeutronLoadBalancerListener loadBalancerListener);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerListener has been deleted
-     *
-     * @param loadBalancerListener
-     *            instance of deleted LoadBalancerListener object
-     * @return void
-     */
-    public void neutronLoadBalancerListenerDeleted(NeutronLoadBalancerListener loadBalancerListener);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerListenerCRUD.java
deleted file mode 100644 (file)
index 7336c76..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack LoadBalancerListener objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerListenerCRUD}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerListenerCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     *LoadBalancerListener object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancerListener object
-     * @return boolean
-     */
-
-    public boolean neutronLoadBalancerListenerExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * LoadBalancerListener object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancerListener object
-     * @return {@link NeutronLoadBalancerListener}
-     *          OpenStackLoadBalancerListener class
-     */
-
-    public NeutronLoadBalancerListener getNeutronLoadBalancerListener(String uuid);
-
-    /**
-     * Applications call this interface method to return all LoadBalancerListener objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronLoadBalancerListener> getAllNeutronLoadBalancerListeners();
-
-    /**
-     * Applications call this interface method to add a LoadBalancerListener object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronLoadBalancerListener(NeutronLoadBalancerListener input);
-
-    /**
-     * Applications call this interface method to remove a Neutron LoadBalancerListener object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the LoadBalancerListener object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronLoadBalancerListener(String uuid);
-
-    /**
-     * Applications call this interface method to edit a LoadBalancerListener object
-     *
-     * @param uuid
-     *            identifier of the LoadBalancerListener object
-     * @param delta
-     *            OpenStackLoadBalancerListener object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronLoadBalancerListener(String uuid, NeutronLoadBalancerListener delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the LoadBalancerListener object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronLoadBalancerListenerInUse(String uuid);
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolAware.java
deleted file mode 100644 (file)
index 851df35..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of LoadBalancerPool Rules needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerPoolAware}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerPoolAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerPool can be created
-     *
-     * @param loadBalancerPool
-     *            instance of proposed new LoadBalancerPool object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronLoadBalancerPool(NeutronLoadBalancerPool loadBalancerPool);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerPool has been created
-     *
-     * @param loadBalancerPool
-     *            instance of new LoadBalancerPool object
-     * @return void
-     */
-    public void neutronLoadBalancerPoolCreated(NeutronLoadBalancerPool loadBalancerPool);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerPool can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the loadBalancerPool object using patch semantics
-     * @param original
-     *            instance of the LoadBalancerPool object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronLoadBalancerPool(NeutronLoadBalancerPool delta, NeutronLoadBalancerPool original);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerPool has been updated
-     *
-     * @param loadBalancerPool
-     *            instance of modified LoadBalancerPool object
-     * @return void
-     */
-    public void neutronLoadBalancerPoolUpdated(NeutronLoadBalancerPool loadBalancerPool);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerPool can be deleted
-     *
-     * @param loadBalancerPool
-     *            instance of the LoadBalancerPool object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronLoadBalancerPool(NeutronLoadBalancerPool loadBalancerPool);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerPool has been deleted
-     *
-     * @param loadBalancerPool
-     *            instance of deleted LoadBalancerPool object
-     * @return void
-     */
-    public void neutronLoadBalancerPoolDeleted(NeutronLoadBalancerPool loadBalancerPool);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolCRUD.java
deleted file mode 100644 (file)
index 7fabcd9..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack LoadBalancerPool objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerPoolCRUD}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerPoolCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     *LoadBalancerPool object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancerPool object
-     * @return boolean
-     */
-
-    public boolean neutronLoadBalancerPoolExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * LoadBalancerPool object exists
-     *
-     * @param uuid
-     *            UUID of the LoadBalancerPool object
-     * @return {@link NeutronLoadBalancerPool}
-     *          OpenStackLoadBalancerPool class
-     */
-
-    public NeutronLoadBalancerPool getNeutronLoadBalancerPool(String uuid);
-
-    /**
-     * Applications call this interface method to return all LoadBalancerPool objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronLoadBalancerPool> getAllNeutronLoadBalancerPools();
-
-    /**
-     * Applications call this interface method to add a LoadBalancerPool object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronLoadBalancerPool(NeutronLoadBalancerPool input);
-
-    /**
-     * Applications call this interface method to remove a Neutron LoadBalancerPool object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the LoadBalancerPool object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronLoadBalancerPool(String uuid);
-
-    /**
-     * Applications call this interface method to edit a LoadBalancerPool object
-     *
-     * @param uuid
-     *            identifier of the LoadBalancerPool object
-     * @param delta
-     *            OpenStackLoadBalancerPool object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronLoadBalancerPool(String uuid, NeutronLoadBalancerPool delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the LoadBalancerPool object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronLoadBalancerPoolInUse(String uuid);
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberAware.java
deleted file mode 100644 (file)
index 88a16ca..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack INeutronLoadBalancerPoolMemberAware objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerPoolMemberAware}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerPoolMemberAware {
-
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerPoolMember can be created
-     *
-     * @param loadBalancerPoolMember
-     *            instance of proposed new LoadBalancerPool object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNeutronLoadBalancerPoolMember(NeutronLoadBalancerPoolMember loadBalancerPoolMember);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerPoolMember has been created
-     *
-     * @param loadBalancerPoolMember
-     *            instance of new LoadBalancerPool object
-     * @return void
-     */
-    public void neutronLoadBalancerPoolMemberCreated(NeutronLoadBalancerPoolMember loadBalancerPoolMember);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerPoolMember can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the loadBalancerPoolMember object using patch semantics
-     * @param original
-     *            instance of the LoadBalancerPool object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNeutronLoadBalancerPoolMember(NeutronLoadBalancerPoolMember delta,
-            NeutronLoadBalancerPoolMember original);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerPoolMember has been updated
-     *
-     * @param loadBalancerPoolMember
-     *            instance of modified LoadBalancerPool object
-     * @return void
-     */
-    public void neutronLoadBalancerPoolMemberUpdated(NeutronLoadBalancerPoolMember loadBalancerPoolMember);
-
-    /**
-     * Services provide this interface method to indicate if the specified loadBalancerPoolMember can be deleted
-     *
-     * @param loadBalancerPoolMember
-     *            instance of the LoadBalancerPool object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNeutronLoadBalancerPoolMember(NeutronLoadBalancerPoolMember loadBalancerPoolMember);
-
-    /**
-     * Services provide this interface method for taking action after a loadBalancerPoolMember has been deleted
-     *
-     * @param loadBalancerPoolMember
-     *            instance of deleted LoadBalancerPool object
-     * @return void
-     */
-    public void neutronLoadBalancerPoolMemberDeleted(NeutronLoadBalancerPoolMember loadBalancerPoolMember);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberCRUD.java
deleted file mode 100644 (file)
index 99b3216..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack INeutronLoadBalancerPoolMemberCRUD objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronLoadBalancerPoolMemberCRUD}
- */
-
-@Deprecated
-public interface INeutronLoadBalancerPoolMemberCRUD {
-
-    /**
-     * Applications call this interface method to determine if a particular
-     *NeutronLoadBalancerPoolMember object exists
-     *
-     * @param uuid
-     *            UUID of the NeutronLoadBalancerPoolMember object
-     * @return boolean
-     */
-
-    public boolean neutronLoadBalancerPoolMemberExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * NeutronLoadBalancerPoolMember object exists
-     *
-     * @param uuid
-     *            UUID of the NeutronLoadBalancerPoolMember object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronLoadBalancerPoolMember}
-     *          OpenStackNeutronLoadBalancerPoolMember class
-     */
-
-    public NeutronLoadBalancerPoolMember getNeutronLoadBalancerPoolMember(String uuid);
-
-    /**
-     * Applications call this interface method to return all NeutronLoadBalancerPoolMember objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronLoadBalancerPoolMember> getAllNeutronLoadBalancerPoolMembers();
-
-    /**
-     * Applications call this interface method to add a NeutronLoadBalancerPoolMember object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronLoadBalancerPoolMember(NeutronLoadBalancerPoolMember input);
-
-    /**
-     * Applications call this interface method to remove a Neutron NeutronLoadBalancerPoolMember object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the NeutronLoadBalancerPoolMember object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronLoadBalancerPoolMember(String uuid);
-
-    /**
-     * Applications call this interface method to edit a NeutronLoadBalancerPoolMember object
-     *
-     * @param uuid
-     *            identifier of the NeutronLoadBalancerPoolMember object
-     * @param delta
-     *            OpenStackNeutronLoadBalancerPoolMember object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronLoadBalancerPoolMember(String uuid, NeutronLoadBalancerPoolMember delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid
-     *            identifier of the NeutronLoadBalancerPoolMember object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronLoadBalancerPoolMemberInUse(String uuid);
-
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberRequest.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronLoadBalancerPoolMemberRequest.java
deleted file mode 100644 (file)
index d8c5eb9..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlElement;
-import java.util.List;
-
-public class INeutronLoadBalancerPoolMemberRequest {
-
-    /**
-     * See OpenStack Network API v2.0 Reference for description of
-     * http://docs.openstack.org/api/openstack-network/2.0/content/
-     */
-
-    @XmlElement(name="member")
-    NeutronLoadBalancerPoolMember singletonLoadBalancerPoolMember;
-
-    @XmlElement(name="members")
-    List<NeutronLoadBalancerPoolMember> bulkRequest;
-
-    INeutronLoadBalancerPoolMemberRequest() {
-    }
-
-    public INeutronLoadBalancerPoolMemberRequest(List<NeutronLoadBalancerPoolMember> bulk) {
-        bulkRequest = bulk;
-        singletonLoadBalancerPoolMember = null;
-    }
-
-    INeutronLoadBalancerPoolMemberRequest(NeutronLoadBalancerPoolMember group) {
-        singletonLoadBalancerPoolMember = group;
-    }
-
-    public List<NeutronLoadBalancerPoolMember> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronLoadBalancerPoolMember getSingleton() {
-        return singletonLoadBalancerPoolMember;
-    }
-
-    public boolean isSingleton() {
-        return (singletonLoadBalancerPoolMember != null);
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkAware.java
deleted file mode 100644 (file)
index f5936a6..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Neutron Networks needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronNetworkAware}
- */
-
-@Deprecated
-public interface INeutronNetworkAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified network can be created
-     *
-     * @param network
-     *            instance of proposed new Neutron Network object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateNetwork(NeutronNetwork network);
-
-    /**
-     * Services provide this interface method for taking action after a network has been created
-     *
-     * @param network
-     *            instance of new Neutron Network object
-     * @return void
-     */
-    public void neutronNetworkCreated(NeutronNetwork network);
-
-    /**
-     * Services provide this interface method to indicate if the specified network can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the network object using patch semantics
-     * @param network
-     *            instance of the Neutron Network object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateNetwork(NeutronNetwork delta, NeutronNetwork original);
-
-    /**
-     * Services provide this interface method for taking action after a network has been updated
-     *
-     * @param network
-     *            instance of modified Neutron Network object
-     * @return void
-     */
-    public void neutronNetworkUpdated(NeutronNetwork network);
-
-    /**
-     * Services provide this interface method to indicate if the specified network can be deleted
-     *
-     * @param network
-     *            instance of the Neutron Network object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteNetwork(NeutronNetwork network);
-
-    /**
-     * Services provide this interface method for taking action after a network has been deleted
-     *
-     * @param network
-     *            instance of deleted Neutron Network object
-     * @return void
-     */
-    public void neutronNetworkDeleted(NeutronNetwork network);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronNetworkCRUD.java
deleted file mode 100644 (file)
index 7f86536..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB network objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronNetworkCRUD}
- */
-
-@Deprecated
-public interface INeutronNetworkCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     * Network object exists
-     *
-     * @param uuid
-     *            UUID of the Network object
-     * @return boolean
-     */
-
-    public boolean networkExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * Network object exists
-     *
-     * @param uuid
-     *            UUID of the Network object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronNetwork.OpenStackNetworks}
-     *          OpenStack Network class
-     */
-
-    public NeutronNetwork getNetwork(String uuid);
-
-    /**
-     * Applications call this interface method to return all Network objects
-     *
-     * @return List of OpenStackNetworks objects
-     */
-
-    public List<NeutronNetwork> getAllNetworks();
-
-    /**
-     * Applications call this interface method to add a Network object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackNetwork object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNetwork(NeutronNetwork input);
-
-    /**
-     * Applications call this interface method to remove a Network object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the network object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNetwork(String uuid);
-
-    /**
-     * Applications call this interface method to edit a Network object
-     *
-     * @param uuid
-     *            identifier of the network object
-     * @param delta
-     *            OpenStackNetwork object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNetwork(String uuid, NeutronNetwork delta);
-
-    /**
-     * Applications call this interface method to determine if a Network object
-     * is use
-     *
-     * @param netUUID
-     *            identifier of the network object
-     *
-     * @return boolean on whether the network is in use or not
-     */
-
-    public boolean networkInUse(String netUUID);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronObject.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronObject.java
deleted file mode 100644 (file)
index e39c07e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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
- *
- *  Authors : Dave Tucker
- */
-
-package org.opendaylight.controller.networkconfig.neutron;
-
-/**
- * This class contains behaviour common to Neutron configuration objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronObject}
- */
-@Deprecated
-public interface INeutronObject {
-    public String getID();
-    public void setID(String id);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortAware.java
deleted file mode 100644 (file)
index 3a14c30..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Neutron Ports needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronPortAware}
- */
-
-@Deprecated
-public interface INeutronPortAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified port can be created
-     *
-     * @param port
-     *            instance of proposed new Neutron Port object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreatePort(NeutronPort port);
-
-    /**
-     * Services provide this interface method for taking action after a port has been created
-     *
-     * @param port
-     *            instance of new Neutron Port object
-     * @return void
-     */
-    public void neutronPortCreated(NeutronPort port);
-
-    /**
-     * Services provide this interface method to indicate if the specified port can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the port object using patch semantics
-     * @param port
-     *            instance of the Neutron Port object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdatePort(NeutronPort delta, NeutronPort original);
-
-    /**
-     * Services provide this interface method for taking action after a port has been updated
-     *
-     * @param port
-     *            instance of modified Neutron Port object
-     * @return void
-     */
-    public void neutronPortUpdated(NeutronPort port);
-
-    /**
-     * Services provide this interface method to indicate if the specified port can be deleted
-     *
-     * @param port
-     *            instance of the Neutron Port object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeletePort(NeutronPort port);
-
-    /**
-     * Services provide this interface method for taking action after a port has been deleted
-     *
-     * @param port
-     *            instance of deleted Port Network object
-     * @return void
-     */
-    public void neutronPortDeleted(NeutronPort port);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronPortCRUD.java
deleted file mode 100644 (file)
index 58b007b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB Port objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronPortCRUD}
- */
-
-@Deprecated
-public interface INeutronPortCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     * Port object exists
-     *
-     * @param uuid
-     *            UUID of the Port object
-     * @return boolean
-     */
-
-    public boolean portExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * Port object exists
-     *
-     * @param uuid
-     *            UUID of the Port object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronPort.OpenStackPorts}
-     *          OpenStack Port class
-     */
-
-    public NeutronPort getPort(String uuid);
-
-    /**
-     * Applications call this interface method to return all Port objects
-     *
-     * @return List of OpenStackPorts objects
-     */
-
-    public List<NeutronPort> getAllPorts();
-
-    /**
-     * Applications call this interface method to add a Port object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackPort object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addPort(NeutronPort input);
-
-    /**
-     * Applications call this interface method to remove a Port object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the Port object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removePort(String uuid);
-
-    /**
-     * Applications call this interface method to edit a Port object
-     *
-     * @param uuid
-     *            identifier of the Port object
-     * @param delta
-     *            OpenStackPort object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updatePort(String uuid, NeutronPort delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param macAddress
-     *            mac Address to be tested
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean macInUse(String macAddress);
-
-    /**
-     * Applications call this interface method to retrieve the port associated with
-     * the gateway address of a subnet
-     *
-     * @param subnetUUID
-     *            identifier of the subnet
-     * @return OpenStackPorts object if the port exists and null if it does not
-     */
-
-    public NeutronPort getGatewayPort(String subnetUUID);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterAware.java
deleted file mode 100644 (file)
index f4c4434..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Neutron Routers needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronRouterAware}
- */
-
-@Deprecated
-public interface INeutronRouterAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified router can be created
-     *
-     * @param router
-     *            instance of proposed new Neutron Router object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateRouter(NeutronRouter router);
-
-    /**
-     * Services provide this interface method for taking action after a router has been created
-     *
-     * @param router
-     *            instance of new Neutron Router object
-     * @return void
-     */
-    public void neutronRouterCreated(NeutronRouter router);
-
-    /**
-     * Services provide this interface method to indicate if the specified router can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the router object using patch semantics
-     * @param router
-     *            instance of the Neutron Router object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateRouter(NeutronRouter delta, NeutronRouter original);
-
-    /**
-     * Services provide this interface method for taking action after a router has been updated
-     *
-     * @param router
-     *            instance of modified Neutron Router object
-     * @return void
-     */
-    public void neutronRouterUpdated(NeutronRouter router);
-
-    /**
-     * Services provide this interface method to indicate if the specified router can be deleted
-     *
-     * @param router
-     *            instance of the Neutron Router object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteRouter(NeutronRouter router);
-
-    /**
-     * Services provide this interface method for taking action after a router has been deleted
-     *
-     * @param router
-     *            instance of deleted Router Network object
-     * @return void
-     */
-    public void neutronRouterDeleted(NeutronRouter router);
-
-    /**
-     * Services provide this interface method to indicate if the specified interface can be attached to the specified route
-     *
-     * @param router
-     *            instance of the base Neutron Router object
-     * @param routerInterface
-     *            instance of the NeutronRouter_Interface to be attached to the router
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the attach operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canAttachInterface(NeutronRouter router, NeutronRouter_Interface routerInterface);
-
-    /**
-     * Services provide this interface method for taking action after an interface has been added to a router
-     *
-     * @param router
-     *            instance of the base Neutron Router object
-     * @param routerInterface
-     *            instance of the NeutronRouter_Interface being attached to the router
-     * @return void
-     */
-    public void neutronRouterInterfaceAttached(NeutronRouter router, NeutronRouter_Interface routerInterface);
-
-    /**
-     * Services provide this interface method to indicate if the specified interface can be detached from the specified router
-     *
-     * @param router
-     *            instance of the base Neutron Router object
-     * @param routerInterface
-     *            instance of the NeutronRouter_Interface to be detached to the router
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the detach operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDetachInterface(NeutronRouter router, NeutronRouter_Interface routerInterface);
-
-    /**
-     * Services provide this interface method for taking action after an interface has been removed from a router
-     *
-     * @param router
-     *            instance of the base Neutron Router object
-     * @param routerInterface
-     *            instance of the NeutronRouter_Interface being detached from the router
-     * @return void
-     */
-    public void neutronRouterInterfaceDetached(NeutronRouter router, NeutronRouter_Interface routerInterface);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronRouterCRUD.java
deleted file mode 100644 (file)
index 37b2c94..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB Router objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronRouterCRUD}
- */
-
-@Deprecated
-public interface INeutronRouterCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     * Router object exists
-     *
-     * @param uuid
-     *            UUID of the Router object
-     * @return boolean
-     */
-
-    public boolean routerExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * Router object exists
-     *
-     * @param uuid
-     *            UUID of the Router object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronRouter.OpenStackRouters}
-     *          OpenStack Router class
-     */
-
-    public NeutronRouter getRouter(String uuid);
-
-    /**
-     * Applications call this interface method to return all Router objects
-     *
-     * @return List of OpenStackRouters objects
-     */
-
-    public List<NeutronRouter> getAllRouters();
-
-    /**
-     * Applications call this interface method to add a Router object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackRouter object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addRouter(NeutronRouter input);
-
-    /**
-     * Applications call this interface method to remove a Router object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the Router object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeRouter(String uuid);
-
-    /**
-     * Applications call this interface method to edit a Router object
-     *
-     * @param uuid
-     *            identifier of the Router object
-     * @param delta
-     *            OpenStackRouter object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateRouter(String uuid, NeutronRouter delta);
-
-    /**
-     * Applications call this interface method to check if a router is in use
-     *
-     * @param uuid
-     *            identifier of the Router object
-     * @return boolean on whether the router is in use or not
-     */
-
-    public boolean routerInUse(String routerUUID);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupAware.java
deleted file mode 100644 (file)
index b518924..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Neutron Security Groups needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronSecurityGroupAware}
- */
-
-@Deprecated
-public interface INeutronSecurityGroupAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified security group can be created
-     *
-     * @param securityGroup instance of proposed new Neutron Security Group object
-     * @return integer
-     * the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     * results in the create operation being interrupted and the returned status value reflected in the
-     * HTTP response.
-     */
-    public int canCreateNeutronSecurityGroup(NeutronSecurityGroup securityGroup);
-
-    /**
-     * Services provide this interface method for taking action after a security group has been created
-     *
-     * @param securityGroup instance of new Neutron Security Group object
-     * @return void
-     */
-    public void neutronSecurityGroupCreated(NeutronSecurityGroup securityGroup);
-
-    /**
-     * Services provide this interface method to indicate if the specified security group can be changed using the specified
-     * delta
-     *
-     * @param delta    updates to the security group object using patch semantics
-     * @param original instance of the Neutron Security Group object to be updated
-     * @return integer
-     * the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     * results in the update operation being interrupted and the returned status value reflected in the
-     * HTTP response.
-     */
-    public int canUpdateNeutronSecurityGroup(NeutronSecurityGroup delta, NeutronSecurityGroup original);
-
-    /**
-     * Services provide this interface method for taking action after a security group has been updated
-     *
-     * @param securityGroup instance of modified Neutron Security Group object
-     * @return void
-     */
-    public void neutronSecurityGroupUpdated(NeutronSecurityGroup securityGroup);
-
-    /**
-     * Services provide this interface method to indicate if the specified security group can be deleted
-     *
-     * @param securityGroup instance of the Neutron Security Group object to be deleted
-     * @return integer
-     * the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     * results in the delete operation being interrupted and the returned status value reflected in the
-     * HTTP response.
-     */
-    public int canDeleteNeutronSecurityGroup(NeutronSecurityGroup securityGroup);
-
-    /**
-     * Services provide this interface method for taking action after a security group has been deleted
-     *
-     * @param securityGroup instance of deleted Neutron Security Group object
-     * @return void
-     */
-    public void neutronSecurityGroupDeleted(NeutronSecurityGroup securityGroup);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityGroupCRUD.java
deleted file mode 100644 (file)
index 6b20182..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack Security Group objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronSecurityGroupCRUD}
- */
-
-@Deprecated
-public interface INeutronSecurityGroupCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     * Security Group object exists
-     *
-     * @param uuid UUID of the Security Group object
-     * @return boolean
-     */
-
-    public boolean neutronSecurityGroupExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * Security Group object exists
-     *
-     * @param uuid UUID of the Security Group object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronSecurityGroup.OpenStackSecurity Groups}
-     * OpenStack Security Group class
-     */
-
-    public NeutronSecurityGroup getNeutronSecurityGroup(String uuid);
-
-    /**
-     * Applications call this interface method to return all Security Group objects
-     *
-     * @return List of OpenStackSecurity Groups objects
-     */
-
-    public List<NeutronSecurityGroup> getAllNeutronSecurityGroups();
-
-    /**
-     * Applications call this interface method to add a Security Group object to the
-     * concurrent map
-     *
-     * @param input OpenStackSecurity Group object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronSecurityGroup(NeutronSecurityGroup input);
-
-    /**
-     * Applications call this interface method to remove a Neutron Security Group object to the
-     * concurrent map
-     *
-     * @param uuid identifier for the security group object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronSecurityGroup(String uuid);
-
-    /**
-     * Applications call this interface method to edit a Security Group object
-     *
-     * @param uuid  identifier of the security group object
-     * @param delta OpenStackSecurity Group object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronSecurityGroup(String uuid, NeutronSecurityGroup delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid identifier of the security group object
-     * @return boolean on whether the Security Groups is already in use
-     */
-
-    public boolean neutronSecurityGroupInUse(String uuid);
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleAware.java
deleted file mode 100644 (file)
index 3be9cc9..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-/**
- * This interface defines the methods required to be aware of Neutron Security Rules
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronSecurityRuleAware}
- */
-
-@Deprecated
-public interface INeutronSecurityRuleAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified security rule can be created
-     *
-     * @param securityRule instance of proposed new Neutron Security Rule object
-     * @return integer
-     * the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     * results in the create operation being interrupted and the returned status value reflected in the
-     * HTTP response.
-     */
-    public int canCreateNeutronSecurityRule(NeutronSecurityRule securityRule);
-
-    /**
-     * Services provide this interface method for taking action after a security rule has been created
-     *
-     * @param securityRule instance of new Neutron Security Rule object
-     * @return void
-     */
-    public void neutronSecurityRuleCreated(NeutronSecurityRule securityRule);
-
-    /**
-     * Services provide this interface method to indicate if the specified security rule can be changed using the specified
-     * delta
-     *
-     * @param delta    updates to the security rule object using patch semantics
-     * @param original instance of the Neutron Security Rule object to be updated
-     * @return integer
-     * the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     * results in the update operation being interrupted and the returned status value reflected in the
-     * HTTP response.
-     */
-    public int canUpdateNeutronSecurityRule(NeutronSecurityRule delta, NeutronSecurityRule original);
-
-    /**
-     * Services provide this interface method for taking action after a security rule has been updated
-     *
-     * @param securityRule instance of modified Neutron Security Rule object
-     * @return void
-     */
-    public void neutronSecurityRuleUpdated(NeutronSecurityRule securityRule);
-
-    /**
-     * Services provide this interface method to indicate if the specified security rule can be deleted
-     *
-     * @param securityRule instance of the Neutron Security Rule object to be deleted
-     * @return integer
-     * the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     * results in the delete operation being interrupted and the returned status value reflected in the
-     * HTTP response.
-     */
-    public int canDeleteNeutronSecurityRule(NeutronSecurityRule securityRule);
-
-    /**
-     * Services provide this interface method for taking action after a security rule has been deleted
-     *
-     * @param securityRule instance of deleted Neutron Security Rule object
-     * @return void
-     */
-    public void neutronSecurityRuleDeleted(NeutronSecurityRule securityRule);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSecurityRuleCRUD.java
deleted file mode 100644 (file)
index a5223b7..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB OpenStack Security Rule objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronSecurityRuleCRUD}
- */
-
-@Deprecated
-public interface INeutronSecurityRuleCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     * Security Rule object exists
-     *
-     * @param uuid UUID of theSecurity Rule object
-     * @return boolean
-     */
-
-    public boolean neutronSecurityRuleExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * Security Rule object exists
-     *
-     * @param uuid UUID of the security rule object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronSecurityRule.OpenStackNetworks}
-     * OpenStackSecurity Rule class
-     */
-
-    public NeutronSecurityRule getNeutronSecurityRule(String uuid);
-
-    /**
-     * Applications call this interface method to return all Security Rule objects
-     *
-     * @return List of OpenStack SecurityRules objects
-     */
-
-    public List<NeutronSecurityRule> getAllNeutronSecurityRules();
-
-    /**
-     * Applications call this interface method to add a Security Rule object to the
-     * concurrent map
-     *
-     * @param input OpenStack security rule object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addNeutronSecurityRule(NeutronSecurityRule input);
-
-    /**
-     * Applications call this interface method to remove a Neutron Security Rule object to the
-     * concurrent map
-     *
-     * @param uuid identifier for the security rule object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeNeutronSecurityRule(String uuid);
-
-    /**
-     * Applications call this interface method to edit aSecurity Rule object
-     *
-     * @param uuid  identifier of the security rule object
-     * @param delta OpenStackSecurity Rule object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateNeutronSecurityRule(String uuid, NeutronSecurityRule delta);
-
-    /**
-     * Applications call this interface method to see if a MAC address is in use
-     *
-     * @param uuid identifier of the security rule object
-     * @return boolean on whether the macAddress is already associated with a
-     * port or not
-     */
-
-    public boolean neutronSecurityRuleInUse(String uuid);
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetAware.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetAware.java
deleted file mode 100644 (file)
index 57d382b..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-/**
- * This interface defines the methods a service that wishes to be aware of Neutron Subnets needs to implement
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronSubnetAware}
- */
-
-@Deprecated
-public interface INeutronSubnetAware {
-
-    /**
-     * Services provide this interface method to indicate if the specified subnet can be created
-     *
-     * @param subnet
-     *            instance of proposed new Neutron Subnet object
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the create operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canCreateSubnet(NeutronSubnet subnet);
-
-    /**
-     * Services provide this interface method for taking action after a subnet has been created
-     *
-     * @param subnet
-     *            instance of new Neutron Subnet object
-     * @return void
-     */
-    public void neutronSubnetCreated(NeutronSubnet subnet);
-
-    /**
-     * Services provide this interface method to indicate if the specified subnet can be changed using the specified
-     * delta
-     *
-     * @param delta
-     *            updates to the subnet object using patch semantics
-     * @param subnet
-     *            instance of the Neutron Subnet object to be updated
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the update operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canUpdateSubnet(NeutronSubnet delta, NeutronSubnet original);
-
-    /**
-     * Services provide this interface method for taking action after a subnet has been updated
-     *
-     * @param subnet
-     *            instance of modified Neutron Subnet object
-     * @return void
-     */
-    public void neutronSubnetUpdated(NeutronSubnet subnet);
-
-    /**
-     * Services provide this interface method to indicate if the specified subnet can be deleted
-     *
-     * @param subnet
-     *            instance of the Subnet Router object to be deleted
-     * @return integer
-     *            the return value is understood to be a HTTP status code.  A return value outside of 200 through 299
-     *            results in the delete operation being interrupted and the returned status value reflected in the
-     *            HTTP response.
-     */
-    public int canDeleteSubnet(NeutronSubnet subnet);
-
-    /**
-     * Services provide this interface method for taking action after a subnet has been deleted
-     *
-     * @param subnet
-     *            instance of deleted Router Subnet object
-     * @return void
-     */
-    public void neutronSubnetDeleted(NeutronSubnet subnet);
-
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetCRUD.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetCRUD.java
deleted file mode 100644 (file)
index 8420682..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.util.List;
-
-/**
- * This interface defines the methods for CRUD of NB Subnet objects
- *
- * @deprecated Replaced by {@link org.opendaylight.neutron.neutron.spi.INeutronSubnetCRUD}
- */
-
-@Deprecated
-public interface INeutronSubnetCRUD {
-    /**
-     * Applications call this interface method to determine if a particular
-     * Subnet object exists
-     *
-     * @param uuid
-     *            UUID of the Subnet object
-     * @return boolean
-     */
-
-    public boolean subnetExists(String uuid);
-
-    /**
-     * Applications call this interface method to return if a particular
-     * Subnet object exists
-     *
-     * @param uuid
-     *            UUID of the Subnet object
-     * @return {@link org.opendaylight.controller.networkconfig.neutron.NeutronSubnet.OpenStackSubnets}
-     *          OpenStack Subnet class
-     */
-
-    public NeutronSubnet getSubnet(String uuid);
-
-    /**
-     * Applications call this interface method to return all Subnet objects
-     *
-     * @return List of OpenStackSubnets objects
-     */
-
-    public List<NeutronSubnet> getAllSubnets();
-
-    /**
-     * Applications call this interface method to add a Subnet object to the
-     * concurrent map
-     *
-     * @param input
-     *            OpenStackSubnet object
-     * @return boolean on whether the object was added or not
-     */
-
-    public boolean addSubnet(NeutronSubnet input);
-
-    /**
-     * Applications call this interface method to remove a Subnet object to the
-     * concurrent map
-     *
-     * @param uuid
-     *            identifier for the Subnet object
-     * @return boolean on whether the object was removed or not
-     */
-
-    public boolean removeSubnet(String uuid);
-
-    /**
-     * Applications call this interface method to edit a Subnet object
-     *
-     * @param uuid
-     *            identifier of the Subnet object
-     * @param delta
-     *            OpenStackSubnet object containing changes to apply
-     * @return boolean on whether the object was updated or not
-     */
-
-    public boolean updateSubnet(String uuid, NeutronSubnet delta);
-
-    /**
-     * Applications call this interface method to determine if a Subnet object
-     * is use
-     *
-     * @param subnetUUID
-     *            identifier of the subnet object
-     *
-     * @return boolean on whether the subnet is in use or not
-     */
-
-    public boolean subnetInUse(String subnetUUID);
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronCRUDInterfaces.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronCRUDInterfaces.java
deleted file mode 100644 (file)
index 0ae523a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NeutronCRUDInterfaces {
-    private static final Logger logger = LoggerFactory
-            .getLogger(NeutronCRUDInterfaces.class);
-
-    public static INeutronNetworkCRUD getINeutronNetworkCRUD(Object o) {
-        INeutronNetworkCRUD answer = (INeutronNetworkCRUD) getInstances(INeutronNetworkCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronSubnetCRUD getINeutronSubnetCRUD(Object o) {
-        INeutronSubnetCRUD answer = (INeutronSubnetCRUD) getInstances(INeutronSubnetCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronPortCRUD getINeutronPortCRUD(Object o) {
-        INeutronPortCRUD answer = (INeutronPortCRUD) getInstances(INeutronPortCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronRouterCRUD getINeutronRouterCRUD(Object o) {
-        INeutronRouterCRUD answer = (INeutronRouterCRUD) getInstances(INeutronRouterCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronFloatingIPCRUD getINeutronFloatingIPCRUD(Object o) {
-        INeutronFloatingIPCRUD answer = (INeutronFloatingIPCRUD) getInstances(INeutronFloatingIPCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronSecurityGroupCRUD getINeutronSecurityGroupCRUD(Object o) {
-        INeutronSecurityGroupCRUD answer = (INeutronSecurityGroupCRUD) getInstances(INeutronSecurityGroupCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronSecurityRuleCRUD getINeutronSecurityRuleCRUD(Object o) {
-        INeutronSecurityRuleCRUD answer = (INeutronSecurityRuleCRUD) getInstances(INeutronSecurityRuleCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronFirewallCRUD getINeutronFirewallCRUD(Object o) {
-        INeutronFirewallCRUD answer = (INeutronFirewallCRUD) getInstances(INeutronFirewallCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronFirewallPolicyCRUD getINeutronFirewallPolicyCRUD(Object o) {
-        INeutronFirewallPolicyCRUD answer = (INeutronFirewallPolicyCRUD) getInstances(INeutronFirewallPolicyCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronFirewallRuleCRUD getINeutronFirewallRuleCRUD(Object o) {
-        INeutronFirewallRuleCRUD answer = (INeutronFirewallRuleCRUD) getInstances(INeutronFirewallRuleCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronLoadBalancerCRUD getINeutronLoadBalancerCRUD(Object o) {
-        INeutronLoadBalancerCRUD answer = (INeutronLoadBalancerCRUD) getInstances(INeutronLoadBalancerCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronLoadBalancerPoolCRUD getINeutronLoadBalancerPoolCRUD(Object o) {
-        INeutronLoadBalancerPoolCRUD answer = (INeutronLoadBalancerPoolCRUD) getInstances(INeutronLoadBalancerPoolCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronLoadBalancerListenerCRUD getINeutronLoadBalancerListenerCRUD(Object o) {
-        INeutronLoadBalancerListenerCRUD answer = (INeutronLoadBalancerListenerCRUD) getInstances(INeutronLoadBalancerListenerCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronLoadBalancerHealthMonitorCRUD getINeutronLoadBalancerHealthMonitorCRUD(Object o) {
-        INeutronLoadBalancerHealthMonitorCRUD answer = (INeutronLoadBalancerHealthMonitorCRUD) getInstances(INeutronLoadBalancerHealthMonitorCRUD.class, o);
-        return answer;
-    }
-
-    public static INeutronLoadBalancerPoolMemberCRUD getINeutronLoadBalancerPoolMemberCRUD(Object o) {
-        INeutronLoadBalancerPoolMemberCRUD answer = (INeutronLoadBalancerPoolMemberCRUD) getInstances(INeutronLoadBalancerPoolMemberCRUD.class, o);
-        return answer;
-    }
-
-    public static Object getInstances(Class<?> clazz,Object bundle) {
-        try {
-            BundleContext bCtx = FrameworkUtil.getBundle(bundle.getClass())
-                    .getBundleContext();
-
-            ServiceReference<?>[] services = null;
-                services = bCtx.getServiceReferences(clazz.getName(),
-                        null);
-            if (services != null) {
-                return bCtx.getService(services[0]);
-            }
-        } catch (Exception e) {
-            logger.error("Instance reference is NULL");
-        }
-        return null;
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewall.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewall.java
deleted file mode 100644 (file)
index 5d427ef..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Firewall as a service
- * (FWaaS) bindings. See OpenStack Network API
- * v2.0 Reference for description of  the fields:
- * Implemented fields are as follows:
- *
- * id                 uuid-str
- * tenant_id          uuid-str
- * name               String
- * description        String
- * admin_state_up     Bool
- * status             String
- * shared             Bool
- * firewall_policy_id uuid-str
- * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewall implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name="id")
-    String firewallUUID;
-
-    @XmlElement (name="tenant_id")
-    String firewallTenantID;
-
-    @XmlElement (name="name")
-    String firewallName;
-
-    @XmlElement (name="description")
-    String firewallDescription;
-
-    @XmlElement (defaultValue="true", name="admin_state_up")
-    Boolean firewallAdminStateIsUp;
-
-    @XmlElement (name="status")
-    String firewallStatus;
-
-    @XmlElement (defaultValue="false", name="shared")
-    Boolean firewallIsShared;
-
-    @XmlElement (name="firewall_policy_id")
-    String neutronFirewallPolicyID;
-
-    public String getFirewallUUID() {
-        return firewallUUID;
-    }
-
-    public void setFirewallUUID(String firewallUUID) {
-        this.firewallUUID = firewallUUID;
-    }
-
-    public String getFirewallTenantID() {
-        return firewallTenantID;
-    }
-
-    public void setFirewallTenantID(String firewallTenantID) {
-        this.firewallTenantID = firewallTenantID;
-    }
-
-    public String getFirewallName() {
-        return firewallName;
-    }
-
-    public void setFirewallName(String firewallName) {
-        this.firewallName = firewallName;
-    }
-
-    public String getFirewallDescription() {
-        return firewallDescription;
-    }
-
-    public void setFirewallDescription(String firewallDescription) {
-        this.firewallDescription = firewallDescription;
-    }
-
-    public Boolean getFirewallAdminStateIsUp() {
-        return firewallAdminStateIsUp;
-    }
-
-    public void setFirewallAdminStateIsUp(Boolean firewallAdminStateIsUp) {
-        this.firewallAdminStateIsUp = firewallAdminStateIsUp;
-    }
-
-    public String getFirewallStatus() {
-        return firewallStatus;
-    }
-
-    public void setFirewallStatus(String firewallStatus) {
-        this.firewallStatus = firewallStatus;
-    }
-
-    public Boolean getFirewallIsShared() {
-        return firewallIsShared;
-    }
-
-    public void setFirewallIsShared(Boolean firewallIsShared) {
-        this.firewallIsShared = firewallIsShared;
-    }
-
-    public String getFirewallPolicyID() {
-        return neutronFirewallPolicyID;
-    }
-
-    public void setNeutronFirewallPolicyID(String firewallPolicy) {
-        this.neutronFirewallPolicyID = firewallPolicy;
-    }
-
-    public NeutronFirewall extractFields(List<String> fields) {
-        NeutronFirewall ans = new NeutronFirewall();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setFirewallUUID(this.getFirewallUUID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setFirewallTenantID(this.getFirewallTenantID());
-            }
-            if (s.equals("name")) {
-                ans.setFirewallName(this.getFirewallName());
-            }
-            if(s.equals("description")) {
-                ans.setFirewallDescription(this.getFirewallDescription());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setFirewallAdminStateIsUp(firewallAdminStateIsUp);
-            }
-            if (s.equals("status")) {
-                ans.setFirewallStatus(this.getFirewallStatus());
-            }
-            if (s.equals("shared")) {
-                ans.setFirewallIsShared(firewallIsShared);
-            }
-            if (s.equals("firewall_policy_id")) {
-                ans.setNeutronFirewallPolicyID(this.getFirewallPolicyID());
-            }
-        }
-        return ans;
-    }
-
-    @Override
-    public String toString() {
-        return "NeutronFirewall{" +
-            "firewallUUID='" + firewallUUID + '\'' +
-            ", firewallTenantID='" + firewallTenantID + '\'' +
-            ", firewallName='" + firewallName + '\'' +
-            ", firewallDescription='" + firewallDescription + '\'' +
-            ", firewallAdminStateIsUp=" + firewallAdminStateIsUp +
-            ", firewallStatus='" + firewallStatus + '\'' +
-            ", firewallIsShared=" + firewallIsShared +
-            ", firewallRulePolicyID=" + neutronFirewallPolicyID +
-            '}';
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallPolicy.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallPolicy.java
deleted file mode 100644 (file)
index 782e18b..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Firewall as a service
- * (FWaaS) bindings. See OpenStack Network API
- * v2.0 Reference for description of  the fields.
- * The implemented fields are as follows:
- *
- * id             uuid-str
- * tenant_id      uuid-str
- * name           String
- * description    String
- * shared         Boolean
- * firewall_rules List
- * audited        Boolean
- * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallPolicy implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name="id")
-    String firewallPolicyUUID;
-
-    @XmlElement (name="tenant_id")
-    String firewallPolicyTenantID;
-
-    @XmlElement (name="name")
-    String firewallPolicyName;
-
-    @XmlElement (name="description")
-    String firewallPolicyDescription;
-
-    @XmlElement (defaultValue="false", name="shared")
-    Boolean firewallPolicyIsShared;
-
-    @XmlElement (name="firewall_rules")
-    List<String> firewallPolicyRules;
-
-    @XmlElement (defaultValue="false", name="audited")
-    String firewallPolicyIsAudited;
-
-    public String getFirewallPolicyIsAudited() {
-        return firewallPolicyIsAudited;
-    }
-
-    public void setFirewallPolicyIsAudited(String firewallPolicyIsAudited) {
-        this.firewallPolicyIsAudited = firewallPolicyIsAudited;
-    }
-
-    public void setFirewallPolicyRules(List<String> firewallPolicyRules) {
-        this.firewallPolicyRules = firewallPolicyRules;
-    }
-
-    public List<String> getFirewallPolicyRules() {
-        return firewallPolicyRules;
-    }
-
-    public Boolean getFirewallPolicyIsShared() {
-        return firewallPolicyIsShared;
-    }
-
-    public void setFirewallPolicyIsShared(Boolean firewallPolicyIsShared) {
-        this.firewallPolicyIsShared = firewallPolicyIsShared;
-    }
-
-    public String getFirewallPolicyDescription() {
-        return firewallPolicyDescription;
-    }
-
-    public void setFirewallPolicyDescription(String firewallPolicyDescription) {
-        this.firewallPolicyDescription = firewallPolicyDescription;
-    }
-
-    public String getFirewallPolicyName() {
-        return firewallPolicyName;
-    }
-
-    public void setFirewallPolicyName(String firewallPolicyName) {
-        this.firewallPolicyName = firewallPolicyName;
-    }
-
-    public String getFirewallPolicyTenantID() {
-        return firewallPolicyTenantID;
-    }
-
-    public void setFirewallPolicyTenantID(String firewallPolicyTenantID) {
-        this.firewallPolicyTenantID = firewallPolicyTenantID;
-    }
-
-    public String getFirewallPolicyUUID() {
-        return firewallPolicyUUID;
-    }
-
-    public void setFirewallPolicyUUID(String firewallPolicyUUID) {
-        this.firewallPolicyUUID = firewallPolicyUUID;
-    }
-
-    public NeutronFirewallPolicy extractFields(List<String> fields) {
-        NeutronFirewallPolicy ans = new NeutronFirewallPolicy();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setFirewallPolicyUUID(this.getFirewallPolicyUUID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setFirewallPolicyTenantID(this.getFirewallPolicyTenantID());
-            }
-            if (s.equals("name")) {
-                ans.setFirewallPolicyName(this.getFirewallPolicyName());
-            }
-            if(s.equals("description")) {
-                ans.setFirewallPolicyDescription(this.getFirewallPolicyDescription());
-            }
-            if (s.equals("shared")) {
-                ans.setFirewallPolicyIsShared(firewallPolicyIsShared);
-            }
-            if (s.equals("firewall_rules")) {
-                List<String> firewallRuleList = new ArrayList<String>();
-                firewallRuleList.addAll(this.getFirewallPolicyRules());
-                ans.setFirewallPolicyRules(firewallRuleList);
-            }
-            if (s.equals("audited")) {
-                ans.setFirewallPolicyIsAudited(firewallPolicyIsAudited);
-            }
-        }
-        return ans;
-    }
-
-    @Override
-    public String toString() {
-        return "NeutronFirewallPolicy{" +
-            "firewallPolicyUUID='" + firewallPolicyUUID + '\'' +
-            ", firewallPolicyTenantID='" + firewallPolicyTenantID + '\'' +
-            ", firewallPolicyName='" + firewallPolicyName + '\'' +
-            ", firewallPolicyDescription='" + firewallPolicyDescription + '\'' +
-            ", firewallPolicyIsShared=" + firewallPolicyIsShared +
-            ", firewallPolicyRules=" + firewallPolicyRules +
-            ", firewallPolicyIsAudited='" + firewallPolicyIsAudited + '\'' +
-            '}';
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallRule.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFirewallRule.java
deleted file mode 100644 (file)
index d4c2393..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Firewall as a service
- * (FWaaS) bindings. See OpenStack Network API
- * v2.0 Reference for description of  the fields.
- * The implemented fields are as follows:
- *
- * tenant_id               uuid-str
- * name                    String
- * description             String
- * admin_state_up          Bool
- * status                  String
- * shared                  Bool
- * firewall_policy_id      uuid-str
- * protocol                String
- * ip_version              Integer
- * source_ip_address       String (IP addr or CIDR)
- * destination_ip_address  String (IP addr or CIDR)
- * source_port             Integer
- * destination_port        Integer
- * position                Integer
- * action                  String
- * enabled                 Bool
- * id                      uuid-str
- * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallRule implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name = "id")
-    String firewallRuleUUID;
-
-    @XmlElement(name = "tenant_id")
-    String firewallRuleTenantID;
-
-    @XmlElement(name = "name")
-    String firewallRuleName;
-
-    @XmlElement(name = "description")
-    String firewallRuleDescription;
-
-    @XmlElement(defaultValue = "true", name = "admin_state_up")
-    Boolean firewallRuleAdminStateIsUp;
-
-    @XmlElement(name = "status")
-    String firewallRuleStatus;
-
-    @XmlElement(defaultValue = "false", name = "shared")
-    Boolean firewallRuleIsShared;
-
-    @XmlElement(name = "firewall_policy_id")
-    String firewallRulePolicyID;
-
-    @XmlElement(name = "protocol")
-    String firewallRuleProtocol;
-
-    @XmlElement(name = "ip_version")
-    Integer firewallRuleIpVer;
-
-    @XmlElement(name = "source_ip_address")
-    String firewallRuleSrcIpAddr;
-
-    @XmlElement(name = "destination_ip_address")
-    String firewallRuleDstIpAddr;
-
-    @XmlElement(name = "source_port")
-    Integer firewallRuleSrcPort;
-
-    @XmlElement(name = "destination_port")
-    Integer firewallRuleDstPort;
-
-    @XmlElement(name = "position")
-    Integer firewallRulePosition;
-
-    @XmlElement(name = "action")
-    String firewallRuleAction;
-
-    @XmlElement(name = "enabled")
-    Boolean firewallRuleIsEnabled;
-
-    public Boolean getFirewallRuleIsEnabled() {
-        return firewallRuleIsEnabled;
-    }
-
-    public void setFirewallRuleIsEnabled(Boolean firewallRuleIsEnabled) {
-        this.firewallRuleIsEnabled = firewallRuleIsEnabled;
-    }
-
-    public String getFirewallRuleAction() {
-        return firewallRuleAction;
-    }
-
-    public void setFirewallRuleAction(String firewallRuleAction) {
-        this.firewallRuleAction = firewallRuleAction;
-    }
-
-    public Integer getFirewallRulePosition() {
-        return firewallRulePosition;
-    }
-
-    public void setFirewallRulePosition(Integer firewallRulePosition) {
-        this.firewallRulePosition = firewallRulePosition;
-    }
-
-    public Integer getFirewallRuleDstPort() {
-        return firewallRuleDstPort;
-    }
-
-    public void setFirewallRuleDstPort(Integer firewallRuleDstPort) {
-        this.firewallRuleDstPort = firewallRuleDstPort;
-    }
-
-    public Integer getFirewallRuleSrcPort() {
-        return firewallRuleSrcPort;
-    }
-
-    public void setFirewallRuleSrcPort(Integer firewallRuleSrcPort) {
-        this.firewallRuleSrcPort = firewallRuleSrcPort;
-    }
-
-    public String getFirewallRuleDstIpAddr() {
-        return firewallRuleDstIpAddr;
-    }
-
-    public void setFirewallRuleDstIpAddr(String firewallRuleDstIpAddr) {
-        this.firewallRuleDstIpAddr = firewallRuleDstIpAddr;
-    }
-
-    public String getFirewallRuleSrcIpAddr() {
-        return firewallRuleSrcIpAddr;
-    }
-
-    public void setFirewallRuleSrcIpAddr(String firewallRuleSrcIpAddr) {
-        this.firewallRuleSrcIpAddr = firewallRuleSrcIpAddr;
-    }
-
-    public Integer getFirewallRuleIpVer() {
-        return firewallRuleIpVer;
-    }
-
-    public void setFirewallRuleIpVer(Integer firewallRuleIpVer) {
-        this.firewallRuleIpVer = firewallRuleIpVer;
-    }
-
-    public String getFirewallRuleProtocol() {
-        return firewallRuleProtocol;
-    }
-
-    public void setFirewallRuleProtocol(String firewallRuleProtocol) {
-        this.firewallRuleProtocol = firewallRuleProtocol;
-    }
-
-    public String getFirewallRulePolicyID() {
-        return firewallRulePolicyID;
-    }
-
-    public void setFirewallRulesPolicyID(String firewallRulePolicyID) {
-        this.firewallRulePolicyID = firewallRulePolicyID;
-    }
-
-    public Boolean getFirewallRuleIsShared() {
-        return firewallRuleIsShared;
-    }
-
-    public void setFirewallRuleIsShared(Boolean firewallRuleIsShared) {
-        this.firewallRuleIsShared = firewallRuleIsShared;
-    }
-
-    public String getFirewallRuleStatus() {
-        return firewallRuleStatus;
-    }
-
-    public void setFirewallRuleStatus(String firewallRuleStatus) {
-        this.firewallRuleStatus = firewallRuleStatus;
-    }
-
-    public Boolean getFirewallRuleAdminStateIsUp() {
-        return firewallRuleAdminStateIsUp;
-    }
-
-    public void setFirewallRuleAdminStateIsUp(Boolean firewallRuleAdminStateIsUp) {
-        this.firewallRuleAdminStateIsUp = firewallRuleAdminStateIsUp;
-    }
-
-    public String getFirewallRuleDescription() {
-        return firewallRuleDescription;
-    }
-
-    public void setFirewallRuleDescription(String firewallRuleDescription) {
-        this.firewallRuleDescription = firewallRuleDescription;
-    }
-
-    public String getFirewallRuleName() {
-        return firewallRuleName;
-    }
-
-    public void setFirewallRuleName(String firewallRuleName) {
-        this.firewallRuleName = firewallRuleName;
-    }
-
-    public String getFirewallRuleTenantID() {
-        return firewallRuleTenantID;
-    }
-
-    public void setFirewallRuleTenantID(String firewallRuleTenantID) {
-        this.firewallRuleTenantID = firewallRuleTenantID;
-    }
-
-    public String getFirewallRuleUUID() {
-        return firewallRuleUUID;
-    }
-
-    public void setFirewallRuleUUID(String firewallRuleUUID) {
-        this.firewallRuleUUID = firewallRuleUUID;
-    }
-
-    public NeutronFirewallRule extractFields(List<String> fields) {
-        NeutronFirewallRule ans = new NeutronFirewallRule();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setFirewallRuleUUID(this.getFirewallRuleUUID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setFirewallRuleTenantID(this.getFirewallRuleTenantID());
-            }
-            if (s.equals("name")) {
-                ans.setFirewallRuleName(this.getFirewallRuleName());
-            }
-            if (s.equals("description")) {
-                ans.setFirewallRuleDescription(this.getFirewallRuleDescription());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setFirewallRuleAdminStateIsUp(firewallRuleAdminStateIsUp);
-            }
-            if (s.equals("status")) {
-                ans.setFirewallRuleStatus(this.getFirewallRuleStatus());
-            }
-            if (s.equals("shared")) {
-                ans.setFirewallRuleIsShared(firewallRuleIsShared);
-            }
-            if (s.equals("firewall_policy_id")) {
-                ans.setFirewallRulesPolicyID(this.getFirewallRulePolicyID());
-            }
-            if (s.equals("protocol")) {
-                ans.setFirewallRuleProtocol(this.getFirewallRuleProtocol());
-            }
-            if (s.equals("source_ip_address")) {
-                ans.setFirewallRuleSrcIpAddr(this.getFirewallRuleSrcIpAddr());
-            }
-            if (s.equals("destination_ip_address")) {
-                ans.setFirewallRuleDstIpAddr(this.getFirewallRuleDstIpAddr());
-            }
-            if (s.equals("source_port")) {
-                ans.setFirewallRuleSrcPort(this.getFirewallRuleSrcPort());
-            }
-            if (s.equals("destination_port")) {
-                ans.setFirewallRuleDstPort(this.getFirewallRuleDstPort());
-            }
-            if (s.equals("position")) {
-                ans.setFirewallRulePosition(this.getFirewallRulePosition());
-            }
-            if (s.equals("action")) {
-                ans.setFirewallRuleAction(this.getFirewallRuleAction());
-            }
-            if (s.equals("enabled")) {
-                ans.setFirewallRuleIsEnabled(firewallRuleIsEnabled);
-            }
-
-        }
-        return ans;
-    }
-
-    @Override
-    public String toString() {
-        return "firewallPolicyRules{" +
-            "firewallRuleUUID='" + firewallRuleUUID + '\'' +
-            ", firewallRuleTenantID='" + firewallRuleTenantID + '\'' +
-            ", firewallRuleName='" + firewallRuleName + '\'' +
-            ", firewallRuleDescription='" + firewallRuleDescription + '\'' +
-            ", firewallRuleAdminStateIsUp=" + firewallRuleAdminStateIsUp +
-            ", firewallRuleStatus='" + firewallRuleStatus + '\'' +
-            ", firewallRuleIsShared=" + firewallRuleIsShared +
-            ", firewallRulePolicyID=" + firewallRulePolicyID +
-            ", firewallRuleProtocol='" + firewallRuleProtocol + '\'' +
-            ", firewallRuleIpVer=" + firewallRuleIpVer +
-            ", firewallRuleSrcIpAddr='" + firewallRuleSrcIpAddr + '\'' +
-            ", firewallRuleDstIpAddr='" + firewallRuleDstIpAddr + '\'' +
-            ", firewallRuleSrcPort=" + firewallRuleSrcPort +
-            ", firewallRuleDstPort=" + firewallRuleDstPort +
-            ", firewallRulePosition=" + firewallRulePosition +
-            ", firewallRuleAction='" + firewallRuleAction + '\'' +
-            ", firewallRuleIsEnabled=" + firewallRuleIsEnabled +
-            '}';
-    }
-
-    public void initDefaults() {
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFloatingIP.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronFloatingIP.java
deleted file mode 100644 (file)
index 9c8c91b..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFloatingIP implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement (name="id")
-    String floatingIPUUID;
-
-    @XmlElement (name="floating_network_id")
-    String floatingNetworkUUID;
-
-    @XmlElement (name="port_id")
-    String portUUID;
-
-    @XmlElement (name="fixed_ip_address")
-    String fixedIPAddress;
-
-    @XmlElement (name="floating_ip_address")
-    String floatingIPAddress;
-
-    @XmlElement (name="tenant_id")
-    String tenantUUID;
-
-    public NeutronFloatingIP() {
-    }
-
-    public String getID() { return floatingIPUUID; }
-
-    public String getFloatingIPUUID() {
-        return floatingIPUUID;
-    }
-
-    public void setFloatingIPUUID(String floatingIPUUID) {
-        this.floatingIPUUID = floatingIPUUID;
-    }
-
-    public String getFloatingNetworkUUID() {
-        return floatingNetworkUUID;
-    }
-
-    public void setFloatingNetworkUUID(String floatingNetworkUUID) {
-        this.floatingNetworkUUID = floatingNetworkUUID;
-    }
-
-    public String getPortUUID() {
-        return portUUID;
-    }
-
-    public void setPortUUID(String portUUID) {
-        this.portUUID = portUUID;
-    }
-
-    public String getFixedIPAddress() {
-        return fixedIPAddress;
-    }
-
-    public void setFixedIPAddress(String fixedIPAddress) {
-        this.fixedIPAddress = fixedIPAddress;
-    }
-
-    public String getFloatingIPAddress() {
-        return floatingIPAddress;
-    }
-
-    public void setFloatingIPAddress(String floatingIPAddress) {
-        this.floatingIPAddress = floatingIPAddress;
-    }
-
-    public String getTenantUUID() {
-        return tenantUUID;
-    }
-
-    public void setTenantUUID(String tenantUUID) {
-        this.tenantUUID = tenantUUID;
-    }
-
-    /**
-     * This method copies selected fields from the object and returns them
-     * as a new object, suitable for marshaling.
-     *
-     * @param fields
-     *            List of attributes to be extracted
-     * @return an OpenStackFloatingIPs object with only the selected fields
-     * populated
-     */
-
-    public NeutronFloatingIP extractFields(List<String> fields) {
-        NeutronFloatingIP ans = new NeutronFloatingIP();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setFloatingIPUUID(this.getFloatingIPUUID());
-            }
-            if (s.equals("floating_network_id")) {
-                ans.setFloatingNetworkUUID(this.getFloatingNetworkUUID());
-            }
-            if (s.equals("port_id")) {
-                ans.setPortUUID(this.getPortUUID());
-            }
-            if (s.equals("fixed_ip_address")) {
-                ans.setFixedIPAddress(this.getFixedIPAddress());
-            }
-            if (s.equals("floating_ip_address")) {
-                ans.setFloatingIPAddress(this.getFloatingIPAddress());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setTenantUUID(this.getTenantUUID());
-            }
-        }
-        return ans;
-    }
-
-    public void initDefaults() {
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancer.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancer.java
deleted file mode 100644 (file)
index 58f0eb4..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Load Balancer as a service
- * (LBaaS) bindings. See OpenStack Network API
- * v2.0 Reference for description of  the fields:
- * Implemented fields are as follows:
- *
- * id                 uuid-str
- * tenant_id          uuid-str
- * name               String
- * description        String
- * status             String
- * vip_address        IP address
- * vip_subnet         uuid-str
- * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancer implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name="id")
-    String loadBalancerID;
-
-    @XmlElement (name="tenant_id")
-    String loadBalancerTenantID;
-
-    @XmlElement (name="name")
-    String loadBalancerName;
-
-    @XmlElement (name="description")
-    String loadBalancerDescription;
-
-    @XmlElement (name="status")
-    String loadBalancerStatus;
-
-    @XmlElement (name="vip_address")
-    String loadBalancerVipAddress;
-
-    @XmlElement (name="vip_subnet_id")
-    String loadBalancerVipSubnetID;
-
-    public String getLoadBalancerID() {
-        return loadBalancerID;
-    }
-
-    public void setLoadBalancerID(String loadBalancerID) {
-        this.loadBalancerID = loadBalancerID;
-    }
-
-    public String getLoadBalancerTenantID() {
-        return loadBalancerTenantID;
-    }
-
-    public void setLoadBalancerTenantID(String loadBalancerTenantID) {
-        this.loadBalancerTenantID = loadBalancerTenantID;
-    }
-
-    public String getLoadBalancerName() {
-        return loadBalancerName;
-    }
-
-    public void setLoadBalancerName(String loadBalancerName) {
-        this.loadBalancerName = loadBalancerName;
-    }
-
-    public String getLoadBalancerDescription() {
-        return loadBalancerDescription;
-    }
-
-    public void setLoadBalancerDescription(String loadBalancerDescription) {
-        this.loadBalancerDescription = loadBalancerDescription;
-    }
-
-    public String getLoadBalancerStatus() {
-        return loadBalancerStatus;
-    }
-
-    public void setLoadBalancerStatus(String loadBalancerStatus) {
-        this.loadBalancerStatus = loadBalancerStatus;
-    }
-
-    public String getLoadBalancerVipAddress() {
-        return loadBalancerVipAddress;
-    }
-
-    public void setLoadBalancerVipAddress(String loadBalancerVipAddress) {
-        this.loadBalancerVipAddress = loadBalancerVipAddress;
-    }
-
-    public String getLoadBalancerVipSubnetID() {
-        return loadBalancerVipSubnetID;
-    }
-
-    public void setLoadBalancerVipSubnetID(String loadBalancerVipSubnetID) {
-        this.loadBalancerVipSubnetID = loadBalancerVipSubnetID;
-    }
-
-    public NeutronLoadBalancer extractFields(List<String> fields) {
-        NeutronLoadBalancer ans = new NeutronLoadBalancer();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setLoadBalancerID(this.getLoadBalancerID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setLoadBalancerTenantID(this.getLoadBalancerTenantID());
-            }
-            if (s.equals("name")) {
-                ans.setLoadBalancerName(this.getLoadBalancerName());
-            }
-            if(s.equals("description")) {
-                ans.setLoadBalancerDescription(this.getLoadBalancerDescription());
-            }
-            if (s.equals("vip_address")) {
-                ans.setLoadBalancerVipAddress(this.getLoadBalancerVipAddress());
-            }
-            if (s.equals("vip_subnet_id")) {
-                ans.setLoadBalancerVipSubnetID(this.getLoadBalancerVipSubnetID());
-            }
-            if (s.equals("status")) {
-                ans.setLoadBalancerStatus(this.getLoadBalancerStatus());
-            }
-        }
-        return ans;
-    }
-
-    @Override public String toString() {
-        return "NeutronLoadBalancer{" +
-                "loadBalancerID='" + loadBalancerID + '\'' +
-                ", loadBalancerTenantID='" + loadBalancerTenantID + '\'' +
-                ", loadBalancerName='" + loadBalancerName + '\'' +
-                ", loadBalancerDescription='" + loadBalancerDescription + '\'' +
-                ", loadBalancerStatus='" + loadBalancerStatus + '\'' +
-                ", loadBalancerVipAddress='" + loadBalancerVipAddress + '\'' +
-                ", loadBalancerVipSubnetID='" + loadBalancerVipSubnetID + '\'' +
-                '}';
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerHealthMonitor.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerHealthMonitor.java
deleted file mode 100644 (file)
index d23fe11..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Load Balancer as a service
- * (LBaaS) bindings. See OpenStack Network API
- * v2.0 Reference for description of  the fields:
- * Implemented fields are as follows:
- *
- *
- * id                 uuid-str
- * tenant_id          uuid-str
- * type               String
- * delay              Integer
- * timeout            Integer
- * max_retries        Integer
- * http_method        String
- * url_path           String
- * expected_codes     String
- * admin_state_up     Boolean
- * status             String
- * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerHealthMonitor implements Serializable {
-    private static final long serialVersionUID = 1L;
-    private static final Logger logger = LoggerFactory.getLogger(NeutronLoadBalancer.class);
-
-    @XmlElement(name="id")
-    String loadBalancerHealthMonitorID;
-
-    @XmlElement (name="tenant_id")
-    String loadBalancerHealthMonitorTenantID;
-
-    @XmlElement (name="type")
-    String loadBalancerHealthMonitorType;
-
-    @XmlElement (name="delay")
-    Integer loadBalancerHealthMonitorDelay;
-
-    @XmlElement (name="timeout")
-    Integer loadBalancerHealthMonitorTimeout;
-
-    @XmlElement (name="max_retries")
-    Integer loadBalancerHealthMonitorMaxRetries;
-
-    @XmlElement (name="http_method")
-    String loadBalancerHealthMonitorHttpMethod;
-
-    @XmlElement (name="url_path")
-    String loadBalancerHealthMonitorUrlPath;
-
-    @XmlElement (name="expected_codes")
-    String loadBalancerHealthMonitorExpectedCodes;
-
-    @XmlElement (defaultValue="true", name="admin_state_up")
-    Boolean loadBalancerHealthMonitorAdminStateIsUp;
-
-    @XmlElement (name="status")
-    String loadBalancerHealthMonitorStatus;
-
-    public String getLoadBalancerHealthMonitorID() {
-        return loadBalancerHealthMonitorID;
-    }
-
-    public void setLoadBalancerHealthMonitorID(String loadBalancerHealthMonitorID) {
-        this.loadBalancerHealthMonitorID = loadBalancerHealthMonitorID;
-    }
-
-    public String getLoadBalancerHealthMonitorTenantID() {
-        return loadBalancerHealthMonitorTenantID;
-    }
-
-    public void setLoadBalancerHealthMonitorTenantID(String loadBalancerHealthMonitorTenantID) {
-        this.loadBalancerHealthMonitorTenantID = loadBalancerHealthMonitorTenantID;
-    }
-
-    public String getLoadBalancerHealthMonitorType() {
-        return loadBalancerHealthMonitorType;
-    }
-
-    public void setLoadBalancerHealthMonitorType(String loadBalancerHealthMonitorType) {
-        this.loadBalancerHealthMonitorType = loadBalancerHealthMonitorType;
-    }
-
-    public Integer getLoadBalancerHealthMonitorDelay() {
-        return loadBalancerHealthMonitorDelay;
-    }
-
-    public void setLoadBalancerHealthMonitorDelay(Integer loadBalancerHealthMonitorDelay) {
-        this.loadBalancerHealthMonitorDelay = loadBalancerHealthMonitorDelay;
-    }
-
-    public Integer getLoadBalancerHealthMonitorTimeout() {
-        return loadBalancerHealthMonitorTimeout;
-    }
-
-    public void setLoadBalancerHealthMonitorTimeout(Integer loadBalancerHealthMonitorTimeout) {
-        this.loadBalancerHealthMonitorTimeout = loadBalancerHealthMonitorTimeout;
-    }
-
-    public Integer getLoadBalancerHealthMonitorMaxRetries() {
-        return loadBalancerHealthMonitorMaxRetries;
-    }
-
-    public void setLoadBalancerHealthMonitorMaxRetries(Integer loadBalancerHealthMonitorMaxRetries) {
-        this.loadBalancerHealthMonitorMaxRetries = loadBalancerHealthMonitorMaxRetries;
-    }
-
-    public String getLoadBalancerHealthMonitorHttpMethod() {
-        return loadBalancerHealthMonitorHttpMethod;
-    }
-
-    public void setLoadBalancerHealthMonitorHttpMethod(String loadBalancerHealthMonitorHttpMethod) {
-        this.loadBalancerHealthMonitorHttpMethod = loadBalancerHealthMonitorHttpMethod;
-    }
-
-    public String getLoadBalancerHealthMonitorUrlPath() {
-        return loadBalancerHealthMonitorUrlPath;
-    }
-
-    public void setLoadBalancerHealthMonitorUrlPath(String loadBalancerHealthMonitorUrlPath) {
-        this.loadBalancerHealthMonitorUrlPath = loadBalancerHealthMonitorUrlPath;
-    }
-
-    public String getLoadBalancerHealthMonitorExpectedCodes() {
-        return loadBalancerHealthMonitorExpectedCodes;
-    }
-
-    public void setLoadBalancerHealthMonitorExpectedCodes(String loadBalancerHealthMonitorExpectedCodes) {
-        this.loadBalancerHealthMonitorExpectedCodes = loadBalancerHealthMonitorExpectedCodes;
-    }
-
-    public Boolean getLoadBalancerHealthMonitorAdminStateIsUp() {
-        return loadBalancerHealthMonitorAdminStateIsUp;
-    }
-
-    public void setLoadBalancerHealthMonitorAdminStateIsUp(Boolean loadBalancerHealthMonitorAdminStateIsUp) {
-        this.loadBalancerHealthMonitorAdminStateIsUp = loadBalancerHealthMonitorAdminStateIsUp;
-    }
-
-    public String getLoadBalancerHealthMonitorStatus() {
-        return loadBalancerHealthMonitorStatus;
-    }
-
-    public void setLoadBalancerHealthMonitorStatus(String loadBalancerHealthMonitorStatus) {
-        this.loadBalancerHealthMonitorStatus = loadBalancerHealthMonitorStatus;
-    }
-
-    public NeutronLoadBalancerHealthMonitor extractFields(List<String> fields) {
-        NeutronLoadBalancerHealthMonitor ans = new NeutronLoadBalancerHealthMonitor();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setLoadBalancerHealthMonitorID(this.getLoadBalancerHealthMonitorID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setLoadBalancerHealthMonitorTenantID(this.getLoadBalancerHealthMonitorTenantID());
-            }
-            if (s.equals("type")) {
-                ans.setLoadBalancerHealthMonitorType(this.getLoadBalancerHealthMonitorType());
-            }
-            if (s.equals("delay")) {
-                ans.setLoadBalancerHealthMonitorDelay(this.getLoadBalancerHealthMonitorDelay());
-            }
-            if (s.equals("timeout")) {
-                ans.setLoadBalancerHealthMonitorTimeout(this.getLoadBalancerHealthMonitorTimeout());
-            }
-            if (s.equals("max_retries")) {
-                ans.setLoadBalancerHealthMonitorMaxRetries(this.getLoadBalancerHealthMonitorMaxRetries());
-            }
-            if (s.equals("http_method")) {
-                ans.setLoadBalancerHealthMonitorHttpMethod(this.getLoadBalancerHealthMonitorHttpMethod());
-            }
-            if(s.equals("url_path")) {
-                ans.setLoadBalancerHealthMonitorUrlPath(this.getLoadBalancerHealthMonitorUrlPath());
-            }
-            if (s.equals("expected_codes")) {
-                ans.setLoadBalancerHealthMonitorExpectedCodes(this.getLoadBalancerHealthMonitorExpectedCodes());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setLoadBalancerHealthMonitorAdminStateIsUp(loadBalancerHealthMonitorAdminStateIsUp);
-            }
-            if (s.equals("status")) {
-                ans.setLoadBalancerHealthMonitorStatus(this.getLoadBalancerHealthMonitorStatus());
-            }
-        }
-        return ans;
-    }
-
-    @Override public String toString() {
-        return "NeutronLoadBalancerHealthMonitor{" +
-                "loadBalancerHealthMonitorID='" + loadBalancerHealthMonitorID + '\'' +
-                ", loadBalancerHealthMonitorTenantID='" + loadBalancerHealthMonitorTenantID + '\'' +
-                ", loadBalancerHealthMonitorType='" + loadBalancerHealthMonitorType + '\'' +
-                ", loadBalancerHealthMonitorDelay=" + loadBalancerHealthMonitorDelay +
-                ", loadBalancerHealthMonitorTimeout=" + loadBalancerHealthMonitorTimeout +
-                ", loadBalancerHealthMonitorMaxRetries=" + loadBalancerHealthMonitorMaxRetries +
-                ", loadBalancerHealthMonitorHttpMethod='" + loadBalancerHealthMonitorHttpMethod + '\'' +
-                ", loadBalancerHealthMonitorUrlPath='" + loadBalancerHealthMonitorUrlPath + '\'' +
-                ", loadBalancerHealthMonitorExpectedCodes='" + loadBalancerHealthMonitorExpectedCodes + '\'' +
-                ", loadBalancerHealthMonitorAdminStateIsUp=" + loadBalancerHealthMonitorAdminStateIsUp +
-                ", loadBalancerHealthMonitorStatus='" + loadBalancerHealthMonitorStatus + '\'' +
-                '}';
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerListener.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerListener.java
deleted file mode 100644 (file)
index 8b4ada3..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Load Balancer as a service
- * (LBaaS) bindings. See OpenStack Network API
- * v2.0 Reference for description of  the fields:
- * Implemented fields are as follows:
- *
- * id                 uuid-str
- * default_pool_id    String
- * tenant_id          uuid-str
- * name               String
- * description        String
- * shared             Bool
- * protocol           String
- * protocol_port      String
- * load_balancer_id   String
- * admin_state_up     Boolean
- * status             String
- *
- * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerListener implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name="id")
-    String loadBalancerListenerID;
-
-    @XmlElement (name="default_pool_id")
-    String neutronLoadBalancerListenerDefaultPoolID;
-
-    @XmlElement (name="tenant_id")
-    String loadBalancerListenerTenantID;
-
-    @XmlElement (name="name")
-    String loadBalancerListenerName;
-
-    @XmlElement (name="description")
-    String loadBalancerListenerDescription;
-
-    @XmlElement (defaultValue="true", name="admin_state_up")
-    Boolean loadBalancerListenerAdminStateIsUp;
-
-    @XmlElement (name="status")
-    String loadBalancerListenerStatus;
-
-    @XmlElement (defaultValue="false", name="shared")
-    Boolean loadBalancerListenerIsShared;
-
-    @XmlElement (name="protocol")
-    String neutronLoadBalancerListenerProtocol;
-
-    @XmlElement (name="protocol_port")
-    String neutronLoadBalancerListenerProtocolPort;
-
-    @XmlElement (name="load_balancer_id")
-    String neutronLoadBalancerListenerLoadBalancerID;
-
-
-    public String getLoadBalancerListenerID() {
-        return loadBalancerListenerID;
-    }
-
-    public void setLoadBalancerListenerID(String loadBalancerListenerID) {
-        this.loadBalancerListenerID = loadBalancerListenerID;
-    }
-
-    public String getLoadBalancerListenerTenantID() {
-        return loadBalancerListenerTenantID;
-    }
-
-    public void setLoadBalancerListenerTenantID(String loadBalancerListenerTenantID) {
-        this.loadBalancerListenerTenantID = loadBalancerListenerTenantID;
-    }
-
-    public String getLoadBalancerListenerName() {
-        return loadBalancerListenerName;
-    }
-
-    public void setLoadBalancerListenerName(String loadBalancerListenerName) {
-        this.loadBalancerListenerName = loadBalancerListenerName;
-    }
-
-    public String getLoadBalancerListenerDescription() {
-        return loadBalancerListenerDescription;
-    }
-
-    public void setLoadBalancerListenerDescription(String loadBalancerListenerDescription) {
-        this.loadBalancerListenerDescription = loadBalancerListenerDescription;
-    }
-
-    public Boolean getLoadBalancerListenerAdminStateIsUp() {
-        return loadBalancerListenerAdminStateIsUp;
-    }
-
-    public void setLoadBalancerListenerAdminStateIsUp(Boolean loadBalancerListenerAdminStateIsUp) {
-        this.loadBalancerListenerAdminStateIsUp = loadBalancerListenerAdminStateIsUp;
-    }
-
-    public String getLoadBalancerListenerStatus() {
-        return loadBalancerListenerStatus;
-    }
-
-    public void setLoadBalancerListenerStatus(String loadBalancerListenerStatus) {
-        this.loadBalancerListenerStatus = loadBalancerListenerStatus;
-    }
-
-    public Boolean getLoadBalancerListenerIsShared() {
-        return loadBalancerListenerIsShared;
-    }
-
-    public void setLoadBalancerListenerIsShared(Boolean loadBalancerListenerIsShared) {
-        this.loadBalancerListenerIsShared = loadBalancerListenerIsShared;
-    }
-
-    public String getNeutronLoadBalancerListenerProtocol() {
-        return neutronLoadBalancerListenerProtocol;
-    }
-
-    public void setNeutronLoadBalancerListenerProtocol(String neutronLoadBalancerListenerProtocol) {
-        this.neutronLoadBalancerListenerProtocol = neutronLoadBalancerListenerProtocol;
-    }
-
-    public String getNeutronLoadBalancerListenerProtocolPort() {
-        return neutronLoadBalancerListenerProtocolPort;
-    }
-
-    public void setNeutronLoadBalancerListenerProtocolPort(String neutronLoadBalancerListenerProtocolPort) {
-        this.neutronLoadBalancerListenerProtocolPort = neutronLoadBalancerListenerProtocolPort;
-    }
-
-    public String getNeutronLoadBalancerListenerDefaultPoolID() {
-        return neutronLoadBalancerListenerDefaultPoolID;
-    }
-
-    public void setNeutronLoadBalancerListenerDefaultPoolID(String neutronLoadBalancerListenerDefaultPoolID) {
-        this.neutronLoadBalancerListenerDefaultPoolID = neutronLoadBalancerListenerDefaultPoolID;
-    }
-
-    public String getNeutronLoadBalancerListenerLoadBalancerID() {
-        return neutronLoadBalancerListenerLoadBalancerID;
-    }
-
-    public void setNeutronLoadBalancerListenerLoadBalancerID(String neutronLoadBalancerListenerLoadBalancerID) {
-        this.neutronLoadBalancerListenerLoadBalancerID = neutronLoadBalancerListenerLoadBalancerID;
-    }
-
-    public NeutronLoadBalancerListener extractFields(List<String> fields) {
-        NeutronLoadBalancerListener ans = new NeutronLoadBalancerListener();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setLoadBalancerListenerID(this.getLoadBalancerListenerID());
-            }
-            if(s.equals("default_pool_id")) {
-                ans.setNeutronLoadBalancerListenerDefaultPoolID(this.getNeutronLoadBalancerListenerDefaultPoolID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setLoadBalancerListenerTenantID(this.getLoadBalancerListenerTenantID());
-            }
-            if (s.equals("name")) {
-                ans.setLoadBalancerListenerName(this.getLoadBalancerListenerName());
-            }
-            if(s.equals("description")) {
-                ans.setLoadBalancerListenerDescription(this.getLoadBalancerListenerDescription());
-            }
-            if (s.equals("shared")) {
-                ans.setLoadBalancerListenerIsShared(loadBalancerListenerIsShared);
-            }
-            if (s.equals("protocol")) {
-                ans.setNeutronLoadBalancerListenerProtocol(this.getNeutronLoadBalancerListenerProtocol());
-            }
-            if (s.equals("protocol_port")) {
-                ans.setNeutronLoadBalancerListenerProtocolPort(this.getNeutronLoadBalancerListenerProtocolPort());
-            }
-            if (s.equals("load_balancer_id")) {
-                ans.setNeutronLoadBalancerListenerLoadBalancerID(this.getNeutronLoadBalancerListenerLoadBalancerID());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setLoadBalancerListenerAdminStateIsUp(loadBalancerListenerAdminStateIsUp);
-            }
-            if (s.equals("status")) {
-                ans.setLoadBalancerListenerStatus(this.getLoadBalancerListenerStatus());
-            }
-        }
-        return ans;
-    }
-
-    @Override public String toString() {
-        return "NeutronLoadBalancerListener{" +
-                "loadBalancerListenerID='" + loadBalancerListenerID + '\'' +
-                ", neutronLoadBalancerListenerDefaultPoolID='" + neutronLoadBalancerListenerDefaultPoolID + '\'' +
-                ", loadBalancerListenerTenantID='" + loadBalancerListenerTenantID + '\'' +
-                ", loadBalancerListenerName='" + loadBalancerListenerName + '\'' +
-                ", loadBalancerListenerDescription='" + loadBalancerListenerDescription + '\'' +
-                ", loadBalancerListenerAdminStateIsUp=" + loadBalancerListenerAdminStateIsUp +
-                ", loadBalancerListenerStatus='" + loadBalancerListenerStatus + '\'' +
-                ", loadBalancerListenerIsShared=" + loadBalancerListenerIsShared +
-                ", neutronLoadBalancerListenerProtocol='" + neutronLoadBalancerListenerProtocol + '\'' +
-                ", neutronLoadBalancerListenerProtocolPort='" + neutronLoadBalancerListenerProtocolPort + '\'' +
-                ", neutronLoadBalancerListenerLoadBalancerID='" + neutronLoadBalancerListenerLoadBalancerID + '\'' +
-                '}';
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPool.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPool.java
deleted file mode 100644 (file)
index 363de41..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-//import javax.xml.bind.annotation.XmlElementWrapper;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Load Balancer as a service
- * (LBaaS) bindings. See OpenStack Network API
- * v2.0 Reference for description of  the fields:
- * Implemented fields are as follows:
- *
- * id                 uuid-str
- * tenant_id          uuid-str
- * name               String
- * description        String
- * protocol           String
- * lb_algorithm       String
- * healthmonitor_id   String
- * admin_state_up     Bool
- * status             String
- * members            List <NeutronLoadBalancerPoolMember>
- * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerPool implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name="id")
-    String loadBalancerPoolID;
-
-    @XmlElement (name="tenant_id")
-    String loadBalancerPoolTenantID;
-
-    @XmlElement (name="name")
-    String loadBalancerPoolName;
-
-    @XmlElement (name="description")
-    String loadBalancerPoolDescription;
-
-    @XmlElement (name="protocol")
-    String loadBalancerPoolProtocol;
-
-    @XmlElement (name="lb_algorithm")
-    String loadBalancerPoolLbAlgorithm;
-
-    @XmlElement (name="healthmonitor_id")
-    String neutronLoadBalancerPoolHealthMonitorID;
-
-    @XmlElement (defaultValue="true", name="admin_state_up")
-    Boolean loadBalancerPoolAdminStateIsUp;
-
-    @XmlElement (name="status")
-    String loadBalancerPoolStatus;
-
-    @XmlElement(name="members")
-    List<NeutronLoadBalancerPoolMember> loadBalancerPoolMembers;
-
-    public NeutronLoadBalancerPool() {
-    }
-
-    public String getLoadBalancerPoolID() {
-        return loadBalancerPoolID;
-    }
-
-    public void setLoadBalancerPoolID(String loadBalancerPoolID) {
-        this.loadBalancerPoolID = loadBalancerPoolID;
-    }
-
-    public String getLoadBalancerPoolTenantID() {
-        return loadBalancerPoolTenantID;
-    }
-
-    public void setLoadBalancerPoolTenantID(String loadBalancerPoolTenantID) {
-        this.loadBalancerPoolTenantID = loadBalancerPoolTenantID;
-    }
-
-    public String getLoadBalancerPoolName() {
-        return loadBalancerPoolName;
-    }
-
-    public void setLoadBalancerPoolName(String loadBalancerPoolName) {
-        this.loadBalancerPoolName = loadBalancerPoolName;
-    }
-
-    public String getLoadBalancerPoolDescription() {
-        return loadBalancerPoolDescription;
-    }
-
-    public void setLoadBalancerPoolDescription(String loadBalancerPoolDescription) {
-        this.loadBalancerPoolDescription = loadBalancerPoolDescription;
-    }
-
-    public String getLoadBalancerPoolProtocol() {
-        return loadBalancerPoolProtocol;
-    }
-
-    public void setLoadBalancerPoolProtocol(String loadBalancerPoolProtocol) {
-        this.loadBalancerPoolProtocol = loadBalancerPoolProtocol;
-    }
-
-    public String getLoadBalancerPoolLbAlgorithm() {
-        return loadBalancerPoolLbAlgorithm;
-    }
-
-    public void setLoadBalancerPoolLbAlgorithm(String loadBalancerPoolLbAlgorithm) {
-        this.loadBalancerPoolLbAlgorithm = loadBalancerPoolLbAlgorithm;
-    }
-
-    public String getNeutronLoadBalancerPoolHealthMonitorID() {
-        return neutronLoadBalancerPoolHealthMonitorID;
-    }
-
-    public void setNeutronLoadBalancerPoolHealthMonitorID(String neutronLoadBalancerPoolHealthMonitorID) {
-        this.neutronLoadBalancerPoolHealthMonitorID = neutronLoadBalancerPoolHealthMonitorID;
-    }
-
-    public Boolean getLoadBalancerPoolAdminIsStateIsUp() {
-        return loadBalancerPoolAdminStateIsUp;
-    }
-
-    public void setLoadBalancerPoolAdminStateIsUp(Boolean loadBalancerPoolAdminStateIsUp) {
-        this.loadBalancerPoolAdminStateIsUp = loadBalancerPoolAdminStateIsUp;
-    }
-
-    public String getLoadBalancerPoolStatus() {
-        return loadBalancerPoolStatus;
-    }
-
-    public void setLoadBalancerPoolStatus(String loadBalancerPoolStatus) {
-        this.loadBalancerPoolStatus = loadBalancerPoolStatus;
-    }
-
-    public List<NeutronLoadBalancerPoolMember> getLoadBalancerPoolMembers() {
-        /*
-         * Update the pool_id of the member to that this.loadBalancerPoolID
-         */
-        for (NeutronLoadBalancerPoolMember member: loadBalancerPoolMembers)
-            member.setPoolID(loadBalancerPoolID);
-        return loadBalancerPoolMembers;
-    }
-
-    public void setLoadBalancerPoolMembers(List<NeutronLoadBalancerPoolMember> loadBalancerPoolMembers) {
-        this.loadBalancerPoolMembers = loadBalancerPoolMembers;
-    }
-
-    public void addLoadBalancerPoolMember(NeutronLoadBalancerPoolMember loadBalancerPoolMember) {
-        this.loadBalancerPoolMembers.add(loadBalancerPoolMember);
-    }
-
-    public void removeLoadBalancerPoolMember(NeutronLoadBalancerPoolMember loadBalancerPoolMember) {
-        this.loadBalancerPoolMembers.remove(loadBalancerPoolMember);
-    }
-
-    public NeutronLoadBalancerPool extractFields(List<String> fields) {
-        NeutronLoadBalancerPool ans = new NeutronLoadBalancerPool();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setLoadBalancerPoolID(this.getLoadBalancerPoolID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setLoadBalancerPoolTenantID(this.getLoadBalancerPoolTenantID());
-            }
-            if (s.equals("name")) {
-                ans.setLoadBalancerPoolName(this.getLoadBalancerPoolName());
-            }
-            if(s.equals("description")) {
-                ans.setLoadBalancerPoolDescription(this.getLoadBalancerPoolDescription());
-            }
-            if(s.equals("protocol")) {
-                ans.setLoadBalancerPoolProtocol(this.getLoadBalancerPoolProtocol());
-            }
-            if(s.equals("lb_algorithm")) {
-                ans.setLoadBalancerPoolLbAlgorithm(this.getLoadBalancerPoolLbAlgorithm());
-            }
-            if(s.equals("healthmonitor_id")) {
-                ans.setNeutronLoadBalancerPoolHealthMonitorID(this.getNeutronLoadBalancerPoolHealthMonitorID());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setLoadBalancerPoolAdminStateIsUp(loadBalancerPoolAdminStateIsUp);
-            }
-            if (s.equals("status")) {
-                ans.setLoadBalancerPoolStatus(this.getLoadBalancerPoolStatus());
-            }
-            if (s.equals("members")) {
-                ans.setLoadBalancerPoolMembers(getLoadBalancerPoolMembers());
-            }
-        }
-        return ans;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPoolMember.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronLoadBalancerPoolMember.java
deleted file mode 100644 (file)
index 313a951..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronLoadBalancerPoolMember implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * TODO: Plumb into LBaaS Pool. Members are nested underneath Pool CRUD.
-     */
-    @XmlElement (name="id")
-    String poolMemberID;
-
-    @XmlElement (name="tenant_id")
-    String poolMemberTenantID;
-
-    @XmlElement (name="address")
-    String poolMemberAddress;
-
-    @XmlElement (name="protocol_port")
-    Integer poolMemberProtoPort;
-
-    @XmlElement (name="admin_state_up")
-    Boolean poolMemberAdminStateIsUp;
-
-    @XmlElement (name="weight")
-    Integer poolMemberWeight;
-
-    @XmlElement (name="subnet_id")
-    String poolMemberSubnetID;
-
-    @XmlElement (name="status")
-    String poolMemberStatus;
-
-    String poolID;
-
-    public NeutronLoadBalancerPoolMember() {
-    }
-
-    @XmlTransient
-    public String getPoolID() {
-        return poolID;
-    }
-
-    public void setPoolID(String poolID) {
-        this.poolID = poolID;
-    }
-
-    public String getPoolMemberID() {
-        return poolMemberID;
-    }
-
-    public void setPoolMemberID(String poolMemberID) {
-        this.poolMemberID = poolMemberID;
-    }
-
-    public String getPoolMemberTenantID() {
-        return poolMemberTenantID;
-    }
-
-    public void setPoolMemberTenantID(String poolMemberTenantID) {
-        this.poolMemberTenantID = poolMemberTenantID;
-    }
-
-    public String getPoolMemberAddress() {
-        return poolMemberAddress;
-    }
-
-    public void setPoolMemberAddress(String poolMemberAddress) {
-        this.poolMemberAddress = poolMemberAddress;
-    }
-
-    public Integer getPoolMemberProtoPort() {
-        return poolMemberProtoPort;
-    }
-
-    public void setPoolMemberProtoPort(Integer poolMemberProtoPort) {
-        this.poolMemberProtoPort = poolMemberProtoPort;
-    }
-
-    public Boolean getPoolMemberAdminStateIsUp() {
-        return poolMemberAdminStateIsUp;
-    }
-
-    public void setPoolMemberAdminStateIsUp(Boolean poolMemberAdminStateIsUp) {
-        this.poolMemberAdminStateIsUp = poolMemberAdminStateIsUp;
-    }
-
-    public Integer getPoolMemberWeight() {
-        return poolMemberWeight;
-    }
-
-    public void setPoolMemberWeight(Integer poolMemberWeight) {
-        this.poolMemberWeight = poolMemberWeight;
-    }
-
-    public String getPoolMemberSubnetID() {
-        return poolMemberSubnetID;
-    }
-
-    public void setPoolMemberSubnetID(String poolMemberSubnetID) {
-        this.poolMemberSubnetID = poolMemberSubnetID;
-    }
-
-    public String getPoolMemberStatus() {
-        return poolMemberStatus;
-    }
-
-    public void setPoolMemberStatus(String poolMemberStatus) {
-        this.poolMemberStatus = poolMemberStatus;
-    }
-
-    public NeutronLoadBalancerPoolMember extractFields(List<String> fields) {
-        NeutronLoadBalancerPoolMember ans = new NeutronLoadBalancerPoolMember();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setPoolMemberID(this.getPoolMemberID());
-            }
-            if (s.equals("pool_id")) {
-                ans.setPoolID(this.getPoolID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setPoolMemberTenantID(this.getPoolMemberTenantID());
-            }
-            if (s.equals("address")) {
-                ans.setPoolMemberAddress(this.getPoolMemberAddress());
-            }
-            if(s.equals("protocol_port")) {
-                ans.setPoolMemberProtoPort(this.getPoolMemberProtoPort());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setPoolMemberAdminStateIsUp(poolMemberAdminStateIsUp);
-            }
-            if(s.equals("weight")) {
-                ans.setPoolMemberWeight(this.getPoolMemberWeight());
-            }
-            if(s.equals("subnet_id")) {
-                ans.setPoolMemberSubnetID(this.getPoolMemberSubnetID());
-            }
-            if (s.equals("status")) {
-                ans.setPoolMemberStatus(this.getPoolMemberStatus());
-            }
-        }
-        return ans;
-    }
-    @Override public String toString() {
-        return "NeutronLoadBalancerPoolMember{" +
-                "poolMemberID='" + poolMemberID + '\'' +
-                ", poolID='" + poolID + '\'' +
-                ", poolMemberTenantID='" + poolMemberTenantID + '\'' +
-                ", poolMemberAddress='" + poolMemberAddress + '\'' +
-                ", poolMemberProtoPort=" + poolMemberProtoPort +
-                ", poolMemberAdminStateIsUp=" + poolMemberAdminStateIsUp +
-                ", poolMemberWeight=" + poolMemberWeight +
-                ", poolMemberSubnetID='" + poolMemberSubnetID + '\'' +
-                ", poolMemberStatus='" + poolMemberStatus + '\'' +
-                '}';
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronNetwork.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronNetwork.java
deleted file mode 100644 (file)
index 1cbbb36..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "network")
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronNetwork implements Serializable, INeutronObject {
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement (name="id")
-    String networkUUID;              // network UUID
-
-    @XmlElement (name="name")
-    String networkName;              // name
-
-    @XmlElement (defaultValue="true", name="admin_state_up")
-    Boolean adminStateUp;             // admin state up (true/false)
-
-    @XmlElement (defaultValue="false", name="shared")
-    Boolean shared;                   // shared network or not
-
-    @XmlElement (name="tenant_id")
-    String tenantID;                 // tenant for this network
-
-    @XmlElement (defaultValue="false", namespace="router", name="external")
-    Boolean routerExternal;           // network external or not
-
-    @XmlElement (defaultValue="flat", namespace="provider", name="network_type")
-    String providerNetworkType;      // provider network type (flat or vlan)
-
-    @XmlElement (namespace="provider", name="physical_network")
-    String providerPhysicalNetwork;  // provider physical network (name)
-
-    @XmlElement (namespace="provider", name="segmentation_id")
-    String providerSegmentationID;   // provide segmentation ID (vlan ID)
-
-    @XmlElement (name="status")
-    String status;                   // status (read-only)
-
-    @XmlElement (name="subnets")
-    List<String> subnets;            // subnets (read-only)
-
-    /* This attribute lists the ports associated with an instance
-     * which is needed for determining if that instance can be deleted
-     */
-
-    List<NeutronPort> myPorts;
-
-    public NeutronNetwork() {
-        myPorts = new ArrayList<NeutronPort>();
-    }
-
-    public void initDefaults() {
-        subnets = new ArrayList<String>();
-        if (status == null) {
-            status = "ACTIVE";
-        }
-        if (adminStateUp == null) {
-            adminStateUp = true;
-        }
-        if (shared == null) {
-            shared = false;
-        }
-        if (routerExternal == null) {
-            routerExternal = false;
-        }
-        if (providerNetworkType == null) {
-            providerNetworkType = "flat";
-        }
-    }
-
-    public String getID() { return networkUUID; }
-
-    public void setID(String id) { this.networkUUID = id; }
-
-    public String getNetworkUUID() {
-        return networkUUID;
-    }
-
-    public void setNetworkUUID(String networkUUID) {
-        this.networkUUID = networkUUID;
-    }
-
-    public String getNetworkName() {
-        return networkName;
-    }
-
-    public void setNetworkName(String networkName) {
-        this.networkName = networkName;
-    }
-
-    public boolean isAdminStateUp() {
-        return adminStateUp;
-    }
-
-    public Boolean getAdminStateUp() { return adminStateUp; }
-
-    public void setAdminStateUp(boolean newValue) {
-        adminStateUp = newValue;
-    }
-
-    public boolean isShared() { return shared; }
-
-    public Boolean getShared() { return shared; }
-
-    public void setShared(boolean newValue) {
-        shared = newValue;
-    }
-
-    public String getTenantID() {
-        return tenantID;
-    }
-
-    public void setTenantID(String tenantID) {
-        this.tenantID = tenantID;
-    }
-
-    public boolean isRouterExternal() { return routerExternal; }
-
-    public Boolean getRouterExternal() { return routerExternal; }
-
-    public void setRouterExternal(boolean newValue) {
-        routerExternal = newValue;
-    }
-
-    public String getProviderNetworkType() {
-        return providerNetworkType;
-    }
-
-    public void setProviderNetworkType(String providerNetworkType) {
-        this.providerNetworkType = providerNetworkType;
-    }
-
-    public String getProviderPhysicalNetwork() {
-        return providerPhysicalNetwork;
-    }
-
-    public void setProviderPhysicalNetwork(String providerPhysicalNetwork) {
-        this.providerPhysicalNetwork = providerPhysicalNetwork;
-    }
-
-    public String getProviderSegmentationID() {
-        return providerSegmentationID;
-    }
-
-    public void setProviderSegmentationID(String providerSegmentationID) {
-        this.providerSegmentationID = providerSegmentationID;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public List<String> getSubnets() {
-        return subnets;
-    }
-
-    public void setSubnets(List<String> subnets) {
-        this.subnets = subnets;
-    }
-
-    public void addSubnet(String uuid) {
-        subnets.add(uuid);
-    }
-
-    public void removeSubnet(String uuid) {
-        subnets.remove(uuid);
-    }
-
-    public List<NeutronPort> getPortsOnNetwork() {
-        return myPorts;
-    }
-
-    public void addPort(NeutronPort port) {
-        myPorts.add(port);
-    }
-
-    public void removePort(NeutronPort port) {
-        myPorts.remove(port);
-    }
-
-    /**
-     * This method copies selected fields from the object and returns them
-     * as a new object, suitable for marshaling.
-     *
-     * @param fields
-     *            List of attributes to be extracted
-     * @return an OpenStackNetworks object with only the selected fields
-     * populated
-     */
-
-    public NeutronNetwork extractFields(List<String> fields) {
-        NeutronNetwork ans = new NeutronNetwork();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setNetworkUUID(this.getNetworkUUID());
-            }
-            if (s.equals("name")) {
-                ans.setNetworkName(this.getNetworkName());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setAdminStateUp(adminStateUp);
-            }
-            if (s.equals("status")) {
-                ans.setStatus(this.getStatus());
-            }
-            if (s.equals("subnets")) {
-                List<String> subnetList = new ArrayList<String>();
-                subnetList.addAll(this.getSubnets());
-                ans.setSubnets(subnetList);
-            }
-            if (s.equals("shared")) {
-                ans.setShared(shared);
-            }
-            if (s.equals("tenant_id")) {
-                ans.setTenantID(this.getTenantID());
-            }
-        }
-        return ans;
-    }
-
-    @Override
-    public String toString() {
-        return "NeutronNetwork [networkUUID=" + networkUUID + ", networkName=" + networkName + ", adminStateUp="
-                + adminStateUp + ", shared=" + shared + ", tenantID=" + tenantID + ", routerExternal=" + routerExternal
-                + ", providerNetworkType=" + providerNetworkType + ", providerPhysicalNetwork="
-                + providerPhysicalNetwork + ", providerSegmentationID=" + providerSegmentationID + ", status=" + status
-                + ", subnets=" + subnets + ", myPorts=" + myPorts + "]";
-    }
-}
-
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java
deleted file mode 100644 (file)
index 3853988..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronPort implements Serializable, INeutronObject {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement (name="id")
-    String portUUID;
-
-    @XmlElement (name="network_id")
-    String networkUUID;
-
-    @XmlElement (name="name")
-    String name;
-
-    @XmlElement (defaultValue="true", name="admin_state_up")
-    Boolean adminStateUp;
-
-    @XmlElement (name="status")
-    String status;
-
-    @XmlElement (name="mac_address")
-    String macAddress;
-
-    @XmlElement (name="fixed_ips")
-    List<Neutron_IPs> fixedIPs;
-
-    @XmlElement (name="device_id")
-    String deviceID;
-
-    @XmlElement (name="device_owner")
-    String deviceOwner;
-
-    @XmlElement (name="tenant_id")
-    String tenantID;
-
-    @XmlElement (name="security_groups")
-    List<NeutronSecurityGroup> securityGroups;
-
-    @XmlElement (namespace= "binding", name="host_id")
-    String bindinghostID;
-
-    @XmlElement (namespace= "binding", name="vnic_type")
-    String bindingvnicType;
-
-    @XmlElement (namespace= "binding", name="vif_type")
-    String bindingvifType;
-
-
-    /* this attribute stores the floating IP address assigned to
-     * each fixed IP address
-     */
-
-    HashMap<String, NeutronFloatingIP> floatingIPMap;
-
-    public NeutronPort() {
-        floatingIPMap = new HashMap<String, NeutronFloatingIP>();
-    }
-
-    public String getID() { return portUUID; }
-
-    public void setID(String id) { this.portUUID = id; }
-
-    public String getPortUUID() {
-        return portUUID;
-    }
-
-    public void setPortUUID(String portUUID) {
-        this.portUUID = portUUID;
-    }
-
-    public String getNetworkUUID() {
-        return networkUUID;
-    }
-
-    public void setNetworkUUID(String networkUUID) {
-        this.networkUUID = networkUUID;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public boolean isAdminStateUp() {
-        if (adminStateUp == null) {
-            return true;
-        }
-        return adminStateUp;
-    }
-
-    public Boolean getAdminStateUp() { return adminStateUp; }
-
-    public void setAdminStateUp(Boolean newValue) {
-            adminStateUp = newValue;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getMacAddress() {
-        return macAddress;
-    }
-
-    public void setMacAddress(String macAddress) {
-        this.macAddress = macAddress;
-    }
-
-    public List<Neutron_IPs> getFixedIPs() {
-        return fixedIPs;
-    }
-
-    public void setFixedIPs(List<Neutron_IPs> fixedIPs) {
-        this.fixedIPs = fixedIPs;
-    }
-
-    public String getDeviceID() {
-        return deviceID;
-    }
-
-    public void setDeviceID(String deviceID) {
-        this.deviceID = deviceID;
-    }
-
-    public String getDeviceOwner() {
-        return deviceOwner;
-    }
-
-    public void setDeviceOwner(String deviceOwner) {
-        this.deviceOwner = deviceOwner;
-    }
-
-    public String getTenantID() {
-        return tenantID;
-    }
-
-    public void setTenantID(String tenantID) {
-        this.tenantID = tenantID;
-    }
-
-    public List<NeutronSecurityGroup> getSecurityGroups() {
-        return securityGroups;
-    }
-
-    public void setSecurityGroups(List<NeutronSecurityGroup> securityGroups) {
-        this.securityGroups = securityGroups;
-    }
-
-    public String getBindinghostID() {
-      return bindinghostID;
-    }
-
-    public void setBindinghostID(String bindinghostID) {
-      this.bindinghostID = bindinghostID;
-    }
-
-  public String getBindingvnicType() {
-    return bindingvnicType;
-  }
-
-  public void setBindingvnicType(String bindingvnicType) {
-    this.bindingvnicType = bindingvnicType;
-  }
-
-  public String getBindingvifType() {
-    return bindingvifType;
-  }
-
-  public void setBindingvifType(String bindingvifType) {
-    this.bindingvifType = bindingvifType;
-  }
-
-    public NeutronFloatingIP getFloatingIP(String key) {
-        if (!floatingIPMap.containsKey(key)) {
-            return null;
-        }
-        return floatingIPMap.get(key);
-    }
-
-    public void removeFloatingIP(String key) {
-        floatingIPMap.remove(key);
-    }
-
-    public void addFloatingIP(String key, NeutronFloatingIP floatingIP) {
-        if (!floatingIPMap.containsKey(key)) {
-            floatingIPMap.put(key, floatingIP);
-        }
-    }
-
-    /**
-     * This method copies selected fields from the object and returns them
-     * as a new object, suitable for marshaling.
-     *
-     * @param fields
-     *            List of attributes to be extracted
-     * @return an OpenStackPorts object with only the selected fields
-     * populated
-     */
-
-    public NeutronPort extractFields(List<String> fields) {
-        NeutronPort ans = new NeutronPort();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setPortUUID(this.getPortUUID());
-            }
-            if (s.equals("network_id")) {
-                ans.setNetworkUUID(this.getNetworkUUID());
-            }
-            if (s.equals("name")) {
-                ans.setName(this.getName());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setAdminStateUp(this.getAdminStateUp());
-            }
-            if (s.equals("status")) {
-                ans.setStatus(this.getStatus());
-            }
-            if (s.equals("mac_address")) {
-                ans.setMacAddress(this.getMacAddress());
-            }
-            if (s.equals("fixed_ips")) {
-                List<Neutron_IPs> fixedIPs = new ArrayList<Neutron_IPs>();
-                fixedIPs.addAll(this.getFixedIPs());
-                ans.setFixedIPs(fixedIPs);
-            }
-            if (s.equals("device_id")) {
-                ans.setDeviceID(this.getDeviceID());
-            }
-            if (s.equals("device_owner")) {
-                ans.setDeviceOwner(this.getDeviceOwner());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setTenantID(this.getTenantID());
-            }
-            if (s.equals("security_groups")) {
-                List<NeutronSecurityGroup> securityGroups = new ArrayList<NeutronSecurityGroup>();
-                securityGroups.addAll(this.getSecurityGroups());
-                ans.setSecurityGroups(securityGroups);
-            }
-        }
-        return ans;
-    }
-
-    public void initDefaults() {
-        adminStateUp = true;
-        if (status == null) {
-            status = "ACTIVE";
-        }
-        if (fixedIPs == null) {
-            fixedIPs = new ArrayList<Neutron_IPs>();
-        }
-    }
-
-    /**
-     * This method checks to see if the port has a floating IPv4 address
-     * associated with the supplied fixed IPv4 address
-     *
-     * @param fixedIP
-     *            fixed IPv4 address in dotted decimal format
-     * @return a boolean indicating if there is a floating IPv4 address bound
-     * to the fixed IPv4 address
-     */
-
-    public boolean isBoundToFloatingIP(String fixedIP) {
-        return floatingIPMap.containsKey(fixedIP);
-    }
-
-    @Override
-    public String toString() {
-        return "NeutronPort [portUUID=" + portUUID + ", networkUUID=" + networkUUID + ", name=" + name
-                + ", adminStateUp=" + adminStateUp + ", status=" + status + ", macAddress=" + macAddress
-                + ", fixedIPs=" + fixedIPs + ", deviceID=" + deviceID + ", deviceOwner=" + deviceOwner + ", tenantID="
-                + tenantID + ", floatingIPMap=" + floatingIPMap + ", securityGroups=" + securityGroups
-                + ", bindinghostID=" + bindinghostID + ", bindingvnicType=" + bindingvnicType
-                + ", bindingvnicType=" + bindingvnicType + "]";
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter.java
deleted file mode 100644 (file)
index 9d5ee38..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronRouter implements Serializable, INeutronObject {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-    @XmlElement (name="id")
-    String routerUUID;
-
-    @XmlElement (name="name")
-    String name;
-
-    @XmlElement (defaultValue="true", name="admin_state_up")
-    Boolean adminStateUp;
-
-    @XmlElement (name="status")
-    String status;
-
-    @XmlElement (name="tenant_id")
-    String tenantID;
-
-    @XmlElement (name="external_gateway_info", nillable=true)
-    NeutronRouter_NetworkReference externalGatewayInfo;
-
-    @XmlElement (name="distributed")
-    Boolean distributed;
-
-    @XmlElement (name="gw_port_id", nillable=true)
-    String gatewayPortId;
-
-    @XmlElement (name="routes")
-    List<String> routes;
-
-    /* Holds a map of OpenStackRouterInterfaces by subnet UUID
-     * used for internal mapping to DOVE
-     */
-    HashMap<String, NeutronRouter_Interface> interfaces;
-
-    public NeutronRouter() {
-        interfaces = new HashMap<String, NeutronRouter_Interface>();
-    }
-
-    public String getID() { return routerUUID; }
-
-    public void setID(String id) { this.routerUUID = id; }
-
-    public String getRouterUUID() {
-        return routerUUID;
-    }
-
-    public void setRouterUUID(String routerUUID) {
-        this.routerUUID = routerUUID;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public boolean isAdminStateUp() {
-        if (adminStateUp == null) {
-            return true;
-        }
-        return adminStateUp;
-    }
-
-    public Boolean getAdminStateUp() { return adminStateUp; }
-
-    public void setAdminStateUp(Boolean newValue) {
-        adminStateUp = newValue;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getTenantID() {
-        return tenantID;
-    }
-
-    public void setTenantID(String tenantID) {
-        this.tenantID = tenantID;
-    }
-
-    public NeutronRouter_NetworkReference getExternalGatewayInfo() {
-        return externalGatewayInfo;
-    }
-
-    public void setExternalGatewayInfo(NeutronRouter_NetworkReference externalGatewayInfo) {
-        this.externalGatewayInfo = externalGatewayInfo;
-    }
-
-    public Boolean getDistributed() {
-        return distributed;
-    }
-
-    public void setDistributed(Boolean distributed) {
-        this.distributed = distributed;
-    }
-
-    public String getGatewayPortId() {
-        return gatewayPortId;
-    }
-
-    public void setGatewayPortId(String gatewayPortId) {
-        this.gatewayPortId = gatewayPortId;
-    }
-
-    public List<String> getRoutes() {
-        return routes;
-    }
-
-    public void setRoutes(List<String> routes) {
-        this.routes = routes;
-    }
-
-    /**
-     * This method copies selected fields from the object and returns them
-     * as a new object, suitable for marshaling.
-     *
-     * @param fields
-     *            List of attributes to be extracted
-     * @return an OpenStackRouters object with only the selected fields
-     * populated
-     */
-    public NeutronRouter extractFields(List<String> fields) {
-        NeutronRouter ans = new NeutronRouter();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setRouterUUID(this.getRouterUUID());
-            }
-            if (s.equals("name")) {
-                ans.setName(this.getName());
-            }
-            if (s.equals("admin_state_up")) {
-                ans.setAdminStateUp(this.getAdminStateUp());
-            }
-            if (s.equals("status")) {
-                ans.setStatus(this.getStatus());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setTenantID(this.getTenantID());
-            }
-            if (s.equals("external_gateway_info")) {
-                ans.setExternalGatewayInfo(this.getExternalGatewayInfo());
-            }
-            if (s.equals("distributed")) {
-                ans.setDistributed(this.getDistributed());
-            }
-            if (s.equals("gw_port_id")) {
-                ans.setGatewayPortId(this.getGatewayPortId());
-            }
-            if (s.equals("routes")){
-                ans.setRoutes(this.getRoutes());
-            }
-        }
-        return ans;
-    }
-
-    public HashMap<String, NeutronRouter_Interface> getInterfaces() {
-        return interfaces;
-    }
-
-    public void addInterface(String s, NeutronRouter_Interface i) {
-        interfaces.put(s, i);
-    }
-
-    public void removeInterface(String s) {
-        interfaces.remove(s);
-    }
-
-    public void initDefaults() {
-        adminStateUp = true;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_Interface.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_Interface.java
deleted file mode 100644 (file)
index c7ae4eb..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronRouter_Interface implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement (name="subnet_id")
-    String subnetUUID;
-
-    @XmlElement (name="port_id")
-    String portUUID;
-
-    @XmlElement (name="id")
-    String id;
-
-    @XmlElement (name="tenant_id")
-    String tenantID;
-
-    public NeutronRouter_Interface() {
-    }
-
-    public NeutronRouter_Interface(String subnetUUID, String portUUID) {
-        this.subnetUUID = subnetUUID;
-        this.portUUID = portUUID;
-    }
-
-    public String getSubnetUUID() {
-        return subnetUUID;
-    }
-
-    public void setSubnetUUID(String subnetUUID) {
-        this.subnetUUID = subnetUUID;
-    }
-
-    public String getPortUUID() {
-        return portUUID;
-    }
-
-    public void setPortUUID(String portUUID) {
-        this.portUUID = portUUID;
-    }
-
-    public String getID() {
-        return id;
-    }
-
-    public void setID(String id) {
-        this.id = id;
-    }
-
-    public void setTenantID(String tenantID) {
-        this.tenantID = tenantID;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_NetworkReference.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronRouter_NetworkReference.java
deleted file mode 100644 (file)
index 8583d44..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronRouter_NetworkReference implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="network_id")
-    String networkID;
-
-    public NeutronRouter_NetworkReference() {
-    }
-
-    public String getNetworkID() {
-        return networkID;
-    }
-
-    public void setNetworkID(String networkID) {
-        this.networkID = networkID;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityGroup.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityGroup.java
deleted file mode 100644 (file)
index ca56c7b..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OpenStack Neutron v2.0 Security Group bindings.
- * See OpenStack Network API v2.0 Reference for description of
- * annotated attributes. The current fields are as follows:
- * <p/>
- * id                   uuid-str unique ID for the security group.
- * name                 String name of the security group.
- * description          String name of the security group.
- * tenant_id            uuid-str Owner of security rule..
- * security_group_rules List<NeutronSecurityRule> nested RO in the sec group.
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronSecurityGroup implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name = "id")
-    String securityGroupUUID;
-
-    @XmlElement(name = "name")
-    String securityGroupName;
-
-    @XmlElement(name = "description")
-    String securityGroupDescription;
-
-    @XmlElement(name = "tenant_id")
-    String securityGroupTenantID;
-
-    @XmlElement(name = "security_group_rules")
-    List<NeutronSecurityRule> neutronSecurityRule;
-
-    List<NeutronPort> neutronPorts;
-
-    public NeutronSecurityGroup() {
-        neutronPorts = new ArrayList<NeutronPort> ();
-        List<NeutronSecurityRule> securityRules;
-
-    }
-
-    public String getSecurityGroupUUID() {
-        return securityGroupUUID;
-    }
-
-    public void setSecurityGroupUUID(String securityGroupUUID) {
-        this.securityGroupUUID = securityGroupUUID;
-    }
-
-    public String getSecurityGroupName() {
-        return securityGroupName;
-    }
-
-    public void setSecurityGroupName(String securityGroupName) {
-        this.securityGroupName = securityGroupName;
-    }
-
-    public String getSecurityGroupDescription() {
-        return securityGroupDescription;
-    }
-
-    public void setSecurityGroupDescription(String securityGroupDescription) {
-        this.securityGroupDescription = securityGroupDescription;
-    }
-
-    public String getSecurityGroupTenantID() {
-        return securityGroupTenantID;
-    }
-
-    public void setSecurityGroupTenantID(String securityGroupTenantID) {
-        this.securityGroupTenantID = securityGroupTenantID;
-    }
-
-    // Rules In Group
-    public List<NeutronSecurityRule> getSecurityRules() {
-        return neutronSecurityRule;
-    }
-
-    public void setSecurityRules(NeutronSecurityRule neutronSecurityRule) {
-        this.neutronSecurityRule = (List<NeutronSecurityRule>) neutronSecurityRule;
-    }
-
-    public NeutronSecurityGroup extractFields(List<String> fields) {
-        NeutronSecurityGroup ans = new NeutronSecurityGroup ();
-        Iterator<String> i = fields.iterator ();
-        while (i.hasNext ()) {
-            String s = i.next ();
-            if (s.equals ("id")) {
-                ans.setSecurityGroupUUID (this.getSecurityGroupUUID ());
-            }
-            if (s.equals ("name")) {
-                ans.setSecurityGroupName (this.getSecurityGroupName ());
-            }
-            if (s.equals ("description")) {
-                ans.setSecurityGroupDescription (this.getSecurityGroupDescription ());
-            }
-            if (s.equals ("tenant_id")) {
-                ans.setSecurityGroupTenantID (this.getSecurityGroupTenantID ());
-            }
-            if (s.equals ("security_group_rules")) {
-                ans.setSecurityRules ((NeutronSecurityRule) this.getSecurityRules ());
-            }
-        }
-        return ans;
-    }
-
-    @Override
-    public String toString() {
-        return "NeutronSecurityGroup{" +
-                "securityGroupUUID='" + securityGroupUUID + '\'' +
-                ", securityGroupName='" + securityGroupName + '\'' +
-                ", securityGroupDescription='" + securityGroupDescription + '\'' +
-                ", securityGroupTenantID='" + securityGroupTenantID + '\'' +
-                ", securityRules=" + neutronSecurityRule + "]";
-    }
-
-    public void initDefaults() {
-        //TODO verify no defaults values are nessecary required.
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityRule.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSecurityRule.java
deleted file mode 100644 (file)
index 6247691..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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.networkconfig.neutron;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * See OpenStack Network API v2.0 Reference for description of
- * annotated attributes. The current fields are as follows:
- * <p/>
- * id                uuid (String) UUID for the security group rule.
- * security_rule_id  uuid (String) The security group to associate rule.
- * direction         String Direction the VM traffic  (ingress/egress).
- * security_group_id The security group to associate rule with.
- * protocol          String IP Protocol (icmp, tcp, udp, etc).
- * port_range_min    Integer Port at start of range
- * port_range_max    Integer Port at end of range
- * ethertype         String ethertype in L2 packet (IPv4, IPv6, etc)
- * remote_ip_prefix  String (IP cidr) CIDR for address range.
- * remote_group_id   uuid-str Source security group to apply to rule.
- * tenant_id         uuid-str Owner of security rule. Admin only outside tenant.
- */
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronSecurityRule implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @XmlElement(name = "id")
-    String securityRuleUUID;
-
-    @XmlElement(name = "direction")
-    String securityRuleDirection;
-
-    @XmlElement(name = "protocol")
-    String securityRuleProtocol;
-
-    @XmlElement(name = "port_range_min")
-    Integer securityRulePortMin;
-
-    @XmlElement(name = " port_range_max")
-    Integer securityRulePortMax;
-
-    @XmlElement(name = "ethertype")
-    String securityRuleEthertype;
-
-    @XmlElement(name = "remote_ip_prefix")
-    String securityRuleRemoteIpPrefix;
-
-    @XmlElement(name = "remote_group_id")
-    String securityRemoteGroupID;
-
-    @XmlElement(name = "security_group_id")
-    String securityRuleGroupID;
-
-    @XmlElement(name = "tenant_id")
-    String securityRuleTenantID;
-
-    public NeutronSecurityRule() {
-        List<NeutronSecurityRule> securityRules;
-    }
-
-    public String getSecurityRuleUUID() {
-        return securityRuleUUID;
-    }
-
-    public void setSecurityRuleUUID(String securityRuleUUID) {
-        this.securityRuleUUID = securityRuleUUID;
-    }
-
-    public String getSecurityRuleDirection() {
-        return securityRuleDirection;
-    }
-
-    public void setSecurityRuleDirection(String securityRuleDirection) {
-        this.securityRuleDirection = securityRuleDirection;
-    }
-
-    public String getSecurityRuleProtocol() {
-        return securityRuleProtocol;
-    }
-
-    public void setSecurityRuleProtocol(String securityRuleProtocol) {
-        this.securityRuleProtocol = securityRuleProtocol;
-    }
-
-    public Integer getSecurityRulePortMin() {
-        return securityRulePortMin;
-    }
-
-    public void setSecurityRulePortMin(Integer securityRulePortMin) {
-        this.securityRulePortMin = securityRulePortMin;
-    }
-
-    public Integer getSecurityRulePortMax() {
-        return securityRulePortMax;
-    }
-
-    public void setSecurityRulePortMax(Integer securityRulePortMax) {
-        this.securityRulePortMax = securityRulePortMax;
-    }
-
-    public String getSecurityRuleEthertype() {
-        return securityRuleEthertype;
-    }
-
-    public void setSecurityRuleEthertype(String securityRuleEthertype) {
-        this.securityRuleEthertype = securityRuleEthertype;
-    }
-
-    public String getSecurityRuleRemoteIpPrefix() {
-        return securityRuleRemoteIpPrefix;
-    }
-
-    public void setSecurityRuleRemoteIpPrefix(String securityRuleRemoteIpPrefix) {
-        this.securityRuleRemoteIpPrefix = securityRuleRemoteIpPrefix;
-    }
-
-    public String getSecurityRemoteGroupID() {
-        return securityRemoteGroupID;
-    }
-
-    public void setSecurityRemoteGroupID(String securityRemoteGroupID) {
-        this.securityRemoteGroupID = securityRemoteGroupID;
-    }
-
-    public String getSecurityRuleGroupID() {
-        return securityRuleGroupID;
-    }
-
-    public void setSecurityRuleGroupID(String securityRuleGroupID) {
-        this.securityRuleGroupID = securityRuleGroupID;
-    }
-
-    public String getSecurityRuleTenantID() {
-        return securityRuleTenantID;
-    }
-
-    public void setSecurityRuleTenantID(String securityRuleTenantID) {
-        this.securityRuleTenantID = securityRuleTenantID;
-    }
-
-    public NeutronSecurityRule extractFields(List<String> fields) {
-        NeutronSecurityRule ans = new NeutronSecurityRule();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setSecurityRuleUUID(this.getSecurityRuleUUID());
-            }
-            if (s.equals("direction")) {
-                ans.setSecurityRuleDirection(this.getSecurityRuleDirection());
-            }
-            if (s.equals("protocol")) {
-                ans.setSecurityRuleProtocol(this.getSecurityRuleProtocol());
-            }
-            if (s.equals("port_range_min")) {
-                ans.setSecurityRulePortMin(this.getSecurityRulePortMin());
-            }
-            if (s.equals("port_range_max")) {
-                ans.setSecurityRulePortMax(this.getSecurityRulePortMax());
-            }
-            if (s.equals("ethertype")) {
-                ans.setSecurityRuleEthertype(this.getSecurityRuleEthertype());
-            }
-            if (s.equals("remote_ip_prefix")) {
-                ans.setSecurityRuleRemoteIpPrefix(this.getSecurityRuleRemoteIpPrefix());
-            }
-            if (s.equals("remote_group_id")) {
-                ans.setSecurityRemoteGroupID(this.getSecurityRemoteGroupID());
-            }
-            if (s.equals("security_group_id")) {
-                ans.setSecurityRuleGroupID(this.getSecurityRuleGroupID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setSecurityRuleTenantID(this.getSecurityRuleTenantID());
-            }
-        }
-        return ans;
-    }
-
-    @Override
-    public String toString() {
-        return "NeutronSecurityRule{" +
-            "securityRuleUUID='" + securityRuleUUID + '\'' +
-            ", securityRuleDirection='" + securityRuleDirection + '\'' +
-            ", securityRuleProtocol='" + securityRuleProtocol + '\'' +
-            ", securityRulePortMin=" + securityRulePortMin +
-            ", securityRulePortMax=" + securityRulePortMax +
-            ", securityRuleEthertype='" + securityRuleEthertype + '\'' +
-            ", securityRuleRemoteIpPrefix='" + securityRuleRemoteIpPrefix + '\'' +
-            ", securityRemoteGroupID=" + securityRemoteGroupID +
-            ", securityRuleGroupID='" + securityRuleGroupID + '\'' +
-            ", securityRuleTenantID='" + securityRuleTenantID + '\'' +
-            '}';
-    }
-
-    public void initDefaults() {
-        //TODO verify no defaults values are nessecary required.
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java
deleted file mode 100644 (file)
index 2a44d8b..0000000
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- * Copyright IBM Corporation and others, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-import java.net.InetAddress;
-import java.net.Inet6Address;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.commons.net.util.SubnetUtils;
-import org.apache.commons.net.util.SubnetUtils.SubnetInfo;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronSubnet implements Serializable, INeutronObject {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement (name="id")
-    String subnetUUID;
-
-    @XmlElement (name="network_id")
-    String networkUUID;
-
-    @XmlElement (name="name")
-    String name;
-
-    @XmlElement (defaultValue="4", name="ip_version")
-    Integer ipVersion;
-
-    @XmlElement (name="cidr")
-    String cidr;
-
-    @XmlElement (name="gateway_ip")
-    String gatewayIP;
-
-    @XmlElement (name="dns_nameservers")
-    List<String> dnsNameservers;
-
-    @XmlElement (name="allocation_pools")
-    List<NeutronSubnet_IPAllocationPool> allocationPools;
-
-    @XmlElement (name="host_routes")
-    List<NeutronSubnet_HostRoute> hostRoutes;
-
-    @XmlElement (defaultValue="true", name="enable_dhcp")
-    Boolean enableDHCP;
-
-    @XmlElement (name="tenant_id")
-    String tenantID;
-
-    @XmlElement (name="ipv6_address_mode", nillable=true)
-    String ipV6AddressMode;
-
-    @XmlElement (name="ipv6_ra_mode", nillable=true)
-    String ipV6RaMode;
-
-    /* stores the OpenStackPorts associated with an instance
-     * used to determine if that instance can be deleted.
-     */
-    List<NeutronPort> myPorts;
-
-    Boolean gatewayIPAssigned;
-
-    public NeutronSubnet() {
-        myPorts = new ArrayList<NeutronPort>();
-    }
-
-    public String getID() { return subnetUUID; }
-
-    public void setID(String id) { this.subnetUUID = id; }
-
-    public String getSubnetUUID() {
-        return subnetUUID;
-    }
-
-    public void setSubnetUUID(String subnetUUID) {
-        this.subnetUUID = subnetUUID;
-    }
-
-    public String getNetworkUUID() {
-        return networkUUID;
-    }
-
-    public void setNetworkUUID(String networkUUID) {
-        this.networkUUID = networkUUID;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Integer getIpVersion() {
-        return ipVersion;
-    }
-
-    public void setIpVersion(Integer ipVersion) {
-        this.ipVersion = ipVersion;
-    }
-
-    public String getCidr() {
-        return cidr;
-    }
-
-    public void setCidr(String cidr) {
-        this.cidr = cidr;
-    }
-
-    public String getGatewayIP() {
-        return gatewayIP;
-    }
-
-    public void setGatewayIP(String gatewayIP) {
-        this.gatewayIP = gatewayIP;
-    }
-
-    public List<String> getDnsNameservers() {
-        return dnsNameservers;
-    }
-
-    public void setDnsNameservers(List<String> dnsNameservers) {
-        this.dnsNameservers = dnsNameservers;
-    }
-
-    public List<NeutronSubnet_IPAllocationPool> getAllocationPools() {
-        return allocationPools;
-    }
-
-    public void setAllocationPools(List<NeutronSubnet_IPAllocationPool> allocationPools) {
-        this.allocationPools = allocationPools;
-    }
-
-    public List<NeutronSubnet_HostRoute> getHostRoutes() {
-        return hostRoutes;
-    }
-
-    public void setHostRoutes(List<NeutronSubnet_HostRoute> hostRoutes) {
-        this.hostRoutes = hostRoutes;
-    }
-
-    public boolean isEnableDHCP() {
-        if (enableDHCP == null) {
-            return true;
-        }
-        return enableDHCP;
-    }
-
-    public Boolean getEnableDHCP() { return enableDHCP; }
-
-    public void setEnableDHCP(Boolean newValue) {
-            enableDHCP = newValue;
-    }
-
-    public String getTenantID() {
-        return tenantID;
-    }
-
-    public void setTenantID(String tenantID) {
-        this.tenantID = tenantID;
-    }
-
-    public String getIpV6AddressMode() { return ipV6AddressMode; }
-
-    public void setIpV6AddressMode(String ipV6AddressMode) { this.ipV6AddressMode = ipV6AddressMode; }
-
-    public String getIpV6RaMode() { return ipV6RaMode; }
-
-    public void setIpV6RaMode(String ipV6RaMode) { this.ipV6RaMode = ipV6RaMode; }
-
-    /**
-     * This method copies selected fields from the object and returns them
-     * as a new object, suitable for marshaling.
-     *
-     * @param fields
-     *            List of attributes to be extracted
-     * @return an OpenStackSubnets object with only the selected fields
-     * populated
-     */
-
-    public NeutronSubnet extractFields(List<String> fields) {
-        NeutronSubnet ans = new NeutronSubnet();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setSubnetUUID(this.getSubnetUUID());
-            }
-            if (s.equals("network_id")) {
-                ans.setNetworkUUID(this.getNetworkUUID());
-            }
-            if (s.equals("name")) {
-                ans.setName(this.getName());
-            }
-            if (s.equals("ip_version")) {
-                ans.setIpVersion(this.getIpVersion());
-            }
-            if (s.equals("cidr")) {
-                ans.setCidr(this.getCidr());
-            }
-            if (s.equals("gateway_ip")) {
-                ans.setGatewayIP(this.getGatewayIP());
-            }
-            if (s.equals("dns_nameservers")) {
-                List<String> nsList = new ArrayList<String>();
-                nsList.addAll(this.getDnsNameservers());
-                ans.setDnsNameservers(nsList);
-            }
-            if (s.equals("allocation_pools")) {
-                List<NeutronSubnet_IPAllocationPool> aPools = new ArrayList<NeutronSubnet_IPAllocationPool>();
-                aPools.addAll(this.getAllocationPools());
-                ans.setAllocationPools(aPools);
-            }
-            if (s.equals("host_routes")) {
-                List<NeutronSubnet_HostRoute> hRoutes = new ArrayList<NeutronSubnet_HostRoute>();
-                hRoutes.addAll(this.getHostRoutes());
-                ans.setHostRoutes(hRoutes);
-            }
-            if (s.equals("enable_dhcp")) {
-                ans.setEnableDHCP(this.getEnableDHCP());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setTenantID(this.getTenantID());
-            }
-            if (s.equals("ipv6_address_mode")) {
-                ans.setIpV6AddressMode(this.getIpV6AddressMode());
-            }
-            if (s.equals("ipv6_ra_mode")) {
-                ans.setIpV6RaMode(this.getIpV6RaMode());
-            }
-        }
-        return ans;
-    }
-
-    /* test to see if the cidr address used to define this subnet
-     * is a valid network address (an necessary condition when creating
-     * a new subnet)
-     */
-    public boolean isValidCIDR() {
-        // fix for Bug 2290 - need to wrap the existing test as
-        // IPv4 because SubnetUtils doesn't support IPv6
-        if (ipVersion == 4) {
-            try {
-                SubnetUtils util = new SubnetUtils(cidr);
-                SubnetInfo info = util.getInfo();
-                if (!info.getNetworkAddress().equals(info.getAddress())) {
-                    return false;
-                }
-            } catch (Exception e) {
-                return false;
-            }
-            return true;
-        }
-        if (ipVersion == 6) {
-            // fix for Bug2290 - this is custom code because no classes
-            // with ODL-friendly licenses have been found
-            // extract address (in front of /) and length (after /)
-            String[] parts = cidr.split("/");
-            if (parts.length != 2) {
-                return false;
-            }
-            try {
-                int length = Integer.parseInt(parts[1]);
-                //TODO?: limit check on length
-                // convert to byte array
-                byte[] addrBytes = ((Inet6Address) InetAddress.getByName(parts[0])).getAddress();
-                int i;
-                for (i=length; i<128; i++) { // offset is to ensure proper comparison
-                    if (((((int) addrBytes[i/8]) & 0x000000FF) & (1 << (7-(i%8)))) != 0) {
-                        return(false);
-                    }
-                }
-                return(true);
-            } catch (Exception e) {
-                return(false);
-            }
-        }
-        return false;
-    }
-
-    /* test to see if the gateway IP specified overlaps with specified
-     * allocation pools (an error condition when creating a new subnet
-     * or assigning a gateway IP)
-     */
-    public boolean gatewayIP_Pool_overlap() {
-        Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator();
-        while (i.hasNext()) {
-            NeutronSubnet_IPAllocationPool pool = i.next();
-            if (pool.contains(gatewayIP)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public boolean initDefaults() {
-        if (enableDHCP == null) {
-            enableDHCP = true;
-        }
-        if (ipVersion == null) {
-            ipVersion = 4;
-        }
-        gatewayIPAssigned = false;
-        dnsNameservers = new ArrayList<String>();
-        if (hostRoutes == null) {
-            hostRoutes = new ArrayList<NeutronSubnet_HostRoute>();
-        }
-        if (allocationPools == null) {
-            allocationPools = new ArrayList<NeutronSubnet_IPAllocationPool>();
-            try {
-                SubnetUtils util = new SubnetUtils(cidr);
-                SubnetInfo info = util.getInfo();
-                if (gatewayIP == null || ("").equals(gatewayIP)) {
-                    gatewayIP = info.getLowAddress();
-                }
-                if (allocationPools.size() < 1) {
-                    NeutronSubnet_IPAllocationPool source =
-                        new NeutronSubnet_IPAllocationPool(info.getLowAddress(),
-                                info.getHighAddress());
-                    allocationPools = source.splitPool(gatewayIP);
-                }
-            } catch (Exception e) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public List<NeutronPort> getPortsInSubnet() {
-        return myPorts;
-    }
-
-    public void addPort(NeutronPort port) {
-        myPorts.add(port);
-    }
-
-    public void removePort(NeutronPort port) {
-        myPorts.remove(port);
-    }
-
-    /* this method tests to see if the supplied IPv4 address
-     * is valid for this subnet or not
-     */
-    public boolean isValidIP(String ipAddress) {
-        try {
-            SubnetUtils util = new SubnetUtils(cidr);
-            SubnetInfo info = util.getInfo();
-            return info.isInRange(ipAddress);
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    /* test to see if the supplied IPv4 address is part of one of the
-     * available allocation pools or not
-     */
-    public boolean isIPInUse(String ipAddress) {
-        if (ipAddress.equals(gatewayIP) && !gatewayIPAssigned ) {
-            return false;
-        }
-        Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator();
-        while (i.hasNext()) {
-            NeutronSubnet_IPAllocationPool pool = i.next();
-            if (pool.contains(ipAddress)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /* method to get the lowest available address of the subnet.
-     * go through all the allocation pools and keep the lowest of their
-     * low addresses.
-     */
-    public String getLowAddr() {
-        String ans = null;
-        Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator();
-        while (i.hasNext()) {
-            NeutronSubnet_IPAllocationPool pool = i.next();
-            if (ans == null) {
-                ans = pool.getPoolStart();
-            }
-            else
-                if (NeutronSubnet_IPAllocationPool.convert(pool.getPoolStart()) <
-                        NeutronSubnet_IPAllocationPool.convert(ans)) {
-                    ans = pool.getPoolStart();
-                }
-        }
-        return ans;
-    }
-
-    /*
-     * allocate the parameter address.  Because this uses an iterator to
-     * check the instance's list of allocation pools and we want to modify
-     * pools while the iterator is being used, it is necessary to
-     * build a new list of allocation pools and replace the list when
-     * finished (otherwise a split will cause undefined iterator behavior.
-     */
-    public void allocateIP(String ipAddress) {
-        Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator();
-        List<NeutronSubnet_IPAllocationPool> newList = new ArrayList<NeutronSubnet_IPAllocationPool>();    // we have to modify a separate list
-        while (i.hasNext()) {
-            NeutronSubnet_IPAllocationPool pool = i.next();
-            /* if the pool contains a single address element and we are allocating it
-             * then we don't need to copy the pool over.  Otherwise, we need to possibly
-             * split the pool and add both pieces to the new list
-             */
-            if (!(pool.getPoolEnd().equalsIgnoreCase(ipAddress) &&
-                    pool.getPoolStart().equalsIgnoreCase(ipAddress))) {
-                if (pool.contains(ipAddress)) {
-                    List<NeutronSubnet_IPAllocationPool> pools = pool.splitPool(ipAddress);
-                    newList.addAll(pools);
-                } else {
-                    newList.add(pool);
-                }
-            }
-        }
-        allocationPools = newList;
-    }
-
-    /*
-     * release an IP address back to the subnet.  Although an iterator
-     * is used, the list is not modified until the iterator is complete, so
-     * an extra list is not necessary.
-     */
-    public void releaseIP(String ipAddress) {
-        NeutronSubnet_IPAllocationPool lPool = null;
-        NeutronSubnet_IPAllocationPool hPool = null;
-        Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator();
-        long sIP = NeutronSubnet_IPAllocationPool.convert(ipAddress);
-        //look for lPool where ipAddr - 1 is high address
-        //look for hPool where ipAddr + 1 is low address
-        while (i.hasNext()) {
-            NeutronSubnet_IPAllocationPool pool = i.next();
-            long lIP = NeutronSubnet_IPAllocationPool.convert(pool.getPoolStart());
-            long hIP = NeutronSubnet_IPAllocationPool.convert(pool.getPoolEnd());
-            if (sIP+1 == lIP) {
-                hPool = pool;
-            }
-            if (sIP-1 == hIP) {
-                lPool = pool;
-            }
-        }
-        //if (lPool == NULL and hPool == NULL) create new pool where low = ip = high
-        if (lPool == null && hPool == null) {
-            allocationPools.add(new NeutronSubnet_IPAllocationPool(ipAddress,ipAddress));
-        }
-        //if (lPool == NULL and hPool != NULL) change low address of hPool to ipAddr
-        if (lPool == null && hPool != null) {
-            hPool.setPoolStart(ipAddress);
-        }
-        //if (lPool != NULL and hPool == NULL) change high address of lPool to ipAddr
-        if (lPool != null && hPool == null) {
-            lPool.setPoolEnd(ipAddress);
-        }
-        //if (lPool != NULL and hPool != NULL) remove lPool and hPool and create new pool
-        //        where low address = lPool.low address and high address = hPool.high Address
-        if (lPool != null && hPool != null) {
-            allocationPools.remove(lPool);
-            allocationPools.remove(hPool);
-            allocationPools.add(new NeutronSubnet_IPAllocationPool(
-                    lPool.getPoolStart(), hPool.getPoolEnd()));
-        }
-    }
-
-    public void setGatewayIPAllocated() {
-        gatewayIPAssigned = true;
-    }
-
-    public void resetGatewayIPAllocated() {
-        gatewayIPAssigned = false;
-    }
-
-    public Boolean getGatewayIPAllocated() {
-        return gatewayIPAssigned;
-    }
-
-    @Override
-    public String toString() {
-        return "NeutronSubnet [subnetUUID=" + subnetUUID + ", networkUUID=" + networkUUID + ", name=" + name
-                + ", ipVersion=" + ipVersion + ", cidr=" + cidr + ", gatewayIP=" + gatewayIP + ", dnsNameservers="
-                + dnsNameservers + ", allocationPools=" + allocationPools + ", hostRoutes=" + hostRoutes
-                + ", enableDHCP=" + enableDHCP + ", tenantID=" + tenantID + ", myPorts=" + myPorts
-                + ", gatewayIPAssigned=" + gatewayIPAssigned + ", ipv6AddressMode=" + ipV6AddressMode
-                + ", ipv6RaMode=" + ipV6RaMode + "]";
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_HostRoute.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_HostRoute.java
deleted file mode 100644 (file)
index 0774406..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronSubnet_HostRoute implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="destination")
-    String destination;
-
-    @XmlElement(name="nexthop")
-    String nextHop;
-
-    public NeutronSubnet_HostRoute() { }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java
deleted file mode 100644 (file)
index 75da310..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronSubnet_IPAllocationPool implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="start")
-    String poolStart;
-
-    @XmlElement(name="end")
-    String poolEnd;
-
-    public NeutronSubnet_IPAllocationPool() {
-    }
-
-    public NeutronSubnet_IPAllocationPool(String lowAddress, String highAddress) {
-        poolStart = lowAddress;
-        poolEnd = highAddress;
-    }
-
-    public String getPoolStart() {
-        return poolStart;
-    }
-
-    public void setPoolStart(String poolStart) {
-        this.poolStart = poolStart;
-    }
-
-    public String getPoolEnd() {
-        return poolEnd;
-    }
-
-    public void setPoolEnd(String poolEnd) {
-        this.poolEnd = poolEnd;
-    }
-
-    /**
-     * This method determines if this allocation pool contains the
-     * input IPv4 address
-     *
-     * @param inputString
-     *            IPv4 address in dotted decimal format
-     * @returns a boolean on whether the pool contains the address or not
-     */
-
-    public boolean contains(String inputString) {
-        long inputIP = convert(inputString);
-        long startIP = convert(poolStart);
-        long endIP = convert(poolEnd);
-        return (inputIP >= startIP && inputIP <= endIP);
-    }
-
-    /**
-     * This static method converts the supplied IPv4 address to a long
-     * integer for comparison
-     *
-     * @param inputString
-     *            IPv4 address in dotted decimal format
-     * @returns high-endian representation of the IPv4 address as a long.
-     *          This method will return 0 if the input is null.
-     */
-
-    static long convert(String inputString) {
-        long ans = 0;
-        if (inputString != null) {
-            String[] parts = inputString.split("\\.");
-            for (String part: parts) {
-                ans <<= 8;
-                ans |= Integer.parseInt(part);
-            }
-        }
-        return ans;
-    }
-
-    /**
-     * This static method converts the supplied high-ending long back
-     * into a dotted decimal representation of an IPv4 address
-     *
-     * @param l
-     *            high-endian representation of the IPv4 address as a long
-     * @returns IPv4 address in dotted decimal format
-     */
-    static String longtoIP(long l) {
-        int i;
-        String[] parts = new String[4];
-        for (i=0; i<4; i++) {
-            parts[3-i] = String.valueOf(l & 255);
-            l >>= 8;
-        }
-        return join(parts,".");
-    }
-
-    /*
-     * helper routine used by longtoIP
-     */
-    public static String join(String r[],String d)
-    {
-        if (r.length == 0) {
-            return "";
-        }
-        StringBuilder sb = new StringBuilder();
-        int i;
-        for(i=0;i<r.length-1;i++) {
-            sb.append(r[i]+d);
-        }
-        return sb.toString()+r[i];
-    }
-
-    /*
-     * This method splits the current instance by removing the supplied
-     * parameter.
-     *
-     * If the parameter is either the low or high address,
-     * then that member is adjusted and a list containing just this instance
-     * is returned.
-     *
-     * If the parameter is in the middle of the pool, then
-     * create two new instances, one ranging from low to parameter-1
-     * the other ranging from parameter+1 to high
-     */
-    public List<NeutronSubnet_IPAllocationPool> splitPool(String ipAddress) {
-        List<NeutronSubnet_IPAllocationPool> ans = new ArrayList<NeutronSubnet_IPAllocationPool>();
-        long gIP = NeutronSubnet_IPAllocationPool.convert(ipAddress);
-        long sIP = NeutronSubnet_IPAllocationPool.convert(poolStart);
-        long eIP = NeutronSubnet_IPAllocationPool.convert(poolEnd);
-        long i;
-        NeutronSubnet_IPAllocationPool p = new NeutronSubnet_IPAllocationPool();
-        boolean poolStarted = false;
-        for (i=sIP; i<=eIP; i++) {
-            if (i == sIP) {
-                if (i != gIP) {
-                    p.setPoolStart(poolStart);
-                    poolStarted = true;
-                } else {
-                    //FIX for bug 533
-                    p.setPoolStart(NeutronSubnet_IPAllocationPool.longtoIP(i+1));
-                }
-            }
-            if (i == eIP) {
-                if (i != gIP) {
-                    p.setPoolEnd(poolEnd);
-                } else {
-                    p.setPoolEnd(NeutronSubnet_IPAllocationPool.longtoIP(i-1));
-                }
-                ans.add(p);
-            }
-            if (i != sIP && i != eIP) {
-                if (i != gIP) {
-                    if (!poolStarted) {
-                        p.setPoolStart(NeutronSubnet_IPAllocationPool.longtoIP(i));
-                        poolStarted = true;
-                    }
-                } else {
-                    p.setPoolEnd(NeutronSubnet_IPAllocationPool.longtoIP(i-1));
-                    poolStarted = false;
-                    ans.add(p);
-                    p = new NeutronSubnet_IPAllocationPool();
-                }
-            }
-        }
-        return ans;
-    }
-}
diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/Neutron_IPs.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/Neutron_IPs.java
deleted file mode 100644 (file)
index fe5d45b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright IBM Corporation, 2013.  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.networkconfig.neutron;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
-public class Neutron_IPs implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    // See OpenStack Network API v2.0 Reference for description of
-    // annotated attributes
-
-    @XmlElement(name="ip_address")
-    String ipAddress;
-
-    @XmlElement(name="subnet_id")
-    String subnetUUID;
-
-    public Neutron_IPs() { }
-
-    public Neutron_IPs(String uuid) {
-        subnetUUID = uuid;
-    }
-
-    public String getIpAddress() {
-        return ipAddress;
-    }
-
-    public void setIpAddress(String ipAddress) {
-        this.ipAddress = ipAddress;
-    }
-
-    public String getSubnetUUID() {
-        return subnetUUID;
-    }
-
-    public void setSubnetUUID(String subnetUUID) {
-        this.subnetUUID = subnetUUID;
-    }
-
-    @Override
-    public String toString() {
-        return "Neutron_IPs{" +
-               "ipAddress='" + ipAddress + '\'' +
-               ", subnetUUID='" + subnetUUID + '\'' + "}";
-    }
-}
diff --git a/pom.xml b/pom.xml
index d41b51b2145828151de5b2fe72102d61314feb77..068be09dcb5d9462be15f7d1bb6320c2b5bdfe9f 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <!-- adsal -->
     <module>opendaylight/adsal</module>
 
-    <!--  Neutron -->
-    <module>opendaylight/networkconfiguration/neutron</module>
-    <module>opendaylight/networkconfiguration/neutron/implementation</module>
-    <module>opendaylight/networkconfiguration/neutron/northbound</module>
-    <module>opendaylight/networkconfiguration/neutron/features</module>
-
     <!-- Parents -->
     <module>opendaylight/commons/concepts</module>
     <module>opendaylight/commons/protocol-framework</module>