Merge "Added Security Rule for Custom ICMP"
authorSam Hague <shague@redhat.com>
Mon, 28 Sep 2015 12:51:01 +0000 (12:51 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 28 Sep 2015 12:51:02 +0000 (12:51 +0000)
169 files changed:
README
commons/integrationtest/pom.xml
commons/parent/pom.xml
features/ovsdb/pom.xml
features/ovsdb/src/main/features/features.xml
hwvtepsouthbound/hwvtepsouthbound-api/pom.xml [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-api/src/main/yang/hwvtepsouthbound.yang [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-features/pom.xml [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-features/src/main/features/features.xml [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/config/default-config.xml [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/impl/HwvtepSouthboundProvider.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModule.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleFactory.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/yang/hwvtepsouthbound-impl.yang [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleFactoryTest.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleTest.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-it/pom.xml [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-it/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/it/HwvtepSouthboundIT.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml [new file with mode: 0644]
hwvtepsouthbound/pom.xml [new file with mode: 0644]
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/ConfigurationBundles.java [deleted file]
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/OvsdbIntegrationTestBase.java [deleted file]
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginIT.java [deleted file]
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginV3IT.java [deleted file]
integrationtest/src/test/resources/northbound.yaml [deleted file]
library/features/pom.xml
library/features/src/main/features/features.xml
library/impl/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpcDecoder.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/json/ConditionSerializer.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/json/Converter.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/json/MutationSerializer.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/json/OvsdbMapSerializer.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/json/OvsdbSetSerializer.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/json/RowSerializer.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/json/UUIDSerializer.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/ColumnSchema.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/ColumnType.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/typed/TyperUtils.java
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestIT.java [new file with mode: 0644]
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestTypedIT.java [new file with mode: 0644]
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/TestBridge.java [new file with mode: 0644]
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/VersionIncompatibleBridge.java [new file with mode: 0644]
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/schema/openvswitch/OpenVSwitchIT.java
northbound/enunciate.xml [deleted file]
northbound/pom.xml [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/DatabaseResource.java [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/NodeResource.java [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV2.java [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV3.java [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbRow.java [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbRows.java [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/RowResource.java [deleted file]
northbound/src/main/java/org/opendaylight/ovsdb/northbound/TableResource.java [deleted file]
northbound/src/main/resources/WEB-INF/web.xml [deleted file]
northbound/src/test/java/org/opendaylight/ovsdb/northbound/NodeResourceTest.java [deleted file]
northbound/src/test/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV3Test.java [deleted file]
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java
openstack/net-virt-providers/pom.xml
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/OF13Provider.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/PipelineOrchestratorImpl.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/EgressAclService.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/IngressAclService.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/arp/ArpSender.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/arp/GatewayMacResolverService.java
openstack/net-virt-sfc/api/pom.xml [new file with mode: 0644]
openstack/net-virt-sfc/api/src/main/yang/ietf-acl.yang [new file with mode: 0644]
openstack/net-virt-sfc/api/src/main/yang/netvirt-acl.yang [new file with mode: 0644]
openstack/net-virt-sfc/api/src/main/yang/netvirt-classifier.yang [new file with mode: 0644]
openstack/net-virt-sfc/api/src/main/yang/netvirt-sfc.yang [new file with mode: 0644]
openstack/net-virt-sfc/api/src/main/yang/packet-fields.yang [new file with mode: 0644]
openstack/net-virt-sfc/artifacts/pom.xml [new file with mode: 0644]
openstack/net-virt-sfc/features/pom.xml [new file with mode: 0644]
openstack/net-virt-sfc/features/src/main/features/features.xml [new file with mode: 0644]
openstack/net-virt-sfc/impl/pom.xml [new file with mode: 0644]
openstack/net-virt-sfc/impl/src/main/config/default-config.xml [new file with mode: 0644]
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcProvider.java [new file with mode: 0644]
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModule.java [new file with mode: 0644]
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleFactory.java [new file with mode: 0644]
openstack/net-virt-sfc/impl/src/main/yang/netvirt-sfc.yang [new file with mode: 0644]
openstack/net-virt-sfc/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleFactoryTest.java [new file with mode: 0644]
openstack/net-virt-sfc/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleTest.java [new file with mode: 0644]
openstack/net-virt-sfc/it/pom.xml [new file with mode: 0644]
openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java [new file with mode: 0644]
openstack/net-virt-sfc/karaf/pom.xml [new file with mode: 0644]
openstack/net-virt-sfc/pom.xml [new file with mode: 0644]
openstack/net-virt/pom.xml
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/MdsalHelper.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/SouthboundHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/BridgeConfigurationManagerImpl.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/SecurityServicesImpl.java
openstack/pom.xml
ovs-sfc/pom.xml
ovsdb-plugin-compatibility-layer/pom.xml [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/NodeUtils.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbConfigurationService.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbConnectionService.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbInventoryListener.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbInventoryService.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/StatusWithUuid.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/error/OvsdbPluginException.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConfigurationServiceImpl.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConnectionServiceImpl.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/InventoryServiceImpl.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/StatusConvertorUtil.java [deleted file]
ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/internal/Activator.java [deleted file]
ovsdb-plugin-compatibility-layer/src/test/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConnectionServiceImplTest.java [deleted file]
plugin-mdsal-adapter/pom.xml [deleted file]
plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/Activator.java [deleted file]
plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbBindingAwareProvider.java [deleted file]
plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbBindingAwareProviderImpl.java [deleted file]
plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbInventoryManager.java [deleted file]
plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/Utils.java [deleted file]
plugin-mdsal-adapter/src/main/yang/ovsdb-node-inventory.yang [deleted file]
plugin-mdsal-adapter/src/test/java/org/opendaylight/ovsdb/plugin/md/UtilsTest.java [deleted file]
plugin-shell/pom.xml [deleted file]
plugin-shell/src/main/java/org/opendaylight/ovsdb/plugin/shell/PrintCache.java [deleted file]
plugin-shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml [deleted file]
plugin-shell/src/test/java/org/opendaylight/ovsdb/plugin/shell/PrintCacheTest.java [deleted file]
plugin-shell/src/test/resources/org/opendaylight/ovsdb/plugin/shell/test_schema.json [deleted file]
plugin/pom.xml [deleted file]
plugin/resources/logback.xml [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/Connection.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/ConnectionConstants.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsVswitchdSchemaConstants.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbConfigurationService.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbConnectionService.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbInventoryListener.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbInventoryService.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/Status.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/StatusCode.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/StatusWithUuid.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/error/OvsdbPluginException.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConfigurationServiceImpl.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConnectionServiceImpl.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/InventoryServiceImpl.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/Activator.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/Encapsulation.java [deleted file]
plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/NodeDatabase.java [deleted file]
plugin/src/test/java/org/opendaylight/ovsdb/plugin/impl/ConnectionServiceImplTest.java [deleted file]
pom.xml
resources/commons/OVSDB_Northbound_APIs.json.postman_collection [deleted file]
resources/commons/OVSDB_Northbound_v3_APIs.json.postman_collection [deleted file]
resources/commons/README
schemas/openvswitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Manager.java
southbound/southbound-api/pom.xml
southbound/southbound-api/src/main/yang/ovsdb.yang
southbound/southbound-features/pom.xml
southbound/southbound-features/src/main/features/features.xml
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/InstanceIdentifierCodec.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManager.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListener.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundUtil.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java [new file with mode: 0644]
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersUpdateCommand.java [new file with mode: 0644]
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbOperationalCommandAggregator.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManagerTest.java [new file with mode: 0644]
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListenerTest.java [new file with mode: 0644]
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java
utils/mdsal-openflow/pom.xml
utils/mdsal-utils/pom.xml [new file with mode: 0644]
utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtils.java [new file with mode: 0644]
utils/mdsal-utils/src/test/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtilsTest.java [new file with mode: 0644]
utils/pom.xml

diff --git a/README b/README
index 34539ffc98a8597250f163fab641aa3ac05bd014..b084ea7c8bb2d2888f913096bce1b2e65a024fad 100644 (file)
--- a/README
+++ b/README
@@ -18,10 +18,6 @@ DIRECTORY ORGANIZATION
             This module doesn't depend on any of the Opendaylight components.
             This library module can also be used independently in a non-OSGi environment.
 
-- northbound : Provides AD-SAL style Northbound REST APIs.
-               Supports the legacy v2 APIs to provide backward compatibility for Hydrogen Release
-               Also supports the newer v3 APIs to provide schema-independent access to the OVSDB protocol.
-
 - openstack
   +-- net-virt : Handles the Openstack Neutron ML2 and Network Service calls and performs all the logic required
                  for Network Virtualization.
@@ -67,7 +63,7 @@ Pre-requisites : JDK 1.7+, Maven 3+
 
    4. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
       is to start the OVSDB plugin framework with the following command in the karaf console:
-      "feature:install odl-ovsdb-openstack odl-ovsdb-northbound" (without quotation marks).
+      "feature:install odl-ovsdb-openstack" (without quotation marks).
 
    Sample output from Karaf console :
 
@@ -76,8 +72,6 @@ Pre-requisites : JDK 1.7+, Maven 3+
    odl-ovsdb-library                | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Library
    odl-ovsdb-schema-openvswitch     | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: Open_vSwitch
    odl-ovsdb-schema-hardwarevtep    | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: hardware_vtep
-   odl-ovsdb-plugin                 | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: Plugin
-   odl-ovsdb-northbound             | 0.6.0-SNAPSHOT      |           | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: Northbound
    odl-ovsdb-openstack              | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: OpenStack Network Virtual
    odl-ovsdb-ovssfc                 | 0.0.1-SNAPSHOT      |           | ovsdb-0.0.1-SNAPSHOT                  | OpenDaylight :: OVSDB :: OVS Service Function Chai
 
@@ -164,7 +158,7 @@ Running The Integration Tests
 To run the integration tests locally the following components are required:
 
  - Docker
- - Fig
+ - Fig or Docker Compose
 
 To install docker, follow the installation guide for your platform:
    http://docs.docker.com/installation/
@@ -172,6 +166,9 @@ To install docker, follow the installation guide for your platform:
 To install fig:
    http://www.fig.sh/install.html
 
+To install Docker Compose:
+   http://docs.docker.com/compose/install/
+
 To run the integration tests:
 
     mvn clean install
@@ -187,6 +184,8 @@ To run the integration tests:
 
 On Linux you'll generally need to run fig as root (sudo fig ...).
 
+If you're using Docker Compose, replace "fig" above with "docker-compose" and ignore the warnings.
+
 Skipping unit tests and karaf tests
 ====================
 
index 84265c6d5f787883097df26b4ff099f566e12e13..3c13a002eb9fad0d5c35c5c937e8e4fde2de419c 100644 (file)
@@ -47,11 +47,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <properties>
     <!-- Overrides -->
     <!-- Controller Dependencies for Pax Exam -->
-    <arphandler.version>0.7.0-SNAPSHOT</arphandler.version>
-    <bundlescanner.implementation.version>0.6.0-SNAPSHOT</bundlescanner.implementation.version>
-    <bundlescanner.version>0.6.0-SNAPSHOT</bundlescanner.version>
-    <clustering.services_implementation.version>0.6.0-SNAPSHOT</clustering.services_implementation.version>
-    <commons.httpclient.version>0.3.0-SNAPSHOT</commons.httpclient.version>
     <configuration.implementation.version>0.6.0-SNAPSHOT</configuration.implementation.version>
     <configuration.version>0.6.0-SNAPSHOT</configuration.version>
     <connectionmanager.version>0.3.0-SNAPSHOT</connectionmanager.version>
@@ -64,7 +59,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <hosttracker.implementation.version>0.7.0-SNAPSHOT</hosttracker.implementation.version>
     <hosttracker.northbound.version>0.6.0-SNAPSHOT</hosttracker.northbound.version>
     <logging.bridge.version>0.6.0-SNAPSHOT</logging.bridge.version>
-    <protocol_plugins.stub.version>0.6.0-SNAPSHOT</protocol_plugins.stub.version>
     <routing.dijkstra_implementation.version>0.6.0-SNAPSHOT</routing.dijkstra_implementation.version>
     <sal.implementation.version>0.6.0-SNAPSHOT</sal.implementation.version>
     <security.version>0.6.0-SNAPSHOT</security.version>
@@ -409,200 +403,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <groupId>org.jboss.spec.javax.transaction</groupId>
       <artifactId>jboss-transaction-api_1.1_spec</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>arphandler</artifactId>
-      <version>${arphandler.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>bundlescanner</artifactId>
-      <version>${bundlescanner.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>bundlescanner.implementation</artifactId>
-      <version>${bundlescanner.implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services</artifactId>
-      <version>${clustering.services.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>clustering.services-implementation</artifactId>
-      <version>${clustering.services_implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.httpclient</artifactId>
-      <version>${commons.httpclient.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.northbound</artifactId>
-      <version>${northbound.commons.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>configuration</artifactId>
-      <version>${configuration.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>configuration.implementation</artifactId>
-      <version>${configuration.implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>connectionmanager</artifactId>
-      <version>${connectionmanager.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>connectionmanager.implementation</artifactId>
-      <version>${connectionmanager.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager</artifactId>
-      <version>${containermanager.it.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>containermanager.it.implementation</artifactId>
-      <version>${containermanager.it.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>flowprogrammer.northbound</artifactId>
-      <version>${flowprogrammer.northbound.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwarding.staticrouting</artifactId>
-      <version>${forwarding.staticrouting}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwarding.staticrouting.northbound</artifactId>
-      <version>${forwarding.staticrouting.northbound.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwardingrulesmanager</artifactId>
-      <version>${forwardingrulesmanager.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>forwardingrulesmanager.implementation</artifactId>
-      <version>${forwardingrulesmanager.implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker</artifactId>
-      <version>${hosttracker.api.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker.implementation</artifactId>
-      <version>${hosttracker.implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>hosttracker.northbound</artifactId>
-      <version>${hosttracker.northbound.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>logging.bridge</artifactId>
-      <version>${logging.bridge.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>protocol_plugins.stub</artifactId>
-      <version>${protocol_plugins.stub.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>routing.dijkstra_implementation</artifactId>
-      <version>${routing.dijkstra_implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-      <version>${sal.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal.implementation</artifactId>
-      <version>${sal.implementation.version}</version>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-binding-it</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>security</artifactId>
-      <version>${security.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>statistics.northbound</artifactId>
-      <version>${statistics.northbound.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>statisticsmanager</artifactId>
-      <version>${statisticsmanager.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>statisticsmanager.implementation</artifactId>
-      <version>${statisticsmanager.implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>subnets.northbound</artifactId>
-      <version>${subnets.northbound.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>switchmanager</artifactId>
-      <version>${switchmanager.api.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>switchmanager.implementation</artifactId>
-      <version>${switchmanager.implementation.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>switchmanager.northbound</artifactId>
-      <version>${switchmanager.northbound.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>topology.northbound</artifactId>
-      <version>${topology.northbound.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>topologymanager</artifactId>
-      <version>${topologymanager.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>usermanager</artifactId>
-      <version>${usermanager.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>usermanager.implementation</artifactId>
-      <version>${usermanager.implementation.version}</version>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller.thirdparty</groupId>
       <artifactId>com.sun.jersey.jersey-servlet</artifactId>
@@ -711,14 +515,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>openstack.net-virt</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>ovsdb-plugin-compatibility-layer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>plugin</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>schema.hardwarevtep</artifactId>
index bd48626709d0c5da854a46df48a0e19774b5e2bd..5cb6e2657eddaf330982242a7780e0ff9e3e6a40 100644 (file)
@@ -80,7 +80,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <sonar.jacoco.itReportPath>${root.directory}/target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
     <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
     <!-- ODL Dependency Versions -->
-    <clustering.services.version>0.7.0-SNAPSHOT</clustering.services.version>
     <containermanager.version>0.7.0-SNAPSHOT</containermanager.version>
     <controller.config.version>0.4.0-SNAPSHOT</controller.config.version>
     <forwardingrulesmanager.version>0.8.0-SNAPSHOT</forwardingrulesmanager.version>
@@ -109,6 +108,20 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <dependencyManagement>
     <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>2.0.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.mdsal.model</groupId>
+        <artifactId>mdsal-model-artifacts</artifactId>
+        <version>0.8.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
       <dependency>
         <groupId>commons-collections</groupId>
         <artifactId>commons-collections</artifactId>
@@ -139,11 +152,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
         <artifactId>config-api</artifactId>
         <version>${controller.config.version}</version>
       </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>clustering.services</artifactId>
-        <version>${clustering.services.version}</version>
-      </dependency>
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
         <artifactId>containermanager</artifactId>
@@ -541,7 +549,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
           </executions>
           <dependencies>
             <dependency>
-              <groupId>org.opendaylight.yangtools</groupId>
+              <groupId>org.opendaylight.mdsal</groupId>
               <artifactId>maven-sal-api-gen-plugin</artifactId>
               <version>${yangtools.version}</version>
               <type>jar</type>
index 8fcb70cc93ac80da0ae1266a7c4225f17d0f8b23..1e8e2fd6651a535e7f1eb0d36183cc31ccd263f2 100644 (file)
@@ -45,7 +45,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   </scm>
 
   <properties>
-    <dummy-console.version>1.3.0-SNAPSHOT</dummy-console.version>
     <odl.karaf.base.version>1.6.0-SNAPSHOT</odl.karaf.base.version>
     <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
     <io.netty.version>3.8.0.Final</io.netty.version>
@@ -221,11 +220,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>org.eclipse.osgi.services</artifactId>
       <version>3.3.100.v20120522-1822</version>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>dummy-console</artifactId>
-      <version>${dummy-console.version}</version>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.neutron</groupId>
       <artifactId>features-neutron</artifactId>
@@ -271,21 +265,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <type>xml</type>
       <classifier>config</classifier>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>plugin</artifactId>
-      <version>${ovsdb.plugin.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>ovsdb-plugin-compatibility-layer</artifactId>
-      <version>${ovsdb.plugin.compatibility.layer.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>plugin-shell</artifactId>
-      <version>${plugin.shell.version}</version>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.ovsdb</groupId>
       <artifactId>schema.openvswitch</artifactId>
index 03f5c9b4d0955003aeb0b98b15ab6fe16e6491d1..15bd93066b529a0b94ce8449065f074929200624 100644 (file)
@@ -12,7 +12,6 @@
   <feature name="odl-ovsdb-all" description="OpenDaylight :: OVSDB :: all"
            version='${project.version}'>
     <feature version="${ovsdb.library.version}">odl-ovsdb-library</feature>
-    <feature version="${ovsdb.plugin.version}">odl-ovsdb-plugin</feature>
   </feature>
 
   <feature name="odl-ovsdb-schema-openvswitch" description="OVSDB :: Schema :: Open_vSwitch"
     <bundle>mvn:org.opendaylight.ovsdb/schema.hardwarevtep/${schema.hardwarevtep.version}</bundle>
   </feature>
 
-  <feature name="odl-ovsdb-plugin" description="OpenDaylight :: OVSDB :: Plugin"
-           version='${ovsdb.plugin.version}'>
-    <feature version="${openflowplugin.version}">odl-openflowplugin-nsf-services</feature>
-    <feature version="${ovsdb.library.version}">odl-ovsdb-library</feature>
-    <feature version="${schema.openvswitch.version}">odl-ovsdb-schema-openvswitch</feature>
-    <feature version="${schema.hardwarevtep.version}">odl-ovsdb-schema-hardwarevtep</feature>
-    <bundle>mvn:org.apache.felix/org.apache.felix.dependencymanager/${felix.dependencymanager.version}</bundle>
-    <bundle>mvn:org.apache.felix/org.apache.felix.dependencymanager.shell/${felix.dependencymanager.shell.version}</bundle>
-    <bundle>mvn:org.osgi/org.osgi.compendium/${osgi.compendium.version}</bundle>
-    <bundle>mvn:org.opendaylight.ovsdb/plugin/${ovsdb.plugin.version}</bundle>
-    <bundle>mvn:org.opendaylight.ovsdb/plugin-shell/${plugin.shell.version}</bundle>
-  </feature>
-
   <feature name="odl-ovsdb-openstack" description="OpenDaylight :: OVSDB :: OpenStack Network Virtualization"
            version='${openstack.netvirt.version}'>
     <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
diff --git a/hwvtepsouthbound/hwvtepsouthbound-api/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-api/pom.xml
new file mode 100644 (file)
index 0000000..c85b1b1
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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">
+  <parent>
+    <groupId>org.opendaylight.mdsal</groupId>
+    <artifactId>binding-parent</artifactId>
+    <version>0.8.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>hwvtepsouthbound-api</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+</project>
diff --git a/hwvtepsouthbound/hwvtepsouthbound-api/src/main/yang/hwvtepsouthbound.yang b/hwvtepsouthbound/hwvtepsouthbound-api/src/main/yang/hwvtepsouthbound.yang
new file mode 100644 (file)
index 0000000..c36bb1b
--- /dev/null
@@ -0,0 +1,9 @@
+module hwvtepsouthbound {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:hwvtepsouthbound";
+    prefix "hwvtepsouthbound";
+
+    revision "2015-09-01" {
+        description "Initial revision of hwvtepsouthbound model";
+    }
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml
new file mode 100644 (file)
index 0000000..4bba156
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>hwvtepsouthbound-artifacts</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>hwvtepsouthbound-api</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>hwvtepsouthbound-impl</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>hwvtepsouthbound-features</artifactId>
+        <version>${project.version}</version>
+        <classifier>features</classifier>
+        <type>xml</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+</project>
diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/pom.xml
new file mode 100644 (file)
index 0000000..e50de3a
--- /dev/null
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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 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>features-parent</artifactId>
+    <version>1.6.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>hwvtepsouthbound-features</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <name>${project.artifactId}</name>
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <properties>
+    <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
+    <restconf.version>1.3.0-SNAPSHOT</restconf.version>
+    <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+    <dlux.version>0.3.0-SNAPSHOT</dlux.version>
+    <mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
+    <configfile.directory>etc/opendaylight/karaf</configfile.directory>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <!-- project specific dependencies -->
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>${mdsal.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.netconf</groupId>
+        <artifactId>restconf-artifacts</artifactId>
+        <version>${restconf.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>features-yangtools</artifactId>
+      <classifier>features</classifier>
+      <version>${yangtools.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>features-mdsal</artifactId>
+      <classifier>features</classifier>
+      <version>${mdsal.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>features-mdsal-model</artifactId>
+      <version>${mdsal.model.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>features-restconf</artifactId>
+      <classifier>features</classifier>
+      <version>${restconf.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.dlux</groupId>
+      <artifactId>features-dlux</artifactId>
+      <classifier>features</classifier>
+      <version>${dlux.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hwvtepsouthbound-impl</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hwvtepsouthbound-impl</artifactId>
+      <version>${project.version}</version>
+      <type>xml</type>
+      <classifier>config</classifier>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hwvtepsouthbound-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/src/main/features/features.xml b/hwvtepsouthbound/hwvtepsouthbound-features/src/main/features/features.xml
new file mode 100644 (file)
index 0000000..967a07c
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd.
+
+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-ovsdb-hwvtepsouthbound-${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.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.version}/xml/features</repository>
+  <feature name='odl-ovsdb-hwvtepsouthbound-api' version='${project.version}' description='OpenDaylight :: hwvtepsouthbound :: api'>
+    <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
+    <bundle>mvn:org.opendaylight.ovsdb/hwvtepsouthbound-api/${project.version}</bundle>
+  </feature>
+  <feature name='odl-ovsdb-hwvtepsouthbound' version='${project.version}' description='OpenDaylight :: hwvtepsouthbound'>
+    <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+    <feature version='${project.version}'>odl-ovsdb-hwvtepsouthbound-api</feature>
+    <bundle>mvn:org.opendaylight.ovsdb/hwvtepsouthbound-impl/${project.version}</bundle>
+    <configfile finalname="${configfile.directory}/hwvtepsouthbound.xml">mvn:org.opendaylight.ovsdb/hwvtepsouthbound-impl/${project.version}/xml/config</configfile>
+  </feature>
+  <feature name='odl-ovsdb-hwvtepsouthbound-rest' version='${project.version}' description='OpenDaylight :: hwvtepsouthbound :: REST'>
+    <feature version="${project.version}">odl-ovsdb-hwvtepsouthbound</feature>
+    <feature version="${mdsal.version}">odl-restconf</feature>
+  </feature>
+  <feature name='odl-ovsdb-hwvtepsouthbound-ui' version='${project.version}' description='OpenDaylight :: hwvtepsouthbound :: UI'>
+    <feature version="${project.version}">odl-ovsdb-hwvtepsouthbound-rest</feature>
+    <feature version="${mdsal.version}">odl-mdsal-apidocs</feature>
+    <feature version="${mdsal.version}">odl-mdsal-xsql</feature>
+    <feature version="${dlux.version}">odl-dlux-yangui</feature>
+  </feature>
+
+</features>
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml
new file mode 100644 (file)
index 0000000..a111024
--- /dev/null
@@ -0,0 +1,44 @@
+<?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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.4.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>hwvtepsouthbound-impl</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hwvtepsouthbound-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <!-- Testing Dependencies -->
+    <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>
+
+</project>
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/config/default-config.xml b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/config/default-config.xml
new file mode 100644 (file)
index 0000000..491fe69
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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>
+  <required-capabilities>
+    <!--  <capability>urn:opendaylight:params:xml:ns:yang:hwvtepsouthbound:impl?module=hwvtepsouthbound-impl&amp;revision=2015-09-01</capability> -->
+      <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
+  </required-capabilities>
+  <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:prefix="urn:opendaylight:params:xml:ns:yang:hwvtepsouthbound:impl">prefix:hwvtepsouthbound</type>
+          <name>hwvtepsouthbound-default</name>
+          <broker>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+            <name>binding-osgi-broker</name>
+          </broker>
+        </module>
+      </modules>
+    </data>
+  </configuration>
+</snapshot>
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/impl/HwvtepSouthboundProvider.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/impl/HwvtepSouthboundProvider.java
new file mode 100644 (file)
index 0000000..8ef25ea
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.ovsdb.hwvtepsouthbound.impl;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HwvtepSouthboundProvider implements BindingAwareProvider, AutoCloseable {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundProvider.class);
+
+    @Override
+    public void onSessionInitiated(ProviderContext session) {
+        LOG.info("HwvtepSouthboundProvider Session Initiated");
+    }
+
+    @Override
+    public void close() throws Exception {
+        LOG.info("HwvtepSouthboundProvider Closed");
+    }
+
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModule.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModule.java
new file mode 100644 (file)
index 0000000..0a37e01
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.params.xml.ns.yang.hwvtepsouthbound.impl.rev150901;
+
+import org.opendaylight.ovsdb.hwvtepsouthbound.impl.HwvtepSouthboundProvider;
+
+public class HwvtepSouthboundModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hwvtepsouthbound.impl.rev150901.AbstractHwvtepSouthboundModule {
+    public HwvtepSouthboundModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public HwvtepSouthboundModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hwvtepsouthbound.impl.rev150901.HwvtepSouthboundModule oldModule, 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() {
+        HwvtepSouthboundProvider provider = new HwvtepSouthboundProvider();
+        getBrokerDependency().registerProvider(provider);
+        return provider;
+    }
+
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleFactory.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleFactory.java
new file mode 100644 (file)
index 0000000..38ca064
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: hwvtepsouthbound-impl yang module local name: hwvtepsouthbound
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Tue Sep 01 21:41:01 IST 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hwvtepsouthbound.impl.rev150901;
+public class HwvtepSouthboundModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hwvtepsouthbound.impl.rev150901.AbstractHwvtepSouthboundModuleFactory {
+
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/yang/hwvtepsouthbound-impl.yang b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/yang/hwvtepsouthbound-impl.yang
new file mode 100644 (file)
index 0000000..2f8aae6
--- /dev/null
@@ -0,0 +1,35 @@
+module hwvtepsouthbound-impl {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:hwvtepsouthbound:impl";
+    prefix "hwvtepsouthbound-impl";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+
+    description
+        "Service definition for hwvtepsouthbound project";
+
+    revision "2015-09-01" {
+        description
+            "Initial revision";
+    }
+
+    identity hwvtepsouthbound {
+        base config:module-type;
+        config:java-name-prefix HwvtepSouthbound;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case hwvtepsouthbound {
+            when "/config:modules/config:module/config:type = 'hwvtepsouthbound'";
+            container broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity md-sal-binding:binding-broker-osgi-registry;
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleFactoryTest.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleFactoryTest.java
new file mode 100644 (file)
index 0000000..74a4d7d
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.params.xml.ns.yang.hwvtepsouthbound.impl.rev150901;
+
+import org.junit.Test;
+
+public class HwvtepSouthboundModuleFactoryTest {
+    @Test
+    public void testFactoryConstructor() {
+        // ensure no exceptions on construction
+        new HwvtepSouthboundModuleFactory();
+    }
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleTest.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/hwvtepsouthbound/impl/rev150901/HwvtepSouthboundModuleTest.java
new file mode 100644 (file)
index 0000000..3b67519
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.params.xml.ns.yang.hwvtepsouthbound.impl.rev150901;
+
+import org.junit.Test;
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.JmxAttribute;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.ovsdb.hwvtepsouthbound.impl.HwvtepSouthboundProvider;
+
+import javax.management.ObjectName;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class HwvtepSouthboundModuleTest {
+    @Test
+    public void testCustomValidation() {
+        HwvtepSouthboundModule module = new HwvtepSouthboundModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class));
+
+        // ensure no exceptions on validation
+        // currently this method is empty
+        module.customValidation();
+    }
+
+    @Test
+    public void testCreateInstance() throws Exception {
+        // configure mocks
+        DependencyResolver dependencyResolver = mock(DependencyResolver.class);
+        BindingAwareBroker broker = mock(BindingAwareBroker.class);
+        when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
+
+        // create instance of module with injected mocks
+        HwvtepSouthboundModule module = new HwvtepSouthboundModule(mock(ModuleIdentifier.class), dependencyResolver);
+
+        // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
+        AutoCloseable closeable = module.getInstance();
+
+        // verify that the module registered the returned provider with the broker
+        verify(broker).registerProvider((HwvtepSouthboundProvider)closeable);
+
+        // ensure no exceptions on close
+        closeable.close();
+    }
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-it/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-it/pom.xml
new file mode 100644 (file)
index 0000000..0511cd7
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>mdsal-it-parent</artifactId>
+    <version>1.3.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>hwvtepsouthbound-it</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <properties>
+    <skipITs>false</skipITs>
+    <karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
+    <karaf.distro.artifactId>hwvtepsouthbound-karaf</karaf.distro.artifactId>
+    <karaf.distro.version>1.2.0-SNAPSHOT</karaf.distro.version>
+    <karaf.distro.type>zip</karaf.distro.type>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hwvtepsouthbound-features</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/hwvtepsouthbound/hwvtepsouthbound-it/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/it/HwvtepSouthboundIT.java b/hwvtepsouthbound/hwvtepsouthbound-it/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/it/HwvtepSouthboundIT.java
new file mode 100644 (file)
index 0000000..aae1d62
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.ovsdb.hwvtepsouthbound.it;
+
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class HwvtepSouthboundIT extends AbstractMdsalTestBase {
+    private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundIT.class);
+
+    @Override
+    public String getModuleName() {
+        return "hwvtepsouthbound";
+    }
+
+    @Override
+    public String getInstanceName() {
+        return "hwvtepsouthbound-default";
+    }
+
+    @Override
+    public MavenUrlReference getFeatureRepo() {
+        return maven()
+                .groupId("org.opendaylight.ovsdb")
+                .artifactId("hwvtepsouthbound-features")
+                .classifier("features")
+                .type("xml")
+                .versionAsInProject();
+    }
+
+    @Override
+    public String getFeatureName() {
+        return "odl-ovsdb-hwvtepsouthbound-ui";
+    }
+
+    @Override
+    public Option getLoggingOption() {
+        Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                logConfiguration(HwvtepSouthboundIT.class),
+                LogLevel.INFO.name());
+        option = composite(option, super.getLoggingOption());
+        return option;
+    }
+
+    @Test
+    public void testhwvtepsouthboundFeatureLoad() {
+        Assert.assertTrue(true);
+    }
+}
diff --git a/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml
new file mode 100644 (file)
index 0000000..77e7db8
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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 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.controller</groupId>
+    <artifactId>karaf-parent</artifactId>
+    <version>1.6.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>hwvtepsouthbound-karaf</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <name>${project.artifactId}</name>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <properties>
+    <karaf.localFeature>odl-hwvtepsouthbound-ui</karaf.localFeature>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>hwvtepsouthbound-artifacts</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <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 -->
+      <groupId>org.apache.karaf.features</groupId>
+      <artifactId>framework</artifactId>
+      <type>kar</type>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hwvtepsouthbound-features</artifactId>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+  <!-- DO NOT install or deploy the karaf artifact -->
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/hwvtepsouthbound/pom.xml b/hwvtepsouthbound/pom.xml
new file mode 100644 (file)
index 0000000..a4b145f
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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 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>
+    <artifactId>commons</artifactId>
+    <groupId>org.opendaylight.ovsdb</groupId>
+    <version>1.4.0-SNAPSHOT</version>
+    <relativePath>../commons/parent</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>hwvtepsouthbound-aggregator</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <name>hwvtepsouthbound</name>
+  <packaging>pom</packaging>
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <modules>
+    <module>hwvtepsouthbound-api</module>
+    <module>hwvtepsouthbound-impl</module>
+    <module>hwvtepsouthbound-karaf</module>
+    <module>hwvtepsouthbound-features</module>
+    <module>hwvtepsouthbound-artifacts</module>
+    <!-- 
+    <module>hwvtepsouthbound-it</module>
+     -->
+  </modules>
+  <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
+  </scm>
+</project>
diff --git a/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/ConfigurationBundles.java b/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/ConfigurationBundles.java
deleted file mode 100644 (file)
index 0708a9c..0000000
+++ /dev/null
@@ -1,87 +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.ovsdb.integrationtest;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.systemPackages;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
-import org.opendaylight.controller.test.sal.binding.it.TestHelper;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.options.DefaultCompositeOption;
-
-
-public class ConfigurationBundles {
-
-    public static Option controllerBundles() {
-        return new DefaultCompositeOption(
-                systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
-                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
-                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
-                mavenBundle("com.google.code.gson", "gson").versionAsInProject(),
-                mavenBundle("com.google.guava", "guava").versionAsInProject(),
-                mavenBundle("eclipselink", "javax.resource").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "javax.servlet").versionAsInProject(),
-                mavenBundle("org.apache.felix", "org.apache.felix.gogo.command").versionAsInProject(),
-                mavenBundle("org.apache.felix", "org.apache.felix.gogo.runtime").versionAsInProject(),
-                mavenBundle("org.apache.felix", "org.apache.felix.gogo.shell").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
-                mavenBundle("equinoxSDK381","org.eclipse.osgi.services").versionAsInProject(),
-                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager.shell").versionAsInProject(),
-                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject()
-        );
-    }
-
-        public static Option ovsdbLibraryBundles() {
-        return new DefaultCompositeOption(
-                mavenBundle("io.netty", "netty-buffer").versionAsInProject(),
-                mavenBundle("io.netty", "netty-codec").versionAsInProject(),
-                mavenBundle("io.netty", "netty-common").versionAsInProject(),
-                mavenBundle("io.netty", "netty-handler").versionAsInProject(),
-                mavenBundle("io.netty", "netty-transport").versionAsInProject(),
-                mavenBundle("com.fasterxml.jackson.core", "jackson-annotations").versionAsInProject(),
-                mavenBundle("com.fasterxml.jackson.core", "jackson-core").versionAsInProject(),
-                mavenBundle("com.fasterxml.jackson.core", "jackson-databind").versionAsInProject(),
-                mavenBundle("javax.portlet", "portlet-api").versionAsInProject(),
-                mavenBundle("com.google.guava", "guava").versionAsInProject(),
-                mavenBundle("org.opendaylight.ovsdb", "utils.servicehelper").versionAsInProject(),
-                mavenBundle("org.opendaylight.ovsdb", "library").versionAsInProject()
-        );
-    }
-
-    public static Option ovsdbPluginBundles() {
-        return new DefaultCompositeOption(
-                mavenBundle("org.opendaylight.ovsdb", "plugin").versionAsInProject(),
-                mavenBundle("org.mockito", "mockito-all").versionAsInProject()
-        );
-    }
-
-    public static Option ovsdbDefaultSchemaBundles() {
-        return new DefaultCompositeOption(
-                mavenBundle("org.opendaylight.ovsdb", "schema.openvswitch").versionAsInProject(),
-                mavenBundle("org.opendaylight.ovsdb", "schema.hardwarevtep").versionAsInProject()
-        );
-    }
-
-        public static Option mdsalBundles() {
-        return new DefaultCompositeOption(
-                TestHelper.configMinumumBundles(),
-                TestHelper.baseModelBundles(),
-                TestHelper.flowCapableModelBundles(),
-                TestHelper.junitAndMockitoBundles(),
-                TestHelper.bindingAwareSalBundles()
-        );
-    }
-}
diff --git a/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/OvsdbIntegrationTestBase.java b/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/OvsdbIntegrationTestBase.java
deleted file mode 100644 (file)
index 3febeb3..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2014 Red Hat, 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
- *
- * Authors : Madhu Venugopal, Sam Hague
- */
-package org.opendaylight.ovsdb.integrationtest;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
-
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.ovsdb.plugin.api.ConnectionConstants;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-
-import org.junit.Rule;
-import org.junit.rules.TestRule;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class OvsdbIntegrationTestBase {
-    private static final Logger LOG = LoggerFactory.getLogger(OvsdbIntegrationTestBase.class);
-    protected final static String IDENTIFIER = "TEST";
-    protected final static String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
-    protected final static String SERVER_PORT = "ovsdbserver.port";
-    protected final static String CONNECTION_TYPE = "ovsdbserver.connection";
-    protected final static String CONNECTION_TYPE_ACTIVE = "active";
-    protected final static String CONNECTION_TYPE_PASSIVE = "passive";
-    protected final static int CONNECTION_INIT_TIMEOUT = 10000;
-    protected final static String DEFAULT_SERVER_PORT = "6640";
-
-    private static boolean bundlesReady = false;
-
-    public Properties loadProperties() {
-        return System.getProperties();
-    }
-
-    public Node getPluginTestConnection() throws IOException, InterruptedException, ExecutionException, TimeoutException {
-        Properties props = loadProperties();
-        String addressStr = props.getProperty(SERVER_IPADDRESS);
-        String portStr = props.getProperty(SERVER_PORT, DEFAULT_SERVER_PORT);
-        String connectionType = props.getProperty(CONNECTION_TYPE, "active");
-        Node node = null;
-
-        OvsdbConnectionService
-                connection = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-        // If the connection type is active, controller connects to the ovsdb-server
-        if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_ACTIVE)) {
-            if (addressStr == null) {
-                fail(usage());
-            }
-
-            Map<ConnectionConstants, String> params = new HashMap<>();
-            params.put(ConnectionConstants.ADDRESS, addressStr);
-            params.put(ConnectionConstants.PORT, portStr);
-            node = connection.connect(IDENTIFIER, params);
-        }  else if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_PASSIVE)) {
-            // Wait for CONNECTION_INIT_TIMEOUT for the Passive connection to be initiated by the ovsdb-server.
-            Thread.sleep(CONNECTION_INIT_TIMEOUT);
-            List<Node> nodes = connection.getNodes();
-            assertNotNull(nodes);
-            assertTrue(nodes.size() > 0);
-            node = nodes.get(0);
-        }
-
-        if (node != null) {
-            LOG.info("getPluginTestConnection: Successfully connected to {}", node);
-        } else {
-            fail("Connection parameter (" + CONNECTION_TYPE + ") must be active or passive");
-        }
-        return node;
-    }
-
-    protected String usage() {
-        return "Integration Test needs a valid connection configuration as follows :\n" +
-               "active connection : mvn -Pintegrationtest -Dovsdbserver.ipaddress=x.x.x.x -Dovsdbserver.port=yyyy verify\n"+
-               "passive connection : mvn -Pintegrationtest -Dovsdbserver.connection=passive verify\n";
-    }
-
-    public String stateToString(int state) {
-        switch (state) {
-            case Bundle.ACTIVE:
-                return "ACTIVE";
-            case Bundle.INSTALLED:
-                return "INSTALLED";
-            case Bundle.RESOLVED:
-                return "RESOLVED";
-            case Bundle.UNINSTALLED:
-                return "UNINSTALLED";
-            default:
-                return "Not CONVERTED";
-        }
-    }
-
-    public void areWeReady(BundleContext bc) throws InterruptedException {
-        if (bundlesReady) {
-            LOG.info("Bundles already loaded");
-            return;
-        }
-        assertNotNull(bc);
-        boolean debugit = false;
-        Bundle b[] = bc.getBundles();
-        for (Bundle element : b) {
-            int state = element.getState();
-            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
-                LOG.info("Bundle:" + element.getSymbolicName() + " state:"
-                        + stateToString(state));
-                debugit = true;
-            }
-        }
-        if (debugit) {
-            LOG.debug("Do some debugging because some bundle is unresolved");
-            Thread.sleep(600000);
-        }
-
-        // Assert if true, if false we are good to go!
-        assertFalse("There is a problem with loading the bundles.", debugit);
-        bundlesReady = true;
-        LOG.info("Bundles loaded");
-    }
-
-    /*
-     * Method adds a log as each test method starts and finishes. This is useful when
-     * the test suite is used because the suites only print a final summary.
-     */
-    @Rule
-    public TestRule watcher = new TestWatcher() {
-        @Override
-        protected void starting(Description description) {
-            LOG.info("TestWatcher: Starting test: {}",
-                     description.getDisplayName());
-        }
-
-        @Override
-        protected void finished(Description description) {
-            LOG.info("TestWatcher: Finished test: {}", description.getDisplayName());
-        }
-    };
-}
diff --git a/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginIT.java b/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginIT.java
deleted file mode 100644 (file)
index 41582a7..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (c) 2014 Red Hat, 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
- *
- * Authors : Madhu Venugopal
- */
-package org.opendaylight.ovsdb.integrationtest.plugin;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperty;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
-import org.junit.After;
-import org.junit.Ignore;
-import org.opendaylight.ovsdb.integrationtest.ConfigurationBundles;
-import org.opendaylight.ovsdb.integrationtest.OvsdbIntegrationTestBase;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.OvsdbConnectionInfo;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.plugin.api.Status;
-import org.opendaylight.ovsdb.plugin.api.StatusWithUuid;
-import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
-import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-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.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
-
-import org.apache.felix.dm.Component;
-import org.apache.felix.dm.DependencyManager;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.util.PathUtils;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-
-import javax.inject.Inject;
-
-@Ignore
-@RunWith(PaxExam.class)
-public class OvsdbPluginIT extends OvsdbIntegrationTestBase {
-    private static final Logger LOG = LoggerFactory.getLogger(OvsdbPluginIT.class);
-    @Inject
-    private BundleContext bc;
-    private OvsdbConfigurationService ovsdbConfigurationService = null;
-
-    @Inject
-    private OvsdbInventoryService ovsdbInventoryService;
-
-    private Node node = null;
-    private OvsdbClient client = null;
-
-    // Configure the OSGi container
-    @Configuration
-    public Option[] config() {
-        return options(
-            //
-            systemProperty("logback.configurationFile").value(
-                    "file:" + PathUtils.getBaseDir()
-                    + "/src/test/resources/logback.xml"
-            ),
-            // To start OSGi console for inspection remotely
-            systemProperty("osgi.console").value("2401"),
-
-            propagateSystemProperty("ovsdbserver.ipaddress"),
-            propagateSystemProperty("ovsdbserver.port"),
-
-            ConfigurationBundles.mdsalBundles(),
-            ConfigurationBundles.controllerBundles(),
-            ConfigurationBundles.ovsdbLibraryBundles(),
-            ConfigurationBundles.ovsdbDefaultSchemaBundles(),
-            ConfigurationBundles.ovsdbPluginBundles()
-        );
-    }
-
-    @Before
-    public void areWeReady() throws InterruptedException {
-        assertNotNull(bc);
-        boolean debugit = false;
-        Bundle b[] = bc.getBundles();
-        for (Bundle element : b) {
-            int state = element.getState();
-            if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
-                LOG.info("Bundle: {} state: {}", element.getSymbolicName(), stateToString(state));
-                debugit = true;
-            }
-        }
-        if (debugit) {
-            LOG.debug("Do some debugging because some bundle is unresolved");
-        }
-
-        assertFalse(debugit);
-        try {
-            node = getPluginTestConnection();
-        } catch (Exception e) {
-            fail("Exception : "+e.getMessage());
-        }
-        this.ovsdbConfigurationService = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class, this);
-    }
-
-    @Test
-    public void apiTests() throws Exception {
-        Thread.sleep(5000);
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-
-        // Check for the ovsdb Connection as seen by the Plugin layer
-        assertNotNull(connectionService.getNodes());
-        assertTrue(connectionService.getNodes().size() > 0);
-        Node node = connectionService.getNodes().get(0);
-        Connection connection = connectionService.getConnection(node);
-        OvsdbConnectionInfo connectionInfo = connection.getClient().getConnectionInfo();
-        String identifier = IDENTIFIER;
-        if (connectionInfo.getType().equals(OvsdbConnectionInfo.ConnectionType.PASSIVE)) {
-            identifier = connectionInfo.getRemoteAddress().getHostAddress()+":"+connectionInfo.getRemotePort();
-        }
-        assertEquals(node, connectionService.getNode("OVS|" + identifier));
-        System.out.println("Nodes = "+ connectionService.getNodes());
-        /*
-         * Test sequence :
-         * 1. Print Cache and Assert to make sure the bridge is not created yet.
-         * 2. Create a bridge with a valid parent_uuid & Assert to make sure the return status is success.
-         * 3. Assert to make sure the bridge is created with a valid Uuid.
-         * 4. Delete the bridge & Assert to make sure the return status is success.
-         * 5. Assert to make sure the bridge is deleted
-         */
-
-        this.endToEndApiTest(connection, getOpenVSwitchTableUUID(connection));
-
-        /*
-         * Repeat all of the above tests without the parent_uuid
-         */
-
-        this.endToEndApiTest(connection, null);
-    }
-
-    @Test
-    public void testInventoryListeners() throws UnknownHostException {
-        DependencyManager dm = new DependencyManager(bc);
-
-        OvsdbInventoryListener listenerA = Mockito.mock(FakeListener.class);
-        OvsdbInventoryListener listenerB = Mockito.mock(FakeListener.class);
-
-        Component componentA = dm.createComponent();
-        componentA.setInterface(OvsdbInventoryListener.class.getName(), null);
-        componentA.setImplementation(listenerA);
-        dm.add(componentA);
-
-        Component componentB = dm.createComponent();
-        componentB.setInterface(OvsdbInventoryListener.class.getName(), null);
-        componentB.setImplementation(listenerB);
-        dm.add(componentB);
-
-        NodeId nodeId = new NodeId("OVS|10.10.10.10:65342");
-        NodeKey nodeKey = new NodeKey(nodeId);
-        node = new NodeBuilder()
-                .setId(nodeId)
-                .setKey(nodeKey)
-                .build();
-        InetAddress address = InetAddress.getByName("10.10.10.10");
-        int port = 65342;
-
-        // Trigger event
-        ovsdbInventoryService.notifyNodeAdded(node, address, port);
-
-        Mockito.verify(listenerA, Mockito.times(1)).nodeAdded(node, address, port);
-        Mockito.verify(listenerB, Mockito.times(1)).nodeAdded(node, address, port);
-
-        dm.remove(componentA);
-        dm.remove(componentB);
-
-    }
-
-    @Test
-    public void testSetOFControllers() throws Exception {
-        Thread.sleep(5000);
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-
-        // 1. Check for the ovsdb Connection as seen by the Plugin layer
-        assertNotNull(connectionService.getNodes());
-        assertTrue(connectionService.getNodes().size() > 0);
-        Node node = connectionService.getNodes().get(0);
-        Connection connection = connectionService.getConnection(node);
-        assertNotNull(connection);
-
-        // 2. Create a bridge with a valid parent_uuid & Assert to make sure the return status is success.
-        final StatusWithUuid status = insertBridge(connection, getOpenVSwitchTableUUID(connection));
-        assertTrue(status.isSuccess());
-
-        // Thread.sleep(3000);  // wait for _real_ controller to be added to bridge... or not (see below **)
-
-        // 3. Test against bug 960: Add same controller multiple times and make sure we do not end up with duplicates.
-        ovsdbConfigurationService.setOFController(node, status.getUuid().toString());
-        ovsdbConfigurationService.setOFController(node, status.getUuid().toString());
-        ovsdbConfigurationService.setOFController(node, status.getUuid().toString());
-        ovsdbConfigurationService.setOFController(node, status.getUuid().toString());
-
-        Row bridgeRow = ovsdbConfigurationService.getRow(node,
-                                                  ovsdbConfigurationService.getTableName(node, Bridge.class),
-                                                  status.getUuid().toString());
-        assertNotNull(bridgeRow);
-        Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, bridgeRow);
-        assertTrue(bridge.getUuid().equals(status.getUuid()));
-
-        final int currControllersSize = bridge.getControllerColumn().getData().size();
-
-        LOG.debug("Bridge has {} controllers", currControllersSize);
-
-        // ** Note: we assert against 2 or less -- instead of 1 -- to account for the _real_ controller's connection
-        assertTrue( "Too few controllers added to bridge object. Is this bug 960?", currControllersSize >= 1 );
-        assertTrue( "Too many controllers added to bridge object. Is this bug 960?", currControllersSize <= 2 );
-
-        // Removal of bridge created in this test is done via tearDown(). It is done that way, so cleanup is ran
-        // even if test fails.
-    }
-
-    @After
-    public void tearDown() throws InterruptedException {
-        Thread.sleep(5000);
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-
-        if (connectionService.getNodes() == null) {
-            return;  // no nodes: noop
-        }
-
-        int bridgesRemoved = 0;
-        List<Node> nodes = connectionService.getNodes();
-        for (Node node : nodes) {
-            Map<String, Row> bridgeRows =
-                    ovsdbConfigurationService.getRows(node, ovsdbConfigurationService.getTableName(node, Bridge.class));
-            if (bridgeRows == null) {
-                continue;
-            }
-            for (Row bridgeRow : bridgeRows.values()) {
-                Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, bridgeRow);
-                LOG.trace("Test clean up removing Bridge {}", bridge.getUuid());
-                Status delStatus = ovsdbConfigurationService.deleteRow(node,
-                                                                bridge.getSchema().getName(),
-                                                                bridge.getUuid().toString());
-                assertTrue(delStatus.isSuccess());
-                bridgesRemoved++;
-            }
-        }
-
-        if (bridgesRemoved > 0) {
-            LOG.debug("Test clean up removed {} bridges", bridgesRemoved);
-            Thread.sleep(2000); // TODO : Remove this Sleep once the Select operation is resolved.
-        }
-    }
-
-    public void endToEndApiTest(Connection connection, String parentUuid) throws Exception {
-        // 1. Print Cache and Assert to make sure the bridge is not created yet.
-        printCache();
-
-        // 2. Create a bridge with a valid parent_uuid & Assert to make sure the return status is success.
-        StatusWithUuid status = insertBridge(connection, parentUuid);
-        assertTrue(status.isSuccess());
-
-        Thread.sleep(2000); // TODO : Remove this Sleep once the Select operation is resolved.
-
-        // 3. Assert to make sure the bridge is created with a valid Uuid.
-        printCache();
-        Bridge bridge = connection.getClient().getTypedRowWrapper(Bridge.class, null);
-        Row bridgeRow = ovsdbConfigurationService.getRow(node, bridge.getSchema().getName(), status.getUuid().toString());
-        assertNotNull(bridgeRow);
-        bridge = connection.getClient().getTypedRowWrapper(Bridge.class, bridgeRow);
-        assertEquals(bridge.getUuid(), status.getUuid());
-
-        // 4. Delete the bridge & Assert to make sure the return status is success.
-        Status delStatus = ovsdbConfigurationService.deleteRow(node, bridge.getSchema().getName(), status.getUuid().toString());
-        assertTrue(delStatus.isSuccess());
-        Thread.sleep(2000); // TODO : Remove this Sleep once the Select operation is resolved.
-
-        // 5. Assert to make sure the bridge is deleted
-        bridgeRow = ovsdbConfigurationService.getRow(node, bridge.getSchema().getName(), status.getUuid().toString());
-        assertNull(bridgeRow);
-    }
-
-    public StatusWithUuid insertBridge(Connection connection, String parentUuid) throws Exception {
-        Bridge bridge = connection.getClient().createTypedRowWrapper(Bridge.class);
-        bridge.setName("br_test1");
-        bridge.setStatus(ImmutableMap.of("key", "value"));
-        bridge.setFloodVlans(Sets.newHashSet(34L));
-        return ovsdbConfigurationService.insertRow(node, bridge.getSchema().getName(), parentUuid, bridge.getRow());
-    }
-
-    public String getOpenVSwitchTableUUID(Connection connection) throws Exception {
-        OpenVSwitch openVSwitch = connection.getClient().getTypedRowWrapper(OpenVSwitch.class, null);
-        ConcurrentMap<String, Row> row = ovsdbConfigurationService.getRows(node, openVSwitch.getSchema().getName());
-        if (row == null || row.size() == 0) {
-            return null;
-        }
-        return (String)row.keySet().toArray()[0];
-    }
-
-    public void printCache() throws Exception {
-        List<String> tables = ovsdbConfigurationService.getTables(node);
-        System.out.println("Tables = "+tables);
-        assertNotNull(tables);
-        for (String table : tables) {
-            System.out.println("Table "+table);
-            ConcurrentMap<String,Row> row = ovsdbConfigurationService.getRows(node, table);
-            System.out.println(row);
-        }
-    }
-
-    public class FakeListener implements OvsdbInventoryListener {
-
-        @Override
-        public void nodeAdded(Node node, InetAddress address, int port) {
-
-        }
-
-        @Override
-        public void nodeRemoved(Node node) {
-
-        }
-
-        @Override
-        public void rowAdded(Node node, String tableName, String uuid, Row row) {
-
-        }
-
-        @Override
-        public void rowUpdated(Node node, String tableName, String uuid, Row old, Row row) {
-
-        }
-
-        @Override
-        public void rowRemoved(Node node, String tableName, String uuid, Row row, Object context) {
-
-        }
-    }
-
-}
diff --git a/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginV3IT.java b/integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/plugin/OvsdbPluginV3IT.java
deleted file mode 100644 (file)
index 6c3370d..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (c) 2014 Red Hat, 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
- *
- * Authors : Madhu Venugopal
- */
-package org.opendaylight.ovsdb.integrationtest.plugin;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperty;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
-
-import javax.inject.Inject;
-
-import org.apache.felix.dm.Component;
-import org.apache.felix.dm.DependencyManager;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.opendaylight.ovsdb.integrationtest.ConfigurationBundles;
-import org.opendaylight.ovsdb.integrationtest.OvsdbIntegrationTestBase;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.OvsdbConnectionInfo;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.plugin.api.StatusCode;
-import org.opendaylight.ovsdb.plugin.api.StatusWithUuid;
-import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
-import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-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.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerSuite;
-import org.ops4j.pax.exam.util.PathUtils;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
-
-@Ignore
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerSuite.class)
-public class OvsdbPluginV3IT extends OvsdbIntegrationTestBase {
-    private static final Logger LOG = LoggerFactory.getLogger(OvsdbPluginV3IT.class);
-    @Inject
-    private BundleContext bc;
-    private OvsdbConfigurationService ovsdbConfigurationService = null;
-    private String databaseName = "Open_vSwitch";
-
-    @Inject
-    private OvsdbInventoryService ovsdbInventoryService;
-
-    private Node node = null;
-    private OvsdbClient client = null;
-
-    // Configure the OSGi container
-    @Configuration
-    public Option[] config() {
-        return options(
-            //
-            systemProperty("logback.configurationFile").value(
-                    "file:" + PathUtils.getBaseDir()
-                    + "/src/test/resources/logback.xml"
-            ),
-            // To start OSGi console for inspection remotely
-            systemProperty("osgi.console").value("2401"),
-
-            propagateSystemProperty("ovsdbserver.ipaddress"),
-            propagateSystemProperty("ovsdbserver.port"),
-
-            ConfigurationBundles.mdsalBundles(),
-            ConfigurationBundles.controllerBundles(),
-            ConfigurationBundles.ovsdbLibraryBundles(),
-            ConfigurationBundles.ovsdbDefaultSchemaBundles(),
-            ConfigurationBundles.ovsdbPluginBundles()
-        );
-    }
-
-    @Before
-    public void setUp () throws ExecutionException, InterruptedException, IOException {
-        areWeReady(bc);
-    }
-
-    public void getConnection () throws InterruptedException {
-        try {
-            node = getPluginTestConnection();
-        } catch (Exception e) {
-            fail("Exception : "+e.getMessage());
-        }
-        this.ovsdbConfigurationService = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class, this);
-    }
-
-    @Test
-    public void apiTests() throws Exception {
-        getConnection();
-        assertNotNull("Node should not be null", node);
-        assertNotNull("OvsdbConfigurationService should not be null", ovsdbConfigurationService);
-
-        Thread.sleep(1000);
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-
-        // Check for the ovsdb Connection as seen by the Plugin layer
-        assertNotNull(connectionService.getNodes());
-        assertTrue(connectionService.getNodes().size() > 0);
-        Node node = connectionService.getNodes().get(0);
-        Connection connection = connectionService.getConnection(node);
-        OvsdbConnectionInfo connectionInfo = connection.getClient().getConnectionInfo();
-        String identifier = IDENTIFIER;
-        if (connectionInfo.getType().equals(OvsdbConnectionInfo.ConnectionType.PASSIVE)) {
-            identifier = connectionInfo.getRemoteAddress().getHostAddress()+":"+connectionInfo.getRemotePort();
-        }
-        assertEquals(node, connectionService.getNode("OVS|" + identifier));
-        LOG.info("Nodes = {}", connectionService.getNodes());
-        /*
-         * Test sequence :
-         * 1. Print Cache and Assert to make sure the bridge is not created yet.
-         * 2. Create a bridge with a valid parent_uuid & Assert to make sure the return status is success.
-         * 3. Assert to make sure the bridge is created with a valid Uuid.
-         * 4. Delete the bridge & Assert to make sure the return status is success.
-         * 5. Assert to make sure the bridge is deleted
-         */
-
-        this.endToEndApiTest(connection, getOpenVSwitchTableUUID(connection));
-    }
-
-    @Test
-    public void testInventoryListeners() throws UnknownHostException {
-        DependencyManager dm = new DependencyManager(bc);
-
-        OvsdbInventoryListener listenerA = Mockito.mock(FakeListener.class);
-        OvsdbInventoryListener listenerB = Mockito.mock(FakeListener.class);
-
-        Component componentA = dm.createComponent();
-        componentA.setInterface(OvsdbInventoryListener.class.getName(), null);
-        componentA.setImplementation(listenerA);
-        dm.add(componentA);
-
-        Component componentB = dm.createComponent();
-        componentB.setInterface(OvsdbInventoryListener.class.getName(), null);
-        componentB.setImplementation(listenerB);
-        dm.add(componentB);
-
-        NodeId nodeId = new NodeId("OVS|10.10.10.10:65342");
-        NodeKey nodeKey = new NodeKey(nodeId);
-        node = new NodeBuilder()
-                .setId(nodeId)
-                .setKey(nodeKey)
-                .build();
-
-        InetAddress address = InetAddress.getByName("10.10.10.10");
-        int port = 65342;
-
-        // Trigger event
-        ovsdbInventoryService.notifyNodeAdded(node, address, port);
-
-        Mockito.verify(listenerA, Mockito.times(1)).nodeAdded(node, address, port);
-        Mockito.verify(listenerB, Mockito.times(1)).nodeAdded(node, address, port);
-
-        dm.remove(componentA);
-        dm.remove(componentB);
-    }
-
-    public void endToEndApiTest(Connection connection, String parentUuid) throws Exception {
-        // 1. Print Cache and Assert to make sure the bridge is not created yet.
-        printCache();
-
-        // 2. Create a bridge with a valid parent_uuid & Assert to make sure the return status is success.
-        StatusWithUuid status = insertBridge(connection, parentUuid);
-        assertTrue(status.isSuccess());
-
-        // 3. Assert to make sure the bridge is created with a valid Uuid.
-        printCache();
-        Bridge bridge = connection.getClient().getTypedRowWrapper(Bridge.class, null);
-        Row bridgeRow = ovsdbConfigurationService.getRow(node, databaseName, bridge.getSchema().getName(), status.getUuid());
-        assertNotNull(bridgeRow);
-        bridge = connection.getClient().getTypedRowWrapper(Bridge.class, bridgeRow);
-        LOG.info("Bridge UUID {} Status Uuid {}", bridge.getUuid(), status.getUuid());
-        assertEquals(bridge.getUuid(), status.getUuid());
-
-        bridge = connection.getClient().createTypedRowWrapper(Bridge.class);
-        bridge.setDatapathType("netdev");
-        try {
-            ovsdbConfigurationService.updateRow(node, databaseName, bridge.getSchema().getName(), status.getUuid(), bridge.getRow(), false);
-        } catch (Exception e) {
-            fail("Failed to updated Bridge "+e.getMessage());
-        }
-
-        // 4. Delete the bridge & Assert to make sure the return status is success.
-        try {
-            ovsdbConfigurationService.deleteRow(node, databaseName, bridge.getSchema().getName(), null, new UUID(parentUuid) ,null, status.getUuid());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-
-        // 5. Assert to make sure the bridge is deleted
-        bridgeRow = ovsdbConfigurationService.getRow(node, databaseName, bridge.getSchema().getName(), status.getUuid());
-        assertNull(bridgeRow);
-    }
-
-    public StatusWithUuid insertBridge(Connection connection, String parentUuid) throws Exception {
-        Bridge bridge = connection.getClient().createTypedRowWrapper(Bridge.class);
-        bridge.setName("br_test1");
-        bridge.setStatus(ImmutableMap.of("key", "value"));
-        bridge.setFloodVlans(Sets.newHashSet(34L));
-        try {
-        Row<GenericTableSchema> row = ovsdbConfigurationService.insertTree(node, databaseName, bridge.getSchema().getName(), new UUID(parentUuid), bridge.getRow());
-        bridge = connection.getClient().getTypedRowWrapper(Bridge.class, row);
-        return new StatusWithUuid(StatusCode.SUCCESS, bridge.getUuid());
-        } catch (Exception e) {
-            return new StatusWithUuid(StatusCode.INTERNALERROR);
-        }
-    }
-
-    public String getOpenVSwitchTableUUID(Connection connection) throws Exception {
-        OpenVSwitch openVSwitch = connection.getClient().getTypedRowWrapper(OpenVSwitch.class, null);
-        ConcurrentMap<UUID, Row<GenericTableSchema>> rows = ovsdbConfigurationService.getRows(node, databaseName, openVSwitch.getSchema().getName());
-        if (rows == null || rows.size() == 0) {
-            return null;
-        }
-        return rows.keySet().toArray()[0].toString();
-    }
-
-    public void printCache() throws Exception {
-        List<String> tables = ovsdbConfigurationService.getTables(node, databaseName);
-        LOG.info("Tables = {}", tables);
-        assertNotNull(tables);
-        for (String table : tables) {
-            LOG.info("Table {}", table);
-            ConcurrentMap<UUID, Row<GenericTableSchema>> rows = ovsdbConfigurationService.getRows(node, databaseName, table);
-            LOG.info(rows.toString());
-        }
-    }
-
-    public class FakeListener implements OvsdbInventoryListener {
-
-        @Override
-        public void nodeAdded(Node node, InetAddress address, int port) {
-
-        }
-
-        @Override
-        public void nodeRemoved(Node node) {
-
-        }
-
-        @Override
-        public void rowAdded(Node node, String tableName, String uuid, Row row) {
-
-        }
-
-        @Override
-        public void rowUpdated(Node node, String tableName, String uuid, Row old, Row row) {
-
-        }
-
-        @Override
-        public void rowRemoved(Node node, String tableName, String uuid, Row row, Object context) {
-
-        }
-    }
-
-}
diff --git a/integrationtest/src/test/resources/northbound.yaml b/integrationtest/src/test/resources/northbound.yaml
deleted file mode 100644 (file)
index c6c1981..0000000
+++ /dev/null
@@ -1,520 +0,0 @@
-# This file contains test cases for the OVSDB Northbound API
-# The ordering of the test data MUST be as follows:
-#   name:
-#   operation:
-#   uri:
-#   json:
-#   expected:
-#
-# The tests are run in the order specified in this file
-# The following variables are permitted in the URI or JSON:
-#
-# ${node} = The node identifier
-# ${uuid} = The last UUID returned by a POST operation
-# ${bridge_uuid} = The UUID of the test bridge
-# ${port_uuid} = The UUID of the test port
----
-- name: testGetBridgeRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows
-  json:
-  expected: 200
-
-- name: testGetPortRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows
-  json:
-  expected: 200
-
-- name: testGetInterfaceRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows
-  json:
-  expected: 200
-
-- name: testGetControllerRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows
-  json:
-  expected: 200
-
-- name: testGetSslRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows
-  json:
-  expected: 200
-
-- name: testGetSflowRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows
-  json:
-  expected: 200
-
-- name: testGetQosRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows
-  json:
-  expected: 200
-
-- name: testGetQueueRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows
-  json:
-  expected: 200
-
-- name: testGetNetflowRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows
-  json:
-  expected: 200
-
-- name: testGetManagerRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows
-  json:
-  expected: 200
-
-- name: testGetOpenVswitchRows
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/open_vswitch/rows
-  json:
-  expected: 200
-
-# Bridge
-
-- name: testCreateBridge
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows
-  json: >
-    {
-      "row": {
-        "Bridge": {
-        "name": "bridge1",
-        "datapath_type": "OPENFLOW"
-        }
-     }
-    }
-  expected: 201
-
-- name: testGetBridgeRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateBridgeRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows/${uuid}
-  json: >
-    {
-      "row": {
-        "Bridge": {
-          "stp_enable": true
-        }
-     }
-    }
-  expected: 200
-
-# Port
-
-- name: testCreatePort
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows
-  json: >
-    {
-      "parent_uuid":"${bridge_uuid}",
-        "row":{
-          "Port":{
-            "name":"testPort1"
-          }
-        }
-    }
-  expected: 201
-
-- name: testGetPortRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdatePortRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows/${uuid}
-  json: >
-    {
-       "row": {
-         "Port": {
-            "fake_bridge": true
-         }
-       }
-    }
-  expected: 200
-
-# Interface
-
-- name: testCreateInteface
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows
-  json: >
-    {
-      "parent_uuid": "${port_uuid}",
-        "row":{
-          "Interface":{
-            "name":"testInterface",
-            "admin_state":"up"
-        }
-      }
-    }
-  expected: 201
-
-- name: testGetInterfaceRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateInterfaceRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows/${uuid}
-  json: >
-    {
-      "row":{
-        "Interface":{
-          "type": "gre"
-        }
-      }
-    }
-  expected: 200
-
-- name: testDeleteInterfaceRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows/${uuid}
-  json:
-  expected: 204
-
-# Controller
-
-- name: testCreateController
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows
-  json: >
-    {
-      "parent_uuid" : "${bridge_uuid}",
-      "row" : {
-        "Controller": {
-          "target": "1.1.1.1"
-            }
-        }
-    }
-  expected: 201
-
-- name: testGetControllerRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateControllerRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows/${uuid}
-  json: >
-    {
-      "row":{
-        "Controller":{
-          "is_connected": false
-        }
-      }
-    }
-  expected: 200
-
-- name: testDeleteControllerRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows/${uuid}
-  json:
-  expected: 204
-
-# SSL
-
-- name: testCreateSslRow
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows
-  json: >
-    {
-        "row":{
-          "SSL":{
-            "name":"mySSL",
-            "ca_cert" : "ca_cert",
-            "bootstrap_ca_cert" : true,
-            "certificate":"pieceofpaper",
-            "private_key" : "private"
-          }
-        }
-    }
-  expected: 201
-
-- name: testGetSslRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateSslRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows/${uuid}
-  json: >
-    {
-      "row":{
-        "SSL":{
-          "private_key" : "secret"
-        }
-      }
-    }
-  expected: 200
-
-- name: testDeleteSslRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows/${uuid}
-  json:
-  expected: 204
-
-# sFlow
-
-- name: testCreateSflowRow
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows
-  json: >
-    {
-      "parent_uuid": "${bridge_uuid}",
-      "row": {
-        "sFlow": {
-          "targets": [
-            "set",
-            [
-              "targets_string"
-            ]
-          ]
-        }
-      }
-    }
-  expected: 201
-
-- name: testGetSflowRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateSflowRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows/${uuid}
-  json: >
-    {
-      "row":{
-        "sFlow":{
-          "targets": [
-            "set",
-            [
-              "targets_string",
-              "second_target"
-            ]
-          ]
-        }
-      }
-    }
-  expected: 200
-
-- name: testDeleteSflowRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows/${uuid}
-  json:
-  expected: 204
-
-# QoS
-
-- name: testCreateQosRow
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows
-  json: >
-    {
-      "parent_uuid" : "${port_uuid}",
-      "row" : {
-        "QoS": {
-          "type": "linux-htb"
-        }
-      }
-    }
-  expected: 201
-
-- name: testGetQosRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateQosRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows/${uuid}
-  json: >
-    {
-      "row":{
-        "QoS":{
-          "type": "linux-hfsc"
-        }
-      }
-    }
-  expected: 200
-
-# Queue
-
-- name: testCreateQueueRow
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows
-  json: >
-    {
-      "parent_uuid": "${qos_uuid}",
-      "row": {
-        "Queue": {
-          "dscp" : [
-          "set",
-          [
-              25
-            ]
-          ]
-        }
-      }
-    }
-  expected: 201
-
-- name: testGetQueueRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateQueueRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows/${uuid}
-  json: >
-    {
-      "row":{
-        "Queue":{
-          "other_config" : [
-            "map", ["foo", "bar" ]
-          ]
-        }
-      }
-    }
-  expected: 200
-
-- name: testDeleteQueueRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows/${uuid}
-  json:
-  expected: 204
-
-# NetFlow
-
-- name: testCreateNetflowRow
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows
-  json: >
-    {
-      "parent_uuid":"${bridge_uuid}",
-      "row" : {
-        "NetFlow":{
-          "targets" : [
-            "set", ["192.168.1.102:9998"]],
-          "active_timeout" : "0"
-          }
-      }
-    }
-  expected: 201
-
-- name: testGetNetflowRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateNetflowRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows/${uuid}
-  json: >
-    {
-      "row" : {
-        "NetFlow":{
-          "targets" : [
-            "set", ["192.168.1.102:9998", "192.168.2.102:9998"]]
-          }
-      }
-    }
-  expected: 200
-
-- name: testDeleteNetflowRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows/${uuid}
-  json:
-  expected: 204
-
-# Manager
-
-- name: testCreateManagerRow
-  operation: POST
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows
-  json: >
-    {
-      "parent_uuid":"${ovs_uuid}",
-        "row":{
-          "Manager":{
-            "target":"a_string",
-            "is_connected": true,
-            "state":"active"
-          }
-        }
-    }
-  expected: 201
-
-- name: testGetManagerRow
-  operation: GET
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows/${uuid}
-  json:
-  expected: 200
-
-- name: testUpdateManagerRow
-  operation: PUT
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows/${uuid}
-  json: >
-    {
-        "row":{
-          "Manager":{
-            "is_connected": false
-          }
-        }
-    }
-  expected: 200
-
-- name: testDeleteManagerRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows/${uuid}
-  json:
-  expected: 204
-
-# Cleanup
-
-- name: testDeleteQosRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows/${qos_uuid}
-  json:
-  expected: 204
-
-- name: testDeletePortRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows/${port_uuid}
-  json:
-  expected: 204
-
-- name: testDeleteBridgeRow
-  operation: DELETE
-  uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows/${bridge_uuid}
-  json:
-  expected: 204
index 6aa1ac0529daf3a2fd5d859c9ac0aee4f4fdd44b..6a0c3294dd2fa4499a8653e60317b5043ce90d65 100644 (file)
@@ -21,10 +21,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <maven>3.1.1</maven>
   </prerequisites>
   <properties>
+    <mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
     <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
-    <restconf.version>1.3.0-SNAPSHOT</restconf.version>
     <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
-    <dlux.version>0.3.0-SNAPSHOT</dlux.version>
     <configfile.directory>etc/opendaylight/karaf</configfile.directory>
   </properties>
   <dependencyManagement>
@@ -57,18 +56,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <scope>runtime</scope>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.netconf</groupId>
-      <artifactId>features-restconf</artifactId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>features-mdsal-model</artifactId>
+      <version>${mdsal.model.version}</version>
       <classifier>features</classifier>
-      <version>${restconf.version}</version>
-      <type>xml</type>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.dlux</groupId>
-      <artifactId>features-dlux</artifactId>
-      <classifier>features</classifier>
-      <version>${dlux.version}</version>
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
index 30dcae47375da9c68546c286ffbba0a691fd4114..07ede6d877df0ad70685d9b5338b3c90ebb9af4e 100644 (file)
@@ -12,11 +12,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
           xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
   <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
   <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
-  <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
-  <repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
   <feature name='odl-ovsdb-library' version='${project.version}' description='OpenDaylight :: library'>
     <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
-    <feature version='${yangtools.version}'>odl-yangtools-models</feature>
+    <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
     <bundle>mvn:org.opendaylight.ovsdb/library/${project.version}</bundle>
     <!-- Test only (move to another feature) -->
     <bundle>mvn:org.opendaylight.ovsdb/utils.servicehelper/${project.version}</bundle>
index 20f559465180c50be311e43cdb3968b68d7116c7..557d17db5486c2e73fabf3d6c7c9926ba9d95abd 100644 (file)
@@ -117,21 +117,19 @@ public class JsonRpcDecoder extends ByteToMessageDecoder {
                 break;
             }
 
-            if (index - buf.readerIndex() >= maxFrameLength) {
-                /*
-                 * Changing this limit to being a warning, we do not wish to "break" in scale environment
-                 * and currently this limits the ovs of having only around 50 ports defined...
-                 * I do acknowledge the fast that this might be risky in case of huge amount of strings
-                 * in which the controller can crash with an OOM, however seems that we need a really huge
-                 * ovs to reach that limit.
-                 */
-
-                //We do not want to issue a log message on every extent of the buffer
-                //hence logging only once
-                if (!maxFrameLimitWasReached) {
-                    maxFrameLimitWasReached = true;
-                    LOG.warn("***** OVSDB Frame limit of {} bytes has been reached! *****", this.maxFrameLength);
-                }
+            /*
+             * Changing this limit to being a warning, we do not wish to "break" in scale environment
+             * and currently this limits the ovs of having only around 50 ports defined...
+             * I do acknowledge the fast that this might be risky in case of huge amount of strings
+             * in which the controller can crash with an OOM, however seems that we need a really huge
+             * ovs to reach that limit.
+             */
+
+            //We do not want to issue a log message on every extent of the buffer
+            //hence logging only once
+            if (index - buf.readerIndex() >= maxFrameLength && !maxFrameLimitWasReached) {
+                maxFrameLimitWasReached = true;
+                LOG.warn("***** OVSDB Frame limit of {} bytes has been reached! *****", this.maxFrameLength);
             }
         }
 
index bc518941e1c1184b79fff6d246c9d8853e366e38..3185feff5f6cc37932a51c0f4d1b597834194292 100644 (file)
@@ -13,15 +13,13 @@ import java.io.IOException;
 import org.opendaylight.ovsdb.lib.notation.Condition;
 
 import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 public class ConditionSerializer extends JsonSerializer<Condition> {
     @Override
     public void serialize(Condition condition, JsonGenerator generator,
-        SerializerProvider provider) throws IOException,
-            JsonProcessingException {
+        SerializerProvider provider) throws IOException {
         generator.writeStartArray();
         generator.writeString(condition.getColumn());
         generator.writeString(condition.getFunction().toString());
index c0bce1b7eed630f8566038803cec2e0e412b1840..0a43b41286d7456b5c4bf4eb6e4bff1718387682 100644 (file)
@@ -26,6 +26,10 @@ public class Converter {
     static SetDeser setDeser = new SetDeser();
     static UpdateNotificationDeser unDeser = new UpdateNotificationDeser();
 
+    private Converter() {
+        // Prevent instantiating a utility class
+    }
+
     public static class MapConverter extends StdConverter<JsonNode, OvsdbMap<Object, Object>> {
         @Override
         public OvsdbMap<Object, Object> convert(JsonNode value) {
@@ -49,30 +53,28 @@ public class Converter {
 
     static class MapDeser {
         public OvsdbMap<Object, Object> deserialize(JsonNode node) {
-            if (node.isArray()) {
-                if (node.size() == 2) {
-                    if (node.get(0).isTextual() && "map".equals(node.get(0).asText())) {
-                        OvsdbMap<Object, Object> map = new OvsdbMap<Object, Object>();
-                        for (JsonNode pairNode : node.get(1)) {
-                            if (pairNode.isArray() && node.size() == 2) {
-                                Object key = atomDeser.deserialize(pairNode.get(0));
-                                Object value = atomDeser.deserialize(pairNode.get(1));
-                                map.put(key, value);
-                            }
+            if (node.isArray() && node.size() == 2) {
+                if (node.get(0).isTextual() && "map".equals(node.get(0).asText())) {
+                    OvsdbMap<Object, Object> map = new OvsdbMap<>();
+                    for (JsonNode pairNode : node.get(1)) {
+                        if (pairNode.isArray() && node.size() == 2) {
+                            Object key = atomDeser.deserialize(pairNode.get(0));
+                            Object value = atomDeser.deserialize(pairNode.get(1));
+                            map.put(key, value);
                         }
-                        return map;
-                    } else if (node.size() == 0) {
-                        return null;
                     }
+                    return map;
+                } else if (node.size() == 0) {
+                    return null;
                 }
             }
-            throw new RuntimeException("not a map type");
+            throw new IllegalArgumentException("not a map type");
         }
     }
 
     static class SetDeser {
         public OvsdbSet<Object> deserialize(JsonNode node) {
-            OvsdbSet<Object> set = new OvsdbSet<Object>();
+            OvsdbSet<Object> set = new OvsdbSet<>();
             if (node.isArray()) {
                 if (node.size() == 2) {
                     if (node.get(0).isTextual() && "set".equals(node.get(0).asText())) {
@@ -97,16 +99,14 @@ public class Converter {
     static class UpdateNotificationDeser {
         public UpdateNotification deserialize(JsonNode node) {
             UpdateNotification un = new UpdateNotification();
-            if (node.isArray()) {
-                if (node.size() == 2) {
-                    un.setContext(node.get(0).asText());
-                    un.setUpdates(node.get(1));
-                    ObjectMapper objectMapper = new ObjectMapper();
-                    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-                    TableUpdates updates = objectMapper.convertValue(node.get(1), TableUpdates.class);
-                    un.setUpdate(updates);
-                    return un;
-                }
+            if (node.isArray() && node.size() == 2) {
+                un.setContext(node.get(0).asText());
+                un.setUpdates(node.get(1));
+                ObjectMapper objectMapper = new ObjectMapper();
+                objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+                TableUpdates updates = objectMapper.convertValue(node.get(1), TableUpdates.class);
+                un.setUpdate(updates);
+                return un;
             }
             return null;
         }
@@ -132,13 +132,12 @@ public class Converter {
                 }
             }
 
-            if (node.isArray() && node.get(0).isTextual()) {
-                if ("uuid".equals(node.get(0).asText()) || "named-uuid".equals(node.get(0).asText())) {
-                    return new UUID(node.get(1).asText());
-                }
+            if (node.isArray() && node.get(0).isTextual()
+                    && ("uuid".equals(node.get(0).asText()) || "named-uuid".equals(node.get(0).asText()))) {
+                return new UUID(node.get(1).asText());
             }
 
-            throw new RuntimeException("not an atom node");
+            throw new IllegalArgumentException("not an atom node");
         }
     }
 }
index 2bc56694495df380d9a0b10712d4c335e7c2901d..127c6f364c61e62e3d85544989ea19c9bc357c59 100644 (file)
@@ -13,15 +13,13 @@ import java.io.IOException;
 import org.opendaylight.ovsdb.lib.notation.Mutation;
 
 import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 public class MutationSerializer extends JsonSerializer<Mutation> {
     @Override
     public void serialize(Mutation condition, JsonGenerator generator,
-        SerializerProvider provider) throws IOException,
-            JsonProcessingException {
+        SerializerProvider provider) throws IOException {
         generator.writeStartArray();
         generator.writeString(condition.getColumn());
         generator.writeString(condition.getMutator().toString());
index b184725e268f5be0b552ebf5998c6879251d2bb8..ee5299363e7cdf427f2f2653f434b98345444448 100644 (file)
@@ -13,15 +13,13 @@ import java.util.Map;
 import org.opendaylight.ovsdb.lib.notation.OvsdbMap;
 
 import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 public class OvsdbMapSerializer extends JsonSerializer<OvsdbMap<?,?>> {
     @Override
     public void serialize(OvsdbMap<?,?> map, JsonGenerator generator,
-        SerializerProvider provider) throws IOException,
-            JsonProcessingException {
+        SerializerProvider provider) throws IOException {
         generator.writeStartArray();
         generator.writeString("map");
         generator.writeStartArray();
index 6675ba8060b3f5ee24ddf3d6f33398a6f53d2080..0c8f7071222366bfbc3387eb0ca5da9fe8f0b03a 100644 (file)
@@ -14,15 +14,13 @@ import java.util.Set;
 import org.opendaylight.ovsdb.lib.notation.OvsdbSet;
 
 import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 public class OvsdbSetSerializer extends JsonSerializer<OvsdbSet<?>> {
     @Override
     public void serialize(OvsdbSet<?> set, JsonGenerator generator,
-        SerializerProvider provider) throws IOException,
-            JsonProcessingException {
+        SerializerProvider provider) throws IOException {
         generator.writeStartArray();
         generator.writeString("set");
         generator.writeStartArray();
index 136ff728aab6332cc6f6599761b29b2525edb3c8..79d0e9e842a1f4ecbb10fd346d051c5907fe2576 100644 (file)
@@ -15,15 +15,13 @@ import org.opendaylight.ovsdb.lib.notation.Column;
 import org.opendaylight.ovsdb.lib.notation.Row;
 
 import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 public class RowSerializer extends JsonSerializer<Row> {
     @Override
     public void serialize(Row row, JsonGenerator generator,
-        SerializerProvider provider) throws IOException,
-            JsonProcessingException {
+        SerializerProvider provider) throws IOException {
         generator.writeStartObject();
         Collection<Column> columns = row.getColumns();
         for (Column<?,?> column : columns) {
index 04ccb312e593e983707faf6f3bcd437aa8587d4c..038165a98057fcbc8bb0200a54ce126de63b193f 100644 (file)
@@ -13,15 +13,13 @@ import java.io.IOException;
 import org.opendaylight.ovsdb.lib.notation.UUID;
 
 import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.SerializerProvider;
 
 public class UUIDSerializer extends JsonSerializer<UUID> {
     @Override
     public void serialize(UUID value, JsonGenerator generator,
-        SerializerProvider provider) throws IOException,
-            JsonProcessingException {
+        SerializerProvider provider) throws IOException {
         generator.writeStartArray();
         try {
             java.util.UUID.fromString(value.toString());
index 1db19b6595240579c4efa2b4a0be44bf62faf904..17d8de0242d80daff33d03ab131fd46d9fec0590 100644 (file)
@@ -23,8 +23,6 @@ import com.fasterxml.jackson.databind.JsonNode;
 public class ColumnSchema<E extends TableSchema<E>, D> {
     String name;
     ColumnType type;
-    boolean ephemeral;
-    boolean mutable;
 
     public ColumnSchema(String name, ColumnType columnType) {
         this.name = name;
@@ -125,9 +123,8 @@ public class ColumnSchema<E extends TableSchema<E>, D> {
     /**
      * Validates the passed in value against the constraints set for this ColumnSchema
      * @param value
-     * @throws java.lang.RuntimeException (validation exception)
      */
-    public D validate(Object value)throws RuntimeException {
+    public D validate(Object value) {
         //todo(type check and validate based on constraints set)
         this.type.validate(value);
         return (D) value;
@@ -146,7 +143,7 @@ public class ColumnSchema<E extends TableSchema<E>, D> {
     }
 
     public Object getNormalizeData(D value) {
-        Object untypedValue = null;
+        Object untypedValue;
         if (value instanceof Set) {
             untypedValue = OvsdbSet.fromSet((Set) value);
         } else if (value instanceof Map) {
index 85c4417eaa2127dbd3d1b5d21f163f90da1be88d..13074387bd54df90f5876fe22b96d574088a68f4 100644 (file)
@@ -164,8 +164,8 @@ public abstract class ColumnType {
         public AtomicColumnType() {
         }
 
-        public AtomicColumnType(BaseType baseType1) {
-            super(baseType1);
+        public AtomicColumnType(BaseType baseType) {
+            super(baseType);
         }
 
         @Override
@@ -173,11 +173,11 @@ public abstract class ColumnType {
             if (json.isObject() && json.has("value")) {
                 return null;
             }
-            BaseType baseType = BaseType.fromJson(json, "key");
+            BaseType jsonBaseType = BaseType.fromJson(json, "key");
 
-            if (baseType != null) {
+            if (jsonBaseType != null) {
 
-                AtomicColumnType atomicColumnType = new AtomicColumnType(baseType);
+                AtomicColumnType atomicColumnType = new AtomicColumnType(jsonBaseType);
 
                 JsonNode node;
                 if ((node = json.get("min")) != null) {
@@ -247,10 +247,10 @@ public abstract class ColumnType {
             if (json.isValueNode() || !json.has("value")) {
                 return null;
             }
-            BaseType keyType = BaseType.fromJson(json, "key");
+            BaseType jsonKeyType = BaseType.fromJson(json, "key");
             BaseType valueType = BaseType.fromJson(json, "value");
 
-            KeyValuedColumnType keyValueColumnType = new KeyValuedColumnType(keyType, valueType);
+            KeyValuedColumnType keyValueColumnType = new KeyValuedColumnType(jsonKeyType, valueType);
             JsonNode node;
             if ((node = json.get("min")) != null) {
                 keyValueColumnType.setMin(node.asLong());
@@ -269,21 +269,19 @@ public abstract class ColumnType {
 
         @Override
         public Object valueFromJson(JsonNode node) {
-            if (node.isArray()) {
-                if (node.size() == 2) {
-                    if (node.get(0).isTextual() && "map".equals(node.get(0).asText())) {
-                        OvsdbMap<Object, Object> map = new OvsdbMap<>();
-                        for (JsonNode pairNode : node.get(1)) {
-                            if (pairNode.isArray() && node.size() == 2) {
-                                Object key = getKeyType().toValue(pairNode.get(0));
-                                Object value = getBaseType().toValue(pairNode.get(1));
-                                map.put(key, value);
-                            }
+            if (node.isArray() && node.size() == 2) {
+                if (node.get(0).isTextual() && "map".equals(node.get(0).asText())) {
+                    OvsdbMap<Object, Object> map = new OvsdbMap<>();
+                    for (JsonNode pairNode : node.get(1)) {
+                        if (pairNode.isArray() && node.size() == 2) {
+                            Object key = getKeyType().toValue(pairNode.get(0));
+                            Object value = getBaseType().toValue(pairNode.get(1));
+                            map.put(key, value);
                         }
-                        return map;
-                    } else if (node.size() == 0) {
-                        return null;
                     }
+                    return map;
+                } else if (node.size() == 0) {
+                    return null;
                 }
             }
             return null;
index 934639f34a0fcbf0fcb1e8b1fd92ae18be568594..d59121e0675a49f6052949c7691e30d5dc507e5c 100644 (file)
@@ -38,6 +38,10 @@ public class TyperUtils {
     private static final String GETCOLUMN_ENDS_WITH = "Column";
     private static final String GETROW_ENDS_WITH = "Row";
 
+    private TyperUtils() {
+        // Prevent instantiating a utility class
+    }
+
     private static <T> String getTableName(Class<T> klazz) {
         TypedTable typedTable = klazz.getAnnotation(TypedTable.class);
         if (typedTable != null) {
@@ -82,58 +86,43 @@ public class TyperUtils {
 
     private static boolean isGetTableSchema(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
-        if (typedColumn != null) {
-            return typedColumn.method().equals(MethodType.GETTABLESCHEMA) ? true : false;
-        }
-        return false;
+        return typedColumn != null && typedColumn.method().equals(MethodType.GETTABLESCHEMA);
     }
 
     private static boolean isGetRow(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
-            return typedColumn.method().equals(MethodType.GETROW) ? true : false;
+            return typedColumn.method().equals(MethodType.GETROW);
         }
 
-        if (method.getName().startsWith(GET_STARTS_WITH) && method.getName().endsWith(GETROW_ENDS_WITH)) {
-            return true;
-        }
-        return false;
+        return method.getName().startsWith(GET_STARTS_WITH) && method.getName().endsWith(GETROW_ENDS_WITH);
     }
 
     private static boolean isGetColumn(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
-            return typedColumn.method().equals(MethodType.GETCOLUMN) ? true : false;
+            return typedColumn.method().equals(MethodType.GETCOLUMN);
         }
 
-        if (method.getName().startsWith(GET_STARTS_WITH) && method.getName().endsWith(GETCOLUMN_ENDS_WITH)) {
-            return true;
-        }
-        return false;
+        return method.getName().startsWith(GET_STARTS_WITH) && method.getName().endsWith(GETCOLUMN_ENDS_WITH);
     }
 
     private static boolean isGetData(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
-            return typedColumn.method().equals(MethodType.GETDATA) ? true : false;
+            return typedColumn.method().equals(MethodType.GETDATA);
         }
 
-        if (method.getName().startsWith(GET_STARTS_WITH) && !method.getName().endsWith(GETCOLUMN_ENDS_WITH)) {
-            return true;
-        }
-        return false;
+        return method.getName().startsWith(GET_STARTS_WITH) && !method.getName().endsWith(GETCOLUMN_ENDS_WITH);
     }
 
     private static boolean isSetData(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
-            return typedColumn.method().equals(MethodType.SETDATA) ? true : false;
+            return typedColumn.method().equals(MethodType.SETDATA);
         }
 
-        if (method.getName().startsWith(SET_STARTS_WITH)) {
-            return true;
-        }
-        return false;
+        return method.getName().startsWith(SET_STARTS_WITH);
     }
 
     public static Version getColumnFromVersion(Method method) {
@@ -183,10 +172,8 @@ public class TyperUtils {
         }
 
         TypedTable typedTable = klazz.getAnnotation(TypedTable.class);
-        if (typedTable != null) {
-            if (!dbSchema.getName().equalsIgnoreCase(typedTable.database())) {
-                return false;
-            }
+        if (typedTable != null && !dbSchema.getName().equalsIgnoreCase(typedTable.database())) {
+            return false;
         }
 
         checkTableSchemaVersion(dbSchema, klazz);
@@ -209,17 +196,13 @@ public class TyperUtils {
     }
 
     private static void checkVersion(Version schemaVersion, Version fromVersion, Version untilVersion) {
-        if (!fromVersion.equals(Version.NULL)) {
-            if (schemaVersion.compareTo(fromVersion) < 0) {
-                String message = SchemaVersionMismatchException.createMessage(schemaVersion, fromVersion);
-                throw new SchemaVersionMismatchException(message);
-            }
+        if (!fromVersion.equals(Version.NULL) && schemaVersion.compareTo(fromVersion) < 0) {
+            String message = SchemaVersionMismatchException.createMessage(schemaVersion, fromVersion);
+            throw new SchemaVersionMismatchException(message);
         }
-        if (!untilVersion.equals(Version.NULL)) {
-            if (schemaVersion.compareTo(untilVersion) > 0) {
-                String message = SchemaVersionMismatchException.createMessage(schemaVersion, untilVersion);
-                throw new SchemaVersionMismatchException(message);
-            }
+        if (!untilVersion.equals(Version.NULL) && schemaVersion.compareTo(untilVersion) > 0) {
+            String message = SchemaVersionMismatchException.createMessage(schemaVersion, untilVersion);
+            throw new SchemaVersionMismatchException(message);
         }
     }
 
@@ -272,7 +255,7 @@ public class TyperUtils {
             row.setTableSchema(getTableSchema(dbSchema, klazz));
         }
         return Reflection.newProxy(klazz, new InvocationHandler() {
-            private Object processGetData(Method method) throws Throwable {
+            private Object processGetData(Method method) {
                 String columnName = getColumnName(method);
                 checkColumnSchemaVersion(dbSchema, method);
                 if (columnName == null) {
@@ -296,11 +279,11 @@ public class TyperUtils {
                 return row.getColumn(columnSchema).getData();
             }
 
-            private Object processGetRow() throws Throwable {
+            private Object processGetRow() {
                 return row;
             }
 
-            private Object processGetColumn(Method method) throws Throwable {
+            private Object processGetColumn(Method method) {
                 String columnName = getColumnName(method);
                 checkColumnSchemaVersion(dbSchema, method);
                 if (columnName == null) {
@@ -326,7 +309,7 @@ public class TyperUtils {
                 return row.getColumn(columnSchema);
             }
 
-            private Object processSetData(Object proxy, Method method, Object[] args) throws Throwable {
+            private Object processSetData(Object proxy, Method method, Object[] args) {
                 if (args == null || args.length != 1) {
                     throw new TyperException("Setter method : " + method.getName() + " requires 1 argument");
                 }
@@ -339,7 +322,7 @@ public class TyperUtils {
                 ColumnSchema<GenericTableSchema, Object> columnSchema =
                         getColumnSchema(tableSchema, columnName, (Class<Object>) args[0].getClass());
                 Column<GenericTableSchema, Object> column =
-                        new Column<GenericTableSchema, Object>(columnSchema, args[0]);
+                        new Column<>(columnSchema, args[0]);
                 row.addColumn(columnName, column);
                 return proxy;
             }
@@ -358,7 +341,7 @@ public class TyperUtils {
                 return (args != null
                         && args.length == 1
                         && method.getName().equals("equals")
-                        && method.getParameterTypes()[0] == Object.class);
+                        && Object.class.equals(method.getParameterTypes()[0]));
             }
             private Boolean isToStringMethod(Method method, Object[] args) {
                 return (args == null || args.length == 0) && method.getName().equals("toString");
@@ -408,7 +391,7 @@ public class TyperUtils {
             }
 
             @Override public String toString() {
-                String tableName = null;
+                String tableName;
                 try {
                     TableSchema<?> schema = (TableSchema<?>)processGetTableSchema();
                     tableName = schema.getName();
@@ -441,15 +424,13 @@ public class TyperUtils {
         Preconditions.checkNotNull(klazz);
         Preconditions.checkNotNull(updates);
         Preconditions.checkNotNull(dbSchema);
-        Map<UUID,T> result = new HashMap<UUID,T>();
+        Map<UUID,T> result = new HashMap<>();
         Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rowUpdates =
                 extractRowUpdates(klazz,updates,dbSchema);
         for (TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema> rowUpdate : rowUpdates.values()) {
-            if (rowUpdate != null) {
-                if (rowUpdate.getNew() != null) {
-                    Row<GenericTableSchema> row = rowUpdate.getNew();
-                    result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
-                }
+            if (rowUpdate != null && rowUpdate.getNew() != null) {
+                Row<GenericTableSchema> row = rowUpdate.getNew();
+                result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
             }
         }
         return result;
@@ -472,15 +453,13 @@ public class TyperUtils {
         Preconditions.checkNotNull(klazz);
         Preconditions.checkNotNull(updates);
         Preconditions.checkNotNull(dbSchema);
-        Map<UUID,T> result = new HashMap<UUID,T>();
+        Map<UUID,T> result = new HashMap<>();
         Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rowUpdates =
                 extractRowUpdates(klazz,updates,dbSchema);
         for (TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema> rowUpdate : rowUpdates.values()) {
-            if (rowUpdate != null) {
-                if (rowUpdate.getOld() != null) {
-                    Row<GenericTableSchema> row = rowUpdate.getOld();
-                    result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
-                }
+            if (rowUpdate != null && rowUpdate.getOld() != null) {
+                Row<GenericTableSchema> row = rowUpdate.getOld();
+                result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
             }
         }
         return result;
@@ -503,15 +482,13 @@ public class TyperUtils {
         Preconditions.checkNotNull(klazz);
         Preconditions.checkNotNull(updates);
         Preconditions.checkNotNull(dbSchema);
-        Map<UUID,T> result = new HashMap<UUID,T>();
+        Map<UUID,T> result = new HashMap<>();
         Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rowUpdates =
                 extractRowUpdates(klazz,updates,dbSchema);
         for (TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema> rowUpdate : rowUpdates.values()) {
-            if (rowUpdate != null) {
-                if (rowUpdate.getNew() == null && rowUpdate.getOld() != null) {
-                    Row<GenericTableSchema> row = rowUpdate.getOld();
-                    result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
-                }
+            if (rowUpdate != null && rowUpdate.getNew() == null && rowUpdate.getOld() != null) {
+                Row<GenericTableSchema> row = rowUpdate.getOld();
+                result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
             }
         }
         return result;
@@ -538,7 +515,7 @@ public class TyperUtils {
         Preconditions.checkNotNull(updates);
         Preconditions.checkNotNull(dbSchema);
         Map<UUID, TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> result =
-                new HashMap<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>>();
+                new HashMap<>();
         TableUpdate<GenericTableSchema> update = updates.getUpdate(TyperUtils.getTableSchema(dbSchema, klazz));
         if (update != null) {
             Map<UUID, TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rows = update.getRows();
diff --git a/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestIT.java b/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestIT.java
new file mode 100644 (file)
index 0000000..32d5f87
--- /dev/null
@@ -0,0 +1,360 @@
+/*
+ * Copyright (C) 2014 EBay Software Foundation
+ *
+ * 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 : Ashwin Raveendran
+ */
+package org.opendaylight.ovsdb.integrationtest.ovsdbclient;
+
+import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.ovsdb.lib.MonitorCallBack;
+import org.opendaylight.ovsdb.lib.OvsdbClient;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestBase;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestUtils;
+import org.opendaylight.ovsdb.lib.message.MonitorRequest;
+import org.opendaylight.ovsdb.lib.message.MonitorRequestBuilder;
+import org.opendaylight.ovsdb.lib.message.MonitorSelect;
+import org.opendaylight.ovsdb.lib.message.TableUpdate;
+import org.opendaylight.ovsdb.lib.message.TableUpdates;
+import org.opendaylight.ovsdb.lib.notation.Column;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.notation.Row;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.operations.OperationResult;
+import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
+import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
+import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
+import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
+import org.opendaylight.ovsdb.lib.schema.TableSchema;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerSuite;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerSuite.class)
+public class OvsdbClientTestIT extends LibraryIntegrationTestBase {
+
+    OvsdbClient ovs;
+    DatabaseSchema dbSchema = null;
+    static String testBridgeName = "br-test";
+    static UUID testBridgeUuid = null;
+
+    /**
+     * Test general OVSDB transactions (viz., insert, select, update,
+     * mutate, comment, delete, where, commit) as well as the special
+     * transactions (viz., abort and assert)
+     */
+    @Test
+    public void testTransact() throws IOException, InterruptedException, ExecutionException {
+        Assert.assertNotNull(dbSchema);
+        TableSchema<GenericTableSchema> bridge = dbSchema.table("Bridge", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
+
+        createBridgeTransaction();
+        abortTransaction();
+        assertTransaction();
+    }
+
+    /**
+     * Test OVS monitor request and reply, with and without specific column filters,
+     * for the Bridge table in the OVSDB. The setup involves creating a test bridge with 5
+     * flood_vlans and 2 key-value pairs, and monitoring the DB update.
+     */
+    @Test
+    public void testMonitorRequest() throws ExecutionException, InterruptedException, IOException {
+        Assert.assertNotNull(dbSchema);
+        // Create Test Bridge before testing the Monitor operation
+        createBridgeTransaction();
+        sendBridgeMonitorRequest(true); // Test monitor request with Column filters
+        sendBridgeMonitorRequest(false); // Test monitor request without filters
+    }
+
+    public void sendBridgeMonitorRequest(boolean filter) throws ExecutionException, InterruptedException, IOException {
+        Assert.assertNotNull(dbSchema);
+        GenericTableSchema bridge = dbSchema.table("Bridge", GenericTableSchema.class);
+
+        List<MonitorRequest<GenericTableSchema>> monitorRequests = Lists.newArrayList();
+        ColumnSchema<GenericTableSchema, Set<Integer>> flood_vlans = bridge.multiValuedColumn("flood_vlans", Integer.class);
+        ColumnSchema<GenericTableSchema, Map<String, String>> externalIds = bridge.multiValuedColumn("external_ids", String.class, String.class);
+        ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
+        MonitorRequestBuilder<GenericTableSchema> builder = MonitorRequestBuilder.builder(bridge);
+        if (filter) {
+            builder.addColumn(bridge.column("name"))
+                   .addColumn(bridge.column("fail_mode", String.class))
+                   .addColumn(flood_vlans)
+                   .addColumn(externalIds);
+        }
+        monitorRequests.add(builder.with(new MonitorSelect(true, true, true, true))
+                                   .build());
+
+        final List<Object> results = Lists.newArrayList();
+
+        TableUpdates updates = ovs.monitor(dbSchema, monitorRequests, new MonitorCallBack() {
+            @Override
+            public void update(TableUpdates result, DatabaseSchema dbSchema) {
+                results.add(result);
+                System.out.println("result = " + result);
+            }
+
+            @Override
+            public void exception(Throwable t) {
+                results.add(t);
+                System.out.println("t = " + t);
+            }
+        });
+        if (updates != null) {
+            results.add(updates);
+        }
+        for (int i = 0; i < 3 ; i++) { //wait 3 seconds to get a result
+            System.out.println("waiting on monitor response for Bridge Table...");
+            if (!results.isEmpty()) {
+                break;
+            }
+            Thread.sleep(1000);
+        }
+
+        Assert.assertTrue(!results.isEmpty());
+        Object result = results.get(0);
+        Assert.assertTrue(result instanceof TableUpdates);
+        updates = (TableUpdates) result;
+        TableUpdate<GenericTableSchema> update = updates.getUpdate(bridge);
+        Assert.assertTrue(update.getRows().size() > 0);
+        for (UUID uuid : update.getRows().keySet()) {
+            Row<GenericTableSchema> aNew = update.getNew(uuid);
+            if (!aNew.getColumn(name).getData().equals(testBridgeName)) {
+                continue;
+            }
+            if (filter) {
+                Assert.assertEquals(builder.getColumns().size(), aNew.getColumns().size());
+            } else {
+                // As per RFC7047, Section 4.1.5 : If "columns" is omitted, all columns in the table, except for "_uuid", are monitored.
+                Assert.assertEquals(bridge.getColumns().size() - 1, aNew.getColumns().size());
+            }
+            for (Column<GenericTableSchema, ?> column: aNew.getColumns()) {
+                if (column.getSchema().equals(flood_vlans)) {
+                    // Test for the 5 flood_vlans inserted in Bridge br-test in createBridgeTransaction
+                    Set<Integer> data = column.getData(flood_vlans);
+                    Assert.assertNotNull(data);
+                    Assert.assertTrue(!data.isEmpty());
+                    Assert.assertEquals(5, data.size());
+                } else if (column.getSchema().equals(externalIds)) {
+                    // Test for the {"key", "value"} external_ids inserted in Bridge br-test in createBridgeTransaction
+                    Map<String, String> data = column.getData(externalIds);
+                    Assert.assertNotNull(data);
+                    Assert.assertNotNull(data.get("key"));
+                    Assert.assertEquals("value", data.get("key"));
+                    // Test for {"key2", "value2"} external_ids mutation-inserted in Bridge br-test in createBridgeTransaction
+                    Assert.assertNotNull(data.get("key2"));
+                    Assert.assertEquals("value2", data.get("key2"));
+                }
+            }
+            return;
+        }
+        Assert.fail("Bridge being monitored :"+testBridgeName+" Not found");
+    }
+
+    /*
+     * TODO : selectOpenVSwitchTableUuid method isn't working as expected due to the Jackson
+     * parsing challenges on the Row object returned by the Select operation.
+     */
+    private UUID selectOpenVSwitchTableUuid() throws ExecutionException, InterruptedException {
+        Assert.assertNotNull(dbSchema);
+        GenericTableSchema ovsTable = dbSchema.table("Open_vSwitch", GenericTableSchema.class);
+
+        List<MonitorRequest<GenericTableSchema>> monitorRequests = Lists.newArrayList();
+        ColumnSchema<GenericTableSchema, UUID> _uuid = ovsTable.column("_uuid", UUID.class);
+
+        List<OperationResult> results = ovs.transactBuilder(dbSchema)
+               .add(op.select(ovsTable)
+                      .column(_uuid))
+                      .execute()
+                      .get();
+
+        Assert.assertTrue(!results.isEmpty());
+        OperationResult result = results.get(0);
+        List<Row<GenericTableSchema>> rows = result.getRows();
+        Row<GenericTableSchema> ovsTableRow = rows.get(0);
+        return ovsTableRow.getColumn(_uuid).getData();
+    }
+
+    private void createBridgeTransaction() throws IOException, InterruptedException, ExecutionException {
+        Assert.assertNotNull(dbSchema);
+        TableSchema<GenericTableSchema> bridge = dbSchema.table("Bridge", GenericTableSchema.class);
+        GenericTableSchema ovsTable = dbSchema.table("Open_vSwitch", GenericTableSchema.class);
+
+        ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
+        ColumnSchema<GenericTableSchema, String> fail_mode = bridge.column("fail_mode", String.class);
+        ColumnSchema<GenericTableSchema, Set<Integer>> flood_vlans = bridge.multiValuedColumn("flood_vlans", Integer.class);
+        ColumnSchema<GenericTableSchema, Map<String, String>> externalIds = bridge.multiValuedColumn("external_ids", String.class, String.class);
+        ColumnSchema<GenericTableSchema, Set<UUID>> bridges = ovsTable.multiValuedColumn("bridges", UUID.class);
+        ColumnSchema<GenericTableSchema, UUID> _uuid = ovsTable.column("_uuid", UUID.class);
+
+        String namedUuid = "br_test";
+        int insertOperationIndex = 0;
+        UUID parentTable = selectOpenVSwitchTableUuid();
+        TransactionBuilder transactionBuilder = ovs.transactBuilder(dbSchema)
+                 /*
+                  * Make sure that the position of insert operation matches the insertOperationIndex.
+                  * This will be used later when the Results are processed.
+                  */
+                .add(op.insert(bridge)
+                        .withId(namedUuid)
+                        .value(name, testBridgeName)
+                        .value(flood_vlans, Sets.newHashSet(100, 101, 4001))
+                        .value(externalIds, ImmutableMap.of("key","value")))
+                .add(op.comment("Inserting Bridge br-int"))
+                .add(op.update(bridge)
+                        .set(fail_mode, "secure")
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.select(bridge)
+                        .column(name)
+                        .column(_uuid)
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.mutate(bridge)
+                        .addMutation(flood_vlans, Mutator.INSERT, Sets.newHashSet(200,400))
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.mutate(bridge)
+                        .addMutation(externalIds, Mutator.INSERT, ImmutableMap.of("key2","value2"))
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.mutate(ovsTable)
+                        .addMutation(bridges, Mutator.INSERT, Sets.newHashSet(new UUID(namedUuid)))
+                        .where(_uuid.opEqual(parentTable))
+                        .build())
+                .add(op.commit(true));
+
+        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        // Check if Results matches the number of operations in transaction
+        Assert.assertEquals(transactionBuilder.getOperations().size(), operationResults.size());
+        System.out.println("Insert & Update operation results = " + operationResults);
+        for (OperationResult result : operationResults) {
+            Assert.assertNull(result.getError());
+        }
+        testBridgeUuid = operationResults.get(insertOperationIndex).getUuid();
+    }
+
+    private void assertTransaction() throws InterruptedException, ExecutionException {
+        Assert.assertNotNull(dbSchema);
+        TableSchema<GenericTableSchema> bridge = dbSchema.table("Bridge", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
+
+        /*
+         * Adding a separate Assert operation in a transaction. Lets not mix this with other
+         * valid transactions as above.
+         */
+        ListenableFuture<List<OperationResult>> results = ovs.transactBuilder(dbSchema)
+                .add(op.delete(bridge)
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.assertion("Assert12345")) // Failing intentionally
+                .execute();
+
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        /* Testing for an Assertion Error */
+        Assert.assertFalse(operationResults.get(1).getError() == null);
+        System.out.println("Assert operation results = " + operationResults);
+    }
+
+    private void abortTransaction() throws InterruptedException, ExecutionException {
+        Assert.assertNotNull(dbSchema);
+        TableSchema<GenericTableSchema> bridge = dbSchema.table("Bridge", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
+
+        /*
+         * Adding a separate Abort operation in a transaction. Lets not mix this with other
+         * valid transactions as above.
+         */
+        ListenableFuture<List<OperationResult>> results = ovs.transactBuilder(dbSchema)
+                .add(op.delete(bridge)
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.abort())
+                .execute();
+
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        /* Testing for Abort Error */
+        Assert.assertFalse(operationResults.get(1).getError() == null);
+        System.out.println("Abort operation results = " + operationResults);
+    }
+
+    public void testGetDBs() throws ExecutionException, InterruptedException {
+        ListenableFuture<List<String>> databases = ovs.getDatabases();
+        List<String> dbNames = databases.get();
+        Assert.assertNotNull(dbNames);
+        boolean hasOpenVswitchSchema = false;
+        for(String dbName : dbNames) {
+           if (dbName.equals(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA)) {
+                hasOpenVswitchSchema = true;
+                break;
+           }
+        }
+        Assert.assertTrue(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA
+                + " schema is not supported by the switch", hasOpenVswitchSchema);
+    }
+
+    @Before
+    public  void setUp() throws IOException, ExecutionException, InterruptedException, TimeoutException {
+        if (ovs != null) {
+            return;
+        }
+
+        ovs = LibraryIntegrationTestUtils.getTestConnection(this);
+        System.out.println("Connection Info :" + ovs.getConnectionInfo().toString());
+        testGetDBs();
+        dbSchema = ovs.getSchema(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA).get();
+    }
+
+    @After
+    public void tearDown() throws InterruptedException, ExecutionException {
+        if (dbSchema == null) {
+            return;
+        }
+        TableSchema<GenericTableSchema> bridge = dbSchema.table("Bridge", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
+        GenericTableSchema ovsTable = dbSchema.table("Open_vSwitch", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, Set<UUID>> bridges = ovsTable.multiValuedColumn("bridges", UUID.class);
+        ColumnSchema<GenericTableSchema, UUID> _uuid = ovsTable.column("_uuid", UUID.class);
+        UUID parentTable = selectOpenVSwitchTableUuid();
+
+        ListenableFuture<List<OperationResult>> results = ovs.transactBuilder(dbSchema)
+                .add(op.delete(bridge)
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.mutate(ovsTable)
+                        .addMutation(bridges, Mutator.DELETE, Sets.newHashSet(testBridgeUuid))
+                        .where(_uuid.opEqual(parentTable))
+                        .build())
+                .add(op.commit(true))
+                .execute();
+
+        List<OperationResult> operationResults = results.get();
+        System.out.println("Delete operation results = " + operationResults);
+        ovs.disconnect();
+    }
+}
diff --git a/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestTypedIT.java b/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestTypedIT.java
new file mode 100644 (file)
index 0000000..15f64fb
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2014 EBay Software Foundation
+ *
+ * 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 : Ashwin Raveendran, Madhu Venugopal
+ */
+
+package org.opendaylight.ovsdb.integrationtest.ovsdbclient;
+
+import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.ovsdb.lib.OvsdbClient;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestBase;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestUtils;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.operations.OperationResult;
+import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
+import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
+import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
+import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
+import org.opendaylight.ovsdb.lib.schema.TableSchema;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerSuite;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerSuite.class)
+public class OvsdbClientTestTypedIT extends LibraryIntegrationTestBase {
+
+    OvsdbClient ovs;
+    DatabaseSchema dbSchema = null;
+    static String testBridgeName = "br_test";
+    static UUID testBridgeUuid = null;
+
+    /**
+     * Test creation of statically typed bridge table as defined in
+     * ovs-vswitchd.conf.db with get/set for all relevant columns. The
+     * SETDATA methods for "name", "status" and "flood_vlans" columns
+     * are verified.
+     */
+    @Test
+    public void testTypedBridgeCreate() throws IOException, InterruptedException, ExecutionException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+        TestBridge rBridge = ovs.createTypedRowWrapper(TestBridge.class);
+        rBridge.setName(testBridgeName);
+        rBridge.setStatus(ImmutableMap.of("key","value"));
+        rBridge.setFloodVlans(Sets.newHashSet(34));
+
+        GenericTableSchema ovsTable = dbSchema.table("Open_vSwitch", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, Set<UUID>> bridges = ovsTable.multiValuedColumn("bridges", UUID.class);
+
+        String namedUuid = "br_test";
+        int insertOperationIndex = 0;
+
+        TransactionBuilder transactionBuilder = ovs.transactBuilder(dbSchema)
+                .add(op.insert(rBridge)
+                        .withId(namedUuid))
+                .add(op.mutate(ovsTable)
+                        .addMutation(bridges, Mutator.INSERT, Sets.newHashSet(new UUID(namedUuid))));
+
+        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        // Check if Results matches the number of operations in transaction
+        Assert.assertEquals(transactionBuilder.getOperations().size(), operationResults.size());
+        System.out.println("Insert & Update operation results = " + operationResults);
+        testBridgeUuid = operationResults.get(insertOperationIndex).getUuid();
+    }
+
+    public void testGetDBs() throws ExecutionException, InterruptedException {
+        ListenableFuture<List<String>> databases = ovs.getDatabases();
+        List<String> dbNames = databases.get();
+        Assert.assertNotNull(dbNames);
+        boolean hasOpenVswitchSchema = false;
+        for(String dbName : dbNames) {
+           if (dbName.equals(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA)) {
+                hasOpenVswitchSchema = true;
+                break;
+           }
+        }
+        Assert.assertTrue(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA
+                + " schema is not supported by the switch", hasOpenVswitchSchema);
+    }
+
+    @Before
+    public  void setUp() throws IOException, ExecutionException, InterruptedException, TimeoutException {
+        if (ovs != null) {
+            return;
+        }
+        ovs = LibraryIntegrationTestUtils.getTestConnection(this);
+        testGetDBs();
+        dbSchema = ovs.getSchema(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA).get();
+    }
+
+    @After
+    public void tearDown() throws InterruptedException, ExecutionException {
+        TableSchema<GenericTableSchema> bridge = dbSchema.table("Bridge", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
+        GenericTableSchema ovsTable = dbSchema.table("Open_vSwitch", GenericTableSchema.class);
+        ColumnSchema<GenericTableSchema, Set<UUID>> bridges = ovsTable.multiValuedColumn("bridges", UUID.class);
+
+        ListenableFuture<List<OperationResult>> results = ovs.transactBuilder(dbSchema)
+                .add(op.delete(bridge)
+                        .where(name.opEqual(testBridgeName))
+                        .build())
+                .add(op.mutate(ovsTable)
+                        .addMutation(bridges, Mutator.DELETE, Sets.newHashSet(testBridgeUuid)))
+                .add(op.commit(true))
+                .execute();
+
+        List<OperationResult> operationResults = results.get();
+        System.out.println("Delete operation results = " + operationResults);
+        ovs.disconnect();
+    }
+}
diff --git a/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/TestBridge.java b/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/TestBridge.java
new file mode 100644 (file)
index 0000000..2ccae3f
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * 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 : Madhu Venugopal
+ */
+
+package org.opendaylight.ovsdb.integrationtest.ovsdbclient;
+
+import java.util.Map;
+import java.util.Set;
+import org.opendaylight.ovsdb.lib.notation.Column;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
+import org.opendaylight.ovsdb.lib.schema.typed.MethodType;
+import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
+import org.opendaylight.ovsdb.lib.schema.typed.TypedColumn;
+import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
+
+/**
+ * Statically Typed Bridge Table as defined in ovs-vswitchd.conf.db
+ */
+
+/*
+ * Interface name was set to TestBridge on purpose to test the @TypeTable annotation
+ * functionality of TyperHelper.java
+ */
+@TypedTable(name="Bridge", database="Open_vSwitch")
+public interface TestBridge extends TypedBaseTable {
+    /*
+     * Its a good practice to set the @TypedColumn to these Statically typed Tables & Columns.
+     * Implementations can choose to use GETDATA or GETCOLUMN or both to get the data.
+     * But GETCOLUMN gives more info on ColumnSchema.
+     * The following "name" column is decorated with both GETDATA and GETCOLUMN and the corresponding test
+     * will test both the options.
+     */
+    @TypedColumn(name="name", method=MethodType.GETDATA)
+    String getName();
+
+    @TypedColumn(name="name", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, String> getNameColumn();
+
+    @TypedColumn(name="name", method=MethodType.SETDATA)
+    void setName(String name);
+
+   /*
+    * Annotations are NOT added to the Status column on purpose to test the backup
+    * functionality on getter, setter, column name derivation etc.  TyperHelper.java.
+    */
+   Column<GenericTableSchema, Map<String, String>> getStatusColumn();
+    void setStatus(Map<String, String> status);
+
+    /*
+     * TypedColumn's name Annotation should override the method name based Column derivation.
+     * The method name and TypedColumn name was kept different on purpose to test the name
+     * resolution priority of TyperHelper.java
+     */
+    @TypedColumn(name="flood_vlans", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<Integer>> getFloodVlansColumn();
+
+    @TypedColumn(name="flood_vlans", method=MethodType.SETDATA)
+    void setFloodVlans(Set<Integer> vlans);
+
+
+    @TypedColumn(name="ports", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<UUID>> getPortsColumn();
+
+    @TypedColumn(name="ports", method=MethodType.SETDATA)
+    void setPorts(Set<UUID> ports);
+
+
+    @TypedColumn(name="mirrors", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<UUID>> getMirrorsColumn();
+
+    @TypedColumn(name="mirrors", method=MethodType.SETDATA)
+    void setMirrors(Set<UUID> mirrors);
+
+
+    @TypedColumn(name="controller", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<UUID>> getControllerColumn();
+
+    @TypedColumn(name="controller", method=MethodType.SETDATA)
+    void setController(Set<UUID> controller);
+
+
+    @TypedColumn(name="datapath_id", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<String>> getDatapathIdColumn();
+
+    @TypedColumn(name="datapath_id", method=MethodType.SETDATA)
+    void setDatapathId(Set<String> datapathId);
+
+
+    @TypedColumn(name="datapath_type", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, String> getDatapathTypeColumn();
+
+    @TypedColumn(name="datapath_type", method=MethodType.SETDATA)
+    void setDatapathType(String datapathType);
+
+
+    @TypedColumn(name="fail_mode", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<String>> getFailModeColumn();
+
+    @TypedColumn(name="fail_mode", method=MethodType.SETDATA)
+    void setFailMode(Set<String> failMode);
+
+
+    @TypedColumn(name="sflow", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<UUID>> getSflowColumn();
+
+    @TypedColumn(name="sflow", method=MethodType.SETDATA)
+    void setSflow(Set<UUID> sflow);
+
+
+    @TypedColumn(name="netflow", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<UUID>> getNetflowColumn();
+
+    @TypedColumn(name="netflow", method=MethodType.SETDATA)
+    void setNetflow(Set<UUID> netflow);
+
+
+    @TypedColumn(name="flow_tables", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Map<Integer, UUID>> getFlowTablesColumn();
+
+    @TypedColumn(name="flow_tables", method=MethodType.SETDATA)
+    void setFlowTables(Map<Integer, UUID> flowTables);
+
+
+    @TypedColumn(name="stp_enable", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Boolean> getStpEnableColumn();
+
+    @TypedColumn(name="stp_enable", method=MethodType.SETDATA)
+    void setStpEnable(Boolean stp_enable);
+
+
+    @TypedColumn(name="protocols", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<String>> getProtocolsColumn();
+
+    @TypedColumn(name="protocols", method=MethodType.SETDATA)
+    void setProtocols(Set<String> protocols);
+
+
+    @TypedColumn(name="other_config", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Map<String, String>> getOtherConfigColumn();
+
+    @TypedColumn(name="other_config", method=MethodType.SETDATA)
+    void setOtherConfig(Map<String, String> other_config);
+
+
+    @TypedColumn(name="external_ids", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Map<String, String>> getExternalIdsColumn();
+
+    @TypedColumn(name="external_ids", method=MethodType.SETDATA)
+    void setExternalIds(Map<String, String> externalIds);
+
+
+    @TypedColumn(name="ipfix", method=MethodType.GETCOLUMN)
+    Column<GenericTableSchema, Set<UUID>> getIpfixColumn();
+
+    @TypedColumn(name="ipfix", method=MethodType.SETDATA)
+    void setIpfix(Set<UUID> ipfix);
+}
diff --git a/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/VersionIncompatibleBridge.java b/library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/VersionIncompatibleBridge.java
new file mode 100644 (file)
index 0000000..4fdc93a
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * 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 : Madhu Venugopal
+ */
+
+package org.opendaylight.ovsdb.integrationtest.ovsdbclient;
+import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
+import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
+
+/**
+ * VersionIncompatibleBridge is used to test the Version Compatibility logic in the Library
+ * with an absurdly low fromVersion and untilVersion which will fail for all the OVS versions.
+ */
+@TypedTable(name="Bridge", database="Open_vSwitch", fromVersion="0.0.1", untilVersion="0.0.2")
+public interface VersionIncompatibleBridge extends TypedBaseTable {
+}
index 65fffb54cfa889175ced05c175513da85b2da9d1..d31ec69c7d688a92970d5f319d51c69ec426c6ee 100644 (file)
@@ -732,7 +732,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
         Manager manager = getClient().createTypedRowWrapper(Manager.class);
         manager.setInactivityProbe(Sets.newHashSet(8192L));
         manager.setMaxBackoff(Sets.newHashSet(4094L));
-        manager.setTarget(Sets.newHashSet("172.16.50.50:6640"));
+        manager.setTarget("tcp:172.16.50.50:6640");
         manager.setExternalIds(externalIds);
 
         TransactionBuilder transactionBuilder = getClient().transactBuilder(getDbSchema())
diff --git a/northbound/enunciate.xml b/northbound/enunciate.xml
deleted file mode 100644 (file)
index e6faef2..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.26.xsd">
-
-  <services>
-    <rest defaultRestSubcontext="/ovsdb/nb/v2"/>
-  </services>
-
-  <modules>
-    <docs docsDir="rest" title="OVSDB Table operations over REST" includeExampleXml="true" includeExampleJson="true"/>
-  </modules>
-</enunciate>
diff --git a/northbound/pom.xml b/northbound/pom.xml
deleted file mode 100644 (file)
index 73ad141..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
-    <artifactId>commons</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../commons/parent</relativePath>
-  </parent>
-
-  <artifactId>northbound</artifactId>
-  <version>0.8.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
-  <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  <licenses>
-    <license>
-      <name>Eclipse Public License v1.0</name>
-      <url>http://www.eclipse.org/legal/epl-v10.html</url>
-    </license>
-  </licenses>
-  <developers>
-    <developer>
-      <name>Sam Hague</name>
-      <email>shague@gmail.com</email>
-      <url>https://github.com/shague</url>
-    </developer>
-  </developers>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  </scm>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.enunciate</groupId>
-      <artifactId>enunciate-core-annotations</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-api-mockito</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-core</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-module-junit4</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>commons.northbound</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>library</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>plugin</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>utils.servicehelper</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</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>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>org.opendaylight.controller.sal.utils,
-              org.opendaylight.controller.northbound.commons,
-              org.opendaylight.controller.northbound.commons.exception,
-              org.opendaylight.controller.northbound.commons.utils,
-              com.sun.jersey.spi.container.servlet,
-              org.opendaylight.controller.sal.core,
-              org.opendaylight.controller.sal.authorization,
-              org.opendaylight.ovsdb.plugin.api,
-              org.opendaylight.ovsdb.lib,
-              org.opendaylight.ovsdb.lib.jsonrpc,
-              org.opendaylight.ovsdb.lib.notation,
-              org.opendaylight.ovsdb.lib.operations,
-              org.opendaylight.ovsdb.lib.message,
-              org.opendaylight.ovsdb.lib.schema,
-              org.opendaylight.ovsdb.lib.schema.typed,
-              javax.ws.rs,
-              javax.ws.rs.core,
-              javax.xml.bind,
-              javax.xml.bind.annotation,
-              org.slf4j,
-              org.apache.catalina.filters,
-              !org.codehaus.enunciate.jaxrs,*</Import-Package>
-            <Export-Package/>
-            <Web-ContextPath>/ovsdb/nb</Web-ContextPath>
-            <Jaxrs-Resources>,${classes;ANNOTATION;javax.ws.rs.Path}</Jaxrs-Resources>
-          </instructions>
-          <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.enunciate</groupId>
-        <artifactId>maven-enunciate-plugin</artifactId>
-        <version>${enunciate.version}</version>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/DatabaseResource.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/DatabaseResource.java
deleted file mode 100644 (file)
index 84b52dc..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.util.List;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Northbound interface for OVSDB Databases
- */
-public class DatabaseResource {
-
-    String nodeId;
-    ObjectMapper objectMapper;
-    DatabaseResource(String id) {
-        this.nodeId = id;
-        objectMapper = new ObjectMapper();
-        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
-    }
-
-    private DatabaseSchema getDatabaseSchema (String databaseName) {
-        String csDatabaseName = this.caseSensitiveDatabaseName(databaseName);
-        OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
-        return client.getDatabaseSchema(csDatabaseName);
-    }
-
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getDatabases(){
-        OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
-        try {
-            List<String> databases = client.getDatabases().get();
-            if (databases == null) {
-                return Response.noContent().build();
-            }
-            String response = objectMapper.writeValueAsString(databases);
-            return Response.status(Response.Status.OK)
-                    .entity(response)
-                    .build();
-        } catch (Exception e) {
-            throw new InternalServerErrorException("Failed due to exception " + e.getMessage());
-        }
-    }
-
-    @GET
-    @Path("{name}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getDatabases(@PathParam("name") String name) throws JsonProcessingException {
-        DatabaseSchema dbSchema = this.getDatabaseSchema(name);
-        String response = objectMapper.writeValueAsString(dbSchema);
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @Path("{name}/table")
-    public TableResource getDatabaseTables(@PathParam("name") String name){
-        String csDatabaseName = this.caseSensitiveDatabaseName(name);
-        return new TableResource(nodeId, csDatabaseName);
-    }
-
-    private String caseSensitiveDatabaseName (String ciDatabaseName) {
-        OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
-        try {
-            List<String> databases = client.getDatabases().get();
-            if (databases == null) {
-                return ciDatabaseName;
-            }
-            for (String csDatabaseName : databases) {
-                if (csDatabaseName.equalsIgnoreCase(ciDatabaseName)) {
-                    return csDatabaseName;
-                }
-            }
-            return ciDatabaseName;
-        } catch (Exception e) {
-            return ciDatabaseName;
-        }
-    }
-}
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/NodeResource.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/NodeResource.java
deleted file mode 100644 (file)
index 5ccdf4f..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.io.InputStream;
-import java.util.Collections;
-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.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.controller.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.collect.Lists;
-
-/**
- * Northbound Interface for OVSDB Nodes
- */
-public class NodeResource {
-    ObjectMapper objectMapper;
-    public NodeResource () {
-        objectMapper = new ObjectMapper();
-        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
-    }
-
-    public static Node getOvsdbNode(String nodeId, Object bundleClassRef) {
-        OvsdbConnectionService connectionService =
-                (OvsdbConnectionService)ServiceHelper.
-                        getGlobalInstance(OvsdbConnectionService.class, bundleClassRef);
-        if (connectionService == null) {
-            throw new ServiceUnavailableException("Ovsdb ConnectionService "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        Node node = connectionService.getNode(nodeId);
-        if (node == null) {
-            throw new ResourceNotFoundException("Node "+nodeId+" not found");
-        }
-
-        return node;
-    }
-
-    public static Connection getOvsdbConnection(String nodeId, Object bundleClassRef) {
-        OvsdbConnectionService connectionService =
-                (OvsdbConnectionService)ServiceHelper.
-                        getGlobalInstance(OvsdbConnectionService.class, bundleClassRef);
-        if (connectionService == null) {
-            throw new ServiceUnavailableException("Ovsdb ConnectionService "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        Node node = connectionService.getNode(nodeId);
-        if (node == null) {
-            throw new ResourceNotFoundException("Node "+nodeId+" not found");
-        }
-
-        Connection connection = connectionService.getConnection(node);
-        if (connection == null) {
-            throw new ResourceNotFoundException("Connection for "+nodeId+" not available");
-        }
-
-        return connection;
-    }
-
-    public static OvsdbClient getOvsdbClient(String nodeId, Object bundleClassRef) {
-        Connection connection = NodeResource.getOvsdbConnection(nodeId, bundleClassRef);
-        OvsdbClient client = connection.getClient();
-        if (client == null) {
-            throw new ResourceNotFoundException("No Ovsdb Client to handle Node "+nodeId);
-        }
-        return client;
-    }
-
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getNodes() throws JsonProcessingException {
-        OvsdbConnectionService connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-        List<Node> nodes = connectionService.getNodes();
-        if (nodes == null) {
-            return Response.noContent().build();
-        }
-
-        List<String> nodeIds = Lists.newArrayList();
-        for (Node node : nodes) {
-            nodeIds.add(node.getId().getValue());
-        }
-        Collections.sort(nodeIds);
-
-        String response = objectMapper.writeValueAsString(nodeIds);
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @POST
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response createNode(InputStream is){
-        return Response.noContent().build();
-    }
-
-    @GET
-    @Path("{id}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getNode(@PathParam("id") String id) throws JsonProcessingException {
-        OvsdbClient client = NodeResource.getOvsdbClient(id, this);
-        String response = objectMapper.writeValueAsString(client.getConnectionInfo());
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @PUT
-    @Path("{id}")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response updateNode(@PathParam("id") String id, InputStream is){
-        return Response.noContent().build();
-    }
-
-    @DELETE
-    @Path("{id}")
-    public Response deleteNode(@PathParam("id") String id){
-        return Response.noContent().build();
-    }
-
-    @Path("{id}/database")
-    public DatabaseResource getNodeDatabase(@PathParam("id") String nodeId){
-        return new DatabaseResource(nodeId);
-    }
-
-}
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV2.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV2.java
deleted file mode 100644 (file)
index be1d98e..0000000
+++ /dev/null
@@ -1,681 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.northbound;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-
-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.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.SecurityContext;
-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.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.BadRequestException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
-import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
-import org.opendaylight.controller.sal.authorization.Privilege;
-import org.opendaylight.ovsdb.plugin.api.Status;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.StatusWithUuid;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-/**
-* OVSDB Northbound REST API.<br>
-* This class provides REST APIs to Create, Read, Update and Delete OVSDB Row in any of the ovsdb table
-* database one at a time. The JSON used to create rows is in the same format as the OVSDB JSON-RPC messages.
-* This format is documented in the <a href="http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf">OVSDB Schema</a>
-* and in <a href="http://tools.ietf.org/rfc/rfc7047.txt">RFC 7047</a>.
-*
-* <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.
-*/
-
-@Path("/v2/")
-@Deprecated
-public class OvsdbNorthboundV2 {
-
-    @Context
-    private UriInfo _uriInfo;
-    private String username;
-
-    @Context
-    public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) {
-            username = context.getUserPrincipal().getName();
-        }
-    }
-
-    protected String getUserName() {
-        return username;
-    }
-
-    /**
-     * Create a Row for Open_vSwitch schema
-     *
-     * @param nodeType type of node e.g OVS
-     * @param nodeId ID of the node
-     * @param tableName name of the OVSDB table
-     * @param rowJson the {@link OvsdbRow} Row that is being inserted
-     *
-     * @return Response as dictated by the HTTP Response Status code
-     *
-     * <br>
-     * Examples:
-     * <br>
-     * Create a Bridge Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows
-     *
-     * JSON:
-     * {
-     *   "row": {
-     *     "Bridge": {
-     *       "name": "bridge1",
-     *       "datapath_type": "OPENFLOW"
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create a Port Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows
-     *
-     * JSON:
-     * {
-     *   "parent_uuid": "b01cd26b-9c63-4216-8cf2-55f7087adab1",
-     *   "row": {
-     *     "Port": {
-     *       "name": "port1",
-     *       "mac": [
-     *         "set",
-     *         "00:00:00:00:00:01"
-     *       ],
-     *       "tag": [
-     *         "set",
-     *         200
-     *       ]
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create an Interface Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows
-     *
-     * JSON:
-     * {
-     *   "parent_uuid": "c7b54c9b-9b25-4801-a81d-d7bc489d4840",
-     *   "row": {
-     *     "Interface": {
-     *       "name": "br2",
-     *       "mac": [
-     *         "set",
-     *         "00:00:bb:bb:00:01"
-     *       ],
-     *       "admin_state": "up"
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create an SSL Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows
-     *
-     * JSON:
-     * {
-     *   "row": {
-     *     "SSL": {
-     *       "name": "mySSL",
-     *       "ca_cert": "ca_cert",
-     *       "bootstrap_ca_cert": true,
-     *       "certificate": "pieceofpaper",
-     *       "private_key": "private"
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create an sFlow Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows
-     *
-     * JSON:
-     * {
-     *   "parent_uuid": "6b3072ba-a120-4db9-82f8-a8ce4eae6942",
-     *   "row": {
-     *     "sFlow": {
-     *       "agent": [
-     *         "set",
-     *         "agent_string"
-     *       ],
-     *       "targets": [
-     *         "set",
-     *         "targets_string"
-     *       ]
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create a QoS Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows
-     *
-     * JSON:
-     * {
-     *   "parent_uuid": "b109dbcf-47bb-4121-b244-e623b3421d6e",
-     *   "row": {
-     *     "QoS": {
-     *       "type": "linux-htb"
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create a Queue Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows
-     *
-     * {
-     *   "parent_uuid": "b16eae7d-7e97-46d2-95d1-333d1de4a3d7",
-     *   "row": {
-     *     "Queue": {
-     *       "dscp": [
-     *         "set",
-     *         "25"
-     *       ]
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create a Netflow Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows
-     *
-     * JSON:
-     * {
-     *   "parent_uuid": "b01cd26b-9c63-4216-8cf2-55f7087adab1",
-     *   "row": {
-     *     "NetFlow": {
-     *       "targets": [
-     *         "set",
-     *         [
-     *           "192.168.1.102:9998"
-     *         ]
-     *       ],
-     *       "active_timeout": "0"
-     *     }
-     *   }
-     * }
-     * </pre>
-     *
-     *
-     * Create a Manager Row:
-     * <pre>
-     *
-     * Request URL:
-     * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows
-     *
-     * JSON:
-     * {
-     *   "parent_uuid": "8d3fb89b-5fac-4631-a990-f5a4e7f5383a",
-     *   "row": {
-     *     "Manager": {
-     *       "target": "a_string",
-     *       "is_connected": true,
-     *       "state": "active"
-     *     }
-     *   }
-     * }
-     * </pre>
-     * @throws IOException
-     * @throws ExecutionException
-     * @throws InterruptedException
-     */
-
-    @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows")
-    @POST
-    @StatusCodes({ @ResponseCode(code = 201, condition = "Row Inserted successfully"),
-        @ResponseCode(code = 400, condition = "Invalid data passed"),
-        @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
-    @Consumes({ MediaType.APPLICATION_JSON})
-    public Response addRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
-                           @PathParam("tableName") String tableName, JsonNode rowJson) throws IOException, InterruptedException, ExecutionException {
-
-        if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
-            throw new UnauthorizedException("User is not authorized to perform this operation");
-        }
-
-        OvsdbConfigurationService
-                ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                            this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-        Node node = connectionService.getNode(nodeId);
-
-        OvsdbClient client = connectionService.getConnection(node).getClient();
-        OvsdbRow localRow = OvsdbRow.fromJsonNode(client, OvsVswitchdSchemaConstants.DATABASE_NAME, rowJson);
-        String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-
-        if (localRow == null) {
-            return Response.status(Response.Status.BAD_REQUEST).build();
-        }
-
-        StatusWithUuid
-                statusWithUuid = ovsdbTable.insertRow(node, bckCompatibleTableName, localRow.getParentUuid(), localRow.getRow());
-
-        if (statusWithUuid.isSuccess()) {
-            UUID uuid = statusWithUuid.getUuid();
-            return Response.status(Response.Status.CREATED)
-                    .header("Location", String.format("%s/%s", _uriInfo.getAbsolutePath().toString(),
-                                                                uuid.toString()))
-                    .entity(uuid.toString())
-                    .build();
-        }
-        return NorthboundUtils.getResponse(
-                new org.opendaylight.controller.sal.utils.Status(
-                        org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));
-    }
-
-    /**
-     * Read a Row
-     *
-     * @param nodeType type of node e.g OVS
-     * @param nodeId ID of the node
-     * @param tableName name of the ovsdb table
-     * @param rowUuid UUID of the row being read
-     *
-     * @return Row corresponding to the UUID.
-     *
-     * <br>
-     * Examples:
-     * <br>
-     * <pre>
-     * Get a specific Bridge Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific Port Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific Interface Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific Controller Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific SSL Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific sFlow Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific QoS Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific Queue Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific Netflow Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Get a specific Manager Row:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     * </pre>
-     */
-
-    @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows/{rowUuid}")
-    @GET
-    @StatusCodes({ @ResponseCode(code = 200, condition = "Row Updated successfully"),
-        @ResponseCode(code = 400, condition = "Invalid data passed"),
-        @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
-    @Produces({ MediaType.APPLICATION_JSON})
-    @TypeHint(Row.class)
-    public Row getRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
-                           @PathParam("tableName") String tableName, @PathParam("rowUuid") String rowUuid) {
-
-        if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
-            throw new UnauthorizedException("User is not authorized to perform this operation");
-        }
-
-        OvsdbConfigurationService
-                ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                            this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("UserManager " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-        Node node = connectionService.getNode(nodeId);
-        OvsdbClient client = connectionService.getConnection(node).getClient();
-        String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-
-        Row row;
-        try {
-            row = ovsdbTable.getRow(node, bckCompatibleTableName, rowUuid);
-        } catch (Exception e) {
-            throw new BadRequestException(e.getMessage());
-        }
-        return row;
-    }
-
-    /**
-     * Read all Rows of a table
-     *
-     * @param nodeType type of node e.g OVS
-     * @param nodeId ID of the node
-     * @param tableName name of the ovsdb table
-     *
-     * @return All the Rows of a table
-     *
-     * <br>
-     * Examples:
-     * <br>
-     * <pre>
-     * Get all Bridge Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows
-     *
-     * Get all Port Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows
-     *
-     * Get all Interface Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows
-     *
-     * Get all Controller Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows
-     *
-     * Get all SSL Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows
-     *
-     * Get all sFlow Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows
-     *
-     * Get all QoS Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows
-     *
-     * Get all Queue Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows
-     *
-     * Get all Netflow Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows
-     *
-     * Get all Manager Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows
-     *
-     * Get all Open vSwitch Rows:
-     * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/open_vswitch/rows
-     * </pre>
-     */
-
-    @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows")
-    @GET
-    @StatusCodes({ @ResponseCode(code = 200, condition = "Row Updated successfully"),
-        @ResponseCode(code = 400, condition = "Invalid data passed"),
-        @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
-    @Produces({ MediaType.APPLICATION_JSON})
-    @TypeHint(OvsdbRows.class)
-    public OvsdbRows getAllRows(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
-                               @PathParam("tableName") String tableName) {
-        if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
-            throw new UnauthorizedException("User is not authorized to perform this operation");
-        }
-
-        OvsdbConfigurationService
-                ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                            this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("UserManager " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-        Node node = connectionService.getNode(nodeId);
-        OvsdbClient client = connectionService.getConnection(node).getClient();
-        String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-        Map<String, Row> rows;
-        try {
-            rows = ovsdbTable.getRows(node, bckCompatibleTableName);
-        } catch (Exception e) {
-            throw new BadRequestException(e.getMessage());
-        }
-        return new OvsdbRows(rows);
-    }
-
-    /*
-    /**
-     * Update a Row
-     *
-     * @param nodeType type of node e.g OVS
-     * @param nodeId ID of the node
-     * @param tableName name of the ovsdb table
-     * @param rowUuid UUID of the row being updated
-     * @param row the {@link OVSDBRow} Row that is being updated
-     *
-     * @return Response as dictated by the HTTP Response Status code
-     *
-     * <br>
-     * Examples:
-     * <br>
-     * Update the Bridge row to add a controller
-     * <pre>
-     *
-     * Request URL:
-     * PUT http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/b01cd26b-9c63-4216-8cf2-55f7087adab1
-     *
-     * JSON:
-     * {
-     *   "row": {
-     *     "Bridge": {
-     *       "controller": [
-     *         "set",
-     *         [
-     *           [
-     *             "uuid",
-     *             "a566e8b4-fc38-499b-8623-6087d5b36b72"
-     *           ]
-     *         ]
-     *       ]
-     *     }
-     *   }
-     * }
-     * </pre>
-     */
-
-    @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows/{rowUuid}")
-    @PUT
-    @StatusCodes({ @ResponseCode(code = 200, condition = "Row Updated successfully"),
-        @ResponseCode(code = 400, condition = "Invalid data passed"),
-        @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
-    @Consumes({ MediaType.APPLICATION_JSON})
-    public Response updateRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
-                           @PathParam("tableName") String tableName, @PathParam("rowUuid") String rowUuid,
-                           JsonNode rowJson) {
-
-        if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
-            throw new UnauthorizedException("User is not authorized to perform this operation");
-        }
-
-        OvsdbConfigurationService
-                ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                            this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-        Node node = connectionService.getNode(nodeId);
-        OvsdbClient client = connectionService.getConnection(node).getClient();
-        String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-        OvsdbRow localRow = OvsdbRow.fromJsonNode(client, OvsVswitchdSchemaConstants.DATABASE_NAME, rowJson);
-
-        if (localRow == null) {
-            return Response.status(Response.Status.BAD_REQUEST).build();
-        }
-
-        ovsdbTable.updateRow(node, bckCompatibleTableName, localRow.getParentUuid(), rowUuid, localRow.getRow());
-        return NorthboundUtils.getResponse(
-                new org.opendaylight.controller.sal.utils.Status(
-                        org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));
-    }
-
-    /**
-     * Delete a row
-     *
-     * @param nodeType type of node e.g OVS
-     * @param nodeId ID of the node
-     * @param tableName name of the ovsdb table
-     * @param uuid UUID of the Row to be removed
-     *
-     * @return Response as dictated by the HTTP Response Status code
-     *
-     * <br>
-     * Examples:
-     * <br>
-     * <pre>
-     * Delete a specific Bridge Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific Port Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific Interface Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific Controller Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific SSL Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific sFlow Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific QoS Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific Queue Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific Netflow Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     *
-     * Delete a specific Manager Row:
-     * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows/6f4c602c-026f-4390-beea-d50d6d448100
-     * </pre>
-     */
-
-    @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows/{uuid}")
-    @DELETE
-    @StatusCodes({ @ResponseCode(code = 204, condition = "User Deleted Successfully"),
-        @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
-        @ResponseCode(code = 404, condition = "The userName passed was not found"),
-        @ResponseCode(code = 500, condition = "Internal Server Error : Removal of user failed"),
-        @ResponseCode(code = 503, condition = "Service unavailable") })
-    public Response removeRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
-                              @PathParam("tableName") String tableName, @PathParam("uuid") String uuid) {
-        if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
-            throw new UnauthorizedException("User is not authorized to perform this operation");
-        }
-
-        OvsdbConfigurationService
-                ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        OvsdbConnectionService
-                connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
-        Node node = connectionService.getNode(nodeId);
-        OvsdbClient client = connectionService.getConnection(node).getClient();
-        String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-
-        Status status = ovsdbTable.deleteRow(node, bckCompatibleTableName, uuid);
-        if (status.isSuccess()) {
-            return Response.noContent().build();
-        }
-        return NorthboundUtils.getResponse(
-                new org.opendaylight.controller.sal.utils.Status(
-                        org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));
-    }
-
-    private String getBackwardCompatibleTableName(OvsdbClient client, String databaseName, String tableName) {
-        DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-        if (dbSchema == null || tableName == null) {
-            return tableName;
-        }
-        for (String dbTableName : dbSchema.getTables()) {
-            if (dbTableName.equalsIgnoreCase(tableName)) {
-                return dbTableName;
-            }
-        }
-        return tableName;
-    }
-}
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV3.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV3.java
deleted file mode 100644 (file)
index 6f1d149..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.northbound;
-
-import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
-import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
-import org.opendaylight.controller.sal.authorization.Privilege;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-
-/**
-* OVSDB Northbound V3 REST API
-*/
-
-@Path("/v3/")
-public class OvsdbNorthboundV3 {
-    @Context
-    private UriInfo _uriInfo;
-    private String username;
-
-    @Context
-    public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) {
-            username = context.getUserPrincipal().getName();
-        }
-    }
-
-    protected String getUserName() {
-        return username;
-    }
-
-    @Path("node")
-    public NodeResource getNode(){
-        if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
-            throw new UnauthorizedException("User is not authorized to perform this operation");
-        }
-        return new NodeResource();
-    }
-
-}
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbRow.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbRow.java
deleted file mode 100644 (file)
index 977bbbd..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.northbound;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.concurrent.ExecutionException;
-
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-public class OvsdbRow {
-    private static final String PARENTUUID = "parent_uuid";
-    private static final String PARENTTABLE = "parent_table";
-    private static final String PARENTCOLUMN = "parent_column";
-    private static final String ROW = "row";
-
-    private String parentUuid;
-    private String parentTable;
-    private String parentColumn;
-    private String tableName;
-    private Row<GenericTableSchema> row;
-
-    public OvsdbRow() {
-    }
-
-    public OvsdbRow(String parentUuid, String tableName, Row<GenericTableSchema> row) {
-        this.parentUuid = parentUuid;
-        this.tableName = tableName;
-        this.row = row;
-    }
-
-    public OvsdbRow(String parentTable, String parentUuid, String parentColumn, String tableName, Row<GenericTableSchema> row) {
-        this.parentTable = parentTable;
-        this.parentColumn = parentColumn;
-        this.parentUuid = parentUuid;
-        this.tableName = tableName;
-        this.row = row;
-    }
-
-    public static OvsdbRow fromJsonNode(OvsdbClient client, String dbName, JsonNode json) {
-        JsonNode parentUuidNode = json.get(PARENTUUID);
-        String parentUuid = null;
-        if (parentUuidNode != null) {
-           parentUuid = parentUuidNode.asText();
-        }
-        JsonNode parentTableNode = json.get(PARENTTABLE);
-        String parentTable = null;
-        if (parentTableNode != null) {
-            parentTable = parentTableNode.asText();
-        }
-        JsonNode parentColumnNode = json.get(PARENTCOLUMN);
-        String parentColumn = null;
-        if (parentColumnNode != null) {
-            parentColumn = parentColumnNode.asText();
-        }
-        JsonNode rowNode = json.get(ROW);
-        if (rowNode == null) {
-            return null;
-        }
-        for(Iterator<String> fieldNames = rowNode.fieldNames(); fieldNames.hasNext();) {
-            String tableName = fieldNames.next();
-            Row<GenericTableSchema> row = null;
-            try {
-                row = getRow(client, dbName, tableName, rowNode.get(tableName));
-            } catch (InterruptedException | ExecutionException | IOException e) {
-                e.printStackTrace();
-                return null;
-            }
-            return new OvsdbRow(parentTable, parentUuid, parentColumn, tableName, row);
-        }
-        return null;
-    }
-
-    public static Row<GenericTableSchema> getRow(OvsdbClient client, String dbName, String tableName, JsonNode rowJson) throws InterruptedException, ExecutionException, JsonParseException, IOException {
-        DatabaseSchema dbSchema = client.getSchema(dbName).get();
-        GenericTableSchema schema = dbSchema.table(tableName, GenericTableSchema.class);
-        return schema.createRow((ObjectNode)rowJson);
-    }
-
-    public String getParentTable() {
-        return parentTable;
-    }
-
-    public String getParentUuid() {
-        return parentUuid;
-    }
-
-    public String getParentColumn() {
-        return parentColumn;
-    }
-
-    public String getTableName() {
-        return tableName;
-    }
-
-    public Row<GenericTableSchema> getRow() {
-        return row;
-    }
-}
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbRows.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/OvsdbRows.java
deleted file mode 100644 (file)
index 9a1eade..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.northbound;
-
-import java.util.Map;
-
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-@Deprecated
-public class OvsdbRows {
-    Map<String, Row> rows;
-
-    public OvsdbRows(Map<String, Row> rows) {
-        super();
-        this.rows = rows;
-    }
-
-    public Map<String, Row> getRows() {
-        return rows;
-    }
-
-    public void setRows(Map<String, Row> rows) {
-        this.rows = rows;
-    }
-}
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/RowResource.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/RowResource.java
deleted file mode 100644 (file)
index e656428..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Map;
-
-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.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.controller.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.BadRequestException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Northbound interface for OVSDB Rows
- */
-public class RowResource {
-
-    String nodeId;
-    String databaseName;
-    String tableName;
-    ObjectMapper objectMapper;
-
-    public RowResource(String nodeId, String databaseName, String tableName) {
-        this.nodeId = nodeId;
-        this.databaseName = databaseName;
-        this.tableName = tableName;
-        objectMapper = new ObjectMapper();
-        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
-    }
-
-    private OvsdbRow getOvsdbRow (InputStream stream) throws IOException {
-        StringBuilder rowNodeStrBuilder = new StringBuilder();
-        BufferedReader in = new BufferedReader(new InputStreamReader(stream));
-        String line = null;
-        while ((line = in.readLine()) != null) {
-            rowNodeStrBuilder.append(line);
-        }
-        JsonNode jsonNode = objectMapper.readTree(rowNodeStrBuilder.toString());
-        OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
-        return OvsdbRow.fromJsonNode(client, OvsVswitchdSchemaConstants.DATABASE_NAME, jsonNode);
-    }
-
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getRows() throws JsonProcessingException {
-        OvsdbConfigurationService
-                ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                            this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("Ovsdb ConfigurationService " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        Node node = NodeResource.getOvsdbNode(nodeId, this);
-        Map<UUID,Row<GenericTableSchema>> rows = null;
-        try {
-            rows = ovsdbTable.getRows(node, databaseName, tableName);
-        } catch (Exception e) {
-            throw new BadRequestException(e.getMessage());
-        }
-        String response = objectMapper.writeValueAsString(rows);
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @POST
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response createRow(InputStream stream) throws IOException {
-        OvsdbRow localRow = this.getOvsdbRow(stream);
-        if (localRow == null) {
-            return Response.status(Response.Status.BAD_REQUEST).build();
-        }
-        OvsdbConfigurationService
-        ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                    this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        Node node = NodeResource.getOvsdbNode(nodeId, this);
-        Row row = ovsdbTable.insertTree(node, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName,
-                localRow.getParentTable(), new UUID(localRow.getParentUuid()), localRow.getParentColumn(),
-                localRow.getRow());
-        String response = objectMapper.writeValueAsString(row);
-        return Response.status(Response.Status.CREATED)
-                .entity(response)
-                .build();
-    }
-
-    @GET
-    @Path("{id}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getRowDetails(@PathParam("id") String id) throws JsonProcessingException {
-        OvsdbConfigurationService
-        ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                    this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("Ovsdb ConfigurationService " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        Node node = NodeResource.getOvsdbNode(nodeId, this);
-        Row<GenericTableSchema> row = null;
-        try {
-            row = ovsdbTable.getRow(node, databaseName, tableName, new UUID(id));
-        } catch (Exception e) {
-            throw new BadRequestException(e.getMessage());
-        }
-        String response = objectMapper.writeValueAsString(row);
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @PUT
-    @Path("{id}")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response updateRow(@PathParam("id") String id, InputStream stream) throws IOException{
-        OvsdbRow localRow = this.getOvsdbRow(stream);
-        if (localRow == null) {
-            return Response.status(Response.Status.BAD_REQUEST).build();
-        }
-        OvsdbConfigurationService ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                    this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        Node node = NodeResource.getOvsdbNode(nodeId, this);
-        Row<GenericTableSchema> row = ovsdbTable.updateRow(node, databaseName, tableName, new UUID(id), localRow.getRow(), true);
-        String response = objectMapper.writeValueAsString(row);
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @DELETE
-    @Path("{id}")
-    @Consumes(MediaType.APPLICATION_JSON)
-    public Response deleteRow(@PathParam("id") String id){
-        OvsdbConfigurationService
-        ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
-                                                                                    this);
-        if (ovsdbTable == null) {
-            throw new ServiceUnavailableException("Ovsdb ConfigurationService " + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        Node node = NodeResource.getOvsdbNode(nodeId, this);
-        try {
-            ovsdbTable.deleteRow(node, databaseName, tableName, new UUID(id));
-        } catch (Exception e) {
-            throw new BadRequestException(e.getMessage());
-        }
-        return Response.status(Response.Status.OK)
-                .build();
-
-    }
-}
diff --git a/northbound/src/main/java/org/opendaylight/ovsdb/northbound/TableResource.java b/northbound/src/main/java/org/opendaylight/ovsdb/northbound/TableResource.java
deleted file mode 100644 (file)
index 309448f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.util.Set;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.TableSchema;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Northbound interface for OVSDB tables
- */
-public class TableResource {
-    ObjectMapper objectMapper;
-    String databaseName;
-    String nodeId;
-
-    TableResource(String nodeId, String databaseName){
-        this.nodeId = nodeId;
-        this.databaseName = databaseName;
-        objectMapper = new ObjectMapper();
-        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
-    }
-
-    private DatabaseSchema getDatabaseSchema (String databaseName) {
-        OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
-        return client.getDatabaseSchema(databaseName);
-    }
-
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getTables() throws JsonProcessingException {
-        DatabaseSchema dbSchema = this.getDatabaseSchema(databaseName);
-        if (dbSchema == null) {
-            return Response.noContent().build();
-        }
-        String response = objectMapper.writeValueAsString(dbSchema.getTables());
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @GET
-    @Path("{name}")
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getTableDetails(@PathParam("name") String name) throws JsonProcessingException {
-        String csTableName = this.caseSensitiveTableName(databaseName, name);
-        DatabaseSchema dbSchema = this.getDatabaseSchema(databaseName);
-        if (dbSchema == null) {
-            return Response.noContent().build();
-        }
-        TableSchema<GenericTableSchema> tableSchema = dbSchema.table(csTableName, GenericTableSchema.class);
-        String response = objectMapper.writeValueAsString(tableSchema);
-        return Response.status(Response.Status.OK)
-                .entity(response)
-                .build();
-    }
-
-    @Path("{name}/row")
-    public RowResource getDatabaseTables(@PathParam("name") String name){
-        return new RowResource(nodeId, databaseName, name);
-    }
-
-    private String caseSensitiveTableName (String databaseName, String ciTableName) {
-        DatabaseSchema dbSchema = this.getDatabaseSchema(databaseName);
-        if (dbSchema == null) {
-            return ciTableName;
-        }
-        Set<String> tables = dbSchema.getTables();
-        if (tables == null) {
-            return ciTableName;
-        }
-        for (String tableName : tables) {
-            if (tableName.equalsIgnoreCase(ciTableName)) {
-                return tableName;
-            }
-        }
-        return ciTableName;
-    }
-}
diff --git a/northbound/src/main/resources/WEB-INF/web.xml b/northbound/src/main/resources/WEB-INF/web.xml
deleted file mode 100644 (file)
index 61f9014..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-        version="3.0">
-  <servlet>
-    <servlet-name>OVSDB</servlet-name>
-    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-    <init-param>
-      <param-name>javax.ws.rs.Application</param-name>
-      <param-value> org.opendaylight.controller.northbound.commons.NorthboundApplication</param-value>
-    </init-param>
-    <init-param>
-        <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
-        <param-value>true</param-value>
-    </init-param>
-    <load-on-startup>1</load-on-startup>
-  </servlet>
-
-  <servlet-mapping>
-    <servlet-name>OVSDB</servlet-name>
-    <url-pattern>/*</url-pattern>
-  </servlet-mapping>
-        <filter>
-          <filter-name>CorsFilter</filter-name>
-          <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
-          <init-param>
-            <param-name>cors.allowed.origins</param-name>
-            <param-value>*</param-value>
-          </init-param>
-          <init-param>
-            <param-name>cors.allowed.methods</param-name>
-            <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
-          </init-param>
-          <init-param>
-            <param-name>cors.allowed.headers</param-name>
-            <param-value>Content-Type,X-Requested-With,accept,authorization, origin,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
-          </init-param>
-          <init-param>
-            <param-name>cors.exposed.headers</param-name>
-            <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
-          </init-param>
-          <init-param>
-            <param-name>cors.support.credentials</param-name>
-            <param-value>true</param-value>
-          </init-param>
-          <init-param>
-            <param-name>cors.preflight.maxage</param-name>
-            <param-value>10</param-value>
-          </init-param>
-        </filter>
-        <filter-mapping>
-          <filter-name>CorsFilter</filter-name>
-          <url-pattern>/*</url-pattern>
-        </filter-mapping>
-
-        <security-constraint>
-          <web-resource-collection>
-            <web-resource-name>NB api</web-resource-name>
-            <url-pattern>/*</url-pattern>
-            <http-method>POST</http-method>
-            <http-method>GET</http-method>
-            <http-method>PUT</http-method>
-            <http-method>PATCH</http-method>
-            <http-method>DELETE</http-method>
-            <http-method>HEAD</http-method>
-          </web-resource-collection>
-          <auth-constraint>
-            <role-name>System-Admin</role-name>
-            <role-name>Network-Admin</role-name>
-          </auth-constraint>
-        </security-constraint>
-
-        <security-role>
-                <role-name>System-Admin</role-name>
-        </security-role>
-        <security-role>
-                <role-name>Network-Admin</role-name>
-        </security-role>
-
-        <login-config>
-                <auth-method>BASIC</auth-method>
-                <realm-name>opendaylight</realm-name>
-        </login-config>
-</web-app>
diff --git a/northbound/src/test/java/org/opendaylight/ovsdb/northbound/NodeResourceTest.java b/northbound/src/test/java/org/opendaylight/ovsdb/northbound/NodeResourceTest.java
deleted file mode 100644 (file)
index 872a305..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- *  Copyright (C) 2015 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 : Sam Hague
- */
-package org.opendaylight.ovsdb.northbound;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.google.common.collect.Lists;
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(ServiceHelper.class)
-public class NodeResourceTest {
-    private static final String OVS = "OVS";
-    private static final String IDENTIFIER = "192.168.120.31:45001";
-    private static final String IDENTIFIER2 = "192.168.120.31:45002";
-    private static final String OVS_IDENTIFIER = OVS + "|" + IDENTIFIER;
-    private static final String OVS_IDENTIFIER2 = OVS + "|" + IDENTIFIER2;
-    private static final String BAD_IDENTIFIER = "BAD" + "|" + IDENTIFIER;
-
-    @Test
-    public void testGetOvsdbNode () {
-        ConnectionServiceImpl connectionService = new ConnectionServiceImpl();
-        Connection connection = new Connection(IDENTIFIER, null);
-        connectionService.putOvsdbConnection(IDENTIFIER, connection);
-
-        PowerMockito.mockStatic(ServiceHelper.class);
-        when(ServiceHelper.getGlobalInstance(eq(OvsdbConnectionService.class), anyObject()))
-                .thenReturn(null)
-                .thenReturn(connectionService)
-                .thenReturn(connectionService);
-
-        try {
-            NodeResource.getOvsdbNode(IDENTIFIER, this);
-            fail("Expected an ServiceUnavailableException to be thrown");
-        } catch (ServiceUnavailableException e) {
-            assertSame(ServiceUnavailableException.class, e.getClass());
-        }
-
-        try {
-            NodeResource.getOvsdbNode(BAD_IDENTIFIER, this);
-            fail("Expected an ResourceNotFoundException to be thrown");
-        } catch (ResourceNotFoundException e) {
-            assertSame(ResourceNotFoundException.class, e.getClass());
-        }
-
-        Node node = NodeResource.getOvsdbNode(OVS_IDENTIFIER, this);
-        assertNotNull("Node " + OVS_IDENTIFIER + " is null", node);
-    }
-
-    @Test
-    public void testGetOvsdbConnection () {
-        ConnectionServiceImpl connectionService = new ConnectionServiceImpl();
-        Connection connection = new Connection(IDENTIFIER, null);
-        connectionService.putOvsdbConnection(IDENTIFIER, connection);
-
-        PowerMockito.mockStatic(ServiceHelper.class);
-        when(ServiceHelper.getGlobalInstance(eq(OvsdbConnectionService.class), anyObject()))
-                .thenReturn(null)
-                .thenReturn(connectionService)
-                .thenReturn(connectionService);
-
-        try {
-            NodeResource.getOvsdbConnection(IDENTIFIER, this);
-            fail("Expected an ServiceUnavailableException to be thrown");
-        } catch (ServiceUnavailableException e) {
-            assertSame(ServiceUnavailableException.class, e.getClass());
-        }
-
-        try {
-            NodeResource.getOvsdbConnection(BAD_IDENTIFIER, this);
-            fail("Expected an ResourceNotFoundException to be thrown");
-        } catch (ResourceNotFoundException e) {
-            assertSame(ResourceNotFoundException.class, e.getClass());
-        }
-
-        Connection testConnection = NodeResource.getOvsdbConnection(IDENTIFIER, this);
-        assertNotNull("Connection " + OVS_IDENTIFIER + " is null", testConnection);
-    }
-
-    @Test
-    public void testGetNodes () {
-        ConnectionServiceImpl connectionService = new ConnectionServiceImpl();
-
-        PowerMockito.mockStatic(ServiceHelper.class);
-        when(ServiceHelper.getGlobalInstance(eq(OvsdbConnectionService.class), anyObject()))
-                .thenReturn(connectionService)
-                .thenReturn(connectionService)
-                .thenReturn(connectionService);
-
-        NodeResource nodeResource = new NodeResource();
-
-        // Check getNodes when there are no nodes
-        try {
-            Response response = nodeResource.getNodes();
-            assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
-            assertNotNull("entity should not be null", response.getEntity());
-            String id = "";
-            List<String> ids = Lists.newArrayList();
-            ids.add(id);
-            assertEquals("there should be no nodes", ids.toString(), response.getEntity());
-        } catch (JsonProcessingException ex) {
-            fail("Exception should not have been caught");
-        }
-
-        // Check getNodes when there is a node
-        Connection connection = new Connection(IDENTIFIER, null);
-        connectionService.putOvsdbConnection(IDENTIFIER, connection);
-
-        try {
-            Response response = nodeResource.getNodes();
-            assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
-            assertNotNull("entity should not be null", response.getEntity());
-            String id = "\"" + OVS_IDENTIFIER + "\"";
-            List<String> ids = Lists.newArrayList();
-            ids.add(id);
-            assertEquals(OVS_IDENTIFIER + " should be found", ids.toString(), response.getEntity());
-        } catch (JsonProcessingException ex) {
-            fail("Exception should not have been caught");
-        }
-
-        // Check getNodes when there are multiple nodes
-        connection = new Connection(IDENTIFIER2, null);
-        connectionService.putOvsdbConnection(IDENTIFIER2, connection);
-
-        try {
-            Response response = nodeResource.getNodes();
-            assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
-            assertNotNull("entity should not be null", response.getEntity());
-            String id = "\"" + OVS_IDENTIFIER + "\"";
-            String id2 = "\"" + OVS_IDENTIFIER2 + "\"";
-            List<String> ids = Lists.newArrayList();
-            ids.add(id);
-            ids.add(id2);
-            assertEquals(OVS_IDENTIFIER + " and " + OVS_IDENTIFIER2 + " should be found",
-                    ids.toString().replaceAll("\\s",""), response.getEntity());
-        } catch (JsonProcessingException ex) {
-            fail("Exception should not have been caught");
-        }
-    }
-}
diff --git a/northbound/src/test/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV3Test.java b/northbound/src/test/java/org/opendaylight/ovsdb/northbound/OvsdbNorthboundV3Test.java
deleted file mode 100644 (file)
index 9ecaf40..0000000
+++ /dev/null
@@ -1,87 +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 : Sam Hague
-*/
-package org.opendaylight.ovsdb.northbound;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.security.Principal;
-import javax.ws.rs.core.SecurityContext;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
-import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
-import org.opendaylight.controller.sal.authorization.Privilege;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(NorthboundUtils.class)
-public class OvsdbNorthboundV3Test {
-    private static final String USER = "admin";
-
-    @Test
-    public void testSetSecurityContext () {
-        SecurityContext securityContext = mock(SecurityContext.class);
-        Principal principal = mock(Principal.class);
-
-        when(securityContext.getUserPrincipal()).thenReturn(null)
-                .thenReturn(principal);
-        when(principal.getName()).thenReturn(USER);
-
-        OvsdbNorthboundV3 ovsdbNorthboundV3 = new OvsdbNorthboundV3();
-
-        // Check if SecurityContext is null
-        ovsdbNorthboundV3.setSecurityContext(null);
-        String userName = ovsdbNorthboundV3.getUserName();
-        assertNull(userName);
-
-        // Check if user has no Principal
-        ovsdbNorthboundV3.setSecurityContext(securityContext);
-        userName = ovsdbNorthboundV3.getUserName();
-        assertNull(userName);
-
-        // Success case
-        ovsdbNorthboundV3.setSecurityContext(securityContext);
-        userName = ovsdbNorthboundV3.getUserName();
-        assertEquals(USER, userName);
-    }
-
-    @Test
-    public void testGetNode () {
-        PowerMockito.mockStatic(NorthboundUtils.class);
-        when(NorthboundUtils.isAuthorized(anyString(), eq("default"), eq(Privilege.WRITE), anyObject()))
-                .thenReturn(false)
-                .thenReturn(true);
-
-        OvsdbNorthboundV3 ovsdbNorthboundV3 = new OvsdbNorthboundV3();
-
-        // Check for unauthorized user
-        try {
-            NodeResource nodeResource = ovsdbNorthboundV3.getNode();
-            fail("Expected an UnauthorizedException to be thrown");
-        } catch (UnauthorizedException e) {
-            assertSame(UnauthorizedException.class, e.getClass());
-        }
-
-        // Success case
-        NodeResource nodeResource = ovsdbNorthboundV3.getNode();
-        assertNotNull(nodeResource);
-    }
-}
index bf9ac1a8ed418f0ea2c965e8f3e2849cdb2291f0..0ca89b042fca2ac984727b8f087ae409a44a9cb3 100644 (file)
@@ -82,11 +82,10 @@ public class SouthboundMapper {
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) {
-        InstanceIdentifier<Node> nodePath = InstanceIdentifier
+        return InstanceIdentifier
                 .create(NetworkTopology.class)
                 .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
                 .child(Node.class,new NodeKey(nodeId));
-        return nodePath;
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(ConnectionInfo key,OvsdbBridgeName bridgeName) {
@@ -128,8 +127,7 @@ public class SouthboundMapper {
         String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
                 + new String(ip.getValue()) + ":" + port.getValue();
         Uri uri = new Uri(uriString);
-        NodeId nodeId = new NodeId(uri);
-        return nodeId;
+        return new NodeId(uri);
     }
 
     public static InetAddress createInetAddress(IpAddress ip) throws UnknownHostException {
@@ -154,7 +152,7 @@ public class SouthboundMapper {
     }
 
     public static String createDatapathType(OvsdbBridgeAugmentation mdsalbridge) {
-        String datapathtype = new String(SouthboundConstants.DATAPATH_TYPE_MAP.get(DatapathTypeSystem.class));
+        String datapathtype = SouthboundConstants.DATAPATH_TYPE_MAP.get(DatapathTypeSystem.class);
 
         if (mdsalbridge.getDatapathType() != null) {
             if (SouthboundConstants.DATAPATH_TYPE_MAP.get(mdsalbridge.getDatapathType()) != null) {
index 733710c09a61eb76346d52f1cca31d38d12f46e8..db41788e9a28490a1f3e43cc4c406470130ec6b1 100644 (file)
@@ -52,10 +52,30 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <ovsdb.utils.servicehelper.version>1.2.1-SNAPSHOT</ovsdb.utils.servicehelper.version>
     <powermock.version>1.5.2</powermock.version>
     <sonar-jacoco-listeners.version>2.4</sonar-jacoco-listeners.version>
-    <liblldp.version>0.9.1-SNAPSHOT</liblldp.version>
+    <liblldp.version>0.10.0-SNAPSHOT</liblldp.version>
     <root.directory>${env.PWD}</root.directory>
     <sonar.jacoco.itReportPath>${root.directory}/target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
   </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>2.0.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.mdsal.model</groupId>
+        <artifactId>mdsal-model-artifacts</artifactId>
+        <version>0.8.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <dependencies>
     <dependency>
       <groupId>org.osgi</groupId>
@@ -121,19 +141,19 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <version>${ovsdb.utils.mdsal.openflow.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
+      <groupId>org.opendaylight.mdsal</groupId>
       <artifactId>yang-binding</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>opendaylight-l2-types</artifactId>
     </dependency>
     <dependency>
@@ -146,7 +166,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>concepts</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-topology</artifactId>
     </dependency>
     <dependency>
index b8a096389b95d024011a9f2566ca88fb4c593c69..12879dadda1c22db175238ea5b35d3002beb1fe8 100644 (file)
@@ -1643,29 +1643,27 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
                 }
             }
             LOG.debug("createOutputGroupInstructions: addNew {}", addNew);
-            if (addNew) {
+            if (addNew && !buckets.getBucket().isEmpty()) {
                 /* the new output action is not in the bucket, add to bucket */
-                if (!buckets.getBucket().isEmpty()) {
-                    Bucket bucket = buckets.getBucket().get(0);
-                    List<Action> bucketActionList = Lists.newArrayList();
-                    bucketActionList.addAll(bucket.getAction());
-                    /* set order for new action and add to action list */
-                    ab.setOrder(bucketActionList.size());
-                    ab.setKey(new ActionKey(bucketActionList.size()));
-                    bucketActionList.add(ab.build());
-
-                    /* set bucket and buckets list. Reset groupBuilder with new buckets.*/
-                    BucketsBuilder bucketsBuilder = new BucketsBuilder();
-                    List<Bucket> bucketList = Lists.newArrayList();
-                    BucketBuilder bucketBuilder = new BucketBuilder();
-                    bucketBuilder.setBucketId(new BucketId((long) 1));
-                    bucketBuilder.setKey(new BucketKey(new BucketId((long) 1)));
-                    bucketBuilder.setAction(bucketActionList);
-                    bucketList.add(bucketBuilder.build());
-                    bucketsBuilder.setBucket(bucketList);
-                    groupBuilder.setBuckets(bucketsBuilder.build());
-                    LOG.debug("createOutputGroupInstructions: bucketList {}", bucketList);
-                }
+                Bucket bucket = buckets.getBucket().get(0);
+                List<Action> bucketActionList = Lists.newArrayList();
+                bucketActionList.addAll(bucket.getAction());
+                /* set order for new action and add to action list */
+                ab.setOrder(bucketActionList.size());
+                ab.setKey(new ActionKey(bucketActionList.size()));
+                bucketActionList.add(ab.build());
+
+                /* set bucket and buckets list. Reset groupBuilder with new buckets.*/
+                BucketsBuilder bucketsBuilder = new BucketsBuilder();
+                List<Bucket> bucketList = Lists.newArrayList();
+                BucketBuilder bucketBuilder = new BucketBuilder();
+                bucketBuilder.setBucketId(new BucketId((long) 1));
+                bucketBuilder.setKey(new BucketKey(new BucketId((long) 1)));
+                bucketBuilder.setAction(bucketActionList);
+                bucketList.add(bucketBuilder.build());
+                bucketsBuilder.setBucket(bucketList);
+                groupBuilder.setBuckets(bucketsBuilder.build());
+                LOG.debug("createOutputGroupInstructions: bucketList {}", bucketList);
             }
         } else {
             /* create group */
index 87b3dee1d364fc815c22884b9af81ac0231f06dc..edea48c26cdc122d5e2c6cbd29dd478f62e90075 100644 (file)
@@ -83,7 +83,7 @@ public class PipelineOrchestratorImpl implements ConfigInterface, NodeCacheListe
         return serviceRegistry.get(service);
     }
 
-    public void start() {
+    public final void start() {
         eventHandler.submit(new Runnable()  {
             @Override
             public void run() {
@@ -93,11 +93,8 @@ public class PipelineOrchestratorImpl implements ConfigInterface, NodeCacheListe
                         LOG.info(">>>>> dequeue: {}", node);
                         for (Service service : staticPipeline) {
                             AbstractServiceInstance serviceInstance = getServiceInstance(service);
-                            //LOG.info("pipeline: {} - {}", service, serviceInstance);
-                            if (serviceInstance != null) {
-                                if (southbound.getBridge(node) != null) {
-                                    serviceInstance.programDefaultPipelineRule(node);
-                                }
+                            if (serviceInstance != null && southbound.getBridge(node) != null) {
+                                serviceInstance.programDefaultPipelineRule(node);
                             }
                         }
                     }
index 313e34b1b35054745cf05aec37aec5503096decc..e62ebb05387c5f0a8ca73230438f03b7108e4e39 100644 (file)
@@ -64,6 +64,10 @@ public class EgressAclService extends AbstractServiceInstance implements EgressA
                                        List<Neutron_IPs> srcAddressList, boolean write) {
 
         LOG.trace("programPortSecurityAcl: neutronSecurityGroup: {} ", securityGroup);
+        if (securityGroup == null || securityGroup.getSecurityRules() == null) {
+            return;
+        }
+
         List<NeutronSecurityRule> portSecurityList = securityGroup.getSecurityRules();
         /* Iterate over the Port Security Rules in the Port Security Group bound to the port*/
         for (NeutronSecurityRule portSecurityRule : portSecurityList) {
index 1bfbc2947083823d7ffe428509eff1a6038a6a67..2e8cd8533d5b0d39a6e1f003757dbeda3ae330d9 100644 (file)
@@ -61,6 +61,10 @@ public class IngressAclService extends AbstractServiceInstance implements Ingres
                                        List<Neutron_IPs> srcAddressList, boolean write) {
 
         LOG.trace("programLocalBridgeRulesWithSec neutronSecurityGroup: {} ", securityGroup);
+        if (securityGroup == null || securityGroup.getSecurityRules() == null) {
+            return;
+        }
+
         List<NeutronSecurityRule> portSecurityList = securityGroup.getSecurityRules();
         /* Iterate over the Port Security Rules in the Port Security Group bound to the port*/
         for (NeutronSecurityRule portSecurityRule : portSecurityList) {
index 8f72018b3822f8ff6668e5aed85f2e250852789d..1030915e53a35df66f7f6e9267f9d335c4cf3189 100644 (file)
@@ -73,8 +73,7 @@ public class ArpSender {
     }
 
     private NodeConnectorId createNodeConnectorId(String connectorId, NodeId nodeId) {
-        StringBuilder stringId = new StringBuilder(nodeId.getValue()).append(":").append(connectorId);
-        return new NodeConnectorId(stringId.toString());
+        return new NodeConnectorId(nodeId.getValue() + ":" + connectorId);
     }
 
     /**
index d6ce3d8b7c4a5700ae81c087b04db56e82866b43..7c2cfbebae8a3ab589561b4d89ec27bd831f686b 100644 (file)
@@ -21,8 +21,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
 
-import javax.annotation.Nullable;
-
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolver;
@@ -30,7 +28,6 @@ import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
 import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 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.inventory.rev130819.FlowCapableNode;
@@ -100,11 +97,11 @@ public class GatewayMacResolverService extends AbstractServiceInstance
     private SalFlowService flowService;
     private final AtomicLong flowCookie = new AtomicLong();
     private final ConcurrentMap<Ipv4Address, ArpResolverMetadata> gatewayToArpMetadataMap =
-            new ConcurrentHashMap<Ipv4Address, ArpResolverMetadata>();
-    private final int ARP_WATCH_BROTHERS = 10;
-    private final int WAIT_CYCLES = 3;
-    private final int PER_CYCLE_WAIT_DURATION = 1000;
-    private final int REFRESH_INTERVAL = 10;
+            new ConcurrentHashMap<>();
+    private static final int ARP_WATCH_BROTHERS = 10;
+    private static final int WAIT_CYCLES = 3;
+    private static final int PER_CYCLE_WAIT_DURATION = 1000;
+    private static final int REFRESH_INTERVAL = 10;
     private final ListeningExecutorService arpWatcherWall = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(ARP_WATCH_BROTHERS));
     private final ScheduledExecutorService gatewayMacRefresherPool = Executors.newScheduledThreadPool(1);
     private final ScheduledExecutorService refreshRequester = Executors.newSingleThreadScheduledExecutor();
@@ -183,7 +180,6 @@ public class GatewayMacResolverService extends AbstractServiceInstance
      * @param sourceMacAddress Source Mac address for the ARP request packet
      * @param periodicRefresh Enable/Disable periodic refresh of the Gateway Mac address
      * NOTE:Periodic refresh is not supported yet.
-     * @param gatewayIp  Resolve MAC address of this Gateway Ip
      * @return Future object
      */
     @Override
@@ -305,13 +301,6 @@ public class GatewayMacResolverService extends AbstractServiceInstance
         });
     }
 
-    private static @Nullable Ipv4Address getIPv4Addresses(IpAddress ipAddress) {
-        if (ipAddress.getIpv4Address() == null) {
-            return null;
-        }
-        return ipAddress.getIpv4Address();
-    }
-
     private Flow createArpReplyToControllerFlow(final ArpMessageAddress senderAddress, final Ipv4Address ipForRequestedMac) {
         checkNotNull(senderAddress);
         checkNotNull(ipForRequestedMac);
@@ -330,11 +319,11 @@ public class GatewayMacResolverService extends AbstractServiceInstance
         arpFlow.setMatch(match);
         arpFlow.setInstructions(new InstructionsBuilder().setInstruction(
                 ImmutableList.of(SEND_TO_CONTROLLER_INSTRUCTION)).build());
-        arpFlow.setId(createFlowId(senderAddress, ipForRequestedMac));
+        arpFlow.setId(createFlowId(ipForRequestedMac));
         return arpFlow.build();
     }
 
-    private FlowId createFlowId(ArpMessageAddress senderAddress, Ipv4Address ipForRequestedMac) {
+    private FlowId createFlowId(Ipv4Address ipForRequestedMac) {
         String flowId = ARP_REPLY_TO_CONTROLLER_FLOW_NAME + "|" + ipForRequestedMac.getValue();
         return new FlowId(flowId);
     }
diff --git a/openstack/net-virt-sfc/api/pom.xml b/openstack/net-virt-sfc/api/pom.xml
new file mode 100644 (file)
index 0000000..7da9620
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright Â© 2015 Red Hat, 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">
+  <parent>
+    <groupId>org.opendaylight.mdsal</groupId>
+    <artifactId>binding-parent</artifactId>
+    <version>0.8.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>openstack.net-virt-sfc-api</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>ietf-inet-types</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>ietf-yang-types-20130715</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>yang-ext</artifactId>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/openstack/net-virt-sfc/api/src/main/yang/ietf-acl.yang b/openstack/net-virt-sfc/api/src/main/yang/ietf-acl.yang
new file mode 100644 (file)
index 0000000..3549cb4
--- /dev/null
@@ -0,0 +1,199 @@
+module ietf-acl {
+  yang-version 1;
+
+  namespace "urn:ietf:params:xml:ns:yang:ietf-acl";
+
+  prefix acl;
+
+  import ietf-yang-types {
+      prefix "ietf";
+  }
+
+  import packet-fields {
+      prefix "packet-fields";
+  }
+
+  organization
+    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+  contact
+    "WG Web: http://tools.ietf.org/wg/netmod/
+    WG List: netmod@ietf.org
+
+    WG Chair: Juergen Schoenwaelder
+    j.schoenwaelder@jacobs-university.de
+
+    WG Chair: Tom Nadeau
+    tnadeau@lucidvision.com
+
+    Editor: Dean Bogdanovic
+    deanb@juniper.net
+
+    Editor: Kiran Agrahara Sreenivasa
+    kkoushik@brocade.com
+
+    Editor: Lisa Huang
+    yihuan@cisco.com
+
+    Editor: Dana Blair
+    dblair@cisco.com";
+
+  description
+    "This YANG module defines a component that describing the
+    configuration of Access Control Lists (ACLs).";
+
+  revision 2014-10-10 {
+    description "Creating base model for netmod.";
+    reference
+      "RFC 6020: YANG - A Data Modeling Language for the
+      Network Configuration Protocol (NETCONF)";
+  }
+
+  identity acl-base {
+    description "Base acl type for all ACL type identifiers.";
+  }
+
+  identity ip-acl {
+    base "acl:acl-base";
+    description "layer 3 ACL type";
+  }
+ identity eth-acl {
+    base "acl:acl-base";
+    description "layer 2 ACL type";
+  }
+
+  typedef acl-type {
+    type identityref {
+      base "acl-base";
+    }
+    description
+      "This type is used to refer to an Access Control List
+      (ACL) type";
+  }
+
+  typedef acl-ref {
+    type leafref {
+      path "/acl:access-lists/acl:access-list/acl:acl-name";
+    }
+    description "This type is used by data models that
+    need to referenced an acl";
+  }
+
+  container access-lists {
+    description
+      "Access control lists.";
+
+    list access-list {
+      key acl-name;
+      description "
+        An access list (acl) is an ordered list of
+        access list entries (ace). Each ace has a
+        sequence number to define the order, list
+        of match criteria, and a list of actions.
+        Since there are several kinds of acls
+        implementeded with different attributes for
+        each and different for each vendor, this
+        model accomodates customizing acls for
+        each kind and for each vendor.
+        ";
+
+      leaf acl-name {
+        type string;
+        description "The name of access-list.
+        A device MAY restrict the length and value of
+        this name, possibly space and special
+        characters are not allowed.";
+      }
+
+      leaf acl-type {
+        type acl-type;
+        description "Type of ACL";
+      }
+
+      container acl-oper-data {
+        config false;
+
+        description "Overall ACL operational data";
+        leaf match-counter {
+          type ietf:counter64;
+          description "Total match count for ACL";
+        }
+
+        leaf-list targets {
+          type string;
+          description "List of targets where ACL is applied";
+        }
+      }
+
+      container access-list-entries {
+        description "The access-list-entries container contains
+          a list of access-list-entry(ACE).";
+
+          list access-list-entry {
+            key rule-name;
+            ordered-by user;
+
+            description "List of access list entries(ACE)";
+            leaf rule-name {
+              type string;
+              description "Entry name.";
+            }
+
+            container matches {
+              description "Define match criteria";
+              choice ace-type {
+                description "Type of ace.";
+                case ace-ip {
+                  uses packet-fields:acl-ip-header-fields;
+                  choice ace-ip-version {
+                    description "Choice of IP version.";
+                    case ace-ipv4 {
+                      uses packet-fields:acl-ipv4-header-fields;
+                    }
+                    case ace-ipv6 {
+                      uses packet-fields:acl-ipv6-header-fields;
+                    }
+                  }
+                }
+                case ace-eth {
+                  uses packet-fields:acl-eth-header-fields;
+                }
+              }
+              uses packet-fields:metadata;
+          }
+
+          container actions {
+            description "Define action criteria";
+            choice packet-handling {
+              default deny;
+
+              description "Packet handling action.";
+              case deny {
+                leaf deny {
+                  type empty;
+                  description "Deny action.";
+                }
+              }
+              case permit {
+                leaf permit {
+                  type empty;
+                  description "Permit action.";
+                }
+              }
+            }
+          }
+
+          container ace-oper-data {
+            config false;
+
+            description "Per ace operational data";
+            leaf match-counter {
+              type ietf:counter64;
+              description "Number of matches for an ace";
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/openstack/net-virt-sfc/api/src/main/yang/netvirt-acl.yang b/openstack/net-virt-sfc/api/src/main/yang/netvirt-acl.yang
new file mode 100644 (file)
index 0000000..b16942a
--- /dev/null
@@ -0,0 +1,21 @@
+module netvirt-sfc-acl {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:netvirt:sfc:acl";
+    prefix "acl";
+
+    import ietf-acl { prefix ietf-acl;}
+    import yang-ext { prefix ext; }
+
+    revision "2015-01-05" {
+        description "Initial revision of netvirt extensions to ietf-acl model";
+    }
+
+    // TODO: Add choice for Neutron and add fields there instead of at the root of matches
+    augment "/ietf-acl:access-lists/ietf-acl:access-list/ietf-acl:access-list-entries" +
+            "/ietf-acl:access-list-entry/ietf-acl:matches" {
+        description "Neutron network uuid";
+        leaf network-uuid {
+            type string;
+        }
+    }
+}
diff --git a/openstack/net-virt-sfc/api/src/main/yang/netvirt-classifier.yang b/openstack/net-virt-sfc/api/src/main/yang/netvirt-classifier.yang
new file mode 100644 (file)
index 0000000..c0aec3a
--- /dev/null
@@ -0,0 +1,37 @@
+module netvirt-sfc-classifier {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:netvirt:sfc:classifier";
+    prefix "classifier";
+
+    import ietf-inet-types { prefix inet;}
+    import ietf-yang-types { prefix yang;}
+
+    revision "2015-01-05" {
+        description "Initial revision of netvirt classifier model";
+    }
+
+    container classifiers {
+        description "Classifier container which represents the ACL being applied,
+                     atachment point and the associated chain";
+
+        list classifier {
+            description "A list of SFC classifiers";
+            key "name";
+            leaf name {
+                type string;
+            }
+            leaf acl {
+                type string;
+            }
+            container sffs {
+                list sff {
+                    description "The classifier will be attached to these SFFs";
+                    key "name";
+                    leaf name {
+                        type string;
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/openstack/net-virt-sfc/api/src/main/yang/netvirt-sfc.yang b/openstack/net-virt-sfc/api/src/main/yang/netvirt-sfc.yang
new file mode 100644 (file)
index 0000000..e00ddb6
--- /dev/null
@@ -0,0 +1,15 @@
+module netvirt-sfc {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:netvirt:sfc";
+    prefix "netvirt-sfc";
+
+    revision "2015-01-05" {
+        description "Initial revision of the netvirt sfc model";
+    }
+
+    container sfc {
+        leaf name {
+            type string;
+        }
+    }
+}
diff --git a/openstack/net-virt-sfc/api/src/main/yang/packet-fields.yang b/openstack/net-virt-sfc/api/src/main/yang/packet-fields.yang
new file mode 100644 (file)
index 0000000..bea6777
--- /dev/null
@@ -0,0 +1,152 @@
+module packet-fields {
+    yang-version 1;
+
+    namespace "urn:ietf:params:xml:ns:yang:packet-fields";
+
+    prefix packet-fields;
+
+    import ietf-inet-types {
+        prefix "inet";
+    }
+
+    import ietf-yang-types {
+        prefix "yang";
+    }
+
+    revision 2014-06-25 {
+        description "Initial version of packet fields used by access-lists";
+    }
+
+    grouping acl-transport-header-fields {
+        description "Transport header fields";
+
+        container source-port-range {
+             description "inclusive range of source ports";
+             leaf lower-port {
+                 mandatory true;
+                 type inet:port-number;
+             }
+             leaf upper-port {
+                 type inet:port-number;
+             }
+        }
+
+        container destination-port-range {
+             description "inclusive range of destination ports";
+             leaf lower-port {
+                 mandatory true;
+                 type inet:port-number;
+             }
+             leaf upper-port {
+                 type inet:port-number;
+             }
+        }
+    }
+
+    grouping acl-ip-header-fields {
+        description "Header fields common to ipv4 and ipv6";
+
+        uses acl-transport-header-fields;
+
+        leaf dscp {
+            type inet:dscp;
+        }
+
+        leaf ip-protocol {
+            type uint8;
+        }
+
+    }
+
+    grouping acl-ipv4-header-fields {
+        description "fields in IPv4 header";
+
+        leaf destination-ipv4-address {
+            type inet:ipv4-prefix;
+        }
+
+        leaf source-ipv4-address {
+            type inet:ipv4-prefix;
+        }
+
+    }
+
+    grouping acl-ipv6-header-fields {
+        description "fields in IPv6 header";
+
+        leaf destination-ipv6-address {
+            type inet:ipv6-prefix;
+        }
+
+        leaf source-ipv6-address {
+            type inet:ipv6-prefix;
+        }
+
+        leaf flow-label {
+            type inet:ipv6-flow-label;
+        }
+
+    }
+
+    grouping acl-eth-header-fields {
+        description "fields in ethernet header";
+
+        leaf destination-mac-address {
+            type yang:mac-address;
+        }
+
+        leaf destination-mac-address-mask {
+            type yang:mac-address;
+        }
+
+        leaf source-mac-address {
+            type yang:mac-address;
+        }
+
+        leaf source-mac-address-mask {
+            type yang:mac-address;
+        }
+    }
+
+    grouping timerange {
+        description "Define time range entries to restrict
+            the access. The time range is identified by a name
+            and then referenced by a function, so that those
+            time restrictions are imposed on the function itself.";
+
+        container absolute {
+            description
+                "Absolute time and date that
+                the associated function starts
+                going into effect.";
+
+            leaf start {
+                type yang:date-and-time;
+                description
+                "Start time and date";
+            }
+            leaf end {
+                type yang:date-and-time;
+                description "Absolute end time and date";
+            }
+            leaf active {
+                type boolean;
+                default "true";
+                description
+                    "Specify the associated function
+                    active or inactive state when
+                    starts going into effect";
+            }
+        } // container absolute
+    } //grouping timerange
+
+    grouping metadata {
+        description "Fields associated with a packet but not in the header";
+
+        leaf input-interface {
+             description "Packet was received on this interface";
+             type string;
+        }
+        uses timerange;
+    }
+}
diff --git a/openstack/net-virt-sfc/artifacts/pom.xml b/openstack/net-virt-sfc/artifacts/pom.xml
new file mode 100644 (file)
index 0000000..6344072
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright Â© 2015 Red Hat, 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>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>openstack.net-virt-sfc-artifacts</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>openstack.net-virt-sfc-api</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>openstack.net-virt-sfc-impl</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>openstack.net-virt-sfc-features</artifactId>
+        <version>${project.version}</version>
+        <classifier>features</classifier>
+        <type>xml</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+</project>
diff --git a/openstack/net-virt-sfc/features/pom.xml b/openstack/net-virt-sfc/features/pom.xml
new file mode 100644 (file)
index 0000000..b43649a
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright Â© 2015 Red Hat, 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 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>features-parent</artifactId>
+    <version>1.6.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>openstack.net-virt-sfc-features</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <name>${project.artifactId}</name>
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <properties>
+    <mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
+    <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
+    <restconf.version>1.3.0-SNAPSHOT</restconf.version>
+    <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+    <dlux.version>0.3.0-SNAPSHOT</dlux.version>
+    <configfile.directory>etc/opendaylight/karaf</configfile.directory>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <!-- project specific dependencies -->
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>${mdsal.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.netconf</groupId>
+        <artifactId>restconf-artifacts</artifactId>
+        <version>${restconf.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>features-yangtools</artifactId>
+      <classifier>features</classifier>
+      <version>${yangtools.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>features-mdsal-model</artifactId>
+      <version>${mdsal.model.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>features-mdsal</artifactId>
+      <classifier>features</classifier>
+      <version>${mdsal.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.netconf</groupId>
+      <artifactId>features-restconf</artifactId>
+      <classifier>features</classifier>
+      <version>${restconf.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.dlux</groupId>
+      <artifactId>features-dlux</artifactId>
+      <classifier>features</classifier>
+      <version>${dlux.version}</version>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>openstack.net-virt-sfc-impl</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>openstack.net-virt-sfc-impl</artifactId>
+      <version>${project.version}</version>
+      <type>xml</type>
+      <classifier>config</classifier>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>openstack.net-virt-sfc-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/openstack/net-virt-sfc/features/src/main/features/features.xml b/openstack/net-virt-sfc/features/src/main/features/features.xml
new file mode 100644 (file)
index 0000000..d425a26
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright Â© 2015 Red Hat, 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
+-->
+<features name="odl-ovsdb-sfc-${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.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.version}/xml/features</repository>
+  <feature name='odl-ovsdb-sfc-api' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: api'>
+    <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
+    <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-api/${project.version}</bundle>
+  </feature>
+  <feature name='odl-ovsdb-sfc' version='${project.version}' description='OpenDaylight :: ovsdb-sfc'>
+    <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+    <feature version='${project.version}'>odl-ovsdb-sfc-api</feature>
+    <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/${project.version}</bundle>
+    <configfile finalname="${configfile.directory}/openstack.net-virt-sfc.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/${project.version}/xml/config</configfile>
+  </feature>
+  <feature name='odl-ovsdb-sfc-rest' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: REST'>
+    <feature version="${project.version}">odl-ovsdb-sfc</feature>
+    <feature version="${restconf.version}">odl-restconf</feature>
+  </feature>
+  <feature name='odl-ovsdb-sfc-ui' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: UI'>
+    <feature version="${project.version}">odl-ovsdb-sfc-rest</feature>
+    <feature version="${restconf.version}">odl-mdsal-apidocs</feature>
+    <feature version="${mdsal.version}">odl-mdsal-xsql</feature>
+    <feature version="${dlux.version}">odl-dlux-yangui</feature>
+  </feature>
+
+</features>
diff --git a/openstack/net-virt-sfc/impl/pom.xml b/openstack/net-virt-sfc/impl/pom.xml
new file mode 100644 (file)
index 0000000..9c8652e
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright Â© 2015 Red Hat, 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">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.4.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>openstack.net-virt-sfc-impl</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>openstack.net-virt-sfc-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <!-- Testing Dependencies -->
+    <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>
+
+</project>
diff --git a/openstack/net-virt-sfc/impl/src/main/config/default-config.xml b/openstack/net-virt-sfc/impl/src/main/config/default-config.xml
new file mode 100644 (file)
index 0000000..402b72d
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright Â© 2015 Red Hat, 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>
+  <required-capabilities>
+    <capability>urn:opendaylight:params:xml:ns:yang:netvirt:sfc?module=netvirt-sfc&amp;revision=2014-12-10</capability>
+    <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
+  </required-capabilities>
+  <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:prefix="urn:opendaylight:params:xml:ns:yang:netvirt:sfc">prefix:netvirt-sfc</type>
+          <name>netvirt-sfc-default</name>
+          <broker>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+            <name>binding-osgi-broker</name>
+          </broker>
+        </module>
+      </modules>
+    </data>
+  </configuration>
+</snapshot>
diff --git a/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcProvider.java b/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcProvider.java
new file mode 100644 (file)
index 0000000..e303a58
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright Â© 2015 Red Hat, 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.ovsdb.openstack.netvirt.sfc;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NetvirtSfcProvider implements BindingAwareProvider, AutoCloseable {
+
+    private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcProvider.class);
+
+    @Override
+    public void onSessionInitiated(ProviderContext session) {
+        LOG.info("NetvirtSfcProvider Session Initiated");
+    }
+
+    @Override
+    public void close() throws Exception {
+        LOG.info("NetvirtSfcProvider Closed");
+    }
+
+}
diff --git a/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModule.java b/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModule.java
new file mode 100644 (file)
index 0000000..73a1db6
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210;
+
+import org.opendaylight.ovsdb.openstack.netvirt.sfc.NetvirtSfcProvider;
+
+public class NetvirtSfcModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210.AbstractNetvirtSfcModule {
+    public NetvirtSfcModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public NetvirtSfcModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210.NetvirtSfcModule oldModule, 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() {
+        NetvirtSfcProvider provider = new NetvirtSfcProvider();
+        getBrokerDependency().registerProvider(provider);
+        return provider;
+    }
+
+}
diff --git a/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleFactory.java b/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleFactory.java
new file mode 100644 (file)
index 0000000..26e2fd5
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: netvirt-sfc yang module local name: netvirt-sfc
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Wed Sep 23 15:18:24 EDT 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210;
+public class NetvirtSfcModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210.AbstractNetvirtSfcModuleFactory {
+
+}
diff --git a/openstack/net-virt-sfc/impl/src/main/yang/netvirt-sfc.yang b/openstack/net-virt-sfc/impl/src/main/yang/netvirt-sfc.yang
new file mode 100644 (file)
index 0000000..8eb6479
--- /dev/null
@@ -0,0 +1,35 @@
+module netvirt-sfc {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:netvirt:sfc";
+    prefix "netvirt-sfc";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+
+    description
+        "Service definition for netvirt sfc project";
+
+    revision "2014-12-10" {
+        description
+            "Initial revision";
+    }
+
+    identity netvirt-sfc {
+        base config:module-type;
+        config:java-name-prefix NetvirtSfc;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case netvirt-sfc {
+            when "/config:modules/config:module/config:type = 'netvirt-sfc'";
+            container broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity md-sal-binding:binding-broker-osgi-registry;
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/openstack/net-virt-sfc/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleFactoryTest.java b/openstack/net-virt-sfc/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleFactoryTest.java
new file mode 100644 (file)
index 0000000..b176a59
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright Â© 2015 Red Hat, 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.params.xml.ns.yang.netvirt.sfc.rev141210;
+
+import org.junit.Test;
+
+public class NetvirtSfcModuleFactoryTest {
+    @Test
+    public void testFactoryConstructor() {
+        // ensure no exceptions on construction
+        new NetvirtSfcModuleFactory();
+    }
+}
diff --git a/openstack/net-virt-sfc/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleTest.java b/openstack/net-virt-sfc/impl/src/test/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleTest.java
new file mode 100644 (file)
index 0000000..f3cb611
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright Â© 2015 Red Hat, 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.params.xml.ns.yang.netvirt.sfc.rev141210;
+
+import org.junit.Test;
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.JmxAttribute;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.ovsdb.openstack.netvirt.sfc.NetvirtSfcProvider;
+
+import javax.management.ObjectName;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class NetvirtSfcModuleTest {
+    @Test
+    public void testCustomValidation() {
+        NetvirtSfcModule module = new NetvirtSfcModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class));
+
+        // ensure no exceptions on validation
+        // currently this method is empty
+        module.customValidation();
+    }
+
+    @Test
+    public void testCreateInstance() throws Exception {
+        // configure mocks
+        DependencyResolver dependencyResolver = mock(DependencyResolver.class);
+        BindingAwareBroker broker = mock(BindingAwareBroker.class);
+        when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
+
+        // create instance of module with injected mocks
+        NetvirtSfcModule module = new NetvirtSfcModule(mock(ModuleIdentifier.class), dependencyResolver);
+
+        // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
+        AutoCloseable closeable = module.getInstance();
+
+        // verify that the module registered the returned provider with the broker
+        verify(broker).registerProvider((NetvirtSfcProvider)closeable);
+
+        // ensure no exceptions on close
+        closeable.close();
+    }
+}
diff --git a/openstack/net-virt-sfc/it/pom.xml b/openstack/net-virt-sfc/it/pom.xml
new file mode 100644 (file)
index 0000000..7b81253
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright Â© 2015 Red Hat, 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">
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>mdsal-it-parent</artifactId>
+    <version>1.3.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>openstack.net-virt-sfc-it</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <properties>
+    <skipITs>false</skipITs>
+    <karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
+    <karaf.distro.artifactId>openstack.net-virt-sfc-karaf</karaf.distro.artifactId>
+    <karaf.distro.version>1.0.0-SNAPSHOT</karaf.distro.version>
+    <karaf.distro.type>zip</karaf.distro.type>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>openstack.net-virt-sfc-features</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java b/openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java
new file mode 100644 (file)
index 0000000..d8a5a84
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright Â© 2015 Red Hat, 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.ovsdb.openstack.netvirt.sfc;
+
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class NetvirtSfcIT extends AbstractMdsalTestBase {
+    private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcIT.class);
+
+    @Override
+    public String getModuleName() {
+        return "netvirt-sfc";
+    }
+
+    @Override
+    public String getInstanceName() {
+        return "netvirt-sfc-default";
+    }
+
+    @Override
+    public MavenUrlReference getFeatureRepo() {
+        return maven()
+                .groupId("org.opendaylight.ovsdb")
+                .artifactId("openstack.net-virt-sfc-features")
+                .classifier("features")
+                .type("xml")
+                .versionAsInProject();
+    }
+
+    @Override
+    public String getFeatureName() {
+        return "odl-ovsdb-sfc-ui";
+    }
+
+    @Override
+    public Option getLoggingOption() {
+        Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                logConfiguration(NetvirtSfcIT.class),
+                LogLevel.INFO.name());
+        option = composite(option, super.getLoggingOption());
+        return option;
+    }
+
+    @Test
+    public void testnetvirtsfcFeatureLoad() {
+        Assert.assertTrue(true);
+    }
+}
diff --git a/openstack/net-virt-sfc/karaf/pom.xml b/openstack/net-virt-sfc/karaf/pom.xml
new file mode 100644 (file)
index 0000000..e193631
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright Â© 2015 Red Hat, 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 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.controller</groupId>
+    <artifactId>karaf-parent</artifactId>
+    <version>1.6.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>openstack.net-virt-sfc-karaf</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <name>${project.artifactId}</name>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <properties>
+    <karaf.localFeature>odl-ovsdb-sfc-ui</karaf.localFeature>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>openstack.net-virt-sfc-artifacts</artifactId>
+        <version>${project.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <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 -->
+      <groupId>org.apache.karaf.features</groupId>
+      <artifactId>framework</artifactId>
+      <type>kar</type>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>openstack.net-virt-sfc-features</artifactId>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+  <!-- DO NOT install or deploy the karaf artifact -->
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/openstack/net-virt-sfc/pom.xml b/openstack/net-virt-sfc/pom.xml
new file mode 100644 (file)
index 0000000..810b37b
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright Â© 2015 Red Hat, 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 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.6.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>openstack.net-virt-sfc-aggregator</artifactId>
+  <version>1.2.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <modules>
+    <module>api</module>
+    <module>impl</module>
+    <module>karaf</module>
+    <module>features</module>
+    <module>artifacts</module>
+    <module>it</module>
+  </modules>
+  <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
+  </scm>
+</project>
index 8109a517bb765b132c209717f8ccc8e8c3be8201..f80c2c9d1589b35f03c15d030747e80264d309df 100644 (file)
@@ -53,6 +53,26 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <root.directory>${env.PWD}</root.directory>
     <sonar.jacoco.itReportPath>${root.directory}/target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
   </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>2.0.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.mdsal.model</groupId>
+        <artifactId>mdsal-model-artifacts</artifactId>
+        <version>0.8.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.commons</groupId>
@@ -111,23 +131,23 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>concepts</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-topology</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>opendaylight-l2-types</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types-20130715</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types</artifactId>
     </dependency>
     <dependency>
index 38b1d5335eaa74ee5be55fd0c8ca326eeac52541..87fc3e0c2f47f2caa8745fd9a49ef7e7c72d6410 100644 (file)
@@ -101,18 +101,16 @@ public class MdsalHelper {
     }
 
     public static InstanceIdentifier<Topology> createInstanceIdentifier() {
-        InstanceIdentifier<Topology> path = InstanceIdentifier
+        return InstanceIdentifier
                 .create(NetworkTopology.class)
                 .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID));
-        return path;
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) {
-        InstanceIdentifier<Node> nodePath = InstanceIdentifier
+        return InstanceIdentifier
                 .create(NetworkTopology.class)
                 .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID))
                 .child(Node.class,new NodeKey(nodeId));
-        return nodePath;
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(NodeKey ovsdbNodeKey, String bridgeName) {
index 8f21cb8902070819fbb1aebc0b4718dbe45d13b1..8eaed984f10a106608882576d3d20b789f70b94b 100644 (file)
@@ -295,10 +295,8 @@ public class SouthboundHandler extends AbstractHandler
     private void processPortUpdate(Node node, OvsdbTerminationPointAugmentation port) {
         LOG.debug("processPortUpdate <{}> <{}>", node, port);
         NeutronNetwork network = tenantNetworkManager.getTenantNetwork(port);
-        if (network != null ){
-            if(!network.getRouterExternal()){
-                this.handleInterfaceUpdate(node, port);
-            }
+        if (network != null && !network.getRouterExternal()) {
+            this.handleInterfaceUpdate(node, port);
         }
     }
 
index a9e84bad2dc9f657b07c9c55433393d50818aa49..bc40093955545c17c1e73b8af2728f9f0a016d38 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.ovsdb.openstack.netvirt.impl;
 
 import org.opendaylight.neutron.spi.NeutronNetwork;
 import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.MdsalHelper;
 import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
 import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
 import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
@@ -127,19 +126,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
             Preconditions.checkNotNull(portNameExt);
 
             if (southbound.isBridgeOnOvsdbNode(ovsdbNode, brExt)) {
-                //this would look better if used a method like isNetworkPatchCreated()
-                if (isPortOnBridge(bridgeNode, portNameInt)) {
-                    Node extBridgeNode = southbound.readBridgeNode(ovsdbNode, brExt);
-                    if (isPortOnBridge(extBridgeNode, portNameExt)) {
-                        ready = true;
-                    } else {
-                        LOG.trace("isNodeL3Ready: node: {}, {} missing",
-                                bridgeNode, portNameExt);
-                    }
-                } else {
-                    LOG.trace("isNodeL3Ready: node: {}, {} missing",
-                            bridgeNode, portNameInt);
-                }
+                ready = isNetworkPatchCreated(bridgeNode, southbound.readBridgeNode(ovsdbNode, brExt));
             } else {
                 LOG.trace("isNodeL3Ready: node: {}, {} missing",
                         bridgeNode, brExt);
@@ -261,7 +248,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
     /**
      * Returns true if a patch port exists between the Integration Bridge and Network Bridge
      */
-    private boolean isNetworkPatchCreated(Node node, Node intBridge, Node netBridge) {
+    private boolean isNetworkPatchCreated(Node intBridge, Node netBridge) {
         Preconditions.checkNotNull(configurationService);
 
         boolean isPatchCreated = false;
@@ -280,7 +267,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
     /**
      * Creates the Integration Bridge
      */
-    private boolean createIntegrationBridge(Node ovsdbNode) throws Exception {
+    private boolean createIntegrationBridge(Node ovsdbNode) {
         Preconditions.checkNotNull(configurationService);
 
         if (!addBridge(ovsdbNode, configurationService.getIntegrationBridgeName())) {
@@ -290,7 +277,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
         return true;
     }
 
-    private boolean createExternalBridge(Node ovsdbNode) throws Exception {
+    private boolean createExternalBridge(Node ovsdbNode) {
         Preconditions.checkNotNull(configurationService);
 
         if (!addBridge(ovsdbNode, configurationService.getExternalBridgeName())) {
@@ -355,7 +342,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
                 Interface br-int
                     type: internal
      */
-    private boolean createBridges(Node bridgeNode, Node ovsdbNode, NeutronNetwork network) throws Exception {
+    private boolean createBridges(Node bridgeNode, Node ovsdbNode, NeutronNetwork network) {
         Preconditions.checkNotNull(configurationService);
         Preconditions.checkNotNull(networkingProviderManager);
 
@@ -408,7 +395,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
     /**
      * Add a Port to a Bridge
      */
-    private boolean addPortToBridge (Node node, String bridgeName, String portName) throws Exception {
+    private boolean addPortToBridge (Node node, String bridgeName, String portName) {
         boolean rv = true;
 
         if (southbound.extractTerminationPointAugmentation(node, portName) == null) {
@@ -432,7 +419,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
     /**
      * Add a Patch Port to a Bridge
      */
-    private boolean addPatchPort (Node node, String bridgeName, String portName, String peerPortName) throws Exception {
+    private boolean addPatchPort (Node node, String bridgeName, String portName, String peerPortName) {
         boolean rv = true;
 
         if (southbound.extractTerminationPointAugmentation(node, portName) == null) {
@@ -456,7 +443,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
     /**
      * Add Bridge to a Node
      */
-    private boolean addBridge(Node ovsdbNode, String bridgeName) throws Exception {
+    private boolean addBridge(Node ovsdbNode, String bridgeName) {
         boolean rv = true;
         if ((!southbound.isBridgeOnOvsdbNode(ovsdbNode, bridgeName)) ||
                 (southbound.getBridgeFromConfig(ovsdbNode, bridgeName) == null)) {
@@ -466,13 +453,10 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
     }
 
     private String getControllerIPAddress() {
-        InetAddress controllerIP = null;
-
         String addressString = ConfigProperties.getProperty(this.getClass(), "ovsdb.controller.address");
         if (addressString != null) {
             try {
-                controllerIP = InetAddress.getByName(addressString);
-                if (controllerIP != null) {
+                if (InetAddress.getByName(addressString) != null) {
                     return addressString;
                 }
             } catch (UnknownHostException e) {
@@ -483,8 +467,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
         addressString = ConfigProperties.getProperty(this.getClass(), "of.address");
         if (addressString != null) {
             try {
-                controllerIP = InetAddress.getByName(addressString);
-                if (controllerIP != null) {
+                if (InetAddress.getByName(addressString) != null) {
                     return addressString;
                 }
             } catch (UnknownHostException e) {
index f5ef9be5dea61ca7cb7e8af190fc6886699a62cc..b679902d379915abf3bdc006b1efc5cee6cd065a 100644 (file)
@@ -73,12 +73,17 @@ public class NeutronL3Adapter implements ConfigInterface {
     private volatile GatewayMacResolver gatewayMacResolver;
 
     private class FloatIpData {
-        private final Long dpid;          // br-int of node where floating ip is associated with tenant port
-        private final Long ofPort;        // patch port in br-int used to reach br-ex
-        private final String segId;       // segmentation id of the net where fixed ip is instantiated
-        private final String macAddress;  // mac address assigned to neutron port of floating ip
+        // br-int of node where floating ip is associated with tenant port
+        private final Long dpid;
+        // patch port in br-int used to reach br-ex
+        private final Long ofPort;
+        // segmentation id of the net where fixed ip is instantiated
+        private final String segId;
+        // mac address assigned to neutron port of floating ip
+        private final String macAddress;
         private final String floatingIpAddress;
-        private final String fixedIpAddress;  // ip address given to tenant vm
+        // ip address given to tenant vm
+        private final String fixedIpAddress;
         private final String neutronRouterMac;
 
         FloatIpData(final Long dpid, final Long ofPort, final String segId, final String macAddress,
@@ -212,14 +217,12 @@ public class NeutronL3Adapter implements ConfigInterface {
             }else{
                 NeutronNetwork externalNetwork = neutronNetworkCache.getNetwork(neutronPort.getNetworkUUID());
 
-                if(externalNetwork != null){
-                    if(externalNetwork.isRouterExternal()){
-                        final NeutronSubnet externalSubnet = getExternalNetworkSubnet(neutronPort);
-                        // TODO support IPv6
-                        if (externalSubnet != null &&
+                if (externalNetwork != null && externalNetwork.isRouterExternal()) {
+                    final NeutronSubnet externalSubnet = getExternalNetworkSubnet(neutronPort);
+                    // TODO support IPv6
+                    if (externalSubnet != null &&
                             externalSubnet.getIpVersion() == 4) {
-                            gatewayMacResolver.stopPeriodicRefresh(new Ipv4Address(externalSubnet.getGatewayIP()));
-                        }
+                        gatewayMacResolver.stopPeriodicRefresh(new Ipv4Address(externalSubnet.getGatewayIP()));
                     }
                 }
             }
@@ -234,7 +237,8 @@ public class NeutronL3Adapter implements ConfigInterface {
             for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) {
                 NeutronRouter_Interface neutronRouterInterface =
                         new NeutronRouter_Interface(neutronIP.getSubnetUUID(), neutronPort.getPortUUID());
-                neutronRouterInterface.setID(neutronIP.getSubnetUUID());  // id of router interface to be same as subnet
+                // id of router interface to be same as subnet
+                neutronRouterInterface.setID(neutronIP.getSubnetUUID());
                 neutronRouterInterface.setTenantID(neutronPort.getTenantID());
 
                 this.handleNeutronRouterInterfaceEvent(null /*neutronRouter*/, neutronRouterInterface, action);
@@ -245,14 +249,12 @@ public class NeutronL3Adapter implements ConfigInterface {
             // need to do this check here because a router interface is not added to a node until tenant becomes needed
             // there.
             //
-            if (!isDelete) {
-                if (neutronPort.getFixedIPs() != null) {
-                    for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) {
-                        NeutronRouter_Interface neutronRouterInterface =
+            if (!isDelete && neutronPort.getFixedIPs() != null) {
+                for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) {
+                    NeutronRouter_Interface neutronRouterInterface =
                             subnetIdToRouterInterfaceCache.get(neutronIP.getSubnetUUID());
-                        if (neutronRouterInterface != null) {
-                            this.handleNeutronRouterInterfaceEvent(null /*neutronRouter*/, neutronRouterInterface, action);
-                        }
+                    if (neutronRouterInterface != null) {
+                        this.handleNeutronRouterInterfaceEvent(null /*neutronRouter*/, neutronRouterInterface, action);
                     }
                 }
             }
@@ -345,7 +347,8 @@ public class NeutronL3Adapter implements ConfigInterface {
         // this.programFlowsForFloatingIP(neutronFloatingIP, action == Action.DELETE);
 
         if (action != Action.DELETE) {
-            programFlowsForFloatingIPArpAdd(neutronFloatingIP);  // must be first, as it updates floatIpDataMapCache
+            // must be first, as it updates floatIpDataMapCache
+            programFlowsForFloatingIPArpAdd(neutronFloatingIP);
 
             programFlowsForFloatingIPInbound(neutronFloatingIP, Action.ADD);
             programFlowsForFloatingIPOutbound(neutronFloatingIP, Action.ADD);
@@ -353,7 +356,8 @@ public class NeutronL3Adapter implements ConfigInterface {
             programFlowsForFloatingIPOutbound(neutronFloatingIP, Action.DELETE);
             programFlowsForFloatingIPInbound(neutronFloatingIP, Action.DELETE);
 
-            programFlowsForFloatingIPArpDelete(neutronFloatingIP.getID()); // must be last, as it updates floatIpDataMapCache
+            // must be last, as it updates floatIpDataMapCache
+            programFlowsForFloatingIPArpDelete(neutronFloatingIP.getID());
         }
     }
 
@@ -654,14 +658,14 @@ public class NeutronL3Adapter implements ConfigInterface {
         // will look at desired action for node.
 
         final String cacheKey = node.getNodeId().getValue() + ":" + providerSegmentationId + ":" + ipStr;
-        final Boolean isProgrammed = l3ForwardingCache.contains(cacheKey);
+        final boolean isProgrammed = l3ForwardingCache.contains(cacheKey);
 
-        if (actionForNode == Action.DELETE && isProgrammed == Boolean.FALSE) {
+        if (actionForNode == Action.DELETE && !isProgrammed) {
             LOG.trace("programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {} is already done",
                          node.getNodeId().getValue(), providerSegmentationId, macAddress, ipStr, actionForNode);
             return;
         }
-        if (actionForNode == Action.ADD && isProgrammed == Boolean.TRUE) {
+        if (actionForNode == Action.ADD && isProgrammed) {
             LOG.trace("programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {} is already done",
                     node.getNodeId().getValue(), providerSegmentationId, macAddress, ipStr, actionForNode);
             return;
@@ -914,16 +918,16 @@ public class NeutronL3Adapter implements ConfigInterface {
         final String cacheKey = node.getNodeId().getValue() + ":" +
                                 sourceSegmentationId + ":" + destinationSegmentationId + ":" +
                                 ipStr + "/" + Integer.toString(mask);
-        final Boolean isProgrammed = routerInterfacesCache.contains(cacheKey);
+        final boolean isProgrammed = routerInterfacesCache.contains(cacheKey);
 
-        if (actionForNode == Action.DELETE && isProgrammed == Boolean.FALSE) {
+        if (actionForNode == Action.DELETE && !isProgrammed) {
             LOG.trace("programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
                          " action {} is already done",
                          node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
                          macAddress, ipStr, mask, actionForNode);
             return;
         }
-        if (actionForNode == Action.ADD && isProgrammed == Boolean.TRUE) {
+        if (actionForNode == Action.ADD && isProgrammed) {
             LOG.trace("programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
                          " action {} is already done",
                          node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
@@ -981,14 +985,14 @@ public class NeutronL3Adapter implements ConfigInterface {
         // will look at desired action for node.
         //
         final String cacheKey = dpid + ":" + segOrOfPort + ":" + ipStr;
-        final Boolean isProgrammed = staticArpEntryCache.contains(cacheKey);
+        final boolean isProgrammed = staticArpEntryCache.contains(cacheKey);
 
-        if (action == Action.DELETE && isProgrammed == Boolean.FALSE) {
+        if (action == Action.DELETE && !isProgrammed) {
             LOG.trace("programStaticArpStage1 dpid {} segOrOfPort {} mac {} ip {} action {} is already done",
                     dpid, segOrOfPort, macAddress, ipStr, action);
             return true;
         }
-        if (action == Action.ADD && isProgrammed == Boolean.TRUE) {
+        if (action == Action.ADD && isProgrammed) {
             LOG.trace("programStaticArpStage1 dpid {} segOrOfPort {} mac {} ip {} action {} is already done",
                     dpid, segOrOfPort, macAddress, ipStr, action);
             return true;
@@ -1041,15 +1045,15 @@ public class NeutronL3Adapter implements ConfigInterface {
         // will look at desired action for node.
         //
         final String cacheKey = dpid + ":" + inboundOFPort + ":" + providerSegmentationId + ":" + matchAddress;
-        final Boolean isProgrammed = inboundIpRewriteCache.contains(cacheKey);
+        final boolean isProgrammed = inboundIpRewriteCache.contains(cacheKey);
 
-        if (action == Action.DELETE && isProgrammed == Boolean.FALSE) {
+        if (action == Action.DELETE && !isProgrammed) {
             LOG.trace("programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
                     " action {} is already done",
                     dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action);
             return true;
         }
-        if (action == Action.ADD && isProgrammed == Boolean.TRUE) {
+        if (action == Action.ADD && isProgrammed) {
             LOG.trace("programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
                     " action is already done",
                     dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action);
@@ -1106,14 +1110,14 @@ public class NeutronL3Adapter implements ConfigInterface {
         // will look at desired action for node.
         //
         final String cacheKey = node.getNodeId().getValue() + ":" + providerSegmentationId + ":" + cidr;
-        final Boolean isProgrammed = outboundIpRewriteExclusionCache.contains(cacheKey);
+        final boolean isProgrammed = outboundIpRewriteExclusionCache.contains(cacheKey);
 
-        if (actionForRewriteExclusion == Action.DELETE && isProgrammed == Boolean.FALSE) {
+        if (actionForRewriteExclusion == Action.DELETE && !isProgrammed) {
             LOG.trace("programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {} is already done",
                          node.getNodeId().getValue(), providerSegmentationId, cidr, actionForRewriteExclusion);
             return;
         }
-        if (actionForRewriteExclusion == Action.ADD && isProgrammed == Boolean.TRUE) {
+        if (actionForRewriteExclusion == Action.ADD && isProgrammed) {
             LOG.trace("programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {} is already done",
                          node.getNodeId().getValue(), providerSegmentationId, cidr, actionForRewriteExclusion);
             return;
@@ -1153,15 +1157,15 @@ public class NeutronL3Adapter implements ConfigInterface {
         // will look at desired action for node.
         //
         final String cacheKey = fid.dpid + ":" + fid.segId + ":" + fid.fixedIpAddress;
-        final Boolean isProgrammed = outboundIpRewriteCache.contains(cacheKey);
+        final boolean isProgrammed = outboundIpRewriteCache.contains(cacheKey);
 
-        if (action == Action.DELETE && isProgrammed == Boolean.FALSE) {
+        if (action == Action.DELETE && !isProgrammed) {
             LOG.trace("programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} " +
                          "is already done",
                     fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action);
             return;
         }
-        if (action == Action.ADD && isProgrammed == Boolean.TRUE) {
+        if (action == Action.ADD && isProgrammed) {
             LOG.trace("programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} " +
                          "is already done",
                     fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action);
index 284074d936f6c66cce757b9ef263f4c918041a28..a2087e14e5157f94de4aa176cd5e8618add8987b 100644 (file)
@@ -109,6 +109,10 @@ public class SecurityServicesImpl implements ConfigInterface, SecurityServicesMa
                 LOG.error("getDHCPServerPort: neutron port of {} is not found", neutronPortId);
                 return null;
             }
+            /* if the current port is a DHCP port, return the same*/
+            if (neutronPort.getDeviceOwner().contains("dhcp")) {
+                return neutronPort;
+            }
             /*Since all the fixed ip assigned to a port should be
              *from the same network, first port is sufficient.*/
             List<Neutron_IPs> fixedIps = neutronPort.getFixedIPs();
@@ -197,18 +201,16 @@ public class SecurityServicesImpl implements ConfigInterface, SecurityServicesMa
                                                                                 Constants.EXTERNAL_ID_INTERFACE_ID);
                         if (null != portId) {
                             NeutronPort port = neutronPortCache.getPort(portId);
-                            if (null != port) {
-                                if (!(port.getID().equals(neutronPort.getID()))
-                                        && port.getDeviceOwner().contains("compute")) {
-                                    List<Neutron_IPs> portFixedIp = port.getFixedIPs();
-                                    if (null == portFixedIp || portFixedIp.isEmpty()) {
-                                        return false;
-                                    }
-                                    if (portFixedIp.iterator().next().getSubnetUUID()
-                                            .equals(neutronPort.getFixedIPs().iterator().next().getSubnetUUID())) {
-                                        LOG.trace("isLastPortinSubnet: Port is not the only port.");
-                                        return false;
-                                    }
+                            if (null != port && !(port.getID().equals(neutronPort.getID()))
+                                    && port.getDeviceOwner().contains("compute")) {
+                                List<Neutron_IPs> portFixedIp = port.getFixedIPs();
+                                if (null == portFixedIp || portFixedIp.isEmpty()) {
+                                    return false;
+                                }
+                                if (portFixedIp.iterator().next().getSubnetUUID()
+                                        .equals(neutronPort.getFixedIPs().iterator().next().getSubnetUUID())) {
+                                    LOG.trace("isLastPortinSubnet: Port is not the only port.");
+                                    return false;
                                 }
                             }
                         }
@@ -231,14 +233,13 @@ public class SecurityServicesImpl implements ConfigInterface, SecurityServicesMa
             for (TerminationPoint tp : terminationPoints) {
                 OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
                         tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
-                if (null != ovsdbTerminationPointAugmentation) {
-                    if (!(ovsdbTerminationPointAugmentation.getName().equals(Constants.INTEGRATION_BRIDGE))
-                            && !(terminationPointAugmentation.getInterfaceUuid()
-                                    .equals(ovsdbTerminationPointAugmentation.getInterfaceUuid()))) {
-                        LOG.debug("isLastPortinBridge: it the last port in bridge {}",
-                                  terminationPointAugmentation.getName());
-                        return false;
-                    }
+                if (null != ovsdbTerminationPointAugmentation
+                        && !(ovsdbTerminationPointAugmentation.getName().equals(Constants.INTEGRATION_BRIDGE))
+                        && !(terminationPointAugmentation.getInterfaceUuid()
+                        .equals(ovsdbTerminationPointAugmentation.getInterfaceUuid()))) {
+                    LOG.debug("isLastPortinBridge: it the last port in bridge {}",
+                            terminationPointAugmentation.getName());
+                    return false;
                 }
             }
         }
index 8205e4ed34d74b3dcfdea87ee085645ec7307e51..8227469facc3e605fcaccd1d1f67adf057c8f60b 100644 (file)
@@ -51,5 +51,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <module>net-virt</module>
     <module>net-virt-providers</module>
     <module>net-virt-it</module>
+    <module>net-virt-sfc</module>
   </modules>
 </project>
index bf94ad81992c312032d6a97df49b983da59baf3c..2ef948c38eaec33600e0bcf7cced3b441053f851 100644 (file)
@@ -124,7 +124,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>concepts</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
+      <groupId>org.opendaylight.mdsal</groupId>
       <artifactId>yang-binding</artifactId>
     </dependency>
     <dependency>
@@ -132,11 +132,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>yang-common</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>opendaylight-l2-types</artifactId>
     </dependency>
     <dependency>
@@ -196,7 +196,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
             <version>${controller.config.version}</version>
           </dependency>
           <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
+            <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>maven-sal-api-gen-plugin</artifactId>
             <version>${yangtools.version}</version>
           </dependency>
diff --git a/ovsdb-plugin-compatibility-layer/pom.xml b/ovsdb-plugin-compatibility-layer/pom.xml
deleted file mode 100755 (executable)
index 0f13ac2..0000000
+++ /dev/null
@@ -1,138 +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.ovsdb</groupId>
-    <artifactId>commons</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../commons/parent</relativePath>
-  </parent>
-
-  <artifactId>ovsdb-plugin-compatibility-layer</artifactId>
-  <version>1.2.1-SNAPSHOT</version>
-  <name>${project.artifactId}</name>
-  <packaging>bundle</packaging>
-  <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
-  <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  <licenses>
-    <license>
-      <name>Eclipse Public License v1.0</name>
-      <url>http://www.eclipse.org/legal/epl-v10.html</url>
-    </license>
-  </licenses>
-  <developers>
-    <developer>
-      <name>Sam Hague</name>
-      <email>shague@gmail.com</email>
-      <url>https://github.com/shague</url>
-    </developer>
-  </developers>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  </scm>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.dependencymanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>plugin</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>library</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <testResources>
-      <testResource>
-        <filtering>true</filtering>
-        <directory>src/test/resources</directory>
-      </testResource>
-    </testResources>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.4.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>
-              org.opendaylight.controller.sal.core,
-              org.opendaylight.controller.sal.utils,
-              org.opendaylight.ovsdb.plugin.api,
-              org.apache.commons.lang3.builder,
-              org.apache.commons.lang3.tuple,
-              org.apache.felix.dm,
-              org.slf4j,
-              org.eclipse.osgi.framework.console,
-              org.osgi.framework,
-              javax.net.ssl,
-              *
-            </Import-Package>
-            <Embed-Dependency>commons-codec,javax.servlet-api,portlet-api,commons-collections,utils.config;type=!pom;inline=false</Embed-Dependency>
-            <Embed-Transitive>true</Embed-Transitive>
-            <Bundle-Activator>org.opendaylight.ovsdb.compatibility.plugin.internal.Activator</Bundle-Activator>
-            <Private-Package>
-              org.opendaylight.ovsdb.compatibility.plugin.impl,
-              org.opendaylight.ovsdb.compatibility.plugin.internal
-            </Private-Package>
-            <Export-Package>
-              org.opendaylight.ovsdb.compatibility.plugin,
-              org.opendaylight.ovsdb.compatibility.plugin.api,
-              org.opendaylight.ovsdb.compatibility.plugin.error
-            </Export-Package>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-failsafe-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/NodeUtils.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/NodeUtils.java
deleted file mode 100644 (file)
index b33f2a5..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2015 Red Hat, 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.ovsdb.compatibility.plugin.api;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.opendaylight.controller.sal.core.ConstructionException;
-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.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NodeUtils {
-    private static final Logger LOG = LoggerFactory.getLogger(NodeUtils.class);
-
-    public static String getId (String identifier) {
-        String id = identifier;
-
-        String[] pair = identifier.split("\\|");
-        if (pair[0].equals("OVS")) {
-            id = pair[1];
-        }
-        return id;
-    }
-
-    public static Node getMdsalNode (org.opendaylight.controller.sal.core.Node salNode) {
-        String identifier = salNode.getNodeIDString();
-
-        NodeId nodeId = new NodeId("OVS" + "|" + identifier);
-        NodeKey nodeKey = new NodeKey(nodeId);
-        Node node = new NodeBuilder()
-                .setId(nodeId)
-                .setKey(nodeKey)
-                .build();
-
-        return node;
-    }
-
-    public static org.opendaylight.controller.sal.core.Node getSalNode (Node mdsalNode) {
-        String identifier = NodeUtils.getId(mdsalNode.getId().getValue());
-        org.opendaylight.controller.sal.core.Node node = null;
-
-        try {
-            node = new org.opendaylight.controller.sal.core.Node("OVS", identifier);
-        } catch (ConstructionException e) {
-            LOG.error("Failed to allocate sal Node", e);
-        }
-
-        return node;
-    }
-
-    public static List<org.opendaylight.controller.sal.core.Node> getSalNodes (List<Node> mdsalNodes) {
-        List<org.opendaylight.controller.sal.core.Node> nodes = new ArrayList<>();
-
-        for (Node mdsalNode : mdsalNodes) {
-            nodes.add(NodeUtils.getSalNode(mdsalNode));
-        }
-        return nodes;
-    }
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbConfigurationService.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbConfigurationService.java
deleted file mode 100644 (file)
index 66127c5..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.compatibility.plugin.api;
-
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.ovsdb.compatibility.plugin.error.OvsdbPluginException;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
-
-public interface OvsdbConfigurationService {
-
-    /**
-     * @deprecated This version of insertRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #insertRow(Node, String, String, UUID, Row) insertRow} and
-     * {@link #insertTree(Node, String, String, UUID, Row) insertTree}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table on which the row is inserted
-     * @param parentUuid UUID of the parent table to which this operation will result in attaching/mutating.
-     * @param row Row of table Content to be inserted
-     * @return UUID of the inserted Row
-     */
-    @Deprecated
-    StatusWithUuid insertRow(Node node, String tableName, String parentUuid, Row<GenericTableSchema> row);
-
-    /**
-     * insert a Row in a Table of a specified Database Schema. This is a convenience method on top of
-     * {@link #insertRow(Node, String, String, String, UUID, String, Row) insertRow}
-     * which assumes that OVSDB schema implementation that corresponds to the databaseName will provide
-     * the necessary service to populate the Parent Table Name and Parent Column Name.
-     *
-     * This method can insert just a single Row specified in the row parameter.
-     * But {@link #insertTree(Node, String, String, UUID, Row) insertTree}
-     * can insert a hierarchy of rows with parent-child relationship.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentRowUuid UUID of the parent table to which this operation will result in attaching/mutating.
-     * @param row Row of table Content to be inserted
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return UUID of the inserted Row
-     */
-    UUID insertRow(Node node, String databaseName, String tableName, UUID parentRowUuid,
-                   Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * insert a Row in a Table of a specified Database Schema.
-     *
-     * This method can insert just a single Row specified in the row parameter.
-     * But {@link #insertTree(Node, String, String, UUID, Row) insertTree}
-     * can insert a hierarchy of rows with parent-child relationship.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentTable Name of the Parent Table to which this operation will result in attaching/mutating.
-     * @param parentRowUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated with the UUID that results from the insert operation.
-     * @param row Row of table Content to be inserted
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return UUID of the inserted Row
-     */
-    UUID insertRow(Node node, String databaseName, String tableName, String parentTable, UUID parentRowUuid,
-                   String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * inserts a Tree of Rows in multiple Tables that has parent-child relationships referenced through the OVSDB schema's refTable construct.
-     * This is a convenience method on top of {@link #insertTree(Node, String, String, String, UUID, String, Row) insertTree}
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentRowUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return Returns the row tree with the UUID of every inserted Row populated in the _uuid column of every row in the tree
-     */
-    Row<GenericTableSchema> insertTree(Node node, String databaseName, String tableName, UUID parentRowUuid,
-                                       Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * inserts a Tree of Rows in multiple Tables that has parent-child relationships referenced through the OVSDB schema's refTable construct
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentTable Name of the Parent Table to which this operation will result in attaching/mutating.
-     * @param parentRowUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated with the UUID that results from the insert operation.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return Returns the row tree with the UUID of every inserted Row populated in the _uuid column of every row in the tree
-     */
-    Row<GenericTableSchema> insertTree(Node node, String databaseName, String tableName, String parentTable, UUID parentRowUuid,
-                                       String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of updateRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #updateRow(Node, String, String, UUID, Row, boolean) updateRow}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table on which the row is Updated
-     * @param parentUuid UUID of the parent row on which this operation might result in mutating.
-     * @param rowUuid UUID of the row that is being updated
-     * @param row Row of table Content to be Updated. Include just those columns that needs to be updated.
-     */
-    @Deprecated
-    Status updateRow(Node node, String tableName, String parentUuid, String rowUuid, Row row);
-
-    /**
-     * update or mutate a Row in a Table of a specified Database Schema.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is updated
-     * @param rowUuid UUID of the row being updated
-     * @param row Row of table Content to be updated
-     * @param overwrite true will overwrite/replace the existing row (matching the rowUuid) with the passed row object.
-     *                  false will update the existing row (matching the rowUuid) using only the columns in the passed row object.
-     * @throws OvsdbPluginException Any failure during the update operation will result in a specific exception.
-     * @return Returns the entire Row after the update operation.
-     */
-    Row<GenericTableSchema> updateRow(Node node, String databaseName, String tableName, UUID rowUuid,
-                                      Row<GenericTableSchema> row, boolean overwrite) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of deleteRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by {@link #deleteRow(Node, String, String, UUID) deleteRow}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table on which the row is Updated
-     * @param rowUuid UUID of the row that is being deleted
-     */
-    @Deprecated
-    Status deleteRow(Node node, String tableName, String rowUuid);
-
-    /**
-     * update or mutate a Row in a Table of a specified Database Schema.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is Updated
-     * @param rowUuid UUID of the row that is being deleted
-     * @throws OvsdbPluginException Any failure during the delete operation will result in a specific exception.
-     */
-
-    void deleteRow(Node node, String databaseName, String tableName, UUID rowUuid) throws OvsdbPluginException;
-
-    /**
-     * update or mutate a Row in a Table of a specified Database Schema.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is Updated
-     * @param parentTable Name of the Parent Table to which this operation will result in mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated.
-     * @param rowUuid UUID of the row that is being deleted
-     * @throws OvsdbPluginException Any failure during the delete operation will result in a specific exception.
-     */
-
-    void deleteRow(Node node, String databaseName, String tableName, String parentTable,
-                   UUID parentRowUuid, String parentColumn, UUID rowUuid) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of getRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by {@link #getRow(Node, String, String, UUID) getRow}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table Name
-     * @param uuid UUID of the row being queried
-     * @return a row with a list of Column data that corresponds to an unique Row-identifier called uuid in a given table.
-     */
-    @Deprecated
-    Row getRow(Node node, String tableName, String uuid);
-
-    /**
-     * Returns a Row from a table for the specified uuid.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table Name
-     * @param uuid UUID of the row being queried
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return a row with a list of Column data that corresponds to an unique Row-identifier called uuid in a given table.
-     */
-    Row<GenericTableSchema> getRow(Node node, String databaseName, String tableName, UUID uuid) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of getRows is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #getRows(Node, String, String) getRows} and {@link #getRows(Node, String, String, String) getRows}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table Name
-     * @return List of rows that makes the entire Table.
-     */
-    @Deprecated
-    ConcurrentMap<String, Row> getRows(Node node, String tableName);
-
-    /**
-     * Returns all rows of a table.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table Name
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return Map of rows to its UUID that makes the entire Table.
-     */
-    ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node, String databaseName, String tableName) throws OvsdbPluginException;
-
-    /**
-     * Returns all rows of a table filtered by query string.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table Name
-     * @param fiqlQuery FIQL style String Query <a href="http://tools.ietf.org/html/draft-nottingham-atompub-fiql-00">draft-nottingham-atompub-fiql</a> to filter rows
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return Map of rows to its UUID that makes the entire Table.
-     */
-    ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node, String databaseName, String tableName, String fiqlQuery) throws OvsdbPluginException;
-
-    /**
-     * @deprecated Returns all the Tables in a given Ndoe.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #getTables(Node, String) getTables}
-     * @param node OVSDB node
-     * @return List of Table Names that make up Open_vSwitch schema.
-     */
-    @Deprecated
-    List<String> getTables(Node node);
-
-    /**
-     * Returns all the Tables in a given Node.
-     *
-     * @param node OVSDB node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return List of Table Names that make up the schema represented by the databaseName
-     */
-    List<String> getTables(Node node, String databaseName) throws OvsdbPluginException;
-
-    /**
-     * setOFController is a convenience method used by existing applications to setup Openflow Controller on
-     * a Open_vSwitch Bridge.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * @param node Node
-     * @param bridgeUUID uuid of the Bridge for which the ip-address of Openflow Controller should be programmed.
-     * @return Boolean representing success or failure of the operation.
-     *
-     * @throws InterruptedException
-     * @throws ExecutionException
-     */
-    Boolean setOFController(Node node, String bridgeUUID) throws InterruptedException, ExecutionException;
-
-    <T extends TypedBaseTable<?>> String getTableName(Node node, Class<T> typedClass);
-    <T extends TypedBaseTable<?>> T getTypedRow(Node node, Class<T> typedClass, Row row);
-    <T extends TypedBaseTable<?>> T createTypedRow(Node node, Class<T> typedClass);
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbConnectionService.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbConnectionService.java
deleted file mode 100644 (file)
index b49eab6..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.compatibility.plugin.api;
-
-import java.util.List;
-import java.util.Map;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.ConnectionConstants;
-
-public interface OvsdbConnectionService {
-    Connection getConnection(Node node);
-    List<Node> getNodes();
-    Node getNode(String identifier);
-    Node connect(String identifier, Map<ConnectionConstants, String> params);
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbInventoryListener.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbInventoryListener.java
deleted file mode 100644 (file)
index c14c679..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.compatibility.plugin.api;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-import java.net.InetAddress;
-
-public interface OvsdbInventoryListener {
-    void nodeAdded(Node node, InetAddress address, int port);
-    void nodeRemoved(Node node);
-    void rowAdded(Node node, String tableName, String uuid, Row row);
-    void rowUpdated(Node node, String tableName, String uuid, Row old, Row row);
-    void rowRemoved(Node node, String tableName, String uuid, Row row, Object context);
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbInventoryService.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/OvsdbInventoryService.java
deleted file mode 100644 (file)
index 7b152e8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.compatibility.plugin.api;
-
-import java.net.InetAddress;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-public interface OvsdbInventoryService{
-    ConcurrentMap<String, ConcurrentMap<String, Row>> getCache(Node n, String databaseName);
-    ConcurrentMap<String, Row> getTableCache(Node n, String databaseName, String tableName);
-    Row getRow(Node n, String databaseName, String tableName, String uuid);
-    void updateRow(Node n, String databaseName, String tableName, String uuid, Row row);
-    void removeRow(Node n, String databaseName, String tableName, String uuid);
-    void processTableUpdates(Node n, String databaseName, TableUpdates tableUpdates);
-    void printCache(Node n);
-    void addNode(Node n, Set<Property> props);
-    void notifyNodeAdded(Node n, InetAddress address, int port);
-    void removeNode(Node n);
-    void addNodeProperty(Node node, UpdateType type, Set<Property> props);
-}
\ No newline at end of file
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/StatusWithUuid.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/api/StatusWithUuid.java
deleted file mode 100644 (file)
index 4abef02..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2015 Red Hat, 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.ovsdb.compatibility.plugin.api;
-
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.controller.sal.utils.StatusCode;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-
-/**
- * Extends the Status class to allow functions to return a uuid
- */
-public class StatusWithUuid extends Status {
-    private static final long serialVersionUID = -5413085099514964003L;
-    private UUID uuid;
-
-    public StatusWithUuid(StatusCode errorCode) {
-        super(errorCode);
-    }
-
-    public StatusWithUuid(StatusCode errorCode, String description) {
-        super(errorCode, description);
-    }
-
-    public StatusWithUuid(StatusCode errorCode, long requestId) {
-        super(errorCode, requestId);
-    }
-
-    public StatusWithUuid(StatusCode errorCode, UUID uuid) {
-        super(errorCode);
-        this.uuid = uuid;
-    }
-
-    public UUID getUuid() {
-        return uuid;
-    }
-
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/error/OvsdbPluginException.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/error/OvsdbPluginException.java
deleted file mode 100644 (file)
index 198e157..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2015 Red Hat, 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.ovsdb.compatibility.plugin.error;
-
-public class OvsdbPluginException extends RuntimeException {
-    public OvsdbPluginException(String message){
-        super(message);
-    }
-
-    public OvsdbPluginException(String message, Throwable cause){
-        super(message, cause);
-    }
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConfigurationServiceImpl.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConfigurationServiceImpl.java
deleted file mode 100644 (file)
index a4148cb..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * 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.ovsdb.compatibility.plugin.impl;
-
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.ovsdb.compatibility.plugin.api.NodeUtils;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.compatibility.plugin.api.StatusWithUuid;
-import org.opendaylight.ovsdb.compatibility.plugin.error.OvsdbPluginException;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
-
-/**
- * This is a proxy class for ovsdb plugin's OvsdbConfigurationService class
- * It just forward the call to OvsdbConfigurationService instance and pass
- * back the response to the caller.
- *
- * @author Anil Vishnoi (vishnoianil@gmail.com)
- *
- */
-public class ConfigurationServiceImpl implements OvsdbConfigurationService
-{
-    private volatile org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService pluginOvsdbConfigurationService;
-
-    void init() {
-    }
-
-    /**
-     * Function called by the dependency manager when at least one dependency
-     * become unsatisfied or when the component is shutting down because for
-     * example bundle is being stopped.
-     *
-     */
-    void destroy() {
-    }
-
-    /**
-     * Function called by dependency manager after "init ()" is called and after
-     * the services provided by the class are registered in the service registry
-     *
-     */
-    void start() {
-    }
-
-    /**
-     * Function called by the dependency manager before the services exported by
-     * the component are unregistered, this will be followed by a "destroy ()"
-     * calls
-     *
-     */
-    void stop() {
-    }
-
-    public void setOvsdbConfigurationService(org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService pluginOvsdbConfigurationService){
-        this.pluginOvsdbConfigurationService = pluginOvsdbConfigurationService;
-    }
-
-    public void unsetOvsdbConfigurationService(org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService pluginOvsdbConfigurationService){
-        this.pluginOvsdbConfigurationService = null;
-    }
-
-
-    @Override
-    public StatusWithUuid insertRow(Node node, String tableName, String parentUuid, Row<GenericTableSchema> row) {
-        return StatusConvertorUtil.convertOvsdbStatusWithUuidToCompLayerStatusWithUuid(pluginOvsdbConfigurationService.insertRow(NodeUtils.getMdsalNode(node), tableName, parentUuid, row));
-    }
-
-    @Override
-    public Status updateRow (Node node, String tableName, String parentUUID, String rowUUID, Row row) {
-        return StatusConvertorUtil
-                .convertOvsdbStatusToSalStatus(pluginOvsdbConfigurationService
-                        .updateRow(NodeUtils.getMdsalNode(node), tableName, parentUUID, rowUUID, row));
-    }
-
-    @Override
-    public Status deleteRow(Node node, String tableName, String uuid) {
-        return StatusConvertorUtil
-                .convertOvsdbStatusToSalStatus(pluginOvsdbConfigurationService.
-                        deleteRow(NodeUtils.getMdsalNode(node), tableName, uuid));
-    }
-
-    @Override
-    public ConcurrentMap<String, Row> getRows(Node node, String tableName) {
-        return pluginOvsdbConfigurationService.getRows(NodeUtils.getMdsalNode(node), tableName);
-    }
-
-    @Override
-    public Row getRow(Node node, String tableName, String uuid) {
-        return pluginOvsdbConfigurationService.getRow(NodeUtils.getMdsalNode(node), tableName, uuid);
-    }
-
-    @Override
-    public List<String> getTables(Node node) {
-        return pluginOvsdbConfigurationService.getTables(NodeUtils.getMdsalNode(node));
-    }
-
-    @Override
-    public Boolean setOFController(Node node, String bridgeUUID) throws InterruptedException, ExecutionException {
-        return pluginOvsdbConfigurationService.setOFController(NodeUtils.getMdsalNode(node), bridgeUUID);
-    }
-
-    @Override
-    public <T extends TypedBaseTable<?>> String getTableName(Node node, Class<T> typedClass) {
-        return pluginOvsdbConfigurationService.getTableName(NodeUtils.getMdsalNode(node), typedClass);
-    }
-
-    @Override
-    public <T extends TypedBaseTable<?>> T getTypedRow(Node node, Class<T> typedClass, Row row) {
-        return pluginOvsdbConfigurationService.getTypedRow(NodeUtils.getMdsalNode(node), typedClass, row);
-    }
-
-    @Override
-    public <T extends TypedBaseTable<?>> T createTypedRow(Node node, Class<T> typedClass) {
-        return pluginOvsdbConfigurationService.createTypedRow(NodeUtils.getMdsalNode(node), typedClass);
-    }
-
-    @Override
-    public UUID insertRow(Node node, String databaseName, String tableName, String parentTable, UUID parentUuid,
-                          String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException {
-        return pluginOvsdbConfigurationService
-                .insertRow(NodeUtils.getMdsalNode(node), databaseName, tableName, parentTable, parentUuid,
-                        parentColumn, row);
-    }
-
-    @Override
-    public UUID insertRow(Node node, String databaseName, String tableName,
-            UUID parentRowUuid, Row<GenericTableSchema> row)
-            throws OvsdbPluginException {
-        return this.insertRow(node, databaseName, tableName, null, parentRowUuid, null, row);
-    }
-
-    @Override
-    public Row<GenericTableSchema> insertTree(Node node, String databaseName, String tableName, String parentTable, UUID parentUuid,
-                                              String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException {
-        return pluginOvsdbConfigurationService
-                .insertTree(NodeUtils.getMdsalNode(node), databaseName, tableName, parentTable,
-                        parentUuid, parentColumn, row);
-    }
-
-    @Override
-    public Row<GenericTableSchema> insertTree(Node node, String databaseName,
-            String tableName, UUID parentRowUuid, Row<GenericTableSchema> row)
-            throws OvsdbPluginException {
-        return this.insertTree(node, databaseName, tableName, null, parentRowUuid, null, row);
-    }
-
-    @Override
-    public Row<GenericTableSchema> updateRow(Node node, String databaseName,
-            String tableName, UUID rowUuid, Row<GenericTableSchema> row,
-            boolean overwrite) throws OvsdbPluginException {
-        return pluginOvsdbConfigurationService
-                .updateRow(NodeUtils.getMdsalNode(node), databaseName, tableName, rowUuid, row, overwrite);
-    }
-
-    @Override
-    public void deleteRow(Node node, String databaseName, String tableName, String parentTable, UUID parentRowUuid,
-            String parentColumn, UUID rowUuid) throws OvsdbPluginException {
-        pluginOvsdbConfigurationService
-                .deleteRow(NodeUtils.getMdsalNode(node), databaseName, tableName, parentTable,
-                        parentRowUuid, parentColumn, rowUuid);
-    }
-
-    @Override
-    public void deleteRow(Node node, String databaseName, String tableName, UUID rowUuid) throws OvsdbPluginException {
-        this.deleteRow(node, databaseName, tableName, null, null, null, rowUuid);
-    }
-
-    @Override
-    public Row<GenericTableSchema> getRow(Node node, String databaseName,
-            String tableName, UUID uuid) throws OvsdbPluginException {
-        return pluginOvsdbConfigurationService
-                .getRow(NodeUtils.getMdsalNode(node), databaseName, tableName, uuid);
-    }
-
-    @Override
-    public ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node,
-            String databaseName, String tableName) throws OvsdbPluginException {
-        return pluginOvsdbConfigurationService
-                .getRows(NodeUtils.getMdsalNode(node), databaseName, tableName);
-    }
-
-    @Override
-    public ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node,
-            String databaseName, String tableName, String fiqlQuery)
-            throws OvsdbPluginException {
-        return this.getRows(node, databaseName, tableName);
-    }
-
-    @Override
-    public List<String> getTables(Node node, String databaseName) throws OvsdbPluginException {
-        return pluginOvsdbConfigurationService.getTables(NodeUtils.getMdsalNode(node), databaseName);
-    }
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConnectionServiceImpl.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConnectionServiceImpl.java
deleted file mode 100644 (file)
index 33b9551..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.ovsdb.compatibility.plugin.impl;
-
-import java.util.List;
-import java.util.Map;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.compatibility.plugin.api.NodeUtils;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.ConnectionConstants;
-
-/**
- * This is a proxy class for ovsdb plugin's OvsdbConnectionService class
- * It just forward the call to OvsdbConnectionService instance and pass
- * back the response to the caller.
- *
- * @author Anil Vishnoi (vishnoianil@gmail.com)
- *
- */
-public class ConnectionServiceImpl implements OvsdbConnectionService{
-
-    private volatile org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService pluginOvsdbConnectionService;
-
-    public void init() {
-    }
-
-    /**
-     * Function called by the dependency manager when at least one dependency
-     * become unsatisfied or when the component is shutting down because for
-     * example bundle is being stopped.
-     */
-    void destroy() {
-    }
-
-    /**
-     * Function called by dependency manager after "init ()" is called and after
-     * the services provided by the class are registered in the service registry
-     */
-    void start() {
-    }
-
-    /**
-     * Function called by the dependency manager before the services exported by
-     * the component are unregistered, this will be followed by a "destroy ()"
-     * calls
-     */
-    void stopping() {
-    }
-
-    public void setOvsdbConnectionService(org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService pluginOvsdbConnectionService){
-        this.pluginOvsdbConnectionService = pluginOvsdbConnectionService;
-    }
-
-    public void unsetOvsdbConnectionService(org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService pluginOvsdbConnectionService){
-        this.pluginOvsdbConnectionService = null;
-    }
-
-    @Override
-    public Connection getConnection(Node node) {
-        return pluginOvsdbConnectionService.getConnection(NodeUtils.getMdsalNode(node));
-    }
-
-    @Override
-    public Node getNode (String identifier) {
-        return NodeUtils.getSalNode(pluginOvsdbConnectionService.getNode(identifier));
-    }
-
-    @Override
-    public List<Node> getNodes() {
-        return NodeUtils.getSalNodes(pluginOvsdbConnectionService.getNodes());
-    }
-
-    @Override
-    public Node connect(String identifier, Map<ConnectionConstants, String> params) {
-        return NodeUtils.getSalNode(pluginOvsdbConnectionService.connect(identifier, params));
-    }
-
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/InventoryServiceImpl.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/InventoryServiceImpl.java
deleted file mode 100644 (file)
index c694380..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * 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.ovsdb.compatibility.plugin.impl;
-
-import java.net.InetAddress;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.ovsdb.compatibility.plugin.api.NodeUtils;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-import com.google.common.collect.Sets;
-
-/**
- * This is a proxy class for ovsdb plugin's OvsdbInventoryService class
- * It just forward the call to OvsdbInventoryService instance and pass
- * back the response to the caller.
- * It also register as a listener to ovsdb plugin and relay the notification
- * back to all the subscriber of this compatibility layer.
- *
- * @author Anil Vishnoi (vishnoianil@gmail.com)
- *
- */
-public class InventoryServiceImpl implements OvsdbInventoryService,
-        org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener {
-    private volatile org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService pluginOvsdbInventoryService;
-
-    private Set<OvsdbInventoryListener> ovsdbInventoryListeners = Sets.newCopyOnWriteArraySet();
-
-
-    /**
-     * Function called by the dependency manager when all the required
-     * dependencies are satisfied
-     *
-     */
-    public void init() {
-    }
-
-    /**
-     * Function called by the dependency manager when at least one dependency
-     * become unsatisfied or when the component is shutting down because for
-     * example bundle is being stopped.
-     *
-     */
-    public void destroy() {
-    }
-
-    /**
-     * Function called by dependency manager after "init ()" is called and after
-     * the services provided by the class are registered in the service registry
-     *
-     */
-    public void start() {
-    }
-
-    /**
-     * Function called by the dependency manager before the services exported by
-     * the component are unregistered, this will be followed by a "destroy ()"
-     * calls
-     *
-     */
-    public void stop() {
-    }
-
-    public void setOvsdbInventoryService(org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService pluginOvsdbInventoryService){
-        this.pluginOvsdbInventoryService = pluginOvsdbInventoryService;
-    }
-
-    public void unsetOvsdbInventoryService(org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService pluginOvsdbInventoryService){
-        this.pluginOvsdbInventoryService = pluginOvsdbInventoryService;
-    }
-
-    //Register listener for ovsdb.compatibility
-    public void addOvsdbInventoryListener(OvsdbInventoryListener pluginOvsdbInventoryListener){
-        this.ovsdbInventoryListeners.add(pluginOvsdbInventoryListener);
-    }
-
-    public void removeOvsdbInventoryListener(OvsdbInventoryListener pluginOvsdbInventoryListener){
-        if(this.ovsdbInventoryListeners.contains(ovsdbInventoryListeners)) {
-            this.ovsdbInventoryListeners.remove(ovsdbInventoryListeners);
-        }
-    }
-
-    @Override
-    public ConcurrentMap<String, ConcurrentMap<String, Row>> getCache(Node n, String databaseName) {
-        return pluginOvsdbInventoryService.getCache(NodeUtils.getMdsalNode(n), databaseName);
-    }
-
-
-    @Override
-    public ConcurrentMap<String, Row> getTableCache(Node n, String databaseName, String tableName) {
-        return pluginOvsdbInventoryService.getTableCache(NodeUtils.getMdsalNode(n), databaseName, tableName);
-    }
-
-
-    @Override
-    public Row getRow(Node n, String databaseName, String tableName, String uuid) {
-        return pluginOvsdbInventoryService.getRow(NodeUtils.getMdsalNode(n), databaseName, tableName, uuid);
-    }
-
-    @Override
-    public void updateRow(Node n, String databaseName, String tableName, String uuid, Row row) {
-        pluginOvsdbInventoryService.updateRow(NodeUtils.getMdsalNode(n), databaseName, tableName, uuid, row);
-    }
-
-    @Override
-    public void removeRow(Node n, String databaseName, String tableName, String uuid) {
-        pluginOvsdbInventoryService.removeRow(NodeUtils.getMdsalNode(n), databaseName, tableName, uuid);
-    }
-
-    @Override
-    public void processTableUpdates(Node n, String databaseName, TableUpdates tableUpdates) {
-        pluginOvsdbInventoryService.processTableUpdates(NodeUtils.getMdsalNode(n), databaseName, tableUpdates);
-    }
-
-    @Override
-    public void printCache(Node n) {
-        pluginOvsdbInventoryService.printCache(NodeUtils.getMdsalNode(n));
-    }
-
-    @Override
-    public void addNode(Node node, Set<Property> props) {
-    }
-
-    @Override
-    public void notifyNodeAdded(Node node, InetAddress address, int port) {
-        pluginOvsdbInventoryService.notifyNodeAdded(NodeUtils.getMdsalNode(node), address, port);
-    }
-
-    @Override
-    public void addNodeProperty(Node node, UpdateType type, Set<Property> props) {
-    }
-
-    @Override
-    public void removeNode(Node node) {
-        pluginOvsdbInventoryService.removeNode(NodeUtils.getMdsalNode(node));
-    }
-
-    @Override
-    public void nodeAdded(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node,
-                          InetAddress address, int port) {
-        for(OvsdbInventoryListener listener : this.ovsdbInventoryListeners) {
-            listener.nodeAdded(NodeUtils.getSalNode(node), address, port);
-        }
-
-    }
-
-    @Override
-    public void nodeRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node) {
-        for(OvsdbInventoryListener listener : this.ovsdbInventoryListeners) {
-            listener.nodeRemoved(NodeUtils.getSalNode(node));
-        }
-
-    }
-
-    @Override
-    public void rowAdded(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node,
-                         String tableName, String uuid, Row row) {
-        for(OvsdbInventoryListener listener : this.ovsdbInventoryListeners) {
-            listener.rowAdded(NodeUtils.getSalNode(node), tableName, uuid, row);
-        }
-
-    }
-
-    @Override
-    public void rowUpdated(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node,
-                           String tableName, String uuid, Row old,
-            Row row) {
-        for(OvsdbInventoryListener listener : this.ovsdbInventoryListeners) {
-            listener.rowUpdated(NodeUtils.getSalNode(node), tableName, uuid, old, row);
-        }
-
-    }
-
-    @Override
-    public void rowRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node,
-                           String tableName, String uuid, Row row,
-            Object context) {
-        for(OvsdbInventoryListener listener : this.ovsdbInventoryListeners) {
-            listener.rowRemoved(NodeUtils.getSalNode(node), tableName, uuid, row, context);
-        }
-    }
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/StatusConvertorUtil.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/impl/StatusConvertorUtil.java
deleted file mode 100644 (file)
index 9fd015c..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.ovsdb.compatibility.plugin.impl;
-
-import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.controller.sal.utils.StatusCode;
-import org.opendaylight.ovsdb.compatibility.plugin.api.StatusWithUuid;
-
-/**
- * Class providers convenience methods for converting *.plugin.api.Status object to *.sal.utils.Status object.
- *
- * @author Anil Vishnoi ( vishnoianil@gmail.com)
- *
- */
-public class StatusConvertorUtil {
-
-    public static StatusWithUuid convertOvsdbStatusWithUuidToCompLayerStatusWithUuid(org.opendaylight.ovsdb.plugin.api.StatusWithUuid statusWithUuid){
-        if(statusWithUuid.getUuid() != null){
-            return new StatusWithUuid(convertOvsdbStatusCodeToSalStatusCode(statusWithUuid.getCode()),statusWithUuid.getUuid());
-        }else if(statusWithUuid.getRequestId() != 0){
-            return new StatusWithUuid(convertOvsdbStatusCodeToSalStatusCode(statusWithUuid.getCode()),statusWithUuid.getRequestId());
-        }else{
-            return new StatusWithUuid(convertOvsdbStatusCodeToSalStatusCode(statusWithUuid.getCode()),statusWithUuid.getDescription());
-        }
-
-    }
-
-    public static Status convertOvsdbStatusToSalStatus(org.opendaylight.ovsdb.plugin.api.Status status){
-        if(status.getRequestId() != 0){
-            return new org.opendaylight.controller.sal.utils.Status(convertOvsdbStatusCodeToSalStatusCode(status.getCode()),status.getRequestId());
-        }else{
-            return new org.opendaylight.controller.sal.utils.Status(convertOvsdbStatusCodeToSalStatusCode(status.getCode()),status.getDescription());
-        }
-    }
-
-    private static StatusCode convertOvsdbStatusCodeToSalStatusCode(org.opendaylight.ovsdb.plugin.api.StatusCode statusCode){
-        switch(statusCode){
-        case SUCCESS:
-            return StatusCode.SUCCESS;
-        case CREATED:
-            return StatusCode.CREATED;
-        case BADREQUEST:
-            return StatusCode.BADREQUEST;
-        case UNAUTHORIZED:
-            return StatusCode.UNAUTHORIZED;
-        case FORBIDDEN:
-            return StatusCode.FORBIDDEN;
-        case NOTFOUND:
-            return StatusCode.NOTFOUND;
-        case NOTALLOWED:
-            return StatusCode.NOTALLOWED;
-        case NOTACCEPTABLE:
-            return StatusCode.NOTACCEPTABLE;
-        case TIMEOUT:
-            return StatusCode.TIMEOUT;
-        case CONFLICT:
-            return StatusCode.CONFLICT;
-        case GONE:
-            return StatusCode.GONE;
-        case UNSUPPORTED:
-            return StatusCode.UNSUPPORTED;
-
-        case INTERNALERROR:
-            return StatusCode.INTERNALERROR;
-        case NOTIMPLEMENTED:
-            return StatusCode.NOTIMPLEMENTED;
-        case NOSERVICE:
-            return StatusCode.NOSERVICE;
-        case UNDEFINED:
-            return StatusCode.UNDEFINED;
-        default:
-            return StatusCode.UNSUPPORTED;
-        }
-    }
-
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/internal/Activator.java b/ovsdb-plugin-compatibility-layer/src/main/java/org/opendaylight/ovsdb/compatibility/plugin/internal/Activator.java
deleted file mode 100644 (file)
index bec2632..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.ovsdb.compatibility.plugin.internal;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.apache.felix.dm.Component;
-import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.compatibility.plugin.impl.ConfigurationServiceImpl;
-import org.opendaylight.ovsdb.compatibility.plugin.impl.ConnectionServiceImpl;
-import org.opendaylight.ovsdb.compatibility.plugin.impl.InventoryServiceImpl;
-
-/**
- * Activator for ovsdb plugin compatibility layer
- * @author Anil Vishnoi (vishnoianil@gmail.com)
- *
- */
-public class Activator extends ComponentActivatorAbstractBase {
-
-    /**
-     * Function called when the activator starts just after some initializations
-     * are done by the ComponentActivatorAbstractBase.
-     * Here it registers the node Type
-     *
-     */
-    @Override
-    public void init() {
-        Node.NodeIDType.registerIDType("OVS", String.class);
-    }
-
-    /**
-     * Function called when the activator stops just before the cleanup done by
-     * ComponentActivatorAbstractBase
-     *
-     */
-    @Override
-    public void destroy() {
-        Node.NodeIDType.unRegisterIDType("OVS");
-    }
-    @Override
-    public Object[] getGlobalImplementations() {
-        return new Object[]{ ConnectionServiceImpl.class, ConfigurationServiceImpl.class, InventoryServiceImpl.class };
-    }
-
-    @Override
-    public void configureGlobalInstance(Component c, Object imp){
-        if (imp.equals(ConfigurationServiceImpl.class)) {
-            // export the service to be used by SAL
-            Dictionary<String, Object> props = new Hashtable<>();
-            c.setInterface(new String[] { OvsdbConfigurationService.class.getName()}, props);
-            c.add(createServiceDependency()
-                    .setService(org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService.class)
-                    .setCallbacks("setOvsdbConfigurationService", "unsetOvsdbConfigurationService")
-                    .setRequired(true));
-        }
-
-        if (imp.equals(ConnectionServiceImpl.class)) {
-            // export the service to be used by SAL
-            Dictionary<String, Object> props = new Hashtable<>();
-            c.setInterface(
-                    new String[] {OvsdbConnectionService.class.getName()}, props);
-            c.add(createServiceDependency()
-                    .setService(org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService.class)
-                    .setCallbacks("setOvsdbConnectionService", "unsetOvsdbConnectionService")
-                    .setRequired(true));
-        }
-
-        if (imp.equals(InventoryServiceImpl.class)) {
-            Dictionary<String, Object> props = new Hashtable<>();
-            c.setInterface(
-                    new String[]{OvsdbInventoryService.class.getName(),
-                            org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener.class.getName()}, props);
-            c.add(createServiceDependency()
-                    .setService(org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService.class)
-                    .setCallbacks("setOvsdbInventoryService", "unsetOvsdbInventoryService")
-                    .setRequired(true));
-            c.add(createServiceDependency()
-                    .setService(OvsdbInventoryListener.class)
-                    .setCallbacks("addOvsdbInventoryListener", "removeOvsdbInventoryListener")
-                    .setRequired(true));
-        }
-
-    }
-}
diff --git a/ovsdb-plugin-compatibility-layer/src/test/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConnectionServiceImplTest.java b/ovsdb-plugin-compatibility-layer/src/test/java/org/opendaylight/ovsdb/compatibility/plugin/impl/ConnectionServiceImplTest.java
deleted file mode 100644 (file)
index 694d6b3..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *  Copyright (C) 2015 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 : Sam Hague
- */
-package org.opendaylight.ovsdb.compatibility.plugin.impl;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.sal.core.ConstructionException;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-
-public class ConnectionServiceImplTest {
-    private static final String OVS = "OVS";
-    private static final String IDENTIFIER = "192.168.120.31:45001";
-    private static final String OVS_IDENTIFIER = OVS + "|" + IDENTIFIER;
-    private static final String BAD_IDENTIFIER = "BAD" + "|" + IDENTIFIER;
-    private static org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl pluginConnectionService;
-    private static ConnectionServiceImpl connectionService;
-
-    @BeforeClass
-    public static void setUp () {
-        Node.NodeIDType.registerIDType(OVS, String.class);
-        NodeConnector.NodeConnectorIDType.registerIDType(OVS, String.class, OVS);
-        pluginConnectionService = new org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl();
-        Connection connection = new Connection(IDENTIFIER, null);
-        pluginConnectionService.putOvsdbConnection(IDENTIFIER, connection);
-
-        connectionService = new ConnectionServiceImpl();
-        connectionService.setOvsdbConnectionService(pluginConnectionService);
-    }
-
-    @Test
-    public void testGetNode () {
-        Node node = connectionService.getNode(IDENTIFIER);
-        assertNotNull("Node " + IDENTIFIER + " is null", node);
-
-        node = connectionService.getNode(OVS_IDENTIFIER);
-        assertNotNull("Node " + OVS_IDENTIFIER + " is null", node);
-
-        try {
-            node = connectionService.getNode(BAD_IDENTIFIER);
-            fail("Expected a NullPointerException to be thrown");
-        } catch (NullPointerException e) {
-            assertSame(NullPointerException.class, e.getClass());
-        }
-    }
-
-    @Test
-    public void testGetConnection () {
-        Node node = connectionService.getNode(IDENTIFIER);
-        assertNotNull("Node " + IDENTIFIER + " is null", node);
-
-        Connection connection = connectionService.getConnection(node);
-        assertNotNull("Connection " + IDENTIFIER + " is null", connection);
-
-        try {
-            connection = connectionService.getConnection(null);
-            fail("Expected a NullPointerException to be thrown");
-        } catch (NullPointerException e) {
-            assertSame(NullPointerException.class, e.getClass());
-        }
-
-        try {
-            node = new Node("OVS", BAD_IDENTIFIER);
-        } catch (ConstructionException e) {
-            fail("Exception should not have occurred" + e);
-        }
-        connection = connectionService.getConnection(node);
-        assertNull("Connection " + BAD_IDENTIFIER + " is not null", connection);
-    }
-}
diff --git a/plugin-mdsal-adapter/pom.xml b/plugin-mdsal-adapter/pom.xml
deleted file mode 100644 (file)
index 6b06de5..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
-    <artifactId>commons</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../commons/parent</relativePath>
-  </parent>
-
-  <artifactId>plugin-mdsal-adapter</artifactId>
-  <version>1.2.1-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.dependencymanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <!-- Yang Models -->
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>concepts</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>yang-binding</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>yang-common</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
-      <artifactId>ietf-inet-types</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.openflowplugin.model</groupId>
-      <artifactId>model-flow-service</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
-      <artifactId>yang-ext</artifactId>
-    </dependency>
-    <!-- Controller Dependencies -->
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-binding-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-common-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>library</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>plugin</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>schema.openvswitch</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>
-        <version>2.4.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Import-Package>
-              org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.*,
-              org.opendaylight.controller.sal.binding.api,
-              org.opendaylight.ovsdb.plugin.api,
-              org.apache.felix.dm,
-              org.slf4j,
-              org.eclipse.osgi.framework.console,
-              org.osgi.framework,
-              javax.net.ssl,
-              *
-            </Import-Package>
-            <Embed-Transitive>true</Embed-Transitive>
-            <Bundle-Activator>
-              org.opendaylight.ovsdb.plugin.md.Activator
-            </Bundle-Activator>
-           </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.opendaylight.yangtools</groupId>
-        <artifactId>yang-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
\ No newline at end of file
diff --git a/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/Activator.java b/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/Activator.java
deleted file mode 100644 (file)
index 1f9eb99..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.md;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-
-import org.apache.felix.dm.Component;
-
-/**
- * OSGi Bundle Activator for the Neutron providers
- */
-public class Activator extends ComponentActivatorAbstractBase {
-    /**
-     * Function called when the activator starts just after some
-     * initializations are done by the
-     * ComponentActivatorAbstractBase.
-     */
-    @Override
-    public void init() {
-    }
-
-    /**
-     * Function called when the activator stops just before the
-     * cleanup done by ComponentActivatorAbstractBase.
-     *
-     */
-    @Override
-    public void destroy() {
-    }
-
-    /**
-     * Function that is used to communicate to dependency manager the
-     * list of known implementations for services inside a container.
-     *
-     * @return An array containing all the CLASS objects that will be
-     * instantiated in order to get an fully working implementation
-     * Object
-     */
-    @Override
-    public Object[] getImplementations() {
-        Object[] res = {OvsdbBindingAwareProviderImpl.class,
-                        OvsdbInventoryManager.class };
-        return res;
-    }
-
-    /**
-     * Function that is called when configuration of the dependencies
-     * is required.
-     *
-     * @param c dependency manager Component object, used for
-     * configuring the dependencies exported and imported
-     * @param imp Implementation class that is being configured,
-     * needed as long as the same routine can configure multiple
-     * implementations
-     * @param containerName The containerName being configured, this allow
-     * also optional per-container different behavior if needed, usually
-     * should not be the case though.
-     */
-    @Override
-    public void configureInstance(Component c, Object imp,
-                                  String containerName) {
-
-        if (imp.equals(OvsdbBindingAwareProviderImpl.class)) {
-            c.setInterface(OvsdbBindingAwareProvider.class.getName(), null);
-            c.add(createServiceDependency()
-                          .setService(BindingAwareBroker.class)
-                          .setRequired(true));
-        }
-
-        if (imp.equals(OvsdbInventoryManager.class)) {
-            c.setInterface(OvsdbInventoryListener.class.getName(), null);
-            c.add(createServiceDependency()
-                          .setService(OvsdbBindingAwareProvider.class)
-                          .setRequired(true));
-            c.add(createServiceDependency()
-                          .setService(OvsdbConfigurationService.class)
-                          .setRequired(true));
-        }
-    }
-}
diff --git a/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbBindingAwareProvider.java b/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbBindingAwareProvider.java
deleted file mode 100644 (file)
index 3ac47bc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.md;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-
-/**
- * Created by dave on 01/08/2014.
- */
-public interface OvsdbBindingAwareProvider {
-    public DataBroker getDataBroker();
-    public NotificationService getNotificationService();
-}
diff --git a/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbBindingAwareProviderImpl.java b/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbBindingAwareProviderImpl.java
deleted file mode 100644 (file)
index b4bf4fb..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.md;
-
-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;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-
-import org.apache.felix.dm.Component;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbBindingAwareProviderImpl extends AbstractBindingAwareProvider implements OvsdbBindingAwareProvider {
-
-    private DataBroker dataBroker;
-    private NotificationProviderService notificationService;
-
-    static final Logger logger = LoggerFactory.getLogger(OvsdbBindingAwareProvider.class);
-
-    private BundleContext bc;
-    private volatile BindingAwareBroker broker;
-
-    void init(Component c) {
-        this.bc = c.getDependencyManager().getBundleContext();
-        broker.registerProvider(this, this.bc);
-        logger.info("OVSDB MD-SAL Inventory Adapter Registered With the MD-SAL");
-    }
-
-    void destroy() {
-        this.dataBroker = null;
-        this.notificationService = null;
-    }
-
-    @Override
-    public void onSessionInitiated(BindingAwareBroker.ProviderContext providerContext) {
-        this.dataBroker = providerContext.getSALService(DataBroker.class);
-        this.notificationService = providerContext.getSALService(NotificationProviderService.class);
-    }
-
-    @Override
-    public DataBroker getDataBroker() {
-        return this.dataBroker;
-    }
-
-    @Override
-    public NotificationService getNotificationService() {
-        return this.notificationService;
-    }
-}
diff --git a/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbInventoryManager.java b/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/OvsdbInventoryManager.java
deleted file mode 100755 (executable)
index 7e7f57e..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.md;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.utils.HexEncode;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-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.ovsdb.node.inventory.rev140731.OvsdbCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.OvsdbCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.OvsdbManagedNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.OvsdbManagedNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.nodes.node.OvsdbBridge;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.nodes.node.OvsdbBridgeBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-
-/**
- * Handle OVSDB Inventory Updates and create the necessary entries in the MD-SAL config datastore
- */
-public class OvsdbInventoryManager implements OvsdbInventoryListener {
-
-    // Dependencies injected by OSGi
-    private volatile OvsdbBindingAwareProvider provider;
-    private volatile OvsdbConfigurationService ovsdbConfigurationService;
-
-    static final String OVS_NODE_PREFIX = "openvswitch:";
-    static final String OPENFLOW_NODE_PREFIX = "openflow:";
-
-    static final Logger LOGGER = LoggerFactory.getLogger(OvsdbInventoryManager.class);
-
-
-    /**
-     * Called by the framework when the bundle is started
-     */
-    public void start() {
-        //ToDo: Add existing nodes from inventory
-        //This case is required for surviving controller reboot
-    }
-
-    /**
-     * When an AD-SAL node is added by the OVSDB Inventory Service, Add an MD-SAL node
-     *
-     * @param node    The AD-SAL node
-     * @param address The {@link java.net.InetAddress} of the Node
-     * @param port    The ephemeral port number used by this connection
-     */
-    @Override
-    public synchronized void nodeAdded(org.opendaylight.controller.sal.core.Node node,
-                                       InetAddress address,
-                                       int port) {
-        DataBroker dataBroker = provider.getDataBroker();
-        Preconditions.checkNotNull(dataBroker);
-
-        NodeId nodeId = new NodeId(OVS_NODE_PREFIX + node.getNodeIDString());
-        NodeKey nodeKey = new NodeKey(nodeId);
-
-        OvsdbCapableNode ovsdbNode = new OvsdbCapableNodeBuilder()
-                .setIpAddress(Utils.convertIpAddress(address))
-                .setPort(new PortNumber(port))
-                .setManagedNodes(new ArrayList<NodeId>())
-                .build();
-
-        Node newNode = new NodeBuilder()
-                .setId(nodeId)
-                .setKey(nodeKey)
-                .addAugmentation(OvsdbCapableNode.class, ovsdbNode)
-                .build();
-
-        InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey)
-                .toInstance();
-
-        WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
-        tx.put(LogicalDatastoreType.CONFIGURATION, path, newNode, true);
-        try {
-            tx.submit().get();
-            LOGGER.debug("Removed Node {}", path.toString());
-        } catch (InterruptedException | ExecutionException e) {
-            LOGGER.error(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * When an AD-SAL node is removed by the OVSDB Inventory Service, Remove the MD-SAL node
-     *
-     * @param node The AD-SAL node
-     */
-    @Override
-    public synchronized void nodeRemoved(org.opendaylight.controller.sal.core.Node node) {
-        DataBroker dataBroker = provider.getDataBroker();
-        Preconditions.checkNotNull(dataBroker);
-
-        NodeId nodeId = new NodeId(new NodeId(OVS_NODE_PREFIX + node.getNodeIDString()));
-        NodeKey nodeKey = new NodeKey(nodeId);
-
-        InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class)
-                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey)
-                .toInstance();
-
-        WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
-        tx.delete(LogicalDatastoreType.CONFIGURATION, path);
-        try {
-            tx.submit().get();
-            LOGGER.debug("Removed Node {}", path.toString());
-        } catch (InterruptedException | ExecutionException e) {
-            LOGGER.error(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * Handle OVSDB row removed When a Bridge row is removed, the OpenFlow Node is deleted The parent OVSDB node is
-     * updated and the OpenFlow node removed from it's managed-nodes list
-     *
-     * @param node      The AD-SAL node
-     * @param tableName The name of modified table
-     * @param uuid      The UUID of the deleted row
-     * @param row       The deleted Row
-     */
-    @Override
-    public synchronized void rowRemoved(org.opendaylight.controller.sal.core.Node node,
-                                        String tableName,
-                                        String uuid,
-                                        Row row,
-                                        Object context) {
-        if (tableName.equalsIgnoreCase(ovsdbConfigurationService.getTableName(node, Bridge.class))) {
-            LOGGER.debug("OVSDB Bridge Row removed on node {}", node.toString());
-            DataBroker dataBroker = provider.getDataBroker();
-            Preconditions.checkNotNull(dataBroker);
-
-            Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, row);
-            Set<String> dpidString = bridge.getDatapathIdColumn().getData();
-            Long dpid = HexEncode.stringToLong((String) dpidString.toArray()[0]);
-
-            NodeId openflowNodeId = new NodeId(OPENFLOW_NODE_PREFIX + dpid.toString());
-            NodeKey openflowNodeKey = new NodeKey(openflowNodeId);
-
-            InstanceIdentifier<Node> openflowNodePath = InstanceIdentifier.builder(Nodes.class)
-                    .child(Node.class, openflowNodeKey)
-                    .toInstance();
-
-            NodeId ovsdbNodeId = new NodeId(OVS_NODE_PREFIX + node.getNodeIDString());
-            NodeKey ovsdbNodeKey = new NodeKey(ovsdbNodeId);
-
-            InstanceIdentifier<OvsdbCapableNode> ovsdbNodePath = InstanceIdentifier.builder(Nodes.class)
-                    .child(Node.class, ovsdbNodeKey)
-                    .augmentation(OvsdbCapableNode.class)
-                    .toInstance();
-
-            // Read the current OVSDB Node from the DataStore
-            ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
-            OvsdbCapableNode ovsdbNode;
-            try {
-                Optional<OvsdbCapableNode> data = tx.read(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath).get();
-                if (!data.isPresent()) {
-                    LOGGER.error("OVSDB node not updated. Parent node for {} does not exist", ovsdbNodePath.toString());
-                    return;
-                }
-                ovsdbNode = data.get();
-            } catch (InterruptedException | ExecutionException e) {
-                LOGGER.error("OVSDB node not updated. Parent node for {} does not exist", ovsdbNodePath.toString());
-                return;
-            }
-
-            // Update the list of Nodes
-            List<NodeId> managedNodesList = ovsdbNode.getManagedNodes();
-            managedNodesList.remove(openflowNodeId);
-
-            // Write changes to DataStore
-            OvsdbCapableNode updatedNode = new OvsdbCapableNodeBuilder(ovsdbNode)
-                    .setManagedNodes(managedNodesList)
-                    .build();
-            tx.delete(LogicalDatastoreType.CONFIGURATION, openflowNodePath);
-            tx.put(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath, updatedNode);
-
-            try {
-                tx.submit().get();
-                LOGGER.debug("Transaction success for delete of {} and update of {}",
-                             openflowNodePath.toString(),
-                             ovsdbNodePath.toString());
-            } catch (InterruptedException | ExecutionException e) {
-                LOGGER.error(e.getMessage(), e);
-            }
-        }
-    }
-
-    /**
-     * Handle OVSDB row updates When a Bridge row is updated and it contains a DPID then add a new OpenFlow node to the
-     * inventory A relationship is created between the OpenFlow and OVSDB nodes
-     *
-     * @param node      The AD-SAL node
-     * @param tableName The name of the updated table
-     * @param uuid      The UUID of the updated row
-     * @param old       The old contents of the row
-     * @param row       The updated Row
-     */
-    @Override
-    public synchronized void rowUpdated(org.opendaylight.controller.sal.core.Node node,
-                                        String tableName,
-                                        String uuid,
-                                        Row old,
-                                        Row row) {
-        LOGGER.debug("OVSDB Bridge Row updated on node {}", node.toString());
-        if (tableName.equalsIgnoreCase(ovsdbConfigurationService.getTableName(node, Bridge.class))) {
-            DataBroker dataBroker = provider.getDataBroker();
-            Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, row);
-
-            Set<String> dpidString = bridge.getDatapathIdColumn().getData();
-            Long dpid;
-            try {
-                dpid = HexEncode.stringToLong((String) dpidString.toArray()[0]);
-            } catch (ArrayIndexOutOfBoundsException e) {
-                return;
-            }
-
-            NodeId openflowNodeId = new NodeId(OPENFLOW_NODE_PREFIX + dpid.toString());
-            NodeKey openflowNodeKey = new NodeKey(openflowNodeId);
-
-            InstanceIdentifier<OvsdbManagedNode> openflowNodepath = InstanceIdentifier.builder(Nodes.class)
-                    .child(Node.class, openflowNodeKey)
-                    .augmentation(OvsdbManagedNode.class)
-                    .toInstance();
-
-            NodeId ovsdbNodeId = new NodeId(OVS_NODE_PREFIX + node.getNodeIDString());
-            NodeKey ovsdbNodeKey = new NodeKey(ovsdbNodeId);
-
-            InstanceIdentifier<OvsdbCapableNode> ovsdbNodePath = InstanceIdentifier.builder(Nodes.class)
-                    .child(Node.class, ovsdbNodeKey)
-                    .augmentation(OvsdbCapableNode.class)
-                    .toInstance();
-
-            // Create an OvsdbBridge object using the information from the update
-            OvsdbBridge ovsdbBridge = new OvsdbBridgeBuilder()
-                    .setBridgeName(bridge.getName())
-                    .setBridgeUuid(uuid)
-                    .setManagedBy(ovsdbNodeId)
-                    .build();
-
-            // Add the bridge to the OvsdbManagedNode
-            OvsdbManagedNode ovsdbManagedNode = new OvsdbManagedNodeBuilder()
-                    .setOvsdbBridge(ovsdbBridge)
-                    .build();
-
-            // Read the current OVSDB Node from the DataStore
-            ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
-            OvsdbCapableNode ovsdbNode;
-            try {
-                Optional<OvsdbCapableNode> data = tx.read(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath).get();
-                if (!data.isPresent()) {
-                    LOGGER.error("OVSDB node not updated. Parent node for {} does not exist", ovsdbNodePath.toString());
-                    return;
-                }
-                ovsdbNode = data.get();
-            } catch (InterruptedException | ExecutionException e) {
-                throw new RuntimeException("Node does not exist");
-            }
-
-            // Update the list of Nodes
-            List<NodeId> managedNodesList = ovsdbNode.getManagedNodes();
-            managedNodesList.add(openflowNodeId);
-
-            // Create a delta object
-            OvsdbCapableNode updatedNode = new OvsdbCapableNodeBuilder(ovsdbNode)
-                    .setManagedNodes(managedNodesList)
-                    .build();
-
-            // Create parent if we get to this node before openflowplugin
-            tx.put(LogicalDatastoreType.CONFIGURATION, openflowNodepath, ovsdbManagedNode, true);
-            tx.put(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath, updatedNode);
-
-            try {
-                tx.submit().get();
-                LOGGER.debug("Transaction success for addition of {} and update of {}",
-                             openflowNodepath.toString(),
-                             ovsdbNodePath.toString());
-            } catch (InterruptedException | ExecutionException e) {
-                LOGGER.error(e.getMessage(), e);
-            }
-        }
-    }
-
-    @Override
-    public synchronized void rowAdded(org.opendaylight.controller.sal.core.Node node,
-                                      String tableName,
-                                      String uuid,
-                                      Row row) {
-        // noop
-    }
-}
diff --git a/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/Utils.java b/plugin-mdsal-adapter/src/main/java/org/opendaylight/ovsdb/plugin/md/Utils.java
deleted file mode 100644 (file)
index 5627199..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.md;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.Inet4Address;
-import java.net.InetAddress;
-
-/**
- * Utilities to convert Java types to the types specified in the Yang models
- */
-public final class Utils {
-
-    static final Logger logger = LoggerFactory.getLogger(Utils.class);
-
-    /**
-     * Returns a {@link org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress}
-     * from a @{link java.net.InetAddress}
-     */
-    public static IpAddress convertIpAddress(InetAddress inetAddress){
-
-        if (inetAddress instanceof Inet4Address){
-            Ipv4Address ipv4Address = new Ipv4Address(inetAddress.getHostAddress());
-            return new IpAddress(ipv4Address);
-        }
-        else {
-            Ipv6Address ipv6Address = new Ipv6Address(inetAddress.getHostAddress());
-            return new IpAddress(ipv6Address);
-        }
-    }
-}
diff --git a/plugin-mdsal-adapter/src/main/yang/ovsdb-node-inventory.yang b/plugin-mdsal-adapter/src/main/yang/ovsdb-node-inventory.yang
deleted file mode 100644 (file)
index d64e1e5..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-module ovsdb-node-inventory {
-    namespace "urn:opendaylight:ovsdb-node-inventory";
-    prefix "ovsdbinv";
-
-    import opendaylight-inventory {
-        prefix inv;
-        revision-date "2013-08-19";
-    }
-
-    import yang-ext {
-        prefix ext;
-        revision-date "2013-07-09";
-    }
-
-    import ietf-inet-types {
-        prefix inet;
-        revision-date "2010-09-24";
-    }
-
-    import flow-node-inventory {
-        prefix flowcapable;
-        revision-date "2013-08-19";
-    }
-
-    revision "2014-07-31" {
-        description "Initial revision of the OVSDB Inventory model";
-    }
-
-    grouping ovsdb-bridge-attributes {
-        leaf bridge-uuid {
-            description "The unique identifier of the bridge";
-            type string;
-        }
-
-        leaf bridge-name {
-            description "The name of the bridge";
-            type string;
-        }
-
-        leaf managed-by {
-            description "The OVSDB which this bridge belongs to";
-            type inv:node-id;
-        }
-    }
-
-    grouping ovsdb-node-attributes {
-        leaf ip-address {
-            description "The IP Address of an OVSDB node";
-            type inet:ip-address;
-        }
-
-        leaf port {
-            description "The port that an OVSDB node is connected on";
-            type inet:port-number;
-        }
-
-        leaf-list managed-nodes {
-            type inv:node-id;
-        }
-    }
-
-    augment /inv:nodes/inv:node {
-        ext:augment-identifier "ovsdb-managed-node";
-        // when "/inv:nodes/inv:node/flowcapable:manufacturer = '*'";
-        container ovsdb-bridge {
-            uses ovsdb-bridge-attributes;
-        }
-    }
-
-    augment /inv:nodes/inv:node {
-        ext:augment-identifier "ovsdb-capable-node";
-        uses ovsdb-node-attributes;
-    }
-
-}
diff --git a/plugin-mdsal-adapter/src/test/java/org/opendaylight/ovsdb/plugin/md/UtilsTest.java b/plugin-mdsal-adapter/src/test/java/org/opendaylight/ovsdb/plugin/md/UtilsTest.java
deleted file mode 100644 (file)
index 15f4eba..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.opendaylight.ovsdb.plugin.md;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-public class UtilsTest {
-
-    static final String IPV4_ADDRESS = "10.10.10.10";
-    static final String IPV6_ADDRESS = "2001:db8:0:0:0:ff00:42:8329";
-
-    @Test
-    public void testConvertIpAddress() throws UnknownHostException {
-
-        InetAddress addressV4 = Inet4Address.getByName(IPV4_ADDRESS);
-        InetAddress addressV6 = Inet6Address.getByName(IPV6_ADDRESS);
-
-        IpAddress ipAddresV4 = Utils.convertIpAddress(addressV4);
-        IpAddress ipAddresV6 = Utils.convertIpAddress(addressV6);
-
-        Assert.assertEquals(IPV4_ADDRESS, ipAddresV4.getIpv4Address().getValue());
-        Assert.assertEquals(IPV6_ADDRESS, ipAddresV6.getIpv6Address().getValue());
-    }
-}
\ No newline at end of file
diff --git a/plugin-shell/pom.xml b/plugin-shell/pom.xml
deleted file mode 100644 (file)
index 8744245..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
-    <artifactId>commons</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../commons/parent</relativePath>
-  </parent>
-
-  <artifactId>plugin-shell</artifactId>
-  <version>1.2.1-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
-  <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  <licenses>
-    <license>
-      <name>Eclipse Public License v1.0</name>
-      <url>http://www.eclipse.org/legal/epl-v10.html</url>
-    </license>
-  </licenses>
-  <developers>
-    <developer>
-      <name>Sam Hague</name>
-      <email>shague@gmail.com</email>
-      <url>https://github.com/shague</url>
-    </developer>
-  </developers>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  </scm>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.karaf.shell</groupId>
-      <artifactId>org.apache.karaf.shell.console</artifactId>
-      <version>${karaf.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>library</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>plugin</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.4.0</version>
-        <extensions>true</extensions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-
-</project>
diff --git a/plugin-shell/src/main/java/org/opendaylight/ovsdb/plugin/shell/PrintCache.java b/plugin-shell/src/main/java/org/opendaylight/ovsdb/plugin/shell/PrintCache.java
deleted file mode 100644 (file)
index dcc63ce..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.shell;
-
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-
-@Command(scope = "ovs", name = "printCache", description="Prints OVSDB Cache")
-public class PrintCache extends OsgiCommandSupport{
-    private OvsdbInventoryService ovsdbInventory;
-
-    @Argument(index=0, name="nodeName", description="Node Name", required=true, multiValued=false)
-    String nodeName = null;
-
-    @Override
-    protected Object doExecute() throws Exception {
-        NodeId nodeId = new NodeId(nodeName);
-        NodeKey nodeKey = new NodeKey(nodeId);
-        Node node = new NodeBuilder()
-                .setId(nodeId)
-                .setKey(nodeKey)
-                .build();
-        ovsdbInventory.printCache(node);
-        return null;
-    }
-
-    public void setOvsdbInventory(OvsdbInventoryService inventoryService){
-        this.ovsdbInventory = inventoryService;
-    }
-}
diff --git a/plugin-shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/plugin-shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml
deleted file mode 100644 (file)
index 4a213c6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-    <reference id="ovsdbInventoryRef" interface="org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService"/>
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-        <command>
-          <action class="org.opendaylight.ovsdb.plugin.shell.PrintCache">
-            <property name="ovsdbInventory" ref="ovsdbInventoryRef"/>
-          </action>
-        </command>
-    </command-bundle>
-</blueprint>
diff --git a/plugin-shell/src/test/java/org/opendaylight/ovsdb/plugin/shell/PrintCacheTest.java b/plugin-shell/src/test/java/org/opendaylight/ovsdb/plugin/shell/PrintCacheTest.java
deleted file mode 100644 (file)
index 0e34a6e..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
- *
- *  Authors : Sam Hague
- */
-package org.opendaylight.ovsdb.plugin.shell;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.lang.reflect.Field;
-import java.util.Set;
-import org.junit.Test;
-import org.opendaylight.ovsdb.lib.notation.Column;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.notation.Version;
-import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
-import org.opendaylight.ovsdb.plugin.impl.InventoryServiceImpl;
-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.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-
-public class PrintCacheTest {
-    private static final String NODESTRING = "OVS|10.10.10.10:65342";
-    private static final String BRIDGES = "bridges";
-    private static final String OVS = "OVS";
-    private static final String BRIDGE = "bridge1";
-    private static final String OPENVSWITCH = "Open_vSwitch";
-    private static final String CACHE =
-            "Database Open_vSwitch" + System.getProperty("line.separator") +
-            "\tTable Open_vSwitch" + System.getProperty("line.separator") +
-            "\t\t1==bridges : bridge1 " + System.getProperty("line.separator") +
-            "-----------------------------------------------------------" + System.getProperty("line.separator");
-
-    @Test
-    public void testDoExecute () throws Exception {
-        // Read in schema and create the DatabaseSchema
-        InputStream resourceAsStream = PrintCacheTest.class.getResourceAsStream("test_schema.json");
-        ObjectMapper mapper = new ObjectMapper();
-        JsonNode jsonNode = mapper.readTree(resourceAsStream);
-        DatabaseSchema schema = DatabaseSchema.fromJson("some", jsonNode.get("result"));
-        assertNotNull(schema);
-        assertEquals(Version.fromString("6.12.0"), schema.getVersion());
-
-        // Add params to PrintCache
-        PrintCache printCacheTest = new PrintCache();
-        Field cNField = printCacheTest.getClass().getDeclaredField("nodeName");
-        cNField.setAccessible(true);
-        cNField.set(printCacheTest, NODESTRING);
-        InventoryServiceImpl inventoryService = new InventoryServiceImpl();
-        inventoryService.init();
-        printCacheTest.setOvsdbInventory(inventoryService);
-
-        // Test that an empty cache prints nothing
-        // Capture the output from PrintCache and compare it to what is expected
-        PrintStream originalBaos = System.out;
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        System.setOut(new PrintStream(baos));
-        printCacheTest.doExecute();
-        assertEquals("PrintCache output does not match expected output:", "", baos.toString());
-
-        // Add some data to the bridges row in the Open_vSwitch table
-        GenericTableSchema ovsTable = schema.table(OPENVSWITCH, GenericTableSchema.class);
-        ColumnSchema<GenericTableSchema, Set<UUID>> bridges = ovsTable.multiValuedColumn(BRIDGES, UUID.class);
-        Column column = new Column(bridges, new UUID(BRIDGE).toString());
-        Row row = new Row(ovsTable);
-        row.addColumn(BRIDGES, column);
-
-        NodeId nodeId = new NodeId(NODESTRING);
-        NodeKey nodeKey = new NodeKey(nodeId);
-        Node node = new NodeBuilder()
-                .setId(nodeId)
-                .setKey(nodeKey)
-                .build();
-        inventoryService.updateRow(node, OvsVswitchdSchemaConstants.DATABASE_NAME, OPENVSWITCH, new UUID("1").toString(), row);
-
-        // Test that a populated cache is printed correctly
-        // Capture the output from PrintCache and compare it to what is expected
-        printCacheTest.doExecute();
-        System.setOut(originalBaos);
-        assertEquals("PrintCache output does not match expected output:", CACHE, baos.toString());
-    }
-}
diff --git a/plugin-shell/src/test/resources/org/opendaylight/ovsdb/plugin/shell/test_schema.json b/plugin-shell/src/test/resources/org/opendaylight/ovsdb/plugin/shell/test_schema.json
deleted file mode 100644 (file)
index f7f8405..0000000
+++ /dev/null
@@ -1,1150 +0,0 @@
-{
-  "id": 0,
-  "result": {
-    "tables": {
-      "Port": {
-        "columns": {
-          "name": {
-            "mutable": false,
-            "type": "string"
-          },
-          "statistics": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "integer",
-              "max": "unlimited"
-            }
-          },
-          "vlan_mode": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "access",
-                    "native-tagged",
-                    "native-untagged",
-                    "trunk"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "qos": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "QoS"
-              },
-              "min": 0
-            }
-          },
-          "status": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "trunks": {
-            "type": {
-              "key": {
-                "maxInteger": 4095,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0,
-              "max": 4096
-            }
-          },
-          "mac": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "interfaces": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "Interface"
-              },
-              "max": "unlimited"
-            }
-          },
-          "bond_downdelay": {
-            "type": "integer"
-          },
-          "bond_mode": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "active-backup",
-                    "balance-slb",
-                    "balance-tcp",
-                    "stable"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "bond_updelay": {
-            "type": "integer"
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "tag": {
-            "type": {
-              "key": {
-                "maxInteger": 4095,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "bond_fake_iface": {
-            "type": "boolean"
-          },
-          "fake_bridge": {
-            "type": "boolean"
-          },
-          "lacp": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "active",
-                    "off",
-                    "passive"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          }
-        },
-        "indexes": [
-          [
-            "name"
-          ]
-        ]
-      },
-      "Manager": {
-        "columns": {
-          "is_connected": {
-            "ephemeral": true,
-            "type": "boolean"
-          },
-          "target": {
-            "type": "string"
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "max_backoff": {
-            "type": {
-              "key": {
-                "minInteger": 1000,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "connection_mode": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "in-band",
-                    "out-of-band"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "status": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "inactivity_probe": {
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          }
-        },
-        "indexes": [
-          [
-            "target"
-          ]
-        ]
-      },
-      "Bridge": {
-        "columns": {
-          "name": {
-            "mutable": false,
-            "type": "string"
-          },
-          "flood_vlans": {
-            "type": {
-              "key": {
-                "maxInteger": 4095,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0,
-              "max": 4096
-            }
-          },
-          "netflow": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "NetFlow"
-              },
-              "min": 0
-            }
-          },
-          "mirrors": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "Mirror"
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "status": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "datapath_id": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "controller": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "Controller"
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "protocols": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "OpenFlow10",
-                    "OpenFlow12",
-                    "OpenFlow13"
-                  ]
-                ]
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "fail_mode": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "secure",
-                    "standalone"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "ports": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "Port"
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "flow_tables": {
-            "type": {
-              "key": {
-                "maxInteger": 254,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0,
-              "value": {
-                "type": "uuid",
-                "refTable": "Flow_Table"
-              },
-              "max": "unlimited"
-            }
-          },
-          "sflow": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "sFlow"
-              },
-              "min": 0
-            }
-          },
-          "datapath_type": {
-            "type": "string"
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "stp_enable": {
-            "type": "boolean"
-          }
-        },
-        "indexes": [
-          [
-            "name"
-          ]
-        ]
-      },
-      "Interface": {
-        "columns": {
-          "options": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "name": {
-            "mutable": false,
-            "type": "string"
-          },
-          "statistics": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "integer",
-              "max": "unlimited"
-            }
-          },
-          "link_speed": {
-            "ephemeral": true,
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          },
-          "mtu": {
-            "ephemeral": true,
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          },
-          "mac_in_use": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "type": {
-            "type": "string"
-          },
-          "ingress_policing_rate": {
-            "type": {
-              "key": {
-                "minInteger": 0,
-                "type": "integer"
-              }
-            }
-          },
-          "cfm_remote_opstate": {
-            "ephemeral": true,
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "down",
-                    "up"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "status": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "mac": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "ofport": {
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          },
-          "cfm_fault_status": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "duplex": {
-            "ephemeral": true,
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "full",
-                    "half"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "lacp_current": {
-            "ephemeral": true,
-            "type": {
-              "key": "boolean",
-              "min": 0
-            }
-          },
-          "cfm_fault": {
-            "ephemeral": true,
-            "type": {
-              "key": "boolean",
-              "min": 0
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "admin_state": {
-            "ephemeral": true,
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "down",
-                    "up"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "link_state": {
-            "ephemeral": true,
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "down",
-                    "up"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "cfm_remote_mpids": {
-            "ephemeral": true,
-            "type": {
-              "key": "integer",
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "cfm_mpid": {
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          },
-          "ofport_request": {
-            "type": {
-              "key": {
-                "maxInteger": 65279,
-                "minInteger": 1,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "ingress_policing_burst": {
-            "type": {
-              "key": {
-                "minInteger": 0,
-                "type": "integer"
-              }
-            }
-          },
-          "cfm_health": {
-            "ephemeral": true,
-            "type": {
-              "key": {
-                "maxInteger": 100,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "link_resets": {
-            "ephemeral": true,
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          }
-        },
-        "indexes": [
-          [
-            "name"
-          ]
-        ]
-      },
-      "SSL": {
-        "columns": {
-          "ca_cert": {
-            "type": "string"
-          },
-          "private_key": {
-            "type": "string"
-          },
-          "bootstrap_ca_cert": {
-            "type": "boolean"
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "certificate": {
-            "type": "string"
-          }
-        },
-        "maxRows": 1
-      },
-      "Open_vSwitch": {
-        "columns": {
-          "ovs_version": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "system_version": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "bridges": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "Bridge"
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "statistics": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "next_cfg": {
-            "type": "integer"
-          },
-          "manager_options": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "Manager"
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "system_type": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "ssl": {
-            "type": {
-              "key": {
-                "type": "uuid",
-                "refTable": "SSL"
-              },
-              "min": 0
-            }
-          },
-          "db_version": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "cur_cfg": {
-            "type": "integer"
-          }
-        },
-        "maxRows": 1,
-        "isRoot": true
-      },
-      "Queue": {
-        "columns": {
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "dscp": {
-            "type": {
-              "key": {
-                "maxInteger": 63,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          }
-        },
-        "isRoot": true
-      },
-      "NetFlow": {
-        "columns": {
-          "engine_type": {
-            "type": {
-              "key": {
-                "maxInteger": 255,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "targets": {
-            "type": {
-              "key": "string",
-              "max": "unlimited"
-            }
-          },
-          "add_id_to_interface": {
-            "type": "boolean"
-          },
-          "active_timeout": {
-            "type": {
-              "key": {
-                "minInteger": -1,
-                "type": "integer"
-              }
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "engine_id": {
-            "type": {
-              "key": {
-                "maxInteger": 255,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          }
-        }
-      },
-      "Mirror": {
-        "columns": {
-          "name": {
-            "type": "string"
-          },
-          "output_port": {
-            "type": {
-              "key": {
-                "refType": "weak",
-                "type": "uuid",
-                "refTable": "Port"
-              },
-              "min": 0
-            }
-          },
-          "output_vlan": {
-            "type": {
-              "key": {
-                "maxInteger": 4095,
-                "minInteger": 1,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "statistics": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "integer",
-              "max": "unlimited"
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "select_dst_port": {
-            "type": {
-              "key": {
-                "refType": "weak",
-                "type": "uuid",
-                "refTable": "Port"
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "select_all": {
-            "type": "boolean"
-          },
-          "select_vlan": {
-            "type": {
-              "key": {
-                "maxInteger": 4095,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0,
-              "max": 4096
-            }
-          },
-          "select_src_port": {
-            "type": {
-              "key": {
-                "refType": "weak",
-                "type": "uuid",
-                "refTable": "Port"
-              },
-              "min": 0,
-              "max": "unlimited"
-            }
-          }
-        }
-      },
-      "QoS": {
-        "columns": {
-          "queues": {
-            "type": {
-              "key": {
-                "maxInteger": 4294967295,
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0,
-              "value": {
-                "type": "uuid",
-                "refTable": "Queue"
-              },
-              "max": "unlimited"
-            }
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "type": {
-            "type": "string"
-          }
-        },
-        "isRoot": true
-      },
-      "Controller": {
-        "columns": {
-          "is_connected": {
-            "ephemeral": true,
-            "type": "boolean"
-          },
-          "enable_async_messages": {
-            "type": {
-              "key": "boolean",
-              "min": 0
-            }
-          },
-          "controller_rate_limit": {
-            "type": {
-              "key": {
-                "minInteger": 100,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "target": {
-            "type": "string"
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "other_config": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "local_netmask": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "local_gateway": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "max_backoff": {
-            "type": {
-              "key": {
-                "minInteger": 1000,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          },
-          "local_ip": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "connection_mode": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "in-band",
-                    "out-of-band"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "status": {
-            "ephemeral": true,
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "role": {
-            "ephemeral": true,
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "master",
-                    "other",
-                    "slave"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "inactivity_probe": {
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          },
-          "controller_burst_limit": {
-            "type": {
-              "key": {
-                "minInteger": 25,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          }
-        }
-      },
-      "Flow_Table": {
-        "columns": {
-          "groups": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "max": "unlimited"
-            }
-          },
-          "name": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "overflow_policy": {
-            "type": {
-              "key": {
-                "type": "string",
-                "enum": [
-                  "set",
-                  [
-                    "evict",
-                    "refuse"
-                  ]
-                ]
-              },
-              "min": 0
-            }
-          },
-          "flow_limit": {
-            "type": {
-              "key": {
-                "minInteger": 0,
-                "type": "integer"
-              },
-              "min": 0
-            }
-          }
-        }
-      },
-      "sFlow": {
-        "columns": {
-          "polling": {
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          },
-          "targets": {
-            "type": {
-              "key": "string",
-              "max": "unlimited"
-            }
-          },
-          "header": {
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          },
-          "agent": {
-            "type": {
-              "key": "string",
-              "min": 0
-            }
-          },
-          "external_ids": {
-            "type": {
-              "key": "string",
-              "min": 0,
-              "value": "string",
-              "max": "unlimited"
-            }
-          },
-          "sampling": {
-            "type": {
-              "key": "integer",
-              "min": 0
-            }
-          }
-        }
-      }
-    },
-    "cksum": "2180939265 17455",
-    "name": "Open_vSwitch",
-    "version": "6.12.0"
-  },
-  "error": null
-}
diff --git a/plugin/pom.xml b/plugin/pom.xml
deleted file mode 100755 (executable)
index 027ed1f..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
-    <artifactId>commons</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../commons/parent</relativePath>
-  </parent>
-
-  <artifactId>plugin</artifactId>
-  <version>1.2.1-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
-  <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  <licenses>
-    <license>
-      <name>Eclipse Public License v1.0</name>
-      <url>http://www.eclipse.org/legal/epl-v10.html</url>
-    </license>
-  </licenses>
-  <developers>
-    <developer>
-      <name>Sam Hague</name>
-      <email>shague@gmail.com</email>
-      <url>https://github.com/shague</url>
-    </developer>
-  </developers>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
-  </scm>
-
-  <dependencies>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>equinoxSDK381</groupId>
-      <artifactId>org.eclipse.osgi</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-all</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.dependencymanager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>library</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>schema.openvswitch</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.ovsdb</groupId>
-      <artifactId>utils.config</artifactId>
-      <version>${ovsdb.utils.config.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <testResources>
-      <testResource>
-        <filtering>true</filtering>
-        <directory>src/test/resources</directory>
-      </testResource>
-    </testResources>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.4.0</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Embed-Dependency>commons-codec,javax.servlet-api,portlet-api,commons-collections,utils.config;type=!pom;inline=false</Embed-Dependency>
-            <Embed-Transitive>true</Embed-Transitive>
-            <Bundle-Activator>org.opendaylight.ovsdb.plugin.internal.Activator</Bundle-Activator>
-            <Private-Package>
-              org.opendaylight.ovsdb.plugin.impl,
-              org.opendaylight.ovsdb.plugin.internal
-            </Private-Package>
-            <Export-Package>
-              org.opendaylight.ovsdb.plugin,
-              org.opendaylight.ovsdb.plugin.api,
-              org.opendaylight.ovsdb.plugin.error
-            </Export-Package>
-          </instructions>
-          <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-failsafe-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/plugin/resources/logback.xml b/plugin/resources/logback.xml
deleted file mode 100644 (file)
index 3a78a98..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<configuration>
-
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <!-- encoders are assigned the type
-             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
-        <encoder>
-            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
-        </encoder>
-    </appender>
-
-    <logger name="org.opendaylight.ovsdb" level="INFO" additivity="false">
-        <appender-ref ref="STDOUT" />
-    </logger>
-
-    <!--<logger name="com.lordofthejars.foo" level="INFO" additivity="false">-->
-        <!--<appender-ref ref="STDOUT" />-->
-    <!--</logger>-->
-
-    <root level="INFO">
-        <appender-ref ref="STDOUT" />
-    </root>
-
-</configuration>
\ No newline at end of file
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/Connection.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/Connection.java
deleted file mode 100644 (file)
index 9b883cf..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-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.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-
-public class Connection {
-    private Node node;
-    private String identifier;
-    private OvsdbClient client;
-
-    public Long getIdCounter() {
-        return idCounter;
-    }
-
-    public void setIdCounter(Long idCounter) {
-        this.idCounter = idCounter;
-    }
-
-    private Long idCounter;
-
-    public Connection(String identifier, OvsdbClient client) {
-        super();
-
-        this.identifier = identifier;
-        this.client = client;
-        this.idCounter = 0L;
-        NodeId nodeId = new NodeId("OVS" + "|" + identifier);
-        NodeKey nodeKey = new NodeKey(nodeId);
-        node = new NodeBuilder()
-                .setId(nodeId)
-                .setKey(nodeKey)
-                .build();
-    }
-
-    public String getIdentifier() {
-        return identifier;
-    }
-
-    public void setIdentifier(String identifier) {
-        this.identifier = identifier;
-    }
-
-    public OvsdbClient getClient() {
-        return this.client;
-    }
-
-    public void setClient(OvsdbClient client) {
-        this.client = client;
-    }
-
-    public Node getNode() {
-        return node;
-    }
-
-    public void setNode(Node node) {
-        this.node = node;
-    }
-
-    public void disconnect() {
-        client.disconnect();
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        Connection other = (Connection) obj;
-        if (identifier == null) {
-            if (other.identifier != null) {
-                return false;
-            }
-        } else if (!identifier.equals(other.identifier)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/ConnectionConstants.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/ConnectionConstants.java
deleted file mode 100644 (file)
index b2a33b2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-/**
- * ConnectionConstants
- * Expand this enum as and when needed to support other connection parameters that
- * might be needed for certain protocol plugins.
- */
-public enum ConnectionConstants {
-    ADDRESS("address"),
-    PORT("port"),
-    PROTOCOL("protocol"),
-    USERNAME("username"),
-    PASSWORD("password");
-
-    private ConnectionConstants(String name) {
-        this.name = name;
-    }
-
-    private String name;
-
-    public String toString() {
-        return name;
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsVswitchdSchemaConstants.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsVswitchdSchemaConstants.java
deleted file mode 100644 (file)
index 7876259..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import org.opendaylight.ovsdb.utils.config.ConfigProperties;
-
-import java.util.Map;
-
-import com.google.common.collect.Maps;
-
-public final class OvsVswitchdSchemaConstants {
-    public static String DATABASE_NAME = "Open_vSwitch";
-
-    private static final String OVSDB_AUTOCONFIGURECONTROLLER = "ovsdb.autoconfigurecontroller";
-    private static final boolean defaultAutoConfigureController = true;
-    private static boolean autoConfigureController = defaultAutoConfigureController;
-
-    private static Map<String, String[]> columnToMutate = Maps.newHashMap();
-    public static String[] getParentColumnToMutate(String childTabletoInsert) {
-        return columnToMutate.get(childTabletoInsert);
-    }
-    private static void addParentColumnToMutate(String childTable, String parentTable, String columnName) {
-        String[] parentColumn = {parentTable, columnName};
-        columnToMutate.put(childTable, parentColumn);
-    }
-
-    static {
-        addParentColumnToMutate("Bridge", "Open_vSwitch", "bridges");
-        addParentColumnToMutate("Port", "Bridge", "ports");
-        addParentColumnToMutate("Interface", "Port", "interfaces");
-        addParentColumnToMutate("SSL", "Open_vSwitch", "ssl");
-        addParentColumnToMutate("IPFIX", "Bridge", "ipfix");
-        addParentColumnToMutate("sFlow", "Bridge", "sflow");
-        addParentColumnToMutate("Flow_Table", "Bridge", "flow_tables");
-        addParentColumnToMutate("QoS", "Port", "qos");
-        addParentColumnToMutate("NetFlow", "Bridge", "netflow");
-        addParentColumnToMutate("Mirror", "Bridge", "mirrors");
-        addParentColumnToMutate("Manager", "Open_vSwitch", "manager_options");
-        addParentColumnToMutate("Controller", "Bridge", "controller");
-        // Keep the default value if the property is not set
-        final String autoConfigureControllerStr =
-                ConfigProperties.getProperty(OvsVswitchdSchemaConstants.class, OVSDB_AUTOCONFIGURECONTROLLER);
-        if (autoConfigureControllerStr != null) {
-            autoConfigureController = Boolean.getBoolean(autoConfigureControllerStr);
-        }
-    }
-
-    public static void setAutoConfigureController(boolean autoConfigure) {
-        autoConfigureController = autoConfigure;
-    }
-
-    public static boolean shouldConfigureController (String databaseName, String tableName) {
-        return autoConfigureController && databaseName.equals(DATABASE_NAME) && tableName.equals("Bridge");
-    }
-
-    public enum PortType {
-        VLAN("vlan"),
-        TUNNEL("Tunnel"),
-        BONDING("Bonding"),
-        PATCH("patch"),
-        INTERNAL("internal");
-
-        private PortType(String name) {
-            this.name = name;
-        }
-
-        private String name;
-
-        @Override
-        public String toString() {
-            return name;
-        }
-    }
-
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbConfigurationService.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbConfigurationService.java
deleted file mode 100644 (file)
index 660058f..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
-
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
-import org.opendaylight.ovsdb.plugin.error.OvsdbPluginException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-public interface OvsdbConfigurationService {
-
-    /**
-     * @deprecated This version of insertRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #insertRow(Node, String, String, Row)} and
-     * {@link #insertTree(Node, String, String, UUID, Row)}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table on which the row is inserted
-     * @param parentUuid UUID of the parent table to which this operation will result in attaching/mutating.
-     * @param row Row of table Content to be inserted
-     * @return UUID of the inserted Row
-     */
-    @Deprecated
-    StatusWithUuid insertRow(Node node, String tableName, String parentUuid, Row<GenericTableSchema> row);
-
-    /**
-     * insert a Row in a Table of a specified Database Schema. This is a convenience method on top of
-     * {@link insertRow(Node, String, String, String, UUID, String, Row) insertRow}
-     * which assumes that OVSDB schema implementation that corresponds to the databaseName will provide
-     * the necessary service to populate the Parent Table Name and Parent Column Name.
-     *
-     * This method can insert just a single Row specified in the row parameter.
-     * But {@link #insertTree(Node, String, String, UUID, Row) insertTree}
-     * can insert a hierarchy of rows with parent-child relationship.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentRowUuid UUID of the parent table to which this operation will result in attaching/mutating.
-     * @param row Row of table Content to be inserted
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return UUID of the inserted Row
-     */
-    UUID insertRow(Node node, String databaseName, String tableName, UUID parentRowUuid,
-                   Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * insert a Row in a Table of a specified Database Schema.
-     *
-     * This method can insert just a single Row specified in the row parameter.
-     * But {@link #insertTree(Node, String, String, UUID, Row)}
-     * can insert a hierarchy of rows with parent-child relationship.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentTable Name of the Parent Table to which this operation will result in attaching/mutating.
-     * @param parentRowUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated with the UUID that results from the insert operation.
-     * @param row Row of table Content to be inserted
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return UUID of the inserted Row
-     */
-    UUID insertRow(Node node, String databaseName, String tableName, String parentTable, UUID parentRowUuid,
-                   String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * inserts a Tree of Rows in multiple Tables that has parent-child relationships referenced through the OVSDB schema's refTable construct.
-     * This is a convenience method on top of {@link #insertTree(Node, String, String, String, UUID, String, Row)}
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentRowUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return Returns the row tree with the UUID of every inserted Row populated in the _uuid column of every row in the tree
-     */
-    Row<GenericTableSchema> insertTree(Node node, String databaseName, String tableName, UUID parentRowUuid,
-                                       Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * inserts a Tree of Rows in multiple Tables that has parent-child relationships referenced through the OVSDB schema's refTable construct
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentTable Name of the Parent Table to which this operation will result in attaching/mutating.
-     * @param parentRowUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated with the UUID that results from the insert operation.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return Returns the row tree with the UUID of every inserted Row populated in the _uuid column of every row in the tree
-     */
-    Row<GenericTableSchema> insertTree(Node node, String databaseName, String tableName, String parentTable, UUID parentRowUuid,
-                                       String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of updateRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #updateRow(Node, String, String, UUID, Row, boolean) updateRow}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table on which the row is Updated
-     * @param rowUuid UUID of the parent row on which this operation might result in mutating.
-     * @param rowUuid UUID of the row that is being updated
-     * @param row Row of table Content to be Updated. Include just those columns that needs to be updated.
-     */
-    @Deprecated
-    Status updateRow(Node node, String tableName, String parentUuid, String rowUuid, Row row);
-
-    /**
-     * update or mutate a Row in a Table of a specified Database Schema.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is updated
-     * @param rowUuid UUID of the row being updated
-     * @param row Row of table Content to be updated
-     * @param overwrite true will overwrite/replace the existing row (matching the rowUuid) with the passed row object.
-     *                  false will update the existing row (matching the rowUuid) using only the columns in the passed row object.
-     * @throws OvsdbPluginException Any failure during the update operation will result in a specific exception.
-     * @return Returns the entire Row after the update operation.
-     */
-    Row<GenericTableSchema> updateRow(Node node, String databaseName, String tableName, UUID rowUuid,
-                                      Row<GenericTableSchema> row, boolean overwrite) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of deleteRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by {@link #deleteRow(Node, String, String, UUID)}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table on which the row is Updated
-     * @param rowUuid UUID of the row that is being deleted
-     */
-    @Deprecated
-    Status deleteRow(Node node, String tableName, String rowUuid);
-
-    /**
-     * update or mutate a Row in a Table of a specified Database Schema.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is Updated
-     * @param rowUuid UUID of the row that is being deleted
-     * @throws OvsdbPluginException Any failure during the delete operation will result in a specific exception.
-     */
-
-    void deleteRow(Node node, String databaseName, String tableName, UUID rowUuid) throws OvsdbPluginException;
-
-    /**
-     * update or mutate a Row in a Table of a specified Database Schema.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is Updated
-     * @param parentTable Name of the Parent Table to which this operation will result in mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated.
-     * @param rowUuid UUID of the row that is being deleted
-     * @throws OvsdbPluginException Any failure during the delete operation will result in a specific exception.
-     */
-
-    void deleteRow(Node node, String databaseName, String tableName, String parentTable,
-                   UUID parentRowUuid, String parentColumn, UUID rowUuid) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of getRow is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by {@link #getRow(Node, String, String, UUID) getRow}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table Name
-     * @param uuid UUID of the row being queried
-     * @return a row with a list of Column data that corresponds to an unique Row-identifier called uuid in a given table.
-     */
-    @Deprecated
-    Row getRow(Node node, String tableName, String uuid);
-
-    /**
-     * Returns a Row from a table for the specified uuid.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table Name
-     * @param uuid UUID of the row being queried
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return a row with a list of Column data that corresponds to an unique Row-identifier called uuid in a given table.
-     */
-    Row<GenericTableSchema> getRow(Node node, String databaseName, String tableName, UUID uuid) throws OvsdbPluginException;
-
-    /**
-     * @deprecated This version of getRows is a short-term replacement for the older and now deprecated method of the same name.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #getRows(Node, String, String) getRows} and {@link #getRows(Node, String, String, String) getRows}
-     *
-     * @param node OVSDB Node
-     * @param tableName Table Name
-     * @return List of rows that makes the entire Table.
-     */
-    @Deprecated
-    ConcurrentMap<String, Row> getRows(Node node, String tableName);
-
-    /**
-     * Returns all rows of a table.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table Name
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return Map of rows to its UUID that makes the entire Table.
-     */
-    ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node, String databaseName, String tableName) throws OvsdbPluginException;
-
-    /**
-     * Returns all rows of a table filtered by query string.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table Name
-     * @param fiqlQuery FIQL style String Query <a href="http://tools.ietf.org/html/draft-nottingham-atompub-fiql-00">draft-nottingham-atompub-fiql</a> to filter rows
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return Map of rows to its UUID that makes the entire Table.
-     */
-    ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node, String databaseName, String tableName, String fiqlQuery) throws OvsdbPluginException;
-
-    /**
-     * @deprecated Returns all the Tables in a given Ndoe.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * This API is replaced by
-     * {@link #getTables(Node, String) getTables}
-     * @param node OVSDB node
-     * @return List of Table Names that make up Open_vSwitch schema.
-     */
-    @Deprecated
-    List<String> getTables(Node node);
-
-    /**
-     * Returns all the Tables in a given Node.
-     *
-     * @param node OVSDB node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @throws OvsdbPluginException Any failure during the get operation will result in a specific exception.
-     * @return List of Table Names that make up the schema represented by the databaseName
-     */
-    List<String> getTables(Node node, String databaseName) throws OvsdbPluginException;
-
-    /**
-     * setOFController is a convenience method used by existing applications to setup Openflow Controller on
-     * a Open_vSwitch Bridge.
-     * This API assumes an Open_vSwitch database Schema.
-     *
-     * @param node Node
-     * @param bridgeUUID uuid of the Bridge for which the ip-address of Openflow Controller should be programmed.
-     * @return Boolean representing success or failure of the operation.
-     *
-     * @throws InterruptedException
-     * @throws ExecutionException
-     */
-    Boolean setOFController(Node node, String bridgeUUID) throws InterruptedException, ExecutionException;
-
-    <T extends TypedBaseTable<?>> String getTableName(Node node, Class<T> typedClass);
-    <T extends TypedBaseTable<?>> T getTypedRow(Node node, Class<T> typedClass, Row row);
-    <T extends TypedBaseTable<?>> T createTypedRow(Node node, Class<T> typedClass);
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbConnectionService.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbConnectionService.java
deleted file mode 100644 (file)
index 11d7a46..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import java.util.List;
-import java.util.Map;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-public interface OvsdbConnectionService {
-    Connection getConnection(Node node);
-    List<Node> getNodes();
-    Node getNode(String identifier);
-    Node connect(String identifier, Map<ConnectionConstants, String> params);
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbInventoryListener.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbInventoryListener.java
deleted file mode 100644 (file)
index 21f7ff9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import java.net.InetAddress;
-
-public interface OvsdbInventoryListener {
-    void nodeAdded(Node node, InetAddress address, int port);
-    void nodeRemoved(Node node);
-    void rowAdded(Node node, String tableName, String uuid, Row row);
-    void rowUpdated(Node node, String tableName, String uuid, Row old, Row row);
-    void rowRemoved(Node node, String tableName, String uuid, Row row, Object context);
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbInventoryService.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/OvsdbInventoryService.java
deleted file mode 100644 (file)
index 236a4e1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import java.net.InetAddress;
-import java.util.concurrent.ConcurrentMap;
-
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-public interface OvsdbInventoryService {
-    ConcurrentMap<String, ConcurrentMap<String, Row>> getCache(Node n, String databaseName);
-    ConcurrentMap<String, Row> getTableCache(Node n, String databaseName, String tableName);
-    Row getRow(Node n, String databaseName, String tableName, String uuid);
-    void updateRow(Node n, String databaseName, String tableName, String uuid, Row row);
-    void removeRow(Node n, String databaseName, String tableName, String uuid);
-    void processTableUpdates(Node n, String databaseName, TableUpdates tableUpdates);
-    void printCache(Node n);
-    void notifyNodeAdded(Node n, InetAddress address, int port);
-    void removeNode(Node n);
-}
\ No newline at end of file
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/Status.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/Status.java
deleted file mode 100644 (file)
index 5c35306..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import java.io.Serializable;
-
-/**
- * Represents the return object of the osgi service interfaces function calls.
- * It contains a code {@code StatusCode} representing the result of the call and
- * a string which describes a failure reason (if any) in human readable form.
- */
-public class Status implements Serializable {
-    private static final long serialVersionUID = 0L;
-    private StatusCode code;
-    private String description;
-    private long requestId;
-
-    /**
-     * Generates an instance of the Status class. This is used as return code
-     * for internal API2 function calls. This constructor allows to specify,
-     * beside the Status Code, a custom human readable description to add more
-     * information about the status.
-     *
-     * @param errorCode
-     *            The status code. If passed as null, code will be stored as
-     *            {@code StatusCode.UNDEFINED}
-     * @param description
-     *            The human readable description of the status. If passed as
-     *            null, description will be inferred by the code
-     */
-    public Status(StatusCode errorCode, String description) {
-        this.code = (errorCode != null) ? errorCode : StatusCode.UNDEFINED;
-        this.description = (description != null) ? description : this.code
-                .toString();
-        this.requestId = 0;
-    }
-
-    /**
-     * Generates an instance of the Status class based on the passed StatusCode
-     * only. The description field of the Status object will be inferred by the
-     * status code.
-     *
-     * @param errorCode
-     *            The status code. If passed as null, code will be stored as
-     *            {@code StatusCode.UNDEFINED}
-     */
-    public Status(StatusCode errorCode) {
-        this.code = (errorCode != null) ? errorCode : StatusCode.UNDEFINED;
-        this.description = (description != null) ? description : this.code
-                .toString();
-        this.requestId = 0;
-    }
-
-    /**
-     * Generates an instance of the Status class to be used in case of
-     * asynchronous call. It is supposed to be created by the underlying
-     * infrastructure only when it was successful in allocating the asynchronous
-     * request id, hence caller should expect StatusCode to be successful.
-     *
-     * @param errorCode
-     *            The status code. If passed as null, code will be stored as
-     *            {@code StatusCode.UNDEFINED}
-     * @param requestId
-     *            The request id set by underlying infrastructure for this
-     *            request
-     */
-    public Status(StatusCode errorCode, long requestId) {
-        this.code = (errorCode != null) ? errorCode : StatusCode.UNDEFINED;
-        this.description = (description != null) ? description : this.code
-                .toString();
-        this.requestId = requestId;
-    }
-
-    /**
-     * Returns the status code
-     *
-     * @return the {@code StatusCode} representing the status code
-     */
-    public StatusCode getCode() {
-        return code;
-    }
-
-    /**
-     * Returns a human readable description of the failure if any
-     *
-     * @return a string representing the reason of failure
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Tells whether the status is successful
-     *
-     * @return true if the Status code is {@code StatusCode.SUCCESS}
-     */
-    public boolean isSuccess() {
-        return code == StatusCode.SUCCESS || code == StatusCode.CREATED;
-    }
-
-    /**
-     * Return the request id assigned by underlying infrastructure in case of
-     * asynchronous request. In case of synchronous requests, the returned id
-     * is expected to be 0
-     *
-     * @return The request id assigned for this asynchronous request
-     */
-    public long getRequestId() {
-        return requestId;
-    }
-
-    @Override
-    public String toString() {
-        return code + ": " + description + " (" + requestId + ")";
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((code == null) ? 0 : code.calculateConsistentHashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        Status other = (Status) obj;
-        if (code != other.code) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/StatusCode.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/StatusCode.java
deleted file mode 100644 (file)
index cd3628e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-/**
- * The enum which describes the generic error conditions.
- * Each enum value is associated with a minimal description string.
- *
- */
-public enum StatusCode {
-    SUCCESS("Success"),
-    CREATED("Created"),
-
-    BADREQUEST("Bad Request"),
-    UNAUTHORIZED("UnAuthorized"),
-    FORBIDDEN("Forbidden"),
-    NOTFOUND("Not Found"),
-    NOTALLOWED("Method Not Allowed"),
-    NOTACCEPTABLE("Request Not Acceptable"),
-    TIMEOUT("Request Timeout"),
-    CONFLICT("Resource Conflict"),
-    GONE("Resource Gone"),
-    UNSUPPORTED("Unsupported"),
-
-    INTERNALERROR("Internal Error"),
-    NOTIMPLEMENTED("Not Implemented"),
-    NOSERVICE("Service Not Available"),
-
-    UNDEFINED("Undefined Error");
-
-    private String description;
-    private StatusCode(String description) {
-        this.description = description;
-    }
-
-    /**
-     * Prints the description associated to the code value
-     */
-    @Override
-    public String toString() {
-        return description;
-    }
-
-    public int calculateConsistentHashCode() {
-        if (this.description != null) {
-            return this.description.hashCode();
-        } else {
-            return 0;
-        }
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/StatusWithUuid.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/api/StatusWithUuid.java
deleted file mode 100644 (file)
index 6f5e89b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.plugin.api;
-
-import org.opendaylight.ovsdb.plugin.api.Status;
-import org.opendaylight.ovsdb.plugin.api.StatusCode;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-
-/**
- * Extends the Status class to allow functions to return a uuid
- */
-public class StatusWithUuid extends Status {
-    private static final long serialVersionUID = -5413085099514964003L;
-    private UUID uuid;
-
-    public StatusWithUuid(StatusCode errorCode) {
-        super(errorCode);
-    }
-
-    public StatusWithUuid(StatusCode errorCode, String description) {
-        super(errorCode, description);
-    }
-
-    public StatusWithUuid(StatusCode errorCode, long requestId) {
-        super(errorCode, requestId);
-    }
-
-    public StatusWithUuid(StatusCode errorCode, UUID uuid) {
-        super(errorCode);
-        this.uuid = uuid;
-    }
-
-    public UUID getUuid() {
-        return uuid;
-    }
-
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/error/OvsdbPluginException.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/error/OvsdbPluginException.java
deleted file mode 100644 (file)
index a3ebc73..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.plugin.error;
-
-public class OvsdbPluginException extends RuntimeException {
-    public OvsdbPluginException(String message){
-        super(message);
-    }
-
-    public OvsdbPluginException(String message, Throwable cause){
-        super(message, cause);
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConfigurationServiceImpl.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConfigurationServiceImpl.java
deleted file mode 100644 (file)
index 639e2cb..0000000
+++ /dev/null
@@ -1,973 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.impl;
-
-import static org.opendaylight.ovsdb.lib.operations.Operations.op;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
-
-import org.opendaylight.ovsdb.plugin.api.Status;
-import org.opendaylight.ovsdb.plugin.api.StatusCode;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.error.SchemaVersionMismatchException;
-import org.opendaylight.ovsdb.lib.notation.Column;
-import org.opendaylight.ovsdb.lib.notation.Mutator;
-import org.opendaylight.ovsdb.lib.notation.OvsdbSet;
-import org.opendaylight.ovsdb.lib.notation.ReferencedRow;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.operations.Insert;
-import org.opendaylight.ovsdb.lib.operations.Operation;
-import org.opendaylight.ovsdb.lib.operations.OperationResult;
-import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
-import org.opendaylight.ovsdb.lib.schema.BaseType.UuidBaseType;
-import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.TableSchema;
-import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.plugin.api.StatusWithUuid;
-import org.opendaylight.ovsdb.plugin.error.OvsdbPluginException;
-import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
-import org.opendaylight.ovsdb.schema.openvswitch.Controller;
-import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
-import org.opendaylight.ovsdb.schema.openvswitch.Port;
-import org.opendaylight.ovsdb.utils.config.ConfigProperties;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public class ConfigurationServiceImpl implements OvsdbConfigurationService
-{
-    private static final Logger LOG = LoggerFactory.getLogger(ConfigurationServiceImpl.class);
-
-    OvsdbConnectionService connectionService;
-    OvsdbInventoryService ovsdbInventoryService;
-    protected static final String OPENFLOW_13 = "1.3";
-
-    void init() {
-    }
-
-    /**
-     * Function called by the dependency manager when at least one dependency
-     * become unsatisfied or when the component is shutting down because for
-     * example bundle is being stopped.
-     *
-     */
-    void destroy() {
-    }
-
-    /**
-     * Function called by dependency manager after "init ()" is called and after
-     * the services provided by the class are registered in the service registry
-     *
-     */
-    void start() {
-    }
-
-    /**
-     * Function called by the dependency manager before the services exported by
-     * the component are unregistered, this will be followed by a "destroy ()"
-     * calls
-     *
-     */
-    void stop() {
-    }
-
-    public void setConnectionServiceInternal(OvsdbConnectionService connectionService) {
-        this.connectionService = connectionService;
-    }
-
-    public void unsetConnectionServiceInternal(OvsdbConnectionService connectionService) {
-        if (this.connectionService.equals(connectionService)) {
-            this.connectionService = null;
-        }
-    }
-
-    public void setOvsdbInventoryService(OvsdbInventoryService ovsdbInventoryService) {
-        this.ovsdbInventoryService = ovsdbInventoryService;
-    }
-
-    public void unsetInventoryServiceInternal(OvsdbInventoryService ovsdbInventoryService) {
-        if (this.ovsdbInventoryService.equals(ovsdbInventoryService)) {
-            this.ovsdbInventoryService = null;
-        }
-    }
-
-    private Connection getConnection (Node node) {
-        Connection connection = connectionService.getConnection(node);
-        if (connection == null || !connection.getClient().isActive()) {
-            return null;
-        }
-
-        return connection;
-    }
-    /*
-     * There are a few Open_vSwitch schema specific special case handling to be done for
-     * the older API (such as by inserting a mandatory Interface row automatically upon inserting
-     * a Port row.
-     */
-    private void handleSpecialInsertCase(OvsdbClient client, String databaseName,
-            String tableName, Row<GenericTableSchema> row, TransactionBuilder transactionBuilder) {
-        Port port = client.getTypedRowWrapper(Port.class, null);
-        if (databaseName.equals(OvsVswitchdSchemaConstants.DATABASE_NAME) && tableName.equals(port.getSchema().getName())) {
-            port = client.getTypedRowWrapper(Port.class, row);
-            DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-            TableSchema<GenericTableSchema> tableSchema = dbSchema.table(tableName, GenericTableSchema.class);
-            ColumnSchema<GenericTableSchema, Set<UUID>> columnSchema = tableSchema.multiValuedColumn("interfaces", UUID.class);
-            String namedUuid = "Special_"+tableName;
-            List<Operation> priorOperations = transactionBuilder.getOperations();
-            Insert portOperation = (Insert)priorOperations.get(0);
-            portOperation.value(columnSchema, new UUID(namedUuid));
-
-            Column<GenericTableSchema, ?> nameColumn = port.getNameColumn();
-            List<Column<GenericTableSchema, ?>> columns = new ArrayList<Column<GenericTableSchema, ?>>();
-            columns.add(nameColumn);
-            Row<GenericTableSchema> intfRow = new Row<GenericTableSchema>(tableSchema, columns);
-            this.processTypedInsertTransaction(client, databaseName, "Interface", null, null, null, namedUuid, intfRow, transactionBuilder);
-        }
-    }
-
-    /*
-     * A common Transaction that takes in old API style Parent_uuid and inserts a mutation on
-     * the parent table for the newly inserted Child.
-     * Due to some additional special case(s), the Transaction is further amended by handleSpecialInsertCase
-     */
-    private void processTypedInsertTransaction(OvsdbClient client, String databaseName, String childTable,
-                                    String parentTable, String parentUuid, String parentColumn, String namedUuid,
-                                    Row<GenericTableSchema> row, TransactionBuilder transactionBuilder) {
-        this.processInsertTransaction(client, databaseName, childTable, parentTable, new UUID(parentUuid), parentColumn,
-                                      namedUuid, row, transactionBuilder);
-        /*
-         * There are a few Open_vSwitch schema specific special case handling to be done for
-         * the older API (such as by inserting a mandatory Interface row automatically upon inserting
-         * a Port row.
-         */
-        handleSpecialInsertCase(client, databaseName, childTable, row, transactionBuilder);
-    }
-
-    /*
-     * TODO : Move all the Special Cases out of ConfigurationService and into the Schema specific bundles.
-     * But that makes plugin more reliant on the Typed Bundles more than just API wrapper.
-     * Keeping these Special Handling locally till we introduce the full schema independent APIs in the
-     * plugin layer.
-     */
-    public String getSpecialCaseParentUUID(Node node, String databaseName, String childTableName) {
-        if (!databaseName.equals(OvsVswitchdSchemaConstants.DATABASE_NAME)) {
-            return null;
-        }
-        String[] parentColumn = OvsVswitchdSchemaConstants.getParentColumnToMutate(childTableName);
-        if (parentColumn != null && parentColumn[0].equals(OvsVswitchdSchemaConstants.DATABASE_NAME)) {
-            Connection connection = connectionService.getConnection(node);
-            OpenVSwitch openVSwitch = connection.getClient().getTypedRowWrapper(OpenVSwitch.class, null);
-            ConcurrentMap<String, Row> row = this.getRows(node, openVSwitch.getSchema().getName());
-            if (row == null || row.size() == 0) {
-                return null;
-            }
-            return (String)row.keySet().toArray()[0];
-        }
-        return null;
-    }
-
-    /*
-     * Though this is a New API that takes in Row object, this still is considered a
-     * Deprecated call because of the assumption with a Single Row insertion.
-     * An ideal insertRow must be able to take in multiple Rows, which includes the
-     * Row being inserted in one Table and other Rows that needs mutate in other Tables.
-     */
-    @Override
-    @Deprecated
-    public StatusWithUuid insertRow(Node node, String tableName, String parentUuid, Row<GenericTableSchema> row) {
-        String[] parentColumn = OvsVswitchdSchemaConstants.getParentColumnToMutate(tableName);
-        if (parentColumn == null) {
-            parentColumn = new String[]{null, null};
-        }
-
-        Connection connection = connectionService.getConnection(node);
-        OvsdbClient client = connection.getClient();
-
-        String myParentUuid = parentUuid;
-        if (myParentUuid == null) {
-            myParentUuid = this.getSpecialCaseParentUUID(node, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-        }
-        LOG.debug("insertRow Connection : {} Table : {} ParentTable : {} Parent Column: {} Parent UUID : {} Row : {}",
-                client.getConnectionInfo(), tableName, parentColumn[0], parentColumn[1], myParentUuid, row);
-
-        DatabaseSchema dbSchema = client.getDatabaseSchema(OvsVswitchdSchemaConstants.DATABASE_NAME);
-        TransactionBuilder transactionBuilder = client.transactBuilder(dbSchema);
-
-        String namedUuid = "Transaction_"+ tableName;
-        this.processTypedInsertTransaction(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName,
-                                parentColumn[0], myParentUuid, parentColumn[1], namedUuid,
-                                row, transactionBuilder);
-
-        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
-        List<OperationResult> operationResults;
-        try {
-            operationResults = results.get();
-            if (operationResults.isEmpty() || (transactionBuilder.getOperations().size() != operationResults.size())) {
-                return new StatusWithUuid(StatusCode.INTERNALERROR);
-            }
-            for (OperationResult result : operationResults) {
-                if (result.getError() != null) {
-                    return new StatusWithUuid(StatusCode.BADREQUEST, result.getError());
-                }
-            }
-            UUID uuid = operationResults.get(0).getUuid();
-            return new StatusWithUuid(StatusCode.SUCCESS, uuid);
-        } catch (InterruptedException | ExecutionException e) {
-            // TODO Auto-generated catch block
-            return new StatusWithUuid(StatusCode.INTERNALERROR, e.getLocalizedMessage());
-        }
-
-    }
-
-    @Override
-    @Deprecated
-    public Status updateRow (Node node, String tableName, String parentUUID, String rowUUID, Row row) {
-        String databaseName = OvsVswitchdSchemaConstants.DATABASE_NAME;
-        this.updateRow(node, databaseName, tableName, new UUID(rowUUID), row, true);
-        return new StatusWithUuid(StatusCode.SUCCESS);
-    }
-
-    private void processDeleteTransaction(OvsdbClient client, String databaseName, String childTable,
-                                    String parentTable, String parentColumn, String uuid, TransactionBuilder transactionBuilder) {
-        DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-        TableSchema<GenericTableSchema> childTableSchema = dbSchema.table(childTable, GenericTableSchema.class);
-
-        if (parentColumn != null) {
-            TableSchema<GenericTableSchema> parentTableSchema = dbSchema.table(parentTable, GenericTableSchema.class);
-            ColumnSchema<GenericTableSchema, UUID> parentColumnSchema = parentTableSchema.column(parentColumn, UUID.class);
-            transactionBuilder
-                .add(op.mutate(parentTableSchema)
-                        .addMutation(parentColumnSchema, Mutator.DELETE, new UUID(uuid))
-                        .where(parentColumnSchema.opIncludes(new UUID(uuid)))
-                        .build());
-        }
-
-        ColumnSchema<GenericTableSchema, UUID> _uuid = childTableSchema.column("_uuid", UUID.class);
-        transactionBuilder.add(op.delete(childTableSchema)
-                .where(_uuid.opEqual(new UUID(uuid)))
-                .build());
-    }
-
-    @Override
-    @Deprecated
-    public Status deleteRow(Node node, String tableName, String uuid) {
-        String databaseName = OvsVswitchdSchemaConstants.DATABASE_NAME;
-        Connection connection = connectionService.getConnection(node);
-        OvsdbClient client = connection.getClient();
-
-        String[] parentColumn = OvsVswitchdSchemaConstants.getParentColumnToMutate(tableName);
-        if (parentColumn == null) {
-            parentColumn = new String[]{null, null};
-        }
-
-        LOG.debug("deleteRow : Connection : {} databaseName : {} tableName : {} Uuid : {} ParentTable : {} ParentColumn : {}",
-                client.getConnectionInfo(), databaseName, tableName, uuid, parentColumn[0], parentColumn[1]);
-
-        DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-        TransactionBuilder transactionBuilder = client.transactBuilder(dbSchema);
-        this.processDeleteTransaction(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName,
-                                      parentColumn[0], parentColumn[1], uuid, transactionBuilder);
-
-        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
-        List<OperationResult> operationResults;
-        try {
-            operationResults = results.get();
-            if (operationResults.isEmpty() || (transactionBuilder.getOperations().size() != operationResults.size())) {
-                return new StatusWithUuid(StatusCode.INTERNALERROR);
-            }
-            for (OperationResult result : operationResults) {
-                if (result.getError() != null) {
-                    return new StatusWithUuid(StatusCode.BADREQUEST, result.getError());
-                }
-            }
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Error in deleteRow() {} {}", node, tableName, e);
-        }
-
-        return new Status(StatusCode.SUCCESS);
-    }
-
-    @Override
-    @Deprecated
-    public ConcurrentMap<String, Row> getRows(Node node, String tableName) {
-        return ovsdbInventoryService.getTableCache(node, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-    }
-
-    @Override
-    @Deprecated
-    public Row getRow(Node node, String tableName, String uuid) {
-        Map<String, Row> ovsTable = ovsdbInventoryService.getTableCache(node, OvsVswitchdSchemaConstants.DATABASE_NAME,  tableName);
-        if (ovsTable == null) {
-            return null;
-        }
-        return ovsTable.get(uuid);
-    }
-
-    @Override
-    @Deprecated
-    public List<String> getTables(Node node) {
-        return this.getTables(node, OvsVswitchdSchemaConstants.DATABASE_NAME);
-    }
-
-    private InetAddress getControllerIPAddress(Connection connection) {
-        InetAddress controllerIP = null;
-
-        String addressString = ConfigProperties.getProperty(this.getClass(), "ovsdb.controller.address");
-
-        if (addressString != null) {
-            try {
-                controllerIP = InetAddress.getByName(addressString);
-                if (controllerIP != null) {
-                    return controllerIP;
-                }
-            } catch (UnknownHostException e) {
-                LOG.error("Host {} is invalid", addressString);
-            }
-        }
-
-        addressString = ConfigProperties.getProperty(this.getClass(), "of.address");
-
-        if (addressString != null) {
-            try {
-                controllerIP = InetAddress.getByName(addressString);
-                if (controllerIP != null) {
-                    return controllerIP;
-                }
-            } catch (UnknownHostException e) {
-                LOG.error("Host {} is invalid", addressString);
-            }
-        }
-
-        try {
-            controllerIP = connection.getClient().getConnectionInfo().getLocalAddress();
-            return controllerIP;
-        } catch (Exception e) {
-            LOG.debug("Invalid connection provided to getControllerIPAddresses", e);
-        }
-        return controllerIP;
-    }
-
-    private short getControllerOFPort() {
-        short openFlowPort = (short) 6633;
-        String portString = ConfigProperties.getProperty(this.getClass(), "of.listenPort");
-        if (portString != null) {
-            try {
-                openFlowPort = Short.parseShort(portString);
-            } catch (NumberFormatException e) {
-                LOG.warn("Invalid port:{}, use default({})", portString,
-                        openFlowPort);
-            }
-        }
-        return openFlowPort;
-    }
-
-    private UUID getCurrentControllerUuid(Node node, final String controllerTableName, final String target) {
-        ConcurrentMap<String, Row> rows = this.getRows(node, controllerTableName);
-
-        if (rows != null) {
-            for (Map.Entry<String, Row> entry : rows.entrySet()) {
-                Controller currController = this.getTypedRow(node, Controller.class, entry.getValue());
-                Column<GenericTableSchema, String> column = currController.getTargetColumn();
-                String currTarget = column.getData();
-                if (currTarget != null && currTarget.equalsIgnoreCase(target)) {
-                    return currController.getUuid();
-                }
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public Boolean setOFController(Node node, String bridgeUUID) throws InterruptedException, ExecutionException {
-        Connection connection = this.getConnection(node);
-        if (connection == null) {
-            return false;
-        }
-
-        Bridge bridge = connection.getClient().createTypedRowWrapper(Bridge.class);
-
-        Status updateOperationStatus = null;
-        try {
-            OvsdbSet<String> protocols = new OvsdbSet<String>();
-
-            String ofVersion = System.getProperty("ovsdb.of.version", OPENFLOW_13);
-            switch (ofVersion) {
-                case OPENFLOW_13:
-                    //fall through
-                default:
-                    protocols.add("OpenFlow13");
-                    break;
-            }
-            bridge.setProtocols(protocols);
-            updateOperationStatus = this.updateRow(node, bridge.getSchema().getName(),
-                                                   null, bridgeUUID, bridge.getRow());
-            LOG.debug("Bridge {} updated to {} with Status {}", bridgeUUID,
-                    protocols.toArray()[0], updateOperationStatus);
-
-        } catch (SchemaVersionMismatchException e){
-            LOG.debug(e.toString());
-        }
-
-        // If we fail to update the protocols
-        if (updateOperationStatus != null && !updateOperationStatus.isSuccess()) {
-            return updateOperationStatus.isSuccess();
-        }
-
-        Status status;
-        UUID currControllerUuid;
-        InetAddress ofControllerAddr = this.getControllerIPAddress(connection);
-        short ofControllerPort = getControllerOFPort();
-        String newControllerTarget = "tcp:"+ofControllerAddr.getHostAddress()+":"+ofControllerPort;
-        Controller newController = connection.getClient().createTypedRowWrapper(Controller.class);
-        newController.setTarget(newControllerTarget);
-        final String controllerTableName = newController.getSchema().getName();
-
-        currControllerUuid = getCurrentControllerUuid(node, controllerTableName, newControllerTarget);
-
-        if (currControllerUuid != null) {
-            bridge = connection.getClient().createTypedRowWrapper(Bridge.class);
-            bridge.setController(Sets.newHashSet(currControllerUuid));
-            status = this.updateRow(node, bridge.getSchema().getName(), null, bridgeUUID, bridge.getRow());
-        } else {
-            status = this.insertRow(node, controllerTableName, bridgeUUID, newController.getRow());
-        }
-
-        return status != null && status.isSuccess();
-
-    }
-
-
-    public Boolean setBridgeOFController(Node node, String bridgeIdentifier) {
-        if (connectionService == null) {
-            LOG.error("Couldn't refer to the ConnectionService");
-            return false;
-        }
-
-        try{
-            Connection connection = connectionService.getConnection(node);
-            Bridge bridge = connection.getClient().getTypedRowWrapper(Bridge.class, null);
-
-            Map<String, Row> brTableCache = ovsdbInventoryService.getTableCache(node, OvsVswitchdSchemaConstants.DATABASE_NAME, bridge.getSchema().getName());
-            for (String uuid : brTableCache.keySet()) {
-                bridge = connection.getClient().getTypedRowWrapper(Bridge.class, brTableCache.get(uuid));
-                if (bridge.getName().contains(bridgeIdentifier)) {
-                    return setOFController(node, uuid);
-                }
-            }
-        } catch(Exception e) {
-            LOG.error("Error in setBridgeOFController()", e);
-        }
-        return false;
-    }
-
-    @Override
-    public <T extends TypedBaseTable<?>> String getTableName(Node node, Class<T> typedClass) {
-        Connection connection = connectionService.getConnection(node);
-        if (connection == null) {
-            return null;
-        }
-        OvsdbClient client = connection.getClient();
-        TypedBaseTable<?> typedTable = client.getTypedRowWrapper(typedClass, null);
-        if (typedTable == null) {
-            return null;
-        }
-        return typedTable.getSchema().getName();
-    }
-
-    @Override
-    public <T extends TypedBaseTable<?>> T getTypedRow(Node node, Class<T> typedClass, Row row) {
-        Connection connection = connectionService.getConnection(node);
-        if (connection == null) {
-            return null;
-        }
-        OvsdbClient client = connection.getClient();
-        return (T)client.getTypedRowWrapper(typedClass, row);
-    }
-
-    @Override
-    public <T extends TypedBaseTable<?>> T createTypedRow(Node node, Class<T> typedClass) {
-        Connection connection = connectionService.getConnection(node);
-        if (connection == null) {
-            return null;
-        }
-        OvsdbClient client = connection.getClient();
-        return client.createTypedRowWrapper(typedClass);
-    }
-
-    // SCHEMA-INDEPENDENT Configuration Service APIs
-
-    private String getTableNameForRowUuid(Node node, String databaseName, UUID rowUuid) {
-        ConcurrentMap<String, ConcurrentMap<String, Row>> cache  = ovsdbInventoryService.getCache(node, databaseName);
-        if (cache == null) {
-            return null;
-        }
-        for (String tableName : cache.keySet()) {
-            ConcurrentMap<String, Row> rows = cache.get(tableName);
-            if (rows.get(rowUuid.toString()) != null) {
-                return tableName;
-            }
-        }
-        return null;
-    }
-
-    private String getReferencingColumn (TableSchema<?> parentTableSchema, String childTableName) throws OvsdbPluginException {
-        Map<String, ColumnSchema> columnSchemas = parentTableSchema.getColumnSchemas();
-        String refColumn = null;
-        for (String columnName : columnSchemas.keySet()) {
-            ColumnSchema columnSchema = columnSchemas.get(columnName);
-            if (columnSchema.getType().getBaseType().getClass().equals(UuidBaseType.class)) {
-                UuidBaseType refType = (UuidBaseType)columnSchema.getType().getBaseType();
-                if (refType.getRefTable() != null && refType.getRefTable().equalsIgnoreCase(childTableName)) {
-                    if (refColumn == null) {
-                        refColumn = columnName;
-                    } else {
-                        throw new OvsdbPluginException("Multiple Referencing Columns for "+ childTableName +" on "+ parentTableSchema.getName());
-                    }
-                }
-            }
-        }
-        if (refColumn != null) {
-            return refColumn;
-        }
-        throw new OvsdbPluginException("No Referencing Column for "+childTableName+" on "+parentTableSchema.getName());
-    }
-    /*
-     * A common Insert Transaction convenience method that populates the TransactionBuilder with insert operation
-     * for a Child Row and also mutates the parent row with the UUID of the inserted Child.
-     */
-    private void processInsertTransaction(OvsdbClient client, String databaseName, String childTable,
-                                    String parentTable, UUID parentUuid, String parentColumn, String namedUuid,
-                                    Row<GenericTableSchema> row,
-                                    TransactionBuilder transactionBuilder) {
-        // Insert the row as the first transaction entry
-        DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-        TableSchema<GenericTableSchema> childTableSchema = dbSchema.table(childTable, GenericTableSchema.class);
-        transactionBuilder.add(op.insert(childTableSchema, row)
-                        .withId(namedUuid));
-
-        // Followed by the Mutation
-        if (parentColumn != null) {
-            TableSchema<GenericTableSchema> parentTableSchema = dbSchema.table(parentTable, GenericTableSchema.class);
-            ColumnSchema<GenericTableSchema, UUID> parentColumnSchema = parentTableSchema.column(parentColumn, UUID.class);
-            ColumnSchema<GenericTableSchema, UUID> _uuid = parentTableSchema.column("_uuid", UUID.class);
-
-            transactionBuilder
-                .add(op.mutate(parentTableSchema)
-                        .addMutation(parentColumnSchema, Mutator.INSERT, new UUID(namedUuid))
-                        .where(_uuid.opEqual(parentUuid))
-                        .build());
-        }
-    }
-
-    /**
-     * insert a Row in a Table of a specified Database Schema.
-     *
-     * This method can insert just a single Row specified in the row parameter.
-     * But {@link #insertTree(Node, String, String, UUID, Row) insertTree}
-     * can insert a hierarchy of rows with parent-child relationship.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentTable Name of the Parent Table to which this operation will result in attaching/mutating.
-     * @param parentUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated with the UUID that results from the insert operation.
-     * @param row Row of table Content to be inserted
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return UUID of the inserted Row
-     */
-    @Override
-    public UUID insertRow(Node node, String databaseName, String tableName, String parentTable, UUID parentUuid,
-                          String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException {
-        Connection connection = connectionService.getConnection(node);
-        OvsdbClient client = connection.getClient();
-        DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-        TableSchema<GenericTableSchema> tableSchema = dbSchema.table(tableName, GenericTableSchema.class);
-
-        Row<GenericTableSchema> processedRow = this.insertTree(node, databaseName, tableName, parentTable, parentUuid, parentColumn, row);
-
-        ColumnSchema<GenericTableSchema, UUID> _uuid = tableSchema.column("_uuid", UUID.class);
-        Column<GenericTableSchema, UUID> uuid = processedRow.getColumn(_uuid);
-        return uuid.getData();
-    }
-
-    /**
-     * insert a Row in a Table of a specified Database Schema. This is a convenience method on top of
-     * {@link insertRow(Node, String, String, String, UUID, String, Row) insertRow}
-     * which assumes that OVSDB schema implementation that corresponds to the databaseName will provide
-     * the necessary service to populate the Parent Table Name and Parent Column Name.
-     *
-     * This method can insert just a single Row specified in the row parameter.
-     * But {@link #insertTree(Node, String, String, UUID, Row) insertTree}
-     * can insert a hierarchy of rows with parent-child relationship.
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentRowUuid UUID of the parent table to which this operation will result in attaching/mutating.
-     * @param row Row of table Content to be inserted
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return UUID of the inserted Row
-     */
-    @Override
-    public UUID insertRow(Node node, String databaseName, String tableName,
-            UUID parentRowUuid, Row<GenericTableSchema> row)
-            throws OvsdbPluginException {
-        return this.insertRow(node, databaseName, tableName, null, parentRowUuid, null, row);
-    }
-
-    /**
-     * inserts a Tree of Rows in multiple Tables that has parent-child relationships referenced through the OVSDB schema's refTable construct
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentTable Name of the Parent Table to which this operation will result in attaching/mutating.
-     * @param parentUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param parentColumn Name of the Column in the Parent Table to be mutated with the UUID that results from the insert operation.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return Returns the row tree with the UUID of every inserted Row populated in the _uuid column of every row in the tree
-     */
-    @Override
-    public Row<GenericTableSchema> insertTree(Node node, String databaseName, String tableName, String parentTable, UUID parentUuid,
-                                              String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException {
-        Connection connection = connectionService.getConnection(node);
-        OvsdbClient client = connection.getClient();
-
-        if (databaseName == null || tableName == null) {
-            throw new OvsdbPluginException("databaseName, tableName and parentUuid are Mandatory Parameters");
-        }
-
-        if (parentTable == null && parentUuid != null) {
-            parentTable = this.getTableNameForRowUuid(node, databaseName, parentUuid);
-        }
-
-        if (parentColumn == null && parentTable != null) {
-            DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-            TableSchema<GenericTableSchema> parentTableSchema = dbSchema.table(parentTable, GenericTableSchema.class);
-            parentColumn = this.getReferencingColumn(parentTableSchema, tableName);
-        }
-
-        LOG.debug("insertTree Connection : {} Table : {} ParentTable : {} Parent Column: {} Parent UUID : {} Row : {}",
-                client.getConnectionInfo(), tableName, parentTable, parentColumn, parentUuid, row);
-
-        Map<UUID, Map.Entry<String, Row<GenericTableSchema>>> referencedRows = Maps.newConcurrentMap();
-        extractReferencedRows(node, databaseName, row, referencedRows, 0);
-        DatabaseSchema dbSchema = client.getDatabaseSchema(OvsVswitchdSchemaConstants.DATABASE_NAME);
-        TransactionBuilder transactionBuilder = client.transactBuilder(dbSchema);
-
-        String namedUuid = "Transaction_"+ tableName;
-        this.processInsertTransaction(client, databaseName, tableName, parentTable, parentUuid,
-                                      parentColumn, namedUuid, row, transactionBuilder);
-
-        int referencedRowsInsertIndex = transactionBuilder.getOperations().size();
-        // Insert Referenced Rows
-        if (referencedRows != null) {
-            for (UUID refUuid : referencedRows.keySet()) {
-                Map.Entry<String, Row<GenericTableSchema>> referencedRow = referencedRows.get(refUuid);
-                TableSchema<GenericTableSchema> refTableSchema = dbSchema.table(referencedRow.getKey(), GenericTableSchema.class);
-                transactionBuilder.add(op.insert(refTableSchema, referencedRow.getValue())
-                                .withId(refUuid.toString()));
-            }
-        }
-
-        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
-        List<OperationResult> operationResults;
-        try {
-            operationResults = results.get();
-            if (operationResults.isEmpty() || (transactionBuilder.getOperations().size() != operationResults.size())) {
-                throw new OvsdbPluginException("Insert Operation Failed");
-            }
-            for (OperationResult result : operationResults) {
-                if (result.getError() != null) {
-                    throw new OvsdbPluginException("Insert Operation Failed with Error : " + result.getError());
-                }
-            }
-            return getNormalizedRow(dbSchema, tableName, row, referencedRows, operationResults, referencedRowsInsertIndex);
-        } catch (InterruptedException | ExecutionException e) {
-            throw new OvsdbPluginException("Exception : "+e.getLocalizedMessage());
-        }
-    }
-
-    /**
-     * inserts a Tree of Rows in multiple Tables that has parent-child relationships referenced through the OVSDB schema's refTable construct.
-     * This is a convenience method on top of {@link #insertTree(Node, String, String, String, UUID, String, Row) insertTree}
-     *
-     * @param node OVSDB Node
-     * @param databaseName Database Name that represents the Schema supported by the node.
-     * @param tableName Table on which the row is inserted
-     * @param parentRowUuid UUID of a Row in parent table to which this operation will result in attaching/mutating.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @throws OvsdbPluginException Any failure during the insert transaction will result in a specific exception.
-     * @return Returns the row tree with the UUID of every inserted Row populated in the _uuid column of every row in the tree
-     */
-    @Override
-    public Row<GenericTableSchema> insertTree(Node node, String databaseName,
-            String tableName, UUID parentRowUuid, Row<GenericTableSchema> row)
-            throws OvsdbPluginException {
-        return this.insertTree(node, databaseName, tableName, null, parentRowUuid, null, row);
-    }
-
-    /**
-     * Convenience method that helps insertTree to extract Rows that are referenced directly from within a primary row
-     * to be inserted. These referenced rows are *NOT* defined in the OVSDB specification. But, we felt that from a northbound
-     * application standpoint, having such an option is useful and our implementation supports it for applications to make use of.
-     * In short, whichever ColumnSchema is based on an UUID (refered by RefTable in schema), applications can directly insert an
-     * entire row and this method will help navigate it through and identify such cases.
-     * After identifying these Referenced Rows, it will modify the primary row with Named UUIDs and fill out the referencedRows
-     * Map structure so that insertTree can insert all the Rows defined in this Tree of rows in a single transaction with automatic
-     * Mutation on the parent rows.
-     *
-     * @param node OVSDB Node
-     * @param dbName Database Name that represents the Schema supported by the node.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @param referencedRows Map of Named-UUID to the actual referenced row (with RefTable)
-     * @param namedUuidSuffix Named UUID must be unique for every new Row insert within a given transaction.
-     *        This index will help to retain the uniqueness.
-     */
-    private void extractReferencedRows(Node node, String dbName, Row<GenericTableSchema> row,
-                                       Map<UUID, Map.Entry<String, Row<GenericTableSchema>>> referencedRows,
-                                       int namedUuidSuffix) {
-        OvsdbClient client = connectionService.getConnection(node).getClient();
-        Collection<Column<GenericTableSchema, ?>> columns = row.getColumns();
-        for (Column column : columns) {
-            if (column.getData() != null) {
-                if (column.getData() instanceof ReferencedRow) {
-                    ReferencedRow refRowObject = (ReferencedRow)column.getData();
-                    UUID refUuid = new UUID("NamedUuid"+namedUuidSuffix++);
-                    column.setData(refUuid);
-                    try {
-                        DatabaseSchema dbSchema = client.getSchema(dbName).get();
-                        GenericTableSchema schema = dbSchema.table(refRowObject.getRefTable(), GenericTableSchema.class);
-                        Row<GenericTableSchema> refRow = schema.createRow((ObjectNode)refRowObject.getJsonNode());
-                        referencedRows.put(refUuid, new AbstractMap.SimpleEntry<>(refRowObject.getRefTable(), refRow));
-                        extractReferencedRows(node, dbName, refRow, referencedRows, namedUuidSuffix);
-                    } catch (InterruptedException | ExecutionException e) {
-                        LOG.error("Exception while extracting multi-level Row references " + e.getLocalizedMessage());
-                    }
-                } else if (column.getData() instanceof OvsdbSet) {
-                    OvsdbSet<Object> setObject = (OvsdbSet<Object>)column.getData();
-                    OvsdbSet<Object> modifiedSet = new OvsdbSet<>();
-                    for (Object obj : setObject) {
-                        if (obj instanceof ReferencedRow) {
-                            ReferencedRow refRowObject = (ReferencedRow)obj;
-                            UUID refUuid = new UUID("NamedUuid"+namedUuidSuffix++);
-                            modifiedSet.add(refUuid);
-                            try {
-                                DatabaseSchema dbSchema = client.getSchema(dbName).get();
-                                GenericTableSchema schema = dbSchema.table(refRowObject.getRefTable(), GenericTableSchema.class);
-                                Row<GenericTableSchema> refRow = schema.createRow((ObjectNode)refRowObject.getJsonNode());
-                                referencedRows.put(refUuid, new AbstractMap.SimpleEntry<>(refRowObject.getRefTable(), refRow));
-                                extractReferencedRows(node, dbName, refRow, referencedRows, namedUuidSuffix);
-                            } catch (InterruptedException | ExecutionException e) {
-                                LOG.error("Exception while extracting multi-level Row references " + e.getLocalizedMessage());
-                            }
-                        } else {
-                            modifiedSet.add(obj);
-                        }
-                    }
-                    column.setData(modifiedSet);
-                }
-            }
-        }
-    }
-
-    /**
-     * getNormalizedRow normalizes the Row from a namedUuid Space as defined in extractReferencedRows to the actual Uuid as created
-     * by the Ovsdb-server. In order to perform this normalization, it processes the operation results for a corresponding Transaction
-     * where the referenced rows are inserted along with the Primary row. It changes the named-Uuid to the actual Uuid before returning
-     * the Row to the application.
-     *
-     * @param dbSchema Database Schema supported by the node.
-     * @param row Row Tree with parent-child relationships via column of type refTable.
-     * @param tableName Table on which the row is inserted
-     * @param referencedRows Map of Named-UUID to the actual referenced row (with RefTable)
-     * @param operationResults Operation Results returned by ovsdb-server for the insertTree transaction
-     * @param referencedRowsInsertIndex Starting index in OperationResults from which the ReferencedRow insert results begin.
-     * @return
-     */
-    private Row<GenericTableSchema> getNormalizedRow(DatabaseSchema dbSchema, String tableName, Row<GenericTableSchema> row,
-                                                     Map<UUID, Map.Entry<String, Row<GenericTableSchema>>> referencedRows,
-                                                     List<OperationResult> operationResults, int referencedRowsInsertIndex) {
-        UUID primaryRowUuid = operationResults.get(0).getUuid();
-        TableSchema<GenericTableSchema> primaryRowTableSchema = dbSchema.table(tableName, GenericTableSchema.class);
-        ColumnSchema<GenericTableSchema, UUID> uuid = primaryRowTableSchema.column("_uuid", UUID.class);
-        if (uuid != null) {
-            Column<GenericTableSchema, UUID> uuidColumn = new Column<>(uuid, primaryRowUuid);
-            row.addColumn("_uuid", uuidColumn);
-        }
-
-        if (referencedRows != null) {
-            Collection<Column<GenericTableSchema, ?>> columns = row.getColumns();
-            Object[] rowKeys = referencedRows.keySet().toArray();
-            for (int idx = 0; idx < rowKeys.length; idx++) {
-                UUID refUuid = (UUID) rowKeys[idx];
-                for (Column column : columns) {
-                    if (column.getData() != null) {
-                        if ((column.getData() instanceof UUID) && column.getData().equals(refUuid)) {
-                            column.setData(operationResults.get(referencedRowsInsertIndex + idx).getUuid());
-                        } else if ((column.getData() instanceof OvsdbSet) && ((OvsdbSet)column.getData()).contains(refUuid)) {
-                            OvsdbSet<UUID> refSet = (OvsdbSet<UUID>)column.getData();
-                            refSet.remove(refUuid);
-                            refSet.add(operationResults.get(referencedRowsInsertIndex + idx).getUuid());
-                        }
-                    }
-                }
-            }
-        }
-        return row;
-    }
-
-    @Override
-    public Row<GenericTableSchema> updateRow(Node node, String databaseName,
-            String tableName, UUID rowUuid, Row<GenericTableSchema> row,
-            boolean overwrite) {
-        Connection connection = connectionService.getConnection(node);
-        OvsdbClient client = connection.getClient();
-
-        LOG.debug("updateRow : Connection : {} databaseName : {} tableName : {} rowUUID : {} row : {}",
-                client.getConnectionInfo(), databaseName, tableName, rowUuid, row.toString());
-        try{
-            DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-            TransactionBuilder transactionBuilder = client.transactBuilder(dbSchema);
-            TableSchema<GenericTableSchema> tableSchema = dbSchema.table(tableName, GenericTableSchema.class);
-            ColumnSchema<GenericTableSchema, UUID> uuid = tableSchema.column("_uuid", UUID.class);
-            transactionBuilder.add(op.update(tableSchema, row)
-                    .where(uuid.opEqual(rowUuid))
-                    .build());
-
-            ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
-            List<OperationResult> operationResults = results.get();
-            for (OperationResult result : operationResults) {
-                if (result.getError() != null) {
-                    throw new OvsdbPluginException("Error updating row : " + result.getError() +
-                                                   " Details: " + result.getDetails());
-                }
-            }
-            if (operationResults.isEmpty() || (transactionBuilder.getOperations().size() != operationResults.size())) {
-                throw new OvsdbPluginException("Failed to update row. Please check OVS logs for more info.");
-            }
-
-            return this.getRow(node, databaseName, tableName, rowUuid);
-        } catch(Exception e){
-            throw new OvsdbPluginException("Error updating row due to an exception "+ e.getMessage());
-        }
-    }
-
-    @Override
-    public void deleteRow(Node node, String databaseName, String tableName, String parentTable, UUID parentRowUuid,
-            String parentColumn, UUID rowUuid) {
-        Connection connection = connectionService.getConnection(node);
-        OvsdbClient client = connection.getClient();
-
-        if (parentTable == null && parentRowUuid != null) {
-            parentTable = this.getTableNameForRowUuid(node, databaseName, parentRowUuid);
-        }
-
-        String myParentColumn = parentColumn;
-        if (myParentColumn == null && parentTable != null) {
-            DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-            TableSchema<GenericTableSchema> parentTableSchema = dbSchema.table(parentTable, GenericTableSchema.class);
-            myParentColumn = this.getReferencingColumn(parentTableSchema, tableName);
-        }
-
-        LOG.debug("deleteRow : Connection : {} databaseName : {} tableName : {} Uuid : {} ParentTable : {} ParentColumn : {}",
-                client.getConnectionInfo(), databaseName, tableName, rowUuid, parentTable, myParentColumn);
-
-        DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
-        TransactionBuilder transactionBuilder = client.transactBuilder(dbSchema);
-        this.processDeleteTransaction(client, databaseName, tableName,
-                                      parentTable, myParentColumn, rowUuid.toString(), transactionBuilder);
-
-        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
-        List<OperationResult> operationResults;
-        try {
-            operationResults = results.get();
-            if (operationResults.isEmpty() || (transactionBuilder.getOperations().size() != operationResults.size())) {
-                throw new OvsdbPluginException("Delete Operation Failed");
-            }
-            for (OperationResult result : operationResults) {
-                if (result.getError() != null) {
-                    throw new OvsdbPluginException("Delete Operation Failed with Error : " + result.getError());
-                }
-            }
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Error in deleteRow() {} {} {} {}", node, databaseName, tableName, parentTable, e);
-        }
-    }
-
-    @Override
-    public void deleteRow(Node node, String databaseName, String tableName, UUID rowUuid) {
-        this.deleteRow(node, databaseName, tableName, null, null, null, rowUuid);
-    }
-
-    @Override
-    public Row<GenericTableSchema> getRow(Node node, String databaseName,
-            String tableName, UUID uuid) {
-        ConcurrentMap<UUID, Row<GenericTableSchema>> rows = this.getRows(node, databaseName, tableName);
-        if (rows != null) {
-            return rows.get(uuid);
-        }
-        return null;
-    }
-
-    @Override
-    public ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node,
-            String databaseName, String tableName) throws OvsdbPluginException {
-        ConcurrentMap<String, Row> ovsTable = ovsdbInventoryService.getTableCache(node, databaseName, tableName);
-        if (ovsTable == null) {
-            return null;
-        }
-        ConcurrentMap<UUID, Row<GenericTableSchema>> tableDB = Maps.newConcurrentMap();
-        for (String uuidStr : ovsTable.keySet()) {
-            tableDB.put(new UUID(uuidStr), ovsTable.get(uuidStr));
-        }
-        return tableDB;
-    }
-
-    @Override
-    public ConcurrentMap<UUID, Row<GenericTableSchema>> getRows(Node node,
-            String databaseName, String tableName, String fiqlQuery) {
-        return this.getRows(node, databaseName, tableName);
-    }
-
-    @Override
-    public List<String> getTables(Node node, String databaseName) {
-        ConcurrentMap<String, ConcurrentMap<String, Row>> cache  = ovsdbInventoryService.getCache(node, databaseName);
-        if (cache == null) {
-            return null;
-        } else {
-            return new ArrayList<>(cache.keySet());
-        }
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConnectionServiceImpl.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConnectionServiceImpl.java
deleted file mode 100644 (file)
index 41a3655..0000000
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.impl;
-
-import io.netty.channel.ChannelHandler;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collection;
-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.ExecutionException;
-
-import org.opendaylight.ovsdb.lib.MonitorCallBack;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.OvsdbConnection;
-import org.opendaylight.ovsdb.lib.OvsdbConnectionInfo;
-import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
-import org.opendaylight.ovsdb.lib.message.MonitorRequest;
-import org.opendaylight.ovsdb.lib.message.MonitorRequestBuilder;
-import org.opendaylight.ovsdb.lib.message.MonitorSelect;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.TableSchema;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.ConnectionConstants;
-import org.opendaylight.ovsdb.plugin.api.Status;
-import org.opendaylight.ovsdb.plugin.api.StatusCode;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.utils.config.ConfigProperties;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.Lists;
-
-
-/**
- * Represents the openflow plugin component in charge of programming the flows
- * the flow programming and relay them to functional modules above SAL.
- */
-public class ConnectionServiceImpl implements OvsdbConnectionService,
-                                              OvsdbConnectionListener {
-    private static final Logger LOG = LoggerFactory.getLogger(ConnectionServiceImpl.class);
-
-    // Properties that can be set in config.ini
-    private static final Integer DEFAULT_OVSDB_PORT = 6640;
-    private static final String OVSDB_LISTENPORT = "ovsdb.listenPort";
-
-
-    public void putOvsdbConnection (String identifier, Connection connection) {
-        ovsdbConnections.put(identifier, connection);
-    }
-
-    private ConcurrentMap<String, Connection> ovsdbConnections = new ConcurrentHashMap<String, Connection>();
-    private List<ChannelHandler> handlers = null;
-
-    private volatile OvsdbInventoryService ovsdbInventoryService;
-    private volatile OvsdbConnection connectionLib;
-
-    public void setOvsdbInventoryService(OvsdbInventoryService inventoryService) {
-        this.ovsdbInventoryService = inventoryService;
-    }
-
-    public void setOvsdbConnection(OvsdbConnection ovsdbConnection) {
-        this.connectionLib = ovsdbConnection;
-    }
-
-    public void init() {
-    }
-
-    /**
-     * Function called by the dependency manager when at least one dependency
-     * become unsatisfied or when the component is shutting down because for
-     * example bundle is being stopped.
-     */
-    void destroy() {
-    }
-
-    /**
-     * Function called by dependency manager after "init ()" is called and after
-     * the services provided by the class are registered in the service registry
-     */
-    void start() {
-        /* Start ovsdb server before getting connection clients */
-        String portString = ConfigProperties.getProperty(OvsdbConnectionService.class, OVSDB_LISTENPORT);
-        int ovsdbListenPort = DEFAULT_OVSDB_PORT;
-        if (portString != null) {
-            ovsdbListenPort = Integer.parseInt(portString);
-        }
-
-        if (!connectionLib.startOvsdbManager(ovsdbListenPort)) {
-            LOG.warn("Start OVSDB manager call from ConnectionService was not necessary");
-        }
-
-        /* Then get connection clients */
-        Collection<OvsdbClient> connections = connectionLib.getConnections();
-        for (OvsdbClient client : connections) {
-            LOG.info("CONNECT start connected clients client = {}", client);
-            this.connected(client);
-        }
-    }
-
-    /**
-     * Function called by the dependency manager before the services exported by
-     * the component are unregistered, this will be followed by a "destroy ()"
-     * calls
-     */
-    void stopping() {
-        for (Connection connection : ovsdbConnections.values()) {
-            connection.disconnect();
-        }
-    }
-
-    public Status disconnect(Node node) {
-        Connection connection = getConnection(node);
-        if (connection != null) {
-            ovsdbConnections.remove(normalizeId(node.getId().getValue()));
-            connection.disconnect();
-            ovsdbInventoryService.removeNode(node);
-            return new Status(StatusCode.SUCCESS);
-        } else {
-            return new Status(StatusCode.NOTFOUND);
-        }
-    }
-
-    public Node connect(String identifier, Map<ConnectionConstants, String> params) {
-        InetAddress address;
-        Integer port;
-
-        try {
-            address = InetAddress.getByName(params.get(ConnectionConstants.ADDRESS));
-        } catch (Exception e) {
-            LOG.error("Unable to resolve {}", params.get(ConnectionConstants.ADDRESS), e);
-            return null;
-        }
-
-        try {
-            port = Integer.parseInt(params.get(ConnectionConstants.PORT));
-            if (port == 0) {
-                port = DEFAULT_OVSDB_PORT;
-            }
-        } catch (Exception e) {
-            port = DEFAULT_OVSDB_PORT;
-        }
-
-        try {
-            OvsdbClient client = connectionLib.connect(address, port);
-            return handleNewConnection(identifier, client);
-        } catch (InterruptedException e) {
-            LOG.error("Thread was interrupted during connect", e);
-        } catch (ExecutionException e) {
-            LOG.error("ExecutionException in handleNewConnection for identifier " + identifier, e);
-        }
-        return null;
-    }
-
-    public List<ChannelHandler> getHandlers() {
-        return handlers;
-    }
-
-    public void setHandlers(List<ChannelHandler> handlers) {
-        this.handlers = handlers;
-    }
-
-    private String normalizeId (String identifier) {
-        String id = identifier;
-
-        String[] pair = identifier.split("\\|");
-        if (pair[0].equals("OVS")) {
-            id = pair[1];
-        }
-
-        return id;
-    }
-
-    @Override
-    public Connection getConnection(Node node) {
-        return ovsdbConnections.get(normalizeId(node.getId().getValue()));
-    }
-
-    @Override
-    public Node getNode (String identifier) {
-        Connection connection = ovsdbConnections.get(normalizeId(identifier));
-        if (connection != null) {
-            return connection.getNode();
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public List<Node> getNodes() {
-        List<Node> nodes = new ArrayList<>();
-        for (Connection connection : ovsdbConnections.values()) {
-            nodes.add(connection.getNode());
-        }
-        return nodes;
-    }
-
-    private Node handleNewConnection(String identifier, OvsdbClient client) throws InterruptedException, ExecutionException {
-        Connection connection = new Connection(identifier, client);
-        Node node = connection.getNode();
-        ovsdbConnections.put(identifier, connection);
-        List<String> dbs = client.getDatabases().get();
-        for (String db : dbs) {
-            client.getSchema(db).get();
-        }
-        // Keeping the Initial inventory update(s) on its own thread.
-        new Thread() {
-            Connection connection;
-            String identifier;
-
-            @Override
-            public void run() {
-                try {
-                    LOG.info("Initialize inventory for {}", connection.toString());
-                    initializeInventoryForNewNode(connection);
-                } catch (InterruptedException | ExecutionException | IOException e) {
-                    LOG.error("Failed to initialize inventory for node with identifier {}", identifier, e);
-                    ovsdbConnections.remove(identifier);
-                }
-            }
-            public Thread initializeConnectionParams(String identifier, Connection connection) {
-                this.identifier = identifier;
-                this.connection = connection;
-                return this;
-            }
-        }.initializeConnectionParams(identifier, connection).start();
-        return node;
-    }
-
-    public void channelClosed(Node node) throws Exception {
-        LOG.info("Connection to Node : {} closed", node);
-        disconnect(node);
-        ovsdbInventoryService.removeNode(node);
-    }
-
-    private void initializeInventoryForNewNode (Connection connection) throws InterruptedException, ExecutionException, IOException {
-        OvsdbClient client = connection.getClient();
-        InetAddress address = client.getConnectionInfo().getRemoteAddress();
-        int port = client.getConnectionInfo().getRemotePort();
-
-        List<String> databases = client.getDatabases().get();
-        if (databases == null) {
-            LOG.error("Unable to get Databases for the ovsdb connection : {}", client.getConnectionInfo());
-            return;
-        }
-        for (String database : databases) {
-            DatabaseSchema dbSchema = client.getSchema(database).get();
-            TableUpdates updates = this.monitorTables(connection.getNode(), dbSchema);
-            ovsdbInventoryService.processTableUpdates(connection.getNode(), dbSchema.getName(), updates);
-        }
-        LOG.info("Notifying Inventory Listeners for Node Added: {}", connection.getNode().toString());
-        ovsdbInventoryService.notifyNodeAdded(connection.getNode(), address, port);
-    }
-
-    public TableUpdates monitorTables(Node node, DatabaseSchema dbSchema) throws ExecutionException, InterruptedException, IOException {
-        Connection connection = getConnection(node);
-        OvsdbClient client = connection.getClient();
-        if (dbSchema == null) {
-            LOG.error("Unable to get Database Schema for the ovsdb connection : {}", client.getConnectionInfo());
-            return null;
-        }
-        Set<String> tables = dbSchema.getTables();
-        if (tables == null) {
-            LOG.warn("Database {} without any tables. Strange !", dbSchema.getName());
-            return null;
-        }
-        List<MonitorRequest<GenericTableSchema>> monitorRequests = Lists.newArrayList();
-        for (String tableName : tables) {
-            GenericTableSchema tableSchema = dbSchema.table(tableName, GenericTableSchema.class);
-            monitorRequests.add(this.getAllColumnsMonitorRequest(tableSchema));
-        }
-        return client.monitor(dbSchema, monitorRequests, new UpdateMonitor(node));
-    }
-
-    /**
-     * As per RFC 7047, section 4.1.5, if a Monitor request is sent without any columns, the update response will not include
-     * the _uuid column.
-     * ----------------------------------------------------------------------------------------------------------------------------------
-     * Each &lt;monitor-request&gt; specifies one or more columns and the manner in which the columns (or the entire table) are to be monitored.
-     * The "columns" member specifies the columns whose values are monitored. It MUST NOT contain duplicates.
-     * If "columns" is omitted, all columns in the table, except for "_uuid", are monitored.
-     * ----------------------------------------------------------------------------------------------------------------------------------
-     * In order to overcome this limitation, this method
-     *
-     * @return MonitorRequest that includes all the Bridge Columns including _uuid
-     */
-    public <T extends TableSchema<T>> MonitorRequest<T> getAllColumnsMonitorRequest (T tableSchema) {
-        Set<String> columns = tableSchema.getColumns();
-        MonitorRequestBuilder<T> monitorBuilder = MonitorRequestBuilder.builder(tableSchema);
-        for (String column : columns) {
-            monitorBuilder.addColumn(column);
-        }
-        return monitorBuilder.with(new MonitorSelect(true, true, true, true)).build();
-    }
-
-    private class UpdateMonitor implements MonitorCallBack {
-        Node node = null;
-        public UpdateMonitor(Node node) {
-            this.node = node;
-        }
-
-        @Override
-        public void update(TableUpdates result, DatabaseSchema dbSchema) {
-            ovsdbInventoryService.processTableUpdates(node, dbSchema.getName(), result);
-        }
-
-        @Override
-        public void exception(Throwable t) {
-            System.out.println("Exception t = " + t);
-        }
-    }
-
-    private String getConnectionIdentifier(OvsdbClient client) {
-        OvsdbConnectionInfo info = client.getConnectionInfo();
-        return info.getRemoteAddress().getHostAddress()+":"+info.getRemotePort();
-    }
-
-
-    @Override
-    public void connected(OvsdbClient client) {
-        String identifier = getConnectionIdentifier(client);
-        try {
-            this.handleNewConnection(identifier, client);
-        } catch (InterruptedException | ExecutionException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Override
-    public void disconnected(OvsdbClient client) {
-        Connection connection = ovsdbConnections.get(this.getConnectionIdentifier(client));
-        if (connection == null) {
-            return;
-        }
-        this.disconnect(connection.getNode());
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/InventoryServiceImpl.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/InventoryServiceImpl.java
deleted file mode 100644 (file)
index c6cfb6d..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.impl;
-
-import java.net.InetAddress;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-
-import org.opendaylight.ovsdb.lib.message.TableUpdate;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.plugin.internal.NodeDatabase;
-import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import com.google.common.collect.Sets;
-
-import com.google.common.collect.Maps;
-
-/**
- * Stub Implementation for IPluginInReadService used by SAL
- *
- *
- */
-public class InventoryServiceImpl implements OvsdbInventoryService {
-    private ConcurrentMap<Node, NodeDatabase> dbCache = Maps.newConcurrentMap();
-    private ScheduledExecutorService executor;
-    private OvsdbConfigurationService ovsdbConfigurationService;
-
-    private Set<OvsdbInventoryListener> ovsdbInventoryListeners = Sets.newCopyOnWriteArraySet();
-
-    /**
-     * Function called by the dependency manager when all the required
-     * dependencies are satisfied
-     *
-     */
-    public void init() {
-        this.executor = Executors.newSingleThreadScheduledExecutor();
-    }
-
-    /**
-     * Function called by the dependency manager when at least one dependency
-     * become unsatisfied or when the component is shutting down because for
-     * example bundle is being stopped.
-     *
-     */
-    public void destroy() {
-    }
-
-    /**
-     * Function called by dependency manager after "init ()" is called and after
-     * the services provided by the class are registered in the service registry
-     *
-     */
-    public void start() {
-    }
-
-    /**
-     * Function called by the dependency manager before the services exported by
-     * the component are unregistered, this will be followed by a "destroy ()"
-     * calls
-     *
-     */
-    public void stop() {
-        this.executor.shutdownNow();
-    }
-
-    public void setOvsdbConfigurationService(OvsdbConfigurationService service) {
-        ovsdbConfigurationService = service;
-    }
-
-    public void unsetConfigurationService(OvsdbConfigurationService service) {
-        ovsdbConfigurationService = null;
-    }
-
-    @Override
-    public ConcurrentMap<String, ConcurrentMap<String, Row>> getCache(Node n, String databaseName) {
-        NodeDatabase db = dbCache.get(n);
-        if (db == null) {
-            return null;
-        }
-        return db.getDatabase(databaseName);
-    }
-
-
-    @Override
-    public ConcurrentMap<String, Row> getTableCache(Node n, String databaseName, String tableName) {
-        NodeDatabase db = dbCache.get(n);
-        if (db == null) {
-            return null;
-        }
-        return db.getTableCache(databaseName, tableName);
-    }
-
-
-    @Override
-    public Row getRow(Node n, String databaseName, String tableName, String uuid) {
-        NodeDatabase db = dbCache.get(n);
-        if (db == null) {
-            return null;
-        }
-        return db.getRow(databaseName, tableName, uuid);
-    }
-
-    @Override
-    public void updateRow(Node n, String databaseName, String tableName, String uuid, Row row) {
-        NodeDatabase db = dbCache.get(n);
-        if (db == null) {
-            db = new NodeDatabase();
-            dbCache.put(n, db);
-        }
-        db.updateRow(databaseName, tableName, uuid, row);
-    }
-
-    @Override
-    public void removeRow(Node n, String databaseName, String tableName, String uuid) {
-        NodeDatabase db = dbCache.get(n);
-        if (db != null) {
-            db.removeRow(databaseName, tableName, uuid);
-        }
-    }
-
-    @Override
-    public void processTableUpdates(Node n, String databaseName, TableUpdates tableUpdates) {
-        NodeDatabase db = dbCache.get(n);
-        if (db == null) {
-            db = new NodeDatabase();
-            dbCache.put(n, db);
-        }
-
-        for (String tableName : tableUpdates.getUpdates().keySet()) {
-            Map<String, Row> tCache = db.getTableCache(databaseName, tableName);
-            TableUpdate update = tableUpdates.getUpdates().get(tableName);
-            for (UUID uuid : (Set<UUID>)update.getRows().keySet()) {
-
-            if (update.getNew(uuid) != null) {
-                boolean isNewRow = (tCache == null || tCache.get(uuid.toString()) == null);
-                db.updateRow(databaseName, tableName, uuid.toString(), update.getNew(uuid));
-                if (isNewRow) {
-                    this.handleOpenVSwitchSpecialCase(n, databaseName, tableName, uuid);
-                    if (!ovsdbInventoryListeners.isEmpty()) {
-                        for (OvsdbInventoryListener listener : ovsdbInventoryListeners) {
-                            listener.rowAdded(n, tableName, uuid.toString(), update.getNew(uuid));
-                        }
-                    }
-                } else {
-                    if (!ovsdbInventoryListeners.isEmpty()) {
-                        for (OvsdbInventoryListener listener : ovsdbInventoryListeners) {
-                            listener.rowUpdated(n, tableName, uuid.toString(), update.getOld(uuid), update.getNew(uuid));
-                        }
-                    }
-                }
-            } else if (update.getOld(uuid) != null){
-                if (tCache != null) {
-                    if (!ovsdbInventoryListeners.isEmpty()) {
-                        for (OvsdbInventoryListener listener : ovsdbInventoryListeners) {
-                            listener.rowRemoved(n, tableName, uuid.toString(), update.getOld(uuid), update.getNew(uuid));
-                        }
-                    }
-                }
-                db.removeRow(databaseName, tableName, uuid.toString());
-            }
-            }
-        }
-    }
-
-    private void handleOpenVSwitchSpecialCase(final Node node, final String databaseName, final String tableName, final UUID uuid) {
-        if (OvsVswitchdSchemaConstants.shouldConfigureController(databaseName, tableName)) {
-            Runnable updateControllerRunnable = new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        if (ovsdbConfigurationService != null) {
-                            ovsdbConfigurationService.setOFController(node, uuid.toString());
-                        }
-                    } catch (InterruptedException | ExecutionException e) {
-                        e.printStackTrace();
-                    }
-                }
-            };
-            executor.execute(updateControllerRunnable);
-        }
-    }
-
-    @Override
-    public void printCache(Node n) {
-        if ((dbCache != null) && (!dbCache.isEmpty())) {
-            NodeDatabase db = dbCache.get(n);
-            if (db != null) {
-                db.printTableCache();
-            }
-        }
-    }
-
-    @Override
-    public void notifyNodeAdded(Node node, InetAddress address, int port) {
-        if (!ovsdbInventoryListeners.isEmpty()) {
-            for (OvsdbInventoryListener listener : ovsdbInventoryListeners) {
-                listener.nodeAdded(node, address, port);
-            }
-        }
-    }
-
-    @Override
-    public void removeNode(Node node) {
-        if (!ovsdbInventoryListeners.isEmpty()) {
-            for (OvsdbInventoryListener listener : ovsdbInventoryListeners) {
-                listener.nodeRemoved(node);
-            }
-        }
-
-        dbCache.remove(node);
-    }
-
-    private void listenerAdded(OvsdbInventoryListener listener) {
-        this.ovsdbInventoryListeners.add(listener);
-    }
-
-    private void listenerRemoved(OvsdbInventoryListener listener) {
-        this.ovsdbInventoryListeners.remove(listener);
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/Activator.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/Activator.java
deleted file mode 100644 (file)
index 3077c95..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.internal;
-
-import org.apache.felix.dm.DependencyActivatorBase;
-import org.apache.felix.dm.DependencyManager;
-import org.opendaylight.ovsdb.lib.OvsdbConnection;
-import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.plugin.impl.ConfigurationServiceImpl;
-import org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl;
-import org.opendaylight.ovsdb.plugin.impl.InventoryServiceImpl;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * OVSDB protocol plugin Activator
- *
- *
- */
-public class Activator extends DependencyActivatorBase {
-
-    @Override
-    public void init(BundleContext context, DependencyManager manager) throws Exception {
-        manager.add(createComponent()
-                        .setInterface(OvsdbConfigurationService.class.getName(), null)
-                        .setImplementation(ConfigurationServiceImpl.class)
-                        .add(createServiceDependency()
-                                        .setService(OvsdbConnectionService.class)
-                                        .setRequired(true))
-                        .add(createServiceDependency()
-                                .setService(OvsdbInventoryService.class)
-                                .setRequired(true)));
-
-        manager.add(createComponent()
-                        .setInterface(
-                                new String[] {OvsdbConnectionService.class.getName(),
-                                        OvsdbConnectionListener.class.getName()}, null)
-                        .setImplementation(ConnectionServiceImpl.class)
-                        .add(createServiceDependency()
-                                .setService(OvsdbInventoryService.class)
-                                .setRequired(true))
-                        .add(createServiceDependency()
-                                .setService(OvsdbConnection.class)
-                                .setRequired(true))
-        );
-
-        manager.add(createComponent()
-                        .setInterface(OvsdbInventoryService.class.getName(), null)
-                        .setImplementation(InventoryServiceImpl.class)
-                        .add(createServiceDependency()
-                                .setService(OvsdbInventoryListener.class)
-                                .setCallbacks("listenerAdded", "listenerRemoved"))
-                        .add(createServiceDependency()
-                                .setService(OvsdbConfigurationService.class)
-                                .setRequired(false)));
-    }
-
-    @Override
-    public void destroy(BundleContext context, DependencyManager manager) throws Exception {
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/Encapsulation.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/Encapsulation.java
deleted file mode 100644 (file)
index ac66169..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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.ovsdb.plugin.internal;
-
-public enum Encapsulation {
-
-    VXLAN("vxlan"), GRE("gre"), CAPWAP("capwap");
-
-    private final String value;
-
-    private Encapsulation(final String value) {
-        this.value = value;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    @Override
-    public String toString() {
-        return getValue();
-    }
-}
diff --git a/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/NodeDatabase.java b/plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/NodeDatabase.java
deleted file mode 100644 (file)
index 46d8175..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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.ovsdb.plugin.internal;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-
-import org.apache.commons.collections.MapUtils;
-import org.opendaylight.ovsdb.lib.notation.Column;
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-import com.google.common.collect.Maps;
-
-public class NodeDatabase {
-    ConcurrentMap<String, TableDB> dbCache = Maps.newConcurrentMap();
-
-    public ConcurrentMap<String, ConcurrentMap<String, Row>> getDatabase(String dbName) {
-        TableDB tdb = dbCache.get(dbName);
-        if (tdb == null) {
-           return null;
-        }
-        return tdb.getTableCache();
-    }
-
-    public ConcurrentMap<String, Row> getTableCache(String dbName, String tableName) {
-        ConcurrentMap<String, ConcurrentMap<String,Row>> tdbMap = getDatabase(dbName);
-        if (tdbMap == null) {
-           return null;
-        }
-        return tdbMap.get(tableName);
-    }
-
-    private void setDBCache(String dbName,  TableDB table) {
-        dbCache.put(dbName, table);
-    }
-
-    public Row getRow (String dbName, String tableName, String uuid) {
-        ConcurrentMap<String, Row> tdb = this.getTableCache(dbName, tableName);
-        if (tdb == null) {
-           return null;
-        }
-        return tdb.get(uuid);
-    }
-
-    public void updateRow(String dbName, String tableName, String uuid, Row row) {
-        TableDB db = dbCache.get(dbName);
-        if (db == null) {
-            db = new TableDB();
-            setDBCache(dbName, db);
-        }
-        db.updateRow(tableName, uuid, row);
-    }
-
-    public void removeRow(String dbName, String tableName, String uuid) {
-        TableDB db = dbCache.get(dbName);
-        if (db == null) {
-           return;
-        }
-        db.removeRow(tableName, uuid);
-    }
-
-    public void printTableCache() {
-        for (String dbName : dbCache.keySet()) {
-            System.out.println("Database "+dbName);
-            ConcurrentMap<String, ConcurrentMap<String,Row>> tableDB = this.getDatabase(dbName);
-            if (tableDB == null) {
-               continue;
-            }
-            for (String tableName : tableDB.keySet()) {
-                ConcurrentMap<String, Row> tableRows = this.getTableCache(dbName, tableName);
-                System.out.println("\tTable "+tableName);
-                for (String uuid : tableRows.keySet()) {
-                    Row row = tableRows.get(uuid);
-                    Collection<Column> columns = row.getColumns();
-                    System.out.print("\t\t"+uuid+ "==");
-                    for (Column column : columns) {
-                        if (column.getData() != null) {
-                           System.out.print(column.getSchema().getName()+" : "+ column.getData()+" ");
-                        }
-                    }
-                    System.out.println("");
-                }
-                System.out.println("-----------------------------------------------------------");
-            }
-        }
-    }
-
-    public class TableDB {
-        ConcurrentMap<String, ConcurrentMap<String, Row>> cache = Maps.newConcurrentMap();
-
-        public ConcurrentMap<String, ConcurrentMap<String, Row>> getTableCache() {
-            return cache;
-        }
-
-        public ConcurrentMap<String, Row> getTableCache(String tableName) {
-            return cache.get(tableName);
-        }
-
-        private void setTableCache(String tableName,  ConcurrentMap<String, Row> tableCache) {
-            cache.put(tableName, tableCache);
-        }
-
-        public Row getRow (String tableName, String uuid) {
-            Map<String, Row> tableCache = getTableCache(tableName);
-            if (tableCache != null) {
-                return tableCache.get(uuid);
-            }
-            return null;
-        }
-
-        public void updateRow(String tableName, String uuid, Row row) {
-            ConcurrentMap<String, Row> tableCache = getTableCache(tableName);
-            if (tableCache == null) {
-                tableCache = Maps.newConcurrentMap();
-                setTableCache(tableName, tableCache);
-            }
-            tableCache.put(uuid, row);
-        }
-
-        public void removeRow(String tableName, String uuid) {
-            Map<String, Row> tableCache = getTableCache(tableName);
-            if (tableCache != null) {
-                tableCache.remove(uuid);
-            }
-        }
-
-        public void printTableCache() {
-            MapUtils.debugPrint(System.out, null, cache);
-        }
-    }
-}
diff --git a/plugin/src/test/java/org/opendaylight/ovsdb/plugin/impl/ConnectionServiceImplTest.java b/plugin/src/test/java/org/opendaylight/ovsdb/plugin/impl/ConnectionServiceImplTest.java
deleted file mode 100644 (file)
index ed46c3f..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *  Copyright (C) 2015 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 : Sam Hague
- */
-package org.opendaylight.ovsdb.plugin.impl;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-
-public class ConnectionServiceImplTest {
-    private static final String OVS = "OVS";
-    private static final String IDENTIFIER = "192.168.120.31:45001";
-    private static final String OVS_IDENTIFIER = OVS + "|" + IDENTIFIER;
-    private static final String BAD_IDENTIFIER = "BAD" + "|" + IDENTIFIER;
-    private static ConnectionServiceImpl connectionService;
-
-    @BeforeClass
-    public static void setUp () {
-        connectionService = new ConnectionServiceImpl();
-        Connection connection = new Connection(IDENTIFIER, null);
-        connectionService.putOvsdbConnection(IDENTIFIER, connection);
-    }
-
-    @Test
-    public void testGetNode () {
-        Node node = connectionService.getNode(IDENTIFIER);
-        assertNotNull("Node " + IDENTIFIER + " is null", node);
-
-        node = connectionService.getNode(OVS_IDENTIFIER);
-        assertNotNull("Node " + OVS_IDENTIFIER + " is null", node);
-
-        node = connectionService.getNode(IDENTIFIER + "extra");
-        assertNull("Node " + BAD_IDENTIFIER + " is not null", node);
-    }
-
-    @Test
-    public void testGetConnection () {
-        Node node = connectionService.getNode(IDENTIFIER);
-        assertNotNull("Node " + IDENTIFIER + " is null", node);
-
-        Connection connection = connectionService.getConnection(node);
-        assertNotNull("Connection " + IDENTIFIER + " is null", connection);
-
-        try {
-            connection = connectionService.getConnection(null);
-            fail("Expected a NullPointerException to be thrown");
-        } catch (NullPointerException e) {
-            assertSame(NullPointerException.class, e.getClass());
-        }
-    }
-}
diff --git a/pom.xml b/pom.xml
index 0b15ee812d56d54544b6e11593d09f705dfc1eb2..462d26a96518fc2d8f30b66587feaba3f4f47132 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -58,15 +58,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <module>karaf</module>
     <!-- OVSDB Components -->
     <module>southbound</module>
-    <module>northbound</module>
     <module>openstack</module>
-    <module>plugin</module>
     <module>ovsdb-artifacts</module>
-    <module>ovsdb-plugin-compatibility-layer</module>
-    <module>plugin-shell</module>
     <module>schemas</module>
     <module>utils</module>
     <module>ovsdb-ui</module>
+    <module>hwvtepsouthbound</module>
     <!-- Integration Tests -->
     <module>integrationtest</module>
   </modules>
diff --git a/resources/commons/OVSDB_Northbound_APIs.json.postman_collection b/resources/commons/OVSDB_Northbound_APIs.json.postman_collection
deleted file mode 100644 (file)
index 97a09e4..0000000
+++ /dev/null
@@ -1,792 +0,0 @@
-{
-       "id": "b4485302-3406-776b-fb0c-94d74c76dc36",
-       "name": "OVSDB Northbound APIs",
-       "description": "Northbound APIs exposed by ovsdb.northbound bundle",
-       "order": [
-               "1aaa544a-7d79-3159-84b5-89574ff7f3e2",
-               "190627e6-ef20-863f-998b-e019034874c4",
-               "d70a4755-d62a-dfcd-e363-dbe931af99a0"
-       ],
-       "folders": [
-               {
-                       "id": "f0bc8237-daf6-5584-4011-1549618623b5",
-                       "name": "01 BRIDGE",
-                       "description": "",
-                       "order": [
-                               "085fa6c6-1d5b-8afb-4e4a-56cafe5e8bd0",
-                               "aed6c263-4d42-ca35-669f-33a00c3d9c82",
-                               "6f5b8f9a-3e66-16b0-7a16-62a96313eab5",
-                               "7e41f2e4-6797-64f0-ebd2-b4b634b6a559",
-                               "2ced04cd-b934-9a0a-576d-8640b6a0b80e"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "d5c6f3fa-0354-d2db-a2e8-4cb29ade5580",
-                       "name": "02 PORT",
-                       "description": "",
-                       "order": [
-                               "2990bcf5-976b-413a-f732-9a21d26d2146",
-                               "618382e3-a833-04d1-f917-c40e70c176cb",
-                               "39cdc358-7c75-d1cc-34ff-081e74254748",
-                               "4945fedc-a9c9-5b38-478f-df9ea0d1248a"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "10aeabc5-bd4b-b64f-31b6-82cbe9c7e9de",
-                       "name": "03 INTERFACE",
-                       "description": "",
-                       "order": [
-                               "a37af20f-0e43-3fe1-9f3b-c42a264fa3a1",
-                               "4b21a8b1-1703-bc2c-8716-7dcdab57300a",
-                               "0753fa84-8a0e-7727-1d45-5b5eb8c74de0"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "704ce201-08b0-59b4-eba0-c0a22d14d64a",
-                       "name": "04 CONTROLLER",
-                       "description": "",
-                       "order": [
-                               "7fc7d8cd-244d-58a0-febf-9814729b9422",
-                               "646be7a5-a484-329a-1039-02b53e1b05fc",
-                               "d239a9ea-8247-3d47-0d3a-2a1063c0177a"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "c49bb77a-920b-9653-232b-6a35fae3229f",
-                       "name": "05 SSL",
-                       "description": "",
-                       "order": [
-                               "3c4a6bb9-30e8-fdf1-1cf3-a3e187537924",
-                               "6c1b9611-b195-c64c-684f-a639e7ae3946",
-                               "989d5e9c-47a9-206a-c225-dc0e796f096a"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "7d339efa-b5a2-ecb5-1639-7c99ab2beb08",
-                       "name": "06 sFlow",
-                       "description": "",
-                       "order": [
-                               "88f1ec23-5471-97a8-2633-c89c51c20071",
-                               "9b2eaefc-5cc0-958a-0926-2b18fea54b88",
-                               "5eab776e-dd13-2a7f-90c3-fabc4d98d481"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "75c166a9-e5de-c7bd-59b4-20e512c89ef4",
-                       "name": "07 Qos",
-                       "description": "",
-                       "order": [
-                               "5e1f52b7-3295-9485-377f-6988c401a8cd",
-                               "d565f3fb-4a9a-3e61-9e8e-87324427c979",
-                               "40323a39-f07f-695a-2428-e888dd9c7cf1",
-                               "c3c1dd3a-1f8e-947d-f729-2eef56795fef"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "ebb04a01-9318-78ba-7d7d-590688434f35",
-                       "name": "08 Queue",
-                       "description": "",
-                       "order": [
-                               "b1af09ee-f6b9-cddd-9087-6d8dc5b958a4",
-                               "d32420de-40fd-d407-59c5-e1c3b8ea359c",
-                               "2d670425-e1ae-c615-1fe1-b27c0ddf4c43",
-                               "9d887d97-a323-a847-a163-ca6e62ad96fe"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "dc13be48-4ea4-7d32-63df-d367c6df6e70",
-                       "name": "09 NetFlow",
-                       "description": "",
-                       "order": [
-                               "c7ab23bd-2d49-71a0-7a40-31ee0f44b2b0",
-                               "76c04544-3be0-e330-75e1-509919d781f0",
-                               "f8d9b165-7fa7-e0bd-b634-b45d550a3114"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "1fe328ce-a0f2-2512-36b2-21c854081873",
-                       "name": "10 Manager",
-                       "description": "",
-                       "order": [
-                               "3d34de25-8015-98e5-957b-eb3cef69175f",
-                               "1aaa544a-7d79-3159-84b5-89574ff7f3e2",
-                               "baab428a-b056-bd23-906d-290933aee25f"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               },
-               {
-                       "id": "40018e32-d0ca-4a2f-5f06-bff5c95382f8",
-                       "name": "11 IPFIX",
-                       "description": "",
-                       "order": [
-                               "a01a045e-e642-8e39-f2cc-baf37ec5dfc5",
-                               "485249a8-94d2-b61b-a6b9-addfe8fb1495",
-                               "8f74bdb1-1f10-69f4-da1d-cd878df784e5"
-                       ],
-                       "collection_name": "OVSDB Northbound APIs",
-                       "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
-               }
-       ],
-       "timestamp": 1384305639019,
-       "synced": false,
-       "requests": [
-               {
-                       "id": "0753fa84-8a0e-7727-1d45-5b5eb8c74de0",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows/45bf1633-1411-4c92-87f8-b1492eed2ff6",
-                       "data": "",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "raw",
-                       "method": "DELETE",
-                       "version": 2,
-                       "time": 1385442001088,
-                       "name": "DELETE interface row given UUID",
-                       "description": "package org.opendaylight.ovsdb.plugin\n\nclass ConfigurationService\n\nMethod: deleteInterfaceRow()",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "085fa6c6-1d5b-8afb-4e4a-56cafe5e8bd0",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows",
-                       "data": [],
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "params",
-                       "method": "GET",
-                       "version": 2,
-                       "time": 1384863804932,
-                       "name": "GET all bridge rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "190627e6-ef20-863f-998b-e019034874c4",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/open_vswitch/rows",
-                       "data": [],
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "params",
-                       "method": "GET",
-                       "version": 2,
-                       "time": 1384895597912,
-                       "name": "GET all open_vswitch rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "1aaa544a-7d79-3159-84b5-89574ff7f3e2",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows",
-                       "data": "{\n  \"parent_uuid\":\"8d3fb89b-5fac-4631-a990-f5a4e7f5383a\",\n    \"row\":{\n      \"Manager\":{\n        \"target\":\"a_string\",\n        \"is_connected\": true,\n        \"state\":\"active\"\n      }\n    }\n}",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "raw",
-                       "method": "POST",
-                       "version": 2,
-                       "time": 1384920841537,
-                       "name": "INSERT a Manager Row",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "2990bcf5-976b-413a-f732-9a21d26d2146",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows",
-                       "data": [],
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "params",
-                       "method": "GET",
-                       "version": 2,
-                       "time": 1384863858721,
-                       "name": "GET all port rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "2ced04cd-b934-9a0a-576d-8640b6a0b80e",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/66ad493c-23cf-45e7-b5a5-1901fb3165f4",
-                       "pathVariables": {},
-                       "method": "PUT",
-                       "data": "{\n    \"row\":{\n      \"Bridge\":{\n        \"netflow\": [\"55f5d382-17fd-4c42-850d-02c282a67c20\",\"60db8cde-26e6-4bf9-bb08-cd1da68d1fcc\"]\n                \n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386202840003,
-                       "name": "Update (PUT) Bridge table",
-                       "description": "Please note that the UUID used here must be one of the existing UUID of a Row in Bridge Table.\n\nAlso the Update must be done ONLY on the fields that needs update. Should NOT send all the immutable fields again. Update will fail in that case.",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "2d670425-e1ae-c615-1fe1-b27c0ddf4c43",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows/cd1d39f2-0e8d-4164-a5ab-926329cd1c61",
-                       "pathVariables": {},
-                       "method": "DELETE",
-                       "data": "",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386291032110,
-                       "name": "DELETE a Queue row given a UUID (ROOT TABLE)",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "39cdc358-7c75-d1cc-34ff-081e74254748",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/2f93780e-ce56-4cce-9f7c-579be7996651",
-                       "data": "",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "raw",
-                       "method": "DELETE",
-                       "version": 2,
-                       "time": 1385084358582,
-                       "name": "DELETE port row given UUID",
-                       "description": "package org.opendaylight.ovsdb.plugin\n\nclass ConfigurationService\n\nMethod: deletePortRow()",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "3c4a6bb9-30e8-fdf1-1cf3-a3e187537924",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows",
-                       "pathVariables": {},
-                       "method": "GET",
-                       "data": [],
-                       "dataMode": "params",
-                       "version": 2,
-                       "time": 1385766024370,
-                       "name": "GET all SSL row",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "3d34de25-8015-98e5-957b-eb3cef69175f",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows",
-                       "data": [],
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "params",
-                       "method": "GET",
-                       "version": 2,
-                       "time": 1384920805653,
-                       "name": "GET all manager rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "40323a39-f07f-695a-2428-e888dd9c7cf1",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/739f3929-3a3e-45b1-88ea-afc09df0ca5c",
-                       "pathVariables": {},
-                       "method": "DELETE",
-                       "data": "",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386292478840,
-                       "name": "DELETE a QoS row given a UUID (ROOT TABLE)",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "485249a8-94d2-b61b-a6b9-addfe8fb1495",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/ipfix/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\":\"2e5c0418-e70c-406b-9ad9-58585ac10c19\",\n    \"row\":{\n      \"IPFIX\":{\n        \"targets\":[\n          \"set\", [\"192.168.56.1:5555\"]]\n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "name": "Insert a IPFIX row",
-                       "description": "",
-                       "descriptionFormat": "html",
-                       "time": 1396821935199,
-                       "version": 2,
-                       "responses": [],
-                       "tests": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "synced": false
-               },
-               {
-                       "id": "4945fedc-a9c9-5b38-478f-df9ea0d1248a",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/97a82ec9-e85e-4a48-9b77-ca4a41128b90",
-                       "pathVariables": {},
-                       "method": "PUT",
-                       "data": "{\n    \"row\":{\n      \"Port\":{\n        \"qos\": [\n          \"ab2b6f2d-5cb4-4dcf-ac1b-c989ae3d76ce\"\n                ]\n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386208729980,
-                       "name": "Update Port Table",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "4b21a8b1-1703-bc2c-8716-7dcdab57300a",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\":\"ea70e5b1-8b21-4caf-a102-0b85b6c63119\",\n    \"row\":{\n      \"Interface\":{\n        \"name\":\"s1-1125-1\",\n        \"mac\":[\"00:00:bb:bb:00:01\"],\n        \"admin_state\":\"up\"\n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396829465324,
-                       "name": "Create row: Interface Table",
-                       "description": "package org.opendaylight.ovsdb.plugin\npublic class ConfigurationService\n\nMethod: insertInterfaceRow\n",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "5e1f52b7-3295-9485-377f-6988c401a8cd",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows",
-                       "pathVariables": {},
-                       "method": "GET",
-                       "data": [],
-                       "dataMode": "params",
-                       "version": 2,
-                       "time": 1385833787440,
-                       "name": "GET all QoS rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "5eab776e-dd13-2a7f-90c3-fabc4d98d481",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows/",
-                       "pathVariables": {},
-                       "method": "DELETE",
-                       "data": "",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1385832734561,
-                       "name": "DELETE an sFlow row given a UUID",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "618382e3-a833-04d1-f917-c40e70c176cb",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\":\"6b3072ba-a120-4db9-82f8-a8ce4eae6942\",\n    \"row\":{\n      \"Port\":{\n        \"name\":\"krb1\",\n        \"mac\":[\"00:00:00:00:00:01\"],\n        \"tag\":[200]\n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396829482311,
-                       "name": "Create a Port and add it to a Bridge",
-                       "description": "Please note that the parent_uuid of this HTTP Data is the UUID of the Bridge that was created in the previous step.\n\nWatch out for the return value which is the UUID of the port that was just created. This UUID must be used as the parent_uuid for the interface addition. Also look out for the HTTP headers that is returned and it has a location field that can be used for both DELETE and UPDATE operations later.\n",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "646be7a5-a484-329a-1039-02b53e1b05fc",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows/68e97a9a-9f2c-497a-b39b-7f1e37c30c6f",
-                       "data": "",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "raw",
-                       "method": "DELETE",
-                       "version": 2,
-                       "time": 1385391658840,
-                       "name": "DELETE controller row given UUID",
-                       "description": "package org.opendaylight.ovsdb.plugin\n\nclass ConfigurationService\n\nMethod: deleteControllerRow()",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "6c1b9611-b195-c64c-684f-a639e7ae3946",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n    \"row\":{\n      \"SSL\":{\n        \"name\":\"mySSL\",\n        \"ca_cert\" : \"ca_cert\",\n        \"bootstrap_ca_cert\" : true,\n        \"certificate\":\"pieceofpaper\",\n        \"private_key\" : \"private\"\n      }\n    }\n}\n",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1385766215625,
-                       "name": "INSERT an SSL row",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "6f5b8f9a-3e66-16b0-7a16-62a96313eab5",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n    \"row\":{\n      \"Bridge\":{\n        \"name\":\"br25\",\n        \"datapath_type\":\"OPENFLOW\"\n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396829500172,
-                       "name": "Create a Bridge",
-                       "description": "Watch out for the return value which is the UUID of the bridge that was just created.\nThis UUID must be used as the parent_uuid for the port addition.\n\nAlso look out for the HTTP headers that is returned and it has a location field that can be used for both DELETE and UPDATE operations later.",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "76c04544-3be0-e330-75e1-509919d781f0",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\":\"817d2e33-448d-4f2e-b183-7f835e93922f\",\n  \"row\" : {\n    \"NetFlow\":{\n      \"targets\" : [\n        \"set\", [\"192.168.1.102:9998\"]],\n      \"active_timeout\" : \"0\"\n      }\n  } \n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396822912058,
-                       "name": "INSERT a NetFlow row",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "id": "7e41f2e4-6797-64f0-ebd2-b4b634b6a559",
-                       "name": "DELETE a Bridge row given UUID",
-                       "description": "Please note that the UUID used here must be one of the existing UUID of a Row in Bridge Table",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/45677cc9-bed2-4def-9986-b05a9b59f1f4",
-                       "method": "DELETE",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "data": "",
-                       "dataMode": "raw",
-                       "timestamp": 0,
-                       "version": 2,
-                       "time": 1384465149749,
-                       "synced": false
-               },
-               {
-                       "id": "7fc7d8cd-244d-58a0-febf-9814729b9422",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows",
-                       "data": [],
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "params",
-                       "method": "GET",
-                       "version": 2,
-                       "time": 1384898533812,
-                       "name": "GET all controller rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "88f1ec23-5471-97a8-2633-c89c51c20071",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows",
-                       "pathVariables": {},
-                       "method": "GET",
-                       "data": [],
-                       "dataMode": "params",
-                       "version": 2,
-                       "time": 1385832695823,
-                       "name": "GET all sFlow rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "8f74bdb1-1f10-69f4-da1d-cd878df784e5",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/ipfix/rows/715fb52c-63bb-495a-8dca-f3f824fbf8fb",
-                       "pathVariables": {},
-                       "method": "DELETE",
-                       "data": "",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396823075244,
-                       "name": "DELETE a IPFIX row given a UUID",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "989d5e9c-47a9-206a-c225-dc0e796f096a",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows/6c2a532c-96df-49ce-8f3f-f83c39e47122",
-                       "pathVariables": {},
-                       "method": "DELETE",
-                       "data": "",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1385766788123,
-                       "name": "DELETE an SSL row given a UUID",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "9b2eaefc-5cc0-958a-0926-2b18fea54b88",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\": \"a8c88ae9-fc08-498b-8ec8-2fd86627055d\",\n  \"row\": {\n    \"sFlow\": {\n      \"targets\": [\n        \"set\",\n        [\n          \"targets_string\"\n        ]\n      ]\n    }\n  }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396827237234,
-                       "name": "INSERT an sFlow row",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "9d887d97-a323-a847-a163-ca6e62ad96fe",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/ab2b6f2d-5cb4-4dcf-ac1b-c989ae3d76ce",
-                       "pathVariables": {},
-                       "method": "PUT",
-                       "data": "{\n    \"row\":{\n      \"QoS\":{\n        \"queues\": {\n          \"1\" : { \"val\": \"0fbe6ced-16cf-4a39-8a79-e7c8c31f63a9\"}\n        }\n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386287453591,
-                       "name": "UPDATE a queue in QOS",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "a01a045e-e642-8e39-f2cc-baf37ec5dfc5",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/ipfix/rows",
-                       "pathVariables": {},
-                       "method": "GET",
-                       "data": [],
-                       "dataMode": "params",
-                       "name": "GET all IPFIX rows",
-                       "description": "",
-                       "descriptionFormat": "html",
-                       "time": 1396821857102,
-                       "version": 2,
-                       "responses": [],
-                       "tests": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "synced": false
-               },
-               {
-                       "id": "a37af20f-0e43-3fe1-9f3b-c42a264fa3a1",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows",
-                       "data": [],
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "dataMode": "params",
-                       "method": "GET",
-                       "version": 2,
-                       "time": 1384866802408,
-                       "name": "GET all interface rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "id": "aed6c263-4d42-ca35-669f-33a00c3d9c82",
-                       "name": "GET a bridge row given a UUID",
-                       "description": "Please note that the UUID used here must be one of the existing UUID of a Row in Bridge Table",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/45677cc9-bed2-4def-9986-b05a9b59f1f4",
-                       "method": "GET",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "data": "",
-                       "dataMode": "raw",
-                       "timestamp": 0,
-                       "version": 2,
-                       "time": 1384465185771,
-                       "synced": false
-               },
-               {
-                       "id": "b1af09ee-f6b9-cddd-9087-6d8dc5b958a4",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows",
-                       "pathVariables": {},
-                       "method": "GET",
-                       "data": [],
-                       "dataMode": "params",
-                       "version": 2,
-                       "time": 1385846165644,
-                       "name": "GET all Queue rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "baab428a-b056-bd23-906d-290933aee25f",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows/",
-                       "pathVariables": {},
-                       "method": "DELETE",
-                       "data": "",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1385866190653,
-                       "name": "DELETE a Manager row given UUID",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "c3c1dd3a-1f8e-947d-f729-2eef56795fef",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/ab2b6f2d-5cb4-4dcf-ac1b-c989ae3d76ce",
-                       "pathVariables": {},
-                       "method": "PUT",
-                       "data": "{\n    \"row\":{\n      \"QoS\":{\n        \"Queues\": {\n          \"queue_value\" : \"5afa70b6-7c74-4972-9d98-874e6307807d\"\n        }\n      }\n    }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386212074539,
-                       "name": "UPDATE a QoS row ",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "c7ab23bd-2d49-71a0-7a40-31ee0f44b2b0",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows",
-                       "pathVariables": {},
-                       "method": "GET",
-                       "data": [],
-                       "dataMode": "params",
-                       "version": 2,
-                       "time": 1385853862100,
-                       "name": "GET all NetFlow rows",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "d239a9ea-8247-3d47-0d3a-2a1063c0177a",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\" : \"a8c88ae9-fc08-498b-8ec8-2fd86627055d\",\n  \"row\" : {\n  \t\"Controller\": {\n      \"target\": \"1.1.1.1\"\n    \t}\n\t}\t\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396828737787,
-                       "name": "Add Controller to Bridge",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "d32420de-40fd-d407-59c5-e1c3b8ea359c",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\": \"c5f7ce39-847c-4a69-bf8a-2a0181898581\",\n  \"row\": {\n    \"Queue\": {\n      \"dscp\" : [\n      \"set\",\n      [\n          25\n        ]\n      ]\n    }\n  }\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "tests": "",
-                       "time": 1396828046762,
-                       "name": "INSERT a Queue row",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "d565f3fb-4a9a-3e61-9e8e-87324427c979",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows",
-                       "pathVariables": {},
-                       "method": "POST",
-                       "data": "{\n  \"parent_uuid\" : \"b109dbcf-47bb-4121-b244-e623b3421d6e\",\n  \"row\" : {\n  \t\"QoS\": {\n      \"type\": \"linux-htb\"\n    \t}\n\t}\t\n}",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386291627774,
-                       "name": "INSERT a QoS row",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "d70a4755-d62a-dfcd-e363-dbe931af99a0",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/controller/nb/v2/connectionmanager/node/HOST1/address/192.168.1.102/port/6640/",
-                       "data": [],
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\n",
-                       "dataMode": "params",
-                       "method": "PUT",
-                       "version": 2,
-                       "time": 1385493381229,
-                       "name": "Connect controller to OVSDB server",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               },
-               {
-                       "id": "f8d9b165-7fa7-e0bd-b634-b45d550a3114",
-                       "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-                       "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows/60db8cde-26e6-4bf9-bb08-cd1da68d1fcc",
-                       "pathVariables": {},
-                       "method": "DELETE",
-                       "data": "",
-                       "dataMode": "raw",
-                       "version": 2,
-                       "time": 1386202872294,
-                       "name": "DELETE a NetFlow row given UUID",
-                       "description": "",
-                       "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
-                       "responses": [],
-                       "synced": false
-               }
-       ]
-}
\ No newline at end of file
diff --git a/resources/commons/OVSDB_Northbound_v3_APIs.json.postman_collection b/resources/commons/OVSDB_Northbound_v3_APIs.json.postman_collection
deleted file mode 100644 (file)
index d5af815..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-{
-    "id":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-    "name":"OVSDB Northbound v3 APIs",
-    "timestamp":1416933391257,
-    "requests":[
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"28f2c9fe-06a8-55fa-eb95-ae6d93fc271e",
-            "name":"GET node database table Manager info",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Manager",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"2ceafd22-6467-e29b-f5b9-a947196a365d",
-            "name":"GET config",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/config",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"31423e07-7f63-cace-1d92-eade985c8058",
-            "name":"GET node database table list",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"52f720c9-424b-f48f-65aa-ef9a9bb29f40",
-            "name":"GET node",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"9d327275-fd29-6b72-9ac8-3bbd38c5364d",
-            "name":"GET node database list",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"9f6858b9-198b-5368-7987-9468354ae06b",
-            "name":"GET node database table Open-vSwitch rows uuid",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Open_vSwitch/row/626d6b88-821f-474c-9680-2b74dfafdcd1",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"b8fff80d-cb81-280a-2a88-e0b28d4d23d3",
-            "name":"GET node database table Open-vSwitch",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Open_vSwitch",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"c508233b-ed4b-c03d-0446-3e206b513203",
-            "name":"GET node database table Open-vSwitch rows",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Open_vSwitch/row",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"d8d420f8-826d-af7e-951b-2d29a51c6033",
-            "name":"GET node database info",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        },
-        {
-            "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
-            "id":"e650b8cc-d983-f329-be2e-153a5601e34c",
-            "name":"GET all nodes",
-            "description":"",
-            "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
-            "data":[
-
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-
-            ],
-            "version":2
-        }
-    ]
-}
\ No newline at end of file
index 0e34991087dd6a6e1b9aa644f1b300a78f2f609d..c5ab757162a709d8e03aa08b7a32b9f618047d4e 100644 (file)
@@ -5,14 +5,12 @@ administrators working on ovsdb project in general.
 Contents
 --------
 
-1. localhost.json.postman_environment : Environment that associates address and port to localhost:8080 in templates for the collections below.
+- localhost.json.postman_environment : Environment that associates address and port to localhost:8080 in templates for the collections below.
 
-2. Mininet_Demo_OVSDB_OF.json.postman_collection : Collection of REST-APIs used in the Mininet demo (http://www.youtube.com/watch?v=8iWhMVlflwE)
+- Mininet_Demo_OVSDB_OF.json.postman_collection : Collection of REST-APIs used in the Mininet demo (http://www.youtube.com/watch?v=8iWhMVlflwE)
 
-3. OVSDB_Northbound_APIs.json.postman_collection : Collection of REST-APIs detailing on all the ovsdb.northbound APIs.
+- OVSDB_Southbound.postman_collection : Collection of RESTCONF APIs for using the OVSDB MD-SAL Southbound
 
-4. OVSDB_Southbound.postman_collection : Collection of RESTCONF APIs for using the OVSDB MD-SAL Southbound
+- Neutron-v2.0-LBaaS-API-Examples_July15.json.postman_collection.txt : Collection of REST-APIs to interact with LBaas pool/pool member/loadbalancer.
 
-5. Neutron-v2.0-LBaaS-API-Examples_July15.json.postman_collection.txt : Collection of REST-APIs to interact with LBaas pool/pool member/loadbalancer.
-
-6. showOvsdbMdsal.py : Dumps mdsal related info from running ODL that is related to ovsdb and netvirt. Use 'showOvsdbMdsal.py -h' for usage
+- showOvsdbMdsal.py : Dumps mdsal related info from running ODL that is related to ovsdb and netvirt. Use 'showOvsdbMdsal.py -h' for usage
index ecf386a64e3ac4b793227bbe50f26bf50bddc8e7..fab409aa77525f00e44fd8f6bb71eb5a70c6646f 100644 (file)
@@ -25,10 +25,10 @@ import java.util.Set;
 public interface Manager extends TypedBaseTable<GenericTableSchema> {
 
     @TypedColumn (name="target", method= MethodType.GETCOLUMN, fromVersion = "1.0.0")
-    Column<GenericTableSchema, Set<String>> getTargetColumn();
+    Column<GenericTableSchema, String> getTargetColumn();
 
     @TypedColumn (name="target", method= MethodType.SETDATA, fromVersion = "1.0.0")
-    void setTarget(Set<String> target) ;
+    void setTarget(String target) ;
 
     @TypedColumn (name = "is_connected", method = MethodType.GETCOLUMN, fromVersion = "1.1.0")
     Column<GenericTableSchema, Boolean> getIsConnectedColumn();
index 4df423ff2e45d80701e6c5dc22b6a514cc37a5d5..9b46cf7564927069d81a3c699cb5cc5fc49a6187 100644 (file)
@@ -8,7 +8,7 @@ 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">
   <parent>
-    <groupId>org.opendaylight.yangtools</groupId>
+    <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
     <version>0.8.0-SNAPSHOT</version>
     <relativePath/>
@@ -40,25 +40,45 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <tag>HEAD</tag>
     <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
   </scm>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>2.0.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.mdsal.model</groupId>
+        <artifactId>mdsal-model-artifacts</artifactId>
+        <version>0.8.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <dependencies>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-topology</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>yang-ext</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types-20130715</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>opendaylight-l2-types</artifactId>
     </dependency>
     <dependency>
index 6d9edb5aa116df823810c96eaf6a755d91cb41bb..b828acc18055daf7fd192d840b29fe7be774b99a 100755 (executable)
@@ -471,6 +471,21 @@ module ovsdb {
             }
          }
 
+         list manager-entry {
+            description "Node managers info";
+            config false;
+            key "target";
+            leaf target {
+                description "Uri that user set to connect to the controller";
+                type inet:uri;
+            }
+            leaf connected {
+                type boolean;
+            }
+            leaf number_of_connections {
+                type uint32;
+            }
+        }
      }
 
     identity interface-type-base {
index edfc418c7aef0f1dfc05a01e98e60ad921460f7f..eb3a9506cf4a2b34cea1869fef780563a49a0e5c 100644 (file)
@@ -45,6 +45,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <mdsal.version>1.3.0-SNAPSHOT</mdsal.version>
     <restconf.version>1.3.0-SNAPSHOT</restconf.version>
     <yangtools.version>0.8.0-SNAPSHOT</yangtools.version>
+    <mdsal.model.version>0.8.0-SNAPSHOT</mdsal.model.version>
   </properties>
   <dependencyManagement>
     <dependencies>
@@ -79,6 +80,16 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <type>xml</type>
       <classifier>features</classifier>
     </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.mdsal.model</groupId>
+      <artifactId>features-mdsal-model</artifactId>
+      <version>${mdsal.model.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>features-mdsal</artifactId>
index 5ed696ce4e1a790e4e861356a5839d007f4553d2..b66393266559ec1f479b6041a4d4346439933b22 100644 (file)
@@ -13,8 +13,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
   <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
   <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
+  <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
   <feature name='odl-ovsdb-southbound-api' version='${project.version}' description='OpenDaylight :: southbound :: api '>
-    <feature version='${yangtools.version}'>odl-yangtools-models</feature>
+    <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
     <bundle>mvn:org.opendaylight.ovsdb/southbound-api/${project.version}</bundle>
   </feature>
   <feature name='odl-ovsdb-southbound-impl' version='${project.version}' description='OpenDaylight :: southbound :: impl '>
index 436a048d676a6ef4be305288770f88b1e1022f72..3d9430f56bd7575ef1ba519dfbc5fdc517325453 100644 (file)
@@ -67,4 +67,9 @@ public class InstanceIdentifierCodec extends AbstractModuleStringInstanceIdentif
         return iid;
     }
 
+    public InstanceIdentifier<?> bindingDeserializer(YangInstanceIdentifier yangIID) {
+        InstanceIdentifier<?> iid = bindingNormalizedNodeSerializer.fromYangInstanceIdentifier(yangIID);
+        return iid;
+    }
+
 }
index 961e7d1c758cbb6398f9c797eba658d42a09dc5f..0db2495b5be877717e793c5271cafb9fd7f9e99a 100644 (file)
@@ -83,7 +83,7 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         // and connected when writing to the operational store
         InetAddress ip = SouthboundMapper.createInetAddress(ovsdbNode.getConnectionInfo().getRemoteIp());
         OvsdbClient client = OvsdbConnectionService.getService().connect(ip,
-                ovsdbNode.getConnectionInfo().getRemotePort().getValue().intValue());
+                ovsdbNode.getConnectionInfo().getRemotePort().getValue());
         // For connections from the controller to the ovs instance, the library doesn't call
         // this method for us
         if (client != null) {
@@ -99,6 +99,7 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         OvsdbClient client = getConnectionInstance(ovsdbNode.getConnectionInfo());
         if (client != null) {
             client.disconnect();
+            removeInstanceIdentifier(ovsdbNode.getConnectionInfo());
         }
     }
 
@@ -130,6 +131,11 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         instanceIdentifiers.put(connectionInfo, iid);
     }
 
+    private void removeInstanceIdentifier(ConnectionInfo key) {
+        ConnectionInfo connectionInfo = SouthboundMapper.suppressLocalIpPort(key);
+        instanceIdentifiers.remove(connectionInfo);
+    }
+
     public OvsdbConnectionInstance getConnectionInstance(ConnectionInfo key) {
         ConnectionInfo connectionInfo = SouthboundMapper.suppressLocalIpPort(key);
         return clients.get(connectionInfo);
index 434ef04aa42af97f87eb0ce48f634cc59fb355da..34eb3d9671d45aa75e18205d490009db0099fff5 100644 (file)
@@ -71,19 +71,6 @@ public class OvsdbDataChangeListener implements DataChangeListener, AutoCloseabl
     public void onDataChanged(
             AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes) {
         LOG.trace("onDataChanged: {}", changes);
-        for (Entry<InstanceIdentifier<?>, DataObject> created : changes.getCreatedData().entrySet()) {
-            // TODO validate we have the correct kind of InstanceIdentifier
-            if (created.getValue() instanceof OvsdbNodeAugmentation) {
-                OvsdbNodeAugmentation ovsdbNode = (OvsdbNodeAugmentation)created.getValue();
-                ConnectionInfo key = ovsdbNode.getConnectionInfo();
-                InstanceIdentifier<Node> iid = cm.getInstanceIdentifier(key);
-                if ( iid != null) {
-                    LOG.warn("Connection to device {} already exists. Plugin does not allow multiple connections "
-                              + "to same device, hence dropping the request {}", key, ovsdbNode);
-                    return;
-                }
-            }
-        }
         // Connect first if we have to:
         connect(changes);
 
@@ -156,11 +143,19 @@ public class OvsdbDataChangeListener implements DataChangeListener, AutoCloseabl
         for (Entry<InstanceIdentifier<?>, DataObject> created : changes.getCreatedData().entrySet()) {
             // TODO validate we have the correct kind of InstanceIdentifier
             if (created.getValue() instanceof OvsdbNodeAugmentation) {
-                try {
-                    cm.connect((InstanceIdentifier<Node>) created.getKey(),
-                            (OvsdbNodeAugmentation) created.getValue());
-                } catch (UnknownHostException e) {
-                    LOG.warn("Failed to connect to ovsdbNode", e);
+                OvsdbNodeAugmentation ovsdbNode = (OvsdbNodeAugmentation)created.getValue();
+                ConnectionInfo key = ovsdbNode.getConnectionInfo();
+                InstanceIdentifier<Node> iid = cm.getInstanceIdentifier(key);
+                if ( iid != null) {
+                    LOG.warn("Connection to device {} already exists. Plugin does not allow multiple connections "
+                              + "to same device, hence dropping the request {}", key, ovsdbNode);
+                } else {
+                    try {
+                        cm.connect((InstanceIdentifier<Node>) created.getKey(),
+                                (OvsdbNodeAugmentation) created.getValue());
+                    } catch (UnknownHostException e) {
+                        LOG.warn("Failed to connect to ovsdbNode", e);
+                    }
                 }
             }
         }
index b5252892b9351beb7fbdeeda9b5e6a945162d3c5..f0db949e8748b4fab43ea9c53b66531bfd3fb24d 100644 (file)
@@ -25,6 +25,8 @@ import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
 import org.opendaylight.ovsdb.schema.openvswitch.Controller;
+import org.opendaylight.ovsdb.schema.openvswitch.Manager;
+import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
@@ -36,12 +38,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntryBuilder;
 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.network.topology.Topology;
@@ -59,6 +64,7 @@ import com.google.common.collect.ImmutableBiMap;
 
 public class SouthboundMapper {
     private static final Logger LOG = LoggerFactory.getLogger(SouthboundMapper.class);
+    private static final String N_CONNECTIONS_STR = "n_connections";
 
     private static NodeId createNodeId(OvsdbConnectionInstance client) {
         NodeKey key = client.getInstanceIdentifier().firstKeyOf(Node.class, NodeKey.class);
@@ -210,7 +216,7 @@ public class SouthboundMapper {
     }
 
     public static Set<String> createOvsdbBridgeProtocols(OvsdbBridgeAugmentation ovsdbBridgeNode) {
-        Set<String> protocols = new HashSet<String>();
+        Set<String> protocols = new HashSet<>();
         if (ovsdbBridgeNode.getProtocolEntry() != null && ovsdbBridgeNode.getProtocolEntry().size() > 0) {
             for (ProtocolEntry protocol : ovsdbBridgeNode.getProtocolEntry()) {
                 if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) {
@@ -335,7 +341,7 @@ public class SouthboundMapper {
 
     public static Map<UUID, Controller> createOvsdbController(OvsdbBridgeAugmentation omn,DatabaseSchema dbSchema) {
         List<ControllerEntry> controllerEntries = omn.getControllerEntry();
-        Map<UUID,Controller> controllerMap = new HashMap<UUID,Controller>();
+        Map<UUID,Controller> controllerMap = new HashMap<>();
         if (controllerEntries != null && !controllerEntries.isEmpty()) {
             for (ControllerEntry controllerEntry : controllerEntries) {
                 String controllerNamedUUID = "Controller_" + getRandomUUID();
@@ -365,4 +371,89 @@ public class SouthboundMapper {
         connectionInfoBuilder.setRemotePort(connectionInfo.getRemotePort());
         return connectionInfoBuilder.build();
     }
+
+    /**
+     * Create the {@link ManagerEntry} list given an OVSDB {@link OpenVSwitch}
+     * and {@link Manager} rows.
+     *
+     * @param ovsdbNode the {@link OpenVSwitch} to update
+     * @param updatedManagerRows the list of {@link Manager} managers with updates
+     * @return list of {@link ManagerEntry} entries
+     */
+    public static List<ManagerEntry> createManagerEntries(OpenVSwitch ovsdbNode,
+                                                                Map<UUID, Manager> updatedManagerRows) {
+
+        LOG.debug("createManagerEntries OpenVSwitch: {}\n, updatedManagerRows: {}",
+                ovsdbNode, updatedManagerRows);
+        final Set<UUID> managerUUIDs = ovsdbNode.getManagerOptionsColumn().getData();
+        final List<ManagerEntry> managerEntries = new ArrayList<ManagerEntry>();
+        for (UUID managerUUID : managerUUIDs ) {
+            final Manager manager = updatedManagerRows.get(managerUUID);
+            addManagerEntries(managerEntries, manager);
+        }
+        LOG.debug("managerEntries: {}", managerEntries);
+        return managerEntries;
+    }
+
+    /**
+     * Create the {@link ManagerEntry} list given an MDSAL {@link Node} ovsdbNode
+     * and {@link Manager} rows.
+     *
+     * @param ovsdbNode the {@link Node} to update
+     * @param updatedManagerRows the list of {@link Manager} managers with updates
+     * @return list of {@link ManagerEntry} entries
+     */
+    public static List<ManagerEntry> createManagerEntries(Node ovsdbNode,
+                                                                Map<Uri, Manager> updatedManagerRows) {
+
+        LOG.debug("createManagerEntries based on OVSDB Node: {}\n, updatedManagerRows: {}",
+                ovsdbNode, updatedManagerRows);
+        final List<ManagerEntry> managerEntriesCreated = new ArrayList<ManagerEntry>();
+        final OvsdbNodeAugmentation ovsdbNodeAugmentation =
+                ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+        if (ovsdbNodeAugmentation == null) {
+            return managerEntriesCreated;
+        }
+
+        final List<ManagerEntry> managerEntries = ovsdbNodeAugmentation.getManagerEntry();
+        if (managerEntries != null) {
+            for (ManagerEntry managerEntry : managerEntries) {
+                final Manager manager = updatedManagerRows.get(managerEntry.getTarget());
+                addManagerEntries(managerEntriesCreated, manager);
+            }
+        }
+        LOG.debug("managerEntries: {}", managerEntriesCreated);
+        return managerEntriesCreated;
+    }
+
+    /**
+     * Add the OVSDB {@link Manager} updates to the MDSAL {@link ManagerEntry} list.
+     *
+     * @param managerEntries the list of {@link ManagerEntry} to update
+     * @param manager the updated OVSDB {@link Manager}
+     */
+    public static void addManagerEntries(List<ManagerEntry> managerEntries,
+                                            final Manager manager) {
+
+        if (manager != null && manager.getTargetColumn() != null) {
+            long numberOfConnections = 0;
+            final String targetString = (String)manager.getTargetColumn().getData();
+
+            final Map<String, String> statusAttributeMap = manager.getStatusColumn().getData();
+            if (statusAttributeMap.containsKey(N_CONNECTIONS_STR)) {
+                String numberOfConnectionValueStr = statusAttributeMap.get(N_CONNECTIONS_STR);
+                numberOfConnections = Integer.parseInt(numberOfConnectionValueStr);
+            } else {
+                final boolean isConnected = manager.getIsConnectedColumn().getData();
+                if (isConnected) {
+                    numberOfConnections = 1;
+                }
+            }
+            managerEntries.add(new ManagerEntryBuilder()
+                    .setTarget(new Uri(targetString))
+                    .setNumberOfConnections(numberOfConnections)
+                    .setConnected(manager.getIsConnectedColumn().getData()).build());
+        }
+    }
+
 }
index 5a909b104ea6acdeee9bba3fd5165a6a24fdf641..3e2ecb9743844d0978e2789dd7d6e969a2f3aa32 100644 (file)
@@ -34,6 +34,10 @@ public class SouthboundUtil {
 
     private static InstanceIdentifierCodec instanceIdentifierCodec;
 
+    private SouthboundUtil() {
+        // Prevent instantiating a utility class
+    }
+
     public static void setInstanceIdentifierCodec(InstanceIdentifierCodec iidc) {
         instanceIdentifierCodec = iidc;
     }
@@ -68,10 +72,11 @@ public class SouthboundUtil {
                 Optional<Node> optional = nf.get();
                 if (optional != null && optional.isPresent()) {
                     OvsdbNodeAugmentation ovsdbNode = null;
-                    if (optional.get() instanceof Node) {
-                        ovsdbNode = optional.get().getAugmentation(OvsdbNodeAugmentation.class);
-                    } else if (optional.get() instanceof OvsdbNodeAugmentation) {
-                        ovsdbNode = (OvsdbNodeAugmentation) optional.get();
+                    Node node = optional.get();
+                    if (node instanceof OvsdbNodeAugmentation) {
+                        ovsdbNode = (OvsdbNodeAugmentation) node;
+                    } else if (node != null) {
+                        ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
                     }
                     if (ovsdbNode != null) {
                         return Optional.of(ovsdbNode);
@@ -110,15 +115,13 @@ public class SouthboundUtil {
         try {
             for (Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();
                  ifaces.hasMoreElements();) {
-                NetworkInterface iface = (NetworkInterface) ifaces.nextElement();
+                NetworkInterface iface = ifaces.nextElement();
 
                 for (Enumeration<InetAddress> inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) {
-                    InetAddress inetAddr = (InetAddress) inetAddrs.nextElement();
-                    if (!inetAddr.isLoopbackAddress()) {
-                        if (inetAddr.isSiteLocalAddress()) {
-                            ipaddress = inetAddr.getHostAddress();
-                            break;
-                        }
+                    InetAddress inetAddr = inetAddrs.nextElement();
+                    if (!inetAddr.isLoopbackAddress() && inetAddr.isSiteLocalAddress()) {
+                        ipaddress = inetAddr.getHostAddress();
+                        break;
                     }
                 }
             }
index 80a6ed69cc67db72cc8df6ba30b3036af490b2ec..55aba8b987f0e101d2d38eaeaa1ba8a57e04ae3a 100644 (file)
@@ -118,8 +118,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
             InstanceIdentifier<Node> bridgeIid, Bridge bridge) {
         Preconditions.checkNotNull(bridgeIid);
         Preconditions.checkNotNull(bridge);
-        List<InstanceIdentifier<BridgeOtherConfigs>> result =
-                new ArrayList<InstanceIdentifier<BridgeOtherConfigs>>();
+        List<InstanceIdentifier<BridgeOtherConfigs>> result = new ArrayList<>();
 
         Bridge oldBridge = oldBridgeRows.get(bridge.getUuid());
 
@@ -143,8 +142,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
             InstanceIdentifier<Node> bridgeIid, Bridge bridge) {
         Preconditions.checkNotNull(bridgeIid);
         Preconditions.checkNotNull(bridge);
-        List<InstanceIdentifier<BridgeExternalIds>> result =
-                new ArrayList<InstanceIdentifier<BridgeExternalIds>>();
+        List<InstanceIdentifier<BridgeExternalIds>> result = new ArrayList<>();
 
         Bridge oldBridge = oldBridgeRows.get(bridge.getUuid());
 
@@ -168,8 +166,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
             InstanceIdentifier<Node> bridgeIid, Bridge bridge) {
         Preconditions.checkNotNull(bridgeIid);
         Preconditions.checkNotNull(bridge);
-        List<InstanceIdentifier<ProtocolEntry>> result =
-                new ArrayList<InstanceIdentifier<ProtocolEntry>>();
+        List<InstanceIdentifier<ProtocolEntry>> result = new ArrayList<>();
         Bridge oldBridge = oldBridgeRows.get(bridge.getUuid());
 
         try {
@@ -200,7 +197,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
         connectionNode.setNodeId(getOvsdbConnectionInstance().getNodeId());
 
         OvsdbNodeAugmentationBuilder ovsdbConnectionAugmentationBuilder = new OvsdbNodeAugmentationBuilder();
-        List<ManagedNodeEntry> managedBridges = new ArrayList<ManagedNodeEntry>();
+        List<ManagedNodeEntry> managedBridges = new ArrayList<>();
         InstanceIdentifier<Node> bridgeIid = SouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(),
                 bridge);
         ManagedNodeEntry managedBridge = new ManagedNodeEntryBuilder().setBridgeRef(
@@ -266,7 +263,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
                 .getOtherConfigColumn().getData();
         if (otherConfigs != null && !otherConfigs.isEmpty()) {
             Set<String> otherConfigKeys = otherConfigs.keySet();
-            List<BridgeOtherConfigs> otherConfigList = new ArrayList<BridgeOtherConfigs>();
+            List<BridgeOtherConfigs> otherConfigList = new ArrayList<>();
             String otherConfigValue;
             for (String otherConfigKey : otherConfigKeys) {
                 otherConfigValue = otherConfigs.get(otherConfigKey);
@@ -287,7 +284,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
                 .getData();
         if (externalIds != null && !externalIds.isEmpty()) {
             Set<String> externalIdKeys = externalIds.keySet();
-            List<BridgeExternalIds> externalIdsList = new ArrayList<BridgeExternalIds>();
+            List<BridgeExternalIds> externalIdsList = new ArrayList<>();
             String externalIdValue;
             for (String externalIdKey : externalIdKeys) {
                 externalIdValue = externalIds.get(externalIdKey);
diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java
new file mode 100644 (file)
index 0000000..42aff40
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * 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.ovsdb.southbound.transactions.md;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.ovsdb.lib.message.TableUpdates;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
+import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
+import org.opendaylight.ovsdb.schema.openvswitch.Manager;
+import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
+import org.opendaylight.ovsdb.southbound.OvsdbConnectionInstance;
+import org.opendaylight.ovsdb.southbound.SouthboundMapper;
+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.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntryKey;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+import com.google.common.base.Preconditions;
+
+public class OvsdbManagersRemovedCommand extends AbstractTransactionCommand {
+
+    private Map<UUID, OpenVSwitch> oldOpenVSwitchRows;
+    private Map<UUID, Manager> removedManagerRows;
+    private Map<UUID, OpenVSwitch> updatedOpenVSwitchRows;
+    private Map<UUID, Manager> updatedManagerRows;
+
+    public OvsdbManagersRemovedCommand(OvsdbConnectionInstance key,
+            TableUpdates updates, DatabaseSchema dbSchema) {
+        super(key, updates, dbSchema);
+        updatedOpenVSwitchRows = TyperUtils.extractRowsUpdated(OpenVSwitch.class, getUpdates(), getDbSchema());
+        oldOpenVSwitchRows = TyperUtils.extractRowsOld(OpenVSwitch.class, getUpdates(), getDbSchema());
+        updatedManagerRows = TyperUtils.extractRowsUpdated(Manager.class, getUpdates(), getDbSchema());
+        removedManagerRows = TyperUtils.extractRowsRemoved(Manager.class,
+                getUpdates(), getDbSchema());
+    }
+
+    @Override
+    public void execute(ReadWriteTransaction transaction) {
+        for (OpenVSwitch openVSwitch : updatedOpenVSwitchRows.values()) {
+            InstanceIdentifier<Node> ovsdbNodeIid =
+                    SouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance().getNodeId());
+            deleteManagers(transaction, managerEntriesToRemove(ovsdbNodeIid,openVSwitch));
+        }
+    }
+
+    private void deleteManagers(ReadWriteTransaction transaction,
+            List<InstanceIdentifier<ManagerEntry>> managerEntryIids) {
+        for (InstanceIdentifier<ManagerEntry> managerEntryIid: managerEntryIids) {
+            transaction.delete(LogicalDatastoreType.OPERATIONAL, managerEntryIid);
+        }
+    }
+
+    private List<InstanceIdentifier<ManagerEntry>> managerEntriesToRemove(
+            InstanceIdentifier<Node> ovsdbNodeIid, OpenVSwitch openVSwitch) {
+        Preconditions.checkNotNull(ovsdbNodeIid);
+        Preconditions.checkNotNull(openVSwitch);
+
+        List<InstanceIdentifier<ManagerEntry>> result =
+                new ArrayList<InstanceIdentifier<ManagerEntry>>();
+        OpenVSwitch oldOvsdbNode = oldOpenVSwitchRows.get(openVSwitch.getUuid());
+
+        if (oldOvsdbNode != null && oldOvsdbNode.getManagerOptionsColumn() != null) {
+            for (UUID managerUuid: oldOvsdbNode.getManagerOptionsColumn().getData()) {
+                if (openVSwitch.getManagerOptionsColumn() == null
+                        || !openVSwitch.getManagerOptionsColumn().getData().contains(managerUuid)) {
+                    Manager manager = removedManagerRows.get(managerUuid);
+                    if (!checkIfManagerPresentInUpdatedManagersList(manager)) {
+                        if (manager != null && manager.getTargetColumn() != null) {
+                            InstanceIdentifier<ManagerEntry> iid = ovsdbNodeIid
+                                    .augmentation(OvsdbNodeAugmentation.class)
+                                    .child(ManagerEntry.class,
+                                            new ManagerEntryKey(
+                                                    new Uri(manager.getTargetColumn().getData())));
+                            result.add(iid);
+                        }
+
+                    }
+                }
+            }
+        }
+        return result;
+    }
+
+    private boolean checkIfManagerPresentInUpdatedManagersList(Manager removedManager) {
+        for (Map.Entry<UUID, Manager> updatedManager : updatedManagerRows.entrySet()) {
+            if (updatedManager.getValue().getTargetColumn().getData()
+                    .equals(removedManager.getTargetColumn().getData())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}
diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersUpdateCommand.java
new file mode 100644 (file)
index 0000000..a33afc3
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * 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.ovsdb.southbound.transactions.md;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.ovsdb.lib.message.TableUpdates;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
+import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
+import org.opendaylight.ovsdb.schema.openvswitch.Manager;
+import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
+import org.opendaylight.ovsdb.southbound.OvsdbConnectionInstance;
+import org.opendaylight.ovsdb.southbound.SouthboundConstants;
+import org.opendaylight.ovsdb.southbound.SouthboundMapper;
+import org.opendaylight.ovsdb.southbound.SouthboundUtil;
+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.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry;
+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.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.Node;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+
+public class OvsdbManagersUpdateCommand extends AbstractTransactionCommand {
+    private static final Logger LOG = LoggerFactory.getLogger(OvsdbManagersUpdateCommand.class);
+
+    private Map<UUID, Manager> updatedManagerRows;
+    private Map<UUID, OpenVSwitch> updatedOpenVSwitchRows;
+
+    public OvsdbManagersUpdateCommand(OvsdbConnectionInstance key,
+            TableUpdates updates, DatabaseSchema dbSchema) {
+        super(key, updates, dbSchema);
+        updatedOpenVSwitchRows = TyperUtils.extractRowsUpdated(OpenVSwitch.class, getUpdates(), getDbSchema());
+        updatedManagerRows = TyperUtils.extractRowsUpdated(Manager.class,getUpdates(), getDbSchema());
+    }
+
+    @Override
+    public void execute(ReadWriteTransaction transaction) {
+        if (updatedManagerRows != null && !updatedManagerRows.isEmpty()) {
+            Map<Uri, Manager> updatedManagerRowsWithUri = getUriManagerMap(updatedManagerRows);
+            if (updatedOpenVSwitchRows != null && !updatedOpenVSwitchRows.isEmpty()) {
+                updateManagers(transaction, updatedManagerRows, updatedOpenVSwitchRows);
+            } else {
+                updateManagers(transaction, updatedManagerRowsWithUri);
+            }
+        }
+    }
+
+    /**
+     * Update the Manager values for the given {@link OpenVSwitch} list.
+     *
+     * <p>
+     * Manager and OpenVSwitch are independent tables in the Open_vSwitch schema
+     * but the OVSDB yang model includes the Manager fields in the
+     * OVSDB Node data. In some cases the OVSDB will send OpenVSwitch and Manager
+     * updates together and in other cases independently. This method here
+     * assumes the former.
+     * </p>
+     *
+     * @param transaction the {@link ReadWriteTransaction}
+     * @param updatedManagerRows updated {@link Manager} rows
+     * @param updatedOpenVSwitchRows updated {@link OpenVSwitch} rows
+     */
+    private void updateManagers(ReadWriteTransaction transaction,
+                                  Map<UUID, Manager> updatedManagerRows,
+                                  Map<UUID, OpenVSwitch> updatedOpenVSwitchRows) {
+
+        for (Map.Entry<UUID, OpenVSwitch> ovsdbNodeEntry : updatedOpenVSwitchRows.entrySet()) {
+            final List<ManagerEntry> managerEntries =
+                    SouthboundMapper.createManagerEntries(ovsdbNodeEntry.getValue(), updatedManagerRows);
+            LOG.debug("Update Ovsdb Node {} with manager entries {}",ovsdbNodeEntry.getValue(), managerEntries);
+            for (ManagerEntry managerEntry : managerEntries) {
+                transaction.merge(LogicalDatastoreType.OPERATIONAL,
+                        getManagerEntryIid(managerEntry),
+                        managerEntry);
+            }
+        }
+    }
+
+    /**
+     * Update the ManagerEntry values after finding the related {@OpenVSwitch} list.
+     *
+     * <p>
+     * Manager and OpenVSwitch are independent tables in the Open_vSwitch schema
+     * but the OVSDB yang model includes the Manager fields in the
+     * OvsdbNode data. In some cases the OVSDB will send OpenVSwitch and Manager
+     * updates together and in other cases independently. This method here
+     * assumes the latter.
+     * </p>
+     *
+     * @param transaction the {@link ReadWriteTransaction}
+     * @param updatedManagerRows updated {@link Manager} rows
+
+     */
+    private void updateManagers(ReadWriteTransaction transaction,
+                                  Map<Uri, Manager> updatedManagerRows) {
+
+        final InstanceIdentifier<Node> connectionIId = getOvsdbConnectionInstance().getInstanceIdentifier();
+        final Optional<Node> ovsdbNode = SouthboundUtil.readNode(transaction, connectionIId);
+        if (ovsdbNode.isPresent()) {
+            final List<ManagerEntry> managerEntries =
+                    SouthboundMapper.createManagerEntries(ovsdbNode.get(), updatedManagerRows);
+
+            LOG.debug("Update Ovsdb Node {} with manager entries {}",ovsdbNode.get(), managerEntries);
+            for (ManagerEntry managerEntry : managerEntries) {
+                InstanceIdentifier<ManagerEntry> iid = connectionIId
+                        .augmentation(OvsdbNodeAugmentation.class)
+                        .child(ManagerEntry.class, managerEntry.getKey());
+                transaction.merge(LogicalDatastoreType.OPERATIONAL,
+                        iid, managerEntry);
+            }
+        }
+    }
+
+    /**
+     * Create the {@link InstanceIdentifier} for the {@link ManagerEntry}.
+     *
+     * @param managerEntry the {@link ManagerEntry}
+     * @return the {@link InstanceIdentifier}
+     */
+    private InstanceIdentifier<ManagerEntry> getManagerEntryIid(ManagerEntry managerEntry) {
+
+        OvsdbConnectionInstance client = getOvsdbConnectionInstance();
+        String nodeString = client.getNodeKey().getNodeId().getValue();
+        NodeId nodeId = new NodeId(new Uri(nodeString));
+        NodeKey nodeKey = new NodeKey(nodeId);
+        InstanceIdentifier<Node> ovsdbNodeIid = InstanceIdentifier.builder(NetworkTopology.class)
+                .child(Topology.class,new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
+                .child(Node.class,nodeKey)
+                .build();
+
+        InstanceIdentifier<ManagerEntry> iid = ovsdbNodeIid
+                .augmentation(OvsdbNodeAugmentation.class)
+                .child(ManagerEntry.class, managerEntry.getKey());
+        return iid;
+    }
+
+    private Map<Uri, Manager> getUriManagerMap(Map<UUID,Manager> uuidManagerMap) {
+        Map<Uri, Manager> uriManagerMap = new HashMap<>();
+        for (Map.Entry<UUID, Manager> uuidManagerMapEntry : uuidManagerMap.entrySet()) {
+            uriManagerMap.put(
+                    new Uri(uuidManagerMapEntry.getValue().getTargetColumn().getData()),
+                    uuidManagerMapEntry.getValue());
+        }
+        return uriManagerMap;
+
+    }
+}
index 63424f7d3c4f8717f33ef8ed13585ae59bd2be70..66b8c0745f1cc96e195a868efd093c82e4baf592 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 import org.opendaylight.ovsdb.southbound.OvsdbConnectionInstance;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagedNodeEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,6 +26,8 @@ import com.google.common.util.concurrent.CheckedFuture;
 
 public class OvsdbNodeRemoveCommand extends AbstractTransactionCommand {
     private static final Logger LOG = LoggerFactory.getLogger(OvsdbNodeRemoveCommand.class);
+    private static final long ONE_CONNECTED_MANAGER = 1;
+    private static final long ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE = 1;
 
     public OvsdbNodeRemoveCommand(OvsdbConnectionInstance key,TableUpdates updates,DatabaseSchema dbSchema) {
         super(key,updates,dbSchema);
@@ -40,23 +43,55 @@ public class OvsdbNodeRemoveCommand extends AbstractTransactionCommand {
             if (ovsdbNodeOptional.isPresent()) {
                 Node ovsdbNode = ovsdbNodeOptional.get();
                 OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
-                if (ovsdbNodeAugmentation != null) {
-                    if (ovsdbNodeAugmentation.getManagedNodeEntry() != null) {
-                        for (ManagedNodeEntry managedNode : ovsdbNodeAugmentation.getManagedNodeEntry()) {
-                            transaction.delete(LogicalDatastoreType.OPERATIONAL, managedNode.getBridgeRef().getValue());
+                if (checkIfOnlyConnectedManager(ovsdbNodeAugmentation)) {
+                    if (ovsdbNodeAugmentation != null) {
+                        if (ovsdbNodeAugmentation.getManagedNodeEntry() != null) {
+                            for (ManagedNodeEntry managedNode : ovsdbNodeAugmentation.getManagedNodeEntry()) {
+                                transaction.delete(
+                                        LogicalDatastoreType.OPERATIONAL, managedNode.getBridgeRef().getValue());
+                            }
+                        } else {
+                            LOG.debug("{} had no managed nodes", ovsdbNode.getNodeId().getValue());
                         }
                     } else {
-                        LOG.debug("{} had no managed nodes", ovsdbNode.getNodeId().getValue());
+                        LOG.warn("{} had no OvsdbNodeAugmentation", ovsdbNode.getNodeId().getValue());
                     }
+                    transaction.delete(LogicalDatastoreType.OPERATIONAL,
+                            getOvsdbConnectionInstance().getInstanceIdentifier());
                 } else {
-                    LOG.warn("{} had no OvsdbNodeAugmentation", ovsdbNode.getNodeId().getValue());
+                    LOG.debug("Other southbound plugin instances in cluster are connected to the device,"
+                            + " not deleting OvsdbNode form data store.");
                 }
-                transaction.delete(LogicalDatastoreType.OPERATIONAL,
-                        getOvsdbConnectionInstance().getInstanceIdentifier());
             }
         } catch (Exception e) {
             LOG.warn("Failure to delete ovsdbNode {}",e);
         }
     }
 
+    private boolean checkIfOnlyConnectedManager(OvsdbNodeAugmentation ovsdbNodeAugmentation) {
+        ManagerEntry onlyConnectedManager = null;
+        if (ovsdbNodeAugmentation != null) {
+            int connectedManager = 0;
+            for (ManagerEntry manager : ovsdbNodeAugmentation.getManagerEntry()) {
+                if (manager.isConnected()) {
+                    connectedManager++;
+                    if (connectedManager > ONE_CONNECTED_MANAGER) {
+                        return false;
+                    }
+                    onlyConnectedManager = manager;
+                }
+            }
+            if (connectedManager == 0) {
+                return true;
+            }
+        }
+        /*When switch is listening in passive mode, this number represent number of active connection to the device
+        This is to handle the controller initiated connection scenario, where all the controller will connect, but
+        switch will have only one manager.
+        */
+        if (onlyConnectedManager.getNumberOfConnections().longValue() > ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE) {
+            return false;
+        }
+        return true;
+    }
 }
index 11477892240706637018d8330e661dc1accee81f..53b35af72733744716417929e5e702881a929342 100644 (file)
@@ -24,6 +24,8 @@ public class OvsdbOperationalCommandAggregator implements TransactionCommand {
     public OvsdbOperationalCommandAggregator(OvsdbConnectionInstance key,TableUpdates updates,
             DatabaseSchema dbSchema) {
         commands.add(new OpenVSwitchUpdateCommand(key, updates, dbSchema));
+        commands.add(new OvsdbManagersUpdateCommand(key, updates,  dbSchema));
+        commands.add(new OvsdbManagersRemovedCommand(key, updates,  dbSchema));
         commands.add(new OvsdbBridgeUpdateCommand(key, updates,  dbSchema));
         commands.add(new OvsdbBridgeRemovedCommand(key, updates,  dbSchema));
         commands.add(new OvsdbControllerUpdateCommand(key, updates,  dbSchema));
diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManagerTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManagerTest.java
new file mode 100644 (file)
index 0000000..0e48534
--- /dev/null
@@ -0,0 +1,265 @@
+package org.opendaylight.ovsdb.southbound;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.net.InetAddress;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.ovsdb.lib.OvsdbClient;
+import org.opendaylight.ovsdb.lib.OvsdbConnection;
+import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
+import org.opendaylight.ovsdb.southbound.transactions.md.TransactionCommand;
+import org.opendaylight.ovsdb.southbound.transactions.md.TransactionInvoker;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAttributes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.api.support.membermodification.MemberMatcher;
+import org.powermock.api.support.membermodification.MemberModifier;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+
+import com.google.common.base.Optional;
+
+@PrepareForTest({SouthboundMapper.class, OvsdbConnectionManager.class, OvsdbConnectionService.class, InstanceIdentifier.class, SouthboundUtil.class, Optional.class})
+@RunWith(PowerMockRunner.class)
+public class OvsdbConnectionManagerTest {
+
+    @Mock private OvsdbConnectionManager ovsdbConnectionManager;
+    @Mock private DataBroker db;
+    @Mock private TransactionInvoker txInvoker;
+    private Map<ConnectionInfo,OvsdbConnectionInstance> clients;
+    private Map<ConnectionInfo,InstanceIdentifier<Node>> instanceIdentifiers;
+    @Mock private InstanceIdentifier<Node> iid;
+
+    @Before
+    public void setUp() throws Exception {
+        ovsdbConnectionManager = PowerMockito.mock(OvsdbConnectionManager.class, Mockito.CALLS_REAL_METHODS);
+        MemberModifier.field(OvsdbConnectionManager.class, "db").set(ovsdbConnectionManager, db);
+        MemberModifier.field(OvsdbConnectionManager.class, "txInvoker").set(ovsdbConnectionManager, txInvoker);
+    }
+    @Test
+    public void testConnected() {
+        OvsdbConnectionInstance client = mock(OvsdbConnectionInstance.class);
+        OvsdbClient externalClient = mock(OvsdbClient.class);
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "connectedButCallBacksNotRegistered", OvsdbClient.class));
+        when(ovsdbConnectionManager.connectedButCallBacksNotRegistered(any(OvsdbClient.class))).thenReturn(client);
+        doNothing().when(client).registerCallbacks();
+        ovsdbConnectionManager.connected(externalClient);
+        verify(client).registerCallbacks();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testConnectedButCallBacksNotRegistered() throws Exception {
+        OvsdbClient externalClient = mock(OvsdbClient.class, Mockito.RETURNS_DEEP_STUBS);
+        OvsdbConnectionInstance client = mock(OvsdbConnectionInstance.class);
+
+        InetAddress ip = mock(InetAddress.class);
+
+        when(externalClient.getConnectionInfo().getRemoteAddress()).thenReturn(ip);
+        when(externalClient.getConnectionInfo().getRemotePort()).thenReturn(new Integer(8080));
+
+        ConnectionInfo key = mock(ConnectionInfo.class);
+        PowerMockito.mockStatic(SouthboundMapper.class);
+        when(SouthboundMapper.createConnectionInfo(any(OvsdbClient.class))).thenReturn(key);
+
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getInstanceIdentifier", ConnectionInfo.class));
+        InstanceIdentifier<Node> iid = mock(InstanceIdentifier.class);
+        when(ovsdbConnectionManager.getInstanceIdentifier(key)).thenReturn(iid);
+
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "putConnectionInstance", ConnectionInfo.class, OvsdbConnectionInstance.class));
+        doNothing().when(client).createTransactInvokers();
+        PowerMockito.whenNew(OvsdbConnectionInstance.class).
+        withArguments(any(ConnectionInfo.class), any(OvsdbClient.class),any(TransactionInvoker.class), any(InstanceIdentifier.class)).
+        thenReturn(client);
+
+        assertEquals("Error, did not receive correct OvsdbConnectionInstance object", client, ovsdbConnectionManager.connectedButCallBacksNotRegistered(externalClient));
+    }
+
+    @Test
+    public void testDisconnected() throws Exception {
+        OvsdbClient client = mock(OvsdbClient.class, Mockito.RETURNS_DEEP_STUBS);
+        OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class);
+        InetAddress ip = mock(InetAddress.class);
+        when(client.getConnectionInfo().getRemoteAddress()).thenReturn(ip);
+        when(client.getConnectionInfo().getRemotePort()).thenReturn(new Integer(8080));
+
+        ConnectionInfo key = mock(ConnectionInfo.class);
+        PowerMockito.mockStatic(SouthboundMapper.class);
+        when(SouthboundMapper.createConnectionInfo(any(OvsdbClient.class))).thenReturn(key);
+
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", ConnectionInfo.class));
+        when(ovsdbConnectionManager.getConnectionInstance(any(ConnectionInfo.class))).thenReturn(ovsdbConnectionInstance);
+        doNothing().when(txInvoker).invoke(any(TransactionCommand.class));
+
+        clients = new ConcurrentHashMap<ConnectionInfo,OvsdbConnectionInstance>();
+        clients.put(key, ovsdbConnectionInstance);
+        MemberModifier.field(OvsdbConnectionManager.class, "clients").set(ovsdbConnectionManager, clients);
+        ovsdbConnectionManager.disconnected(client);
+        Map<ConnectionInfo,OvsdbConnectionInstance> testClients = Whitebox.getInternalState(ovsdbConnectionManager, "clients");
+        assertEquals("Error, size of the hashmap is incorrect", 0, testClients.size());
+    }
+
+    @Test
+    public void testDisconnect() throws Exception {
+        OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
+        ConnectionInfo connectionInfo = mock(ConnectionInfo.class);
+        when(ovsdbNode.getConnectionInfo()).thenReturn(connectionInfo);
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", ConnectionInfo.class));
+        OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class);
+        when(ovsdbConnectionManager.getConnectionInstance(any(ConnectionInfo.class))).thenReturn(ovsdbConnectionInstance);
+
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "removeInstanceIdentifier", ConnectionInfo.class));
+        ovsdbConnectionManager.disconnect(ovsdbNode);
+        verify((OvsdbClient)ovsdbConnectionInstance).disconnect();
+    }
+
+    @Test
+    public void testInit() {
+        ConnectionInfo key = mock(ConnectionInfo.class);
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", ConnectionInfo.class));
+        OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class);
+        when(ovsdbConnectionManager.getConnectionInstance(any(ConnectionInfo.class))).thenReturn(ovsdbConnectionInstance);
+
+        //client not null
+        ovsdbConnectionManager.init(key);
+        verify(ovsdbConnectionInstance).registerCallbacks();
+    }
+
+    @Test
+    public void testClose() throws Exception {
+        ConnectionInfo key1 = mock(ConnectionInfo.class);
+        ConnectionInfo key2 = mock(ConnectionInfo.class);
+        OvsdbConnectionInstance ovsdbConnectionInstance1 = mock(OvsdbConnectionInstance.class);
+        OvsdbConnectionInstance ovsdbConnectionInstance2 = mock(OvsdbConnectionInstance.class);
+        clients = new ConcurrentHashMap<ConnectionInfo,OvsdbConnectionInstance>();
+        clients.put(key1, ovsdbConnectionInstance1);
+        clients.put(key2, ovsdbConnectionInstance2);
+        MemberModifier.field(OvsdbConnectionManager.class, "clients").set(ovsdbConnectionManager, clients);
+        ovsdbConnectionManager.close();
+        verify(ovsdbConnectionInstance1).disconnect();
+        verify(ovsdbConnectionInstance2).disconnect();
+    }
+
+    @Test
+    public void testPutAndGetConnectionInstance() throws Exception {
+        ConnectionInfo key = mock(ConnectionInfo.class);
+        ConnectionInfo connectionInfo = mock(ConnectionInfo.class);
+        OvsdbConnectionInstance instance = mock(OvsdbConnectionInstance.class);
+        PowerMockito.mockStatic(SouthboundMapper.class);
+        when(SouthboundMapper.suppressLocalIpPort(key)).thenReturn(connectionInfo);
+
+        clients = new ConcurrentHashMap<ConnectionInfo,OvsdbConnectionInstance>();
+        MemberModifier.field(OvsdbConnectionManager.class, "clients").set(ovsdbConnectionManager, clients);
+
+        //Test putConnectionInstance()
+        Whitebox.invokeMethod(ovsdbConnectionManager, "putConnectionInstance", key, instance);
+        Map<ConnectionInfo,OvsdbConnectionInstance> testClients = Whitebox.getInternalState(ovsdbConnectionManager, "clients");
+        assertEquals("Error, size of the hashmap is incorrect", 1, testClients.size());
+
+        //Test getConnectionInstance(ConnectionInfo key)
+        assertEquals("Error, returned incorrect OvsdbConnectionInstance object", instance, ovsdbConnectionManager.getConnectionInstance(key));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testPutandGetInstanceIdentifier() throws Exception {
+        ConnectionInfo key = mock(ConnectionInfo.class);
+        ConnectionInfo connectionInfo = mock(ConnectionInfo.class);
+        InstanceIdentifier<Node> iid = mock(InstanceIdentifier.class);
+        PowerMockito.mockStatic(SouthboundMapper.class);
+        when(SouthboundMapper.suppressLocalIpPort(key)).thenReturn(connectionInfo);
+
+        instanceIdentifiers = new ConcurrentHashMap<ConnectionInfo,InstanceIdentifier<Node>>();
+        MemberModifier.field(OvsdbConnectionManager.class, "instanceIdentifiers").set(ovsdbConnectionManager, instanceIdentifiers);
+
+        //Test putInstanceIdentifier()
+        Whitebox.invokeMethod(ovsdbConnectionManager, "putInstanceIdentifier", key, iid);
+        Map<ConnectionInfo,OvsdbConnectionInstance> testIids = Whitebox.getInternalState(ovsdbConnectionManager, "instanceIdentifiers");
+        assertEquals("Error, size of the hashmap is incorrect", 1, testIids.size());
+
+        //Test getInstanceIdentifier()
+        assertEquals("Error returning correct InstanceIdentifier object",iid , ovsdbConnectionManager.getInstanceIdentifier(key));
+
+        //Test removeInstanceIdentifier()
+        Whitebox.invokeMethod(ovsdbConnectionManager, "removeInstanceIdentifier", key);
+        Map<ConnectionInfo,OvsdbConnectionInstance> testRemoveIids = Whitebox.getInternalState(ovsdbConnectionManager, "instanceIdentifiers");
+        assertEquals("Error, size of the hashmap is incorrect", 0, testRemoveIids.size());
+    }
+
+    @Test
+    public void testGetClient() {
+        OvsdbClient ovsdbClient = mock(OvsdbConnectionInstance.class);
+
+        //Test getClient(ConnectionInfo connectionInfo)
+        ConnectionInfo key = mock(ConnectionInfo.class);
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", ConnectionInfo.class));
+        when(ovsdbConnectionManager.getConnectionInstance(key)).thenReturn((OvsdbConnectionInstance)ovsdbClient);
+        assertEquals("Error getting correct OvsdbClient object", ovsdbClient, ovsdbConnectionManager.getClient(key));
+
+        //Test getClient(OvsdbBridgeAttributes mn)
+        OvsdbBridgeAttributes mn = mock(OvsdbBridgeAttributes.class);
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", OvsdbBridgeAttributes.class));
+        when(ovsdbConnectionManager.getConnectionInstance(mn)).thenReturn((OvsdbConnectionInstance)ovsdbClient);
+        assertEquals("Error getting correct OvsdbClient object", ovsdbClient, ovsdbConnectionManager.getClient(mn));
+
+        //Test getClient(Node node)
+        Node node = mock(Node.class);
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", Node.class));
+        when(ovsdbConnectionManager.getConnectionInstance(node)).thenReturn((OvsdbConnectionInstance)ovsdbClient);
+        assertEquals("Error getting correct OvsdbClient object", ovsdbClient, ovsdbConnectionManager.getClient(node));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testConnect() throws Exception {
+        OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
+        ConnectionInfo connectionInfo = mock(ConnectionInfo.class);
+        when(ovsdbNode.getConnectionInfo()).thenReturn(connectionInfo);
+        IpAddress ipAddr = mock(IpAddress.class);
+        when(connectionInfo.getRemoteIp()).thenReturn(ipAddr);
+
+        PowerMockito.mockStatic(SouthboundMapper.class);
+        InetAddress ip = mock(InetAddress.class);
+        when(SouthboundMapper.createInetAddress(any(IpAddress.class))).thenReturn(ip);
+
+        OvsdbClient client = mock(OvsdbClient.class);
+        OvsdbConnection ovsdbConnection = mock(OvsdbConnection.class);
+        PowerMockito.mockStatic(OvsdbConnectionService.class);
+        when(OvsdbConnectionService.getService()).thenReturn(ovsdbConnection);
+        PortNumber port = mock(PortNumber.class);
+        when(connectionInfo.getRemotePort()).thenReturn(port);
+        when(port.getValue()).thenReturn(new Integer(8080));
+        when(ovsdbConnection.connect(any(InetAddress.class), anyInt())).thenReturn(client);
+
+        //client not null case
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "putInstanceIdentifier", ConnectionInfo.class, InstanceIdentifier.class));
+        MemberModifier.suppress(MemberMatcher.method(OvsdbConnectionManager.class, "connectedButCallBacksNotRegistered", OvsdbClient.class));
+
+        PowerMockito.doNothing().when(ovsdbConnectionManager, "putInstanceIdentifier", any(ConnectionInfo.class), any(InstanceIdentifier.class));
+
+        OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class);
+        when(ovsdbConnectionManager.connectedButCallBacksNotRegistered(any(OvsdbClient.class))).thenReturn(ovsdbConnectionInstance);
+
+        assertEquals("ERROR", client, ovsdbConnectionManager.connect(PowerMockito.mock(InstanceIdentifier.class), ovsdbNode));
+    }
+}
diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListenerTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListenerTest.java
new file mode 100644 (file)
index 0000000..9760b10
--- /dev/null
@@ -0,0 +1,242 @@
+package org.opendaylight.ovsdb.southbound;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.reset;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+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.AsyncDataChangeEvent;
+import org.opendaylight.ovsdb.lib.OvsdbClient;
+import org.opendaylight.ovsdb.southbound.ovsdb.transact.BridgeOperationalState;
+import org.opendaylight.ovsdb.southbound.ovsdb.transact.DataChangesManagedByOvsdbNodeEvent;
+import org.opendaylight.ovsdb.southbound.ovsdb.transact.TransactCommandAggregator;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
+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.network.topology.topology.Node;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.api.support.membermodification.MemberMatcher;
+import org.powermock.api.support.membermodification.MemberModifier;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+
+@PrepareForTest({InstanceIdentifier.class, OvsdbDataChangeListener.class, SouthboundMapper.class})
+@RunWith(PowerMockRunner.class)
+public class OvsdbDataChangeListenerTest {
+    @Mock private ListenerRegistration<DataChangeListener> registration;
+    @Mock private OvsdbConnectionManager cm;
+    @Mock private DataBroker db;
+    @Mock private OvsdbDataChangeListener ovsdbDataChangeListener;
+
+    @Before
+    public void setUp() throws Exception {
+        ovsdbDataChangeListener = PowerMockito.mock(OvsdbDataChangeListener.class, Mockito.CALLS_REAL_METHODS);
+        MemberModifier.field(OvsdbDataChangeListener.class, "cm").set(ovsdbDataChangeListener, cm);
+        MemberModifier.field(OvsdbDataChangeListener.class, "db").set(ovsdbDataChangeListener, db);
+        MemberModifier.field(OvsdbDataChangeListener.class, "registration").set(ovsdbDataChangeListener, registration);
+    }
+
+    @Test
+    public void testClose() throws Exception {
+        doNothing().when(registration).close();
+        ovsdbDataChangeListener.close();
+        verify(registration).close();
+    }
+
+    @SuppressWarnings({ "unchecked" })
+    @Test
+    public void testOnDataChanged() throws Exception {
+        AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
+        Map<InstanceIdentifier<?>, DataObject> map = new HashMap<InstanceIdentifier<?>, DataObject>();
+        InstanceIdentifier<?> iid1 = mock(InstanceIdentifier.class);
+        OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
+        map.put(iid1, ovsdbNode);
+        when(changes.getCreatedData()).thenReturn(map);
+        ConnectionInfo key = mock(ConnectionInfo.class);
+        when(ovsdbNode.getConnectionInfo()).thenReturn(key);
+
+        //suppress calls to these functions
+        MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "connect", AsyncDataChangeEvent.class));
+        MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "updateConnections", AsyncDataChangeEvent.class));
+        MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "updateData", AsyncDataChangeEvent.class));
+        MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "disconnect", AsyncDataChangeEvent.class));
+        MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "init", AsyncDataChangeEvent.class));
+
+        //iid null case
+        when(cm.getInstanceIdentifier(any(ConnectionInfo.class))).thenReturn(null);
+        ovsdbDataChangeListener.onDataChanged(changes);
+
+        PowerMockito.verifyPrivate(ovsdbDataChangeListener, times(1)).invoke("connect", any(AsyncDataChangeEvent.class));
+        PowerMockito.verifyPrivate(ovsdbDataChangeListener, times(1)).invoke("updateConnections", any(AsyncDataChangeEvent.class));
+        PowerMockito.verifyPrivate(ovsdbDataChangeListener, times(1)).invoke("updateData", any(AsyncDataChangeEvent.class));
+        PowerMockito.verifyPrivate(ovsdbDataChangeListener, times(1)).invoke("disconnect", any(AsyncDataChangeEvent.class));
+        PowerMockito.verifyPrivate(ovsdbDataChangeListener, times(1)).invoke("init", any(AsyncDataChangeEvent.class));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testUpdateData() throws Exception {
+        AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
+        Map<InstanceIdentifier<Node>, OvsdbConnectionInstance> map = new HashMap<InstanceIdentifier<Node>, OvsdbConnectionInstance>();
+        InstanceIdentifier<Node> iid = mock(InstanceIdentifier.class);
+        OvsdbConnectionInstance connectionInstance = mock(OvsdbConnectionInstance.class);
+        map.put(iid, connectionInstance);
+
+        MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "connectionInstancesFromChanges", AsyncDataChangeEvent.class));
+        when(ovsdbDataChangeListener.connectionInstancesFromChanges(any(AsyncDataChangeEvent.class))).thenReturn(map);
+        TransactCommandAggregator transactCommandAggregator = mock(TransactCommandAggregator.class);
+        BridgeOperationalState bridgeOperationalState = mock(BridgeOperationalState.class);
+        DataChangesManagedByOvsdbNodeEvent dataChangesManagedByOvsdbNodeEvent = mock(DataChangesManagedByOvsdbNodeEvent.class);
+        PowerMockito.whenNew(DataChangesManagedByOvsdbNodeEvent.class).withArguments(any(InstanceIdentifier.class), any(AsyncDataChangeEvent.class)).thenReturn(dataChangesManagedByOvsdbNodeEvent);
+        PowerMockito.whenNew(BridgeOperationalState.class).withArguments(any(DataBroker.class), any(AsyncDataChangeEvent.class)).thenReturn(bridgeOperationalState);
+        PowerMockito.whenNew(TransactCommandAggregator.class).withArguments(any(BridgeOperationalState.class), any(AsyncDataChangeEvent.class)).thenReturn(transactCommandAggregator);
+
+        when(connectionInstance.getInstanceIdentifier()).thenReturn(iid);
+        doNothing().when(connectionInstance).transact(transactCommandAggregator);
+
+        Whitebox.invokeMethod(ovsdbDataChangeListener, "updateData", changes);
+        verify(connectionInstance).transact(transactCommandAggregator);
+        verify(ovsdbDataChangeListener).connectionInstancesFromChanges(changes);
+    }
+
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @Test
+    public void testDisconnectAndConnectAndInit() throws Exception {
+        AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
+        Map<InstanceIdentifier<?>, DataObject> originalDataObject = new HashMap<InstanceIdentifier<?>, DataObject>();
+        Set<InstanceIdentifier<?>> iiD = new HashSet<InstanceIdentifier<?>>();
+        InstanceIdentifier instanceIdentifier = mock(InstanceIdentifier.class);
+        OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
+        iiD.add(instanceIdentifier);
+        originalDataObject.put(instanceIdentifier, ovsdbNode);
+        when(changes.getRemovedPaths()).thenReturn(iiD);
+        when(changes.getOriginalData()).thenReturn(originalDataObject);
+        doNothing().when(cm).disconnect(any(OvsdbNodeAugmentation.class));
+
+        //test disconnect()
+        Whitebox.invokeMethod(ovsdbDataChangeListener, "disconnect", changes);
+        verify(cm).disconnect(any(OvsdbNodeAugmentation.class));
+
+        //test connect()
+        when(changes.getCreatedData()).thenReturn(originalDataObject);
+        Whitebox.invokeMethod(ovsdbDataChangeListener, "connect", changes);
+        verify(cm).disconnect(any(OvsdbNodeAugmentation.class));
+
+        //test init
+        ConnectionInfo connectionInfo = mock(ConnectionInfo.class);
+        when(ovsdbNode.getConnectionInfo()).thenReturn(connectionInfo);
+        Whitebox.invokeMethod(ovsdbDataChangeListener, "init", changes);
+        verify(cm).init(any(ConnectionInfo.class));
+    }
+
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @Test
+    public void testUpdateConnections() throws Exception {
+        AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
+        Map<InstanceIdentifier<?>, DataObject> map = new HashMap<InstanceIdentifier<?>, DataObject>();
+        InstanceIdentifier instanceIdentifier = mock(InstanceIdentifier.class);
+        OvsdbNodeAugmentation value = mock(OvsdbNodeAugmentation.class);
+        map.put(instanceIdentifier, value);
+
+        when(changes.getUpdatedData()).thenReturn(map);
+        OvsdbClient client = mock(OvsdbClient.class);
+        ConnectionInfo connectionInfo = mock(ConnectionInfo.class);
+        when(value.getConnectionInfo()).thenReturn(connectionInfo);
+        when(cm.getClient(any(ConnectionInfo.class))).thenReturn(null);
+
+        when(changes.getOriginalData()).thenReturn(map);
+        doNothing().when(cm).disconnect(any(OvsdbNodeAugmentation.class));
+        when(cm.connect(any(InstanceIdentifier.class), any(OvsdbNodeAugmentation.class))).thenReturn(client);
+        Whitebox.invokeMethod(ovsdbDataChangeListener, "updateConnections", changes);
+        verify(cm).connect(any(InstanceIdentifier.class), any(OvsdbNodeAugmentation.class));
+        verify(cm).disconnect(any(OvsdbNodeAugmentation.class));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testConnectionInstancesFromChanges() throws Exception {
+        AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
+        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> testResultMap = new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
+        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> map1 = new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
+        InstanceIdentifier<Node> key1 = mock(InstanceIdentifier.class);
+        OvsdbConnectionInstance value1 = mock(OvsdbConnectionInstance.class);
+        map1.put(key1, value1);
+
+        MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "connectionInstancesFromMap", HashMap.class));
+        when(ovsdbDataChangeListener.connectionInstancesFromMap(any(HashMap.class))).thenReturn(map1);
+
+        testResultMap.put(key1, value1);
+        reset(ovsdbDataChangeListener);
+        assertEquals("Error returning correct Map", testResultMap, ovsdbDataChangeListener.connectionInstancesFromChanges(changes));
+        verify(ovsdbDataChangeListener, times(3)).connectionInstancesFromMap(any(HashMap.class));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testConnectionInstancesFromMap() {
+        reset(cm);
+        Map<InstanceIdentifier<?>,DataObject> map = new HashMap<InstanceIdentifier<?>,DataObject>();
+        Node node = mock(Node.class);
+        InstanceIdentifier<Node> iid = mock(InstanceIdentifier.class);
+        map.put(iid, node);
+        OvsdbConnectionInstance client = mock(OvsdbConnectionInstance.class);
+
+        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> testResultMap = new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
+        testResultMap.put(iid, client);
+
+        //bridge and client not null case
+        when(cm.getConnectionInstance(any(OvsdbBridgeAugmentation.class))).thenReturn(client);
+        OvsdbBridgeAugmentation bridge = mock(OvsdbBridgeAugmentation.class);
+        when(node.getAugmentation(OvsdbBridgeAugmentation.class)).thenReturn(bridge);
+        assertEquals("Error returning correct Map", testResultMap, ovsdbDataChangeListener.connectionInstancesFromMap(map));
+        verify(cm).getConnectionInstance(any(OvsdbBridgeAugmentation.class));
+
+        //bridge null, ovsnode not null and client not null case
+        when(node.getAugmentation(OvsdbBridgeAugmentation.class)).thenReturn(null);
+        OvsdbNodeAugmentation ovsNode = mock(OvsdbNodeAugmentation.class);
+        ConnectionInfo connectionInfo = mock(ConnectionInfo.class);
+        when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsNode);
+        when(ovsNode.getConnectionInfo()).thenReturn(connectionInfo);
+        when(cm.getConnectionInstance(any(ConnectionInfo.class))).thenReturn(client);
+        assertEquals("Error returning correct Map", testResultMap, ovsdbDataChangeListener.connectionInstancesFromMap(map));
+        verify(cm).getConnectionInstance(any(ConnectionInfo.class));
+
+        //bridge null, ovsnode null, and client not null case
+        when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(null);
+        List<TerminationPoint> terminationPoint = new ArrayList<TerminationPoint>();
+        terminationPoint.add(0, mock(TerminationPoint.class));
+        when(node.getTerminationPoint()).thenReturn(terminationPoint);
+        PowerMockito.mockStatic(SouthboundMapper.class);
+        InstanceIdentifier<Node> nodeIid = mock(InstanceIdentifier.class);
+        when(node.getNodeId()).thenReturn(mock(NodeId.class));
+        when(SouthboundMapper.createInstanceIdentifier(any(NodeId.class))).thenReturn(nodeIid);
+        when(cm.getConnectionInstance(any(InstanceIdentifier.class))).thenReturn(client);
+        assertEquals("Error returning correct Map", testResultMap, ovsdbDataChangeListener.connectionInstancesFromMap(map));
+        verify(node).getTerminationPoint();
+        verify(cm).getConnectionInstance(any(InstanceIdentifier.class));
+    }
+}
index b3ef1a4b21f207aba8f7fb8b75460acf8fdd3ecf..0aed67f2170a500ddf6932ad5943c6f3e9ef1903 100644 (file)
@@ -335,8 +335,12 @@ public class SouthboundIT extends AbstractMdsalTestBase {
     }
 
     private boolean addOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException {
+        InstanceIdentifier<Node> iid = createInstanceIdentifier(connectionInfo);
+        // Check that the node doesn't already exist (we don't support connecting twice)
+        Assert.assertNull("The OVSDB node has already been added",
+                mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, iid));
         boolean result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION,
-                createInstanceIdentifier(connectionInfo),
+                iid,
                 createNode(connectionInfo));
         Thread.sleep(OVSDB_UPDATE_TIMEOUT);
         return result;
index 573ea2c083eb355b0fd215df7c823d8af75bc49c..c819d7729f9031c4ca7647f776db5b636c30317a 100644 (file)
@@ -47,7 +47,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <dependencies>
     <!-- Yang Models -->
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-inet-types</artifactId>
     </dependency>
     <dependency>
@@ -59,11 +59,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>model-flow-base</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.yangtools.model</groupId>
+      <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>opendaylight-l2-types</artifactId>
     </dependency>
     <!-- Controller Dependencies -->
diff --git a/utils/mdsal-utils/pom.xml b/utils/mdsal-utils/pom.xml
new file mode 100644 (file)
index 0000000..c218c8b
--- /dev/null
@@ -0,0 +1,49 @@
+<?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.mdsal</groupId>
+    <artifactId>binding-parent</artifactId>
+    <version>0.8.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.opendaylight.ovsdb</groupId>
+  <artifactId>utils.mdsal-utils</artifactId>
+  <version>1.2.0-SNAPSHOT</version>
+  <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>
+      <version>1.3.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</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>
+
+</project>
\ No newline at end of file
diff --git a/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtils.java b/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtils.java
new file mode 100644 (file)
index 0000000..642ba08
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2015 Red Hat, 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.ovsdb.utils.mdsal.utils;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+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.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MdsalUtils {
+    private static final Logger LOG = LoggerFactory.getLogger(MdsalUtils.class);
+    private DataBroker databroker = null;
+
+    /**
+     * Class constructor setting the data broker.
+     *
+     * @param dataBroker the {@link org.opendaylight.controller.md.sal.binding.api.DataBroker}
+     */
+    public MdsalUtils(DataBroker dataBroker) {
+        this.databroker = dataBroker;
+    }
+
+    /**
+     * Executes delete as a blocking transaction.
+     *
+     * @param store {@link LogicalDatastoreType} which should be modified
+     * @param path {@link InstanceIdentifier} to read from
+     * @param <D> the data object type
+     * @return the result of the request
+     */
+    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean delete(
+            final LogicalDatastoreType store, final InstanceIdentifier<D> path)  {
+        boolean result = false;
+        final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
+        transaction.delete(store, path);
+        CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
+        try {
+            future.checkedGet();
+            result = true;
+        } catch (TransactionCommitFailedException e) {
+            LOG.warn("Failed to delete {} ", path, e);
+        }
+        return result;
+    }
+
+    /**
+     * Executes merge as a blocking transaction.
+     *
+     * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
+     * @param path {@link InstanceIdentifier} for path to read
+     * @param <D> the data object type
+     * @return the result of the request
+     */
+    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean merge(
+            final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data)  {
+        boolean result = false;
+        final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
+        transaction.merge(logicalDatastoreType, path, data, true);
+        CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
+        try {
+            future.checkedGet();
+            result = true;
+        } catch (TransactionCommitFailedException e) {
+            LOG.warn("Failed to merge {} ", path, e);
+        }
+        return result;
+    }
+
+    /**
+     * Executes put as a blocking transaction.
+     *
+     * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
+     * @param path {@link InstanceIdentifier} for path to read
+     * @param <D> the data object type
+     * @return the result of the request
+     */
+    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean put(
+            final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data)  {
+        boolean result = false;
+        final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
+        transaction.put(logicalDatastoreType, path, data, true);
+        CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
+        try {
+            future.checkedGet();
+            result = true;
+        } catch (TransactionCommitFailedException e) {
+            LOG.warn("Failed to put {} ", path, e);
+        }
+        return result;
+    }
+
+    /**
+     * Executes read as a blocking transaction.
+     *
+     * @param store {@link LogicalDatastoreType} to read
+     * @param path {@link InstanceIdentifier} for path to read
+     * @param <D> the data object type
+     * @return the result as the data object requested
+     */
+    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> D read(
+            final LogicalDatastoreType store, final InstanceIdentifier<D> path)  {
+        D result = null;
+        final ReadOnlyTransaction transaction = databroker.newReadOnlyTransaction();
+        Optional<D> optionalDataObject;
+        CheckedFuture<Optional<D>, ReadFailedException> future = transaction.read(store, path);
+        try {
+            optionalDataObject = future.checkedGet();
+            if (optionalDataObject.isPresent()) {
+                result = optionalDataObject.get();
+            } else {
+                LOG.debug("{}: Failed to read {}",
+                        Thread.currentThread().getStackTrace()[1], path);
+            }
+        } catch (ReadFailedException e) {
+            LOG.warn("Failed to read {} ", path, e);
+        }
+        transaction.close();
+        return result;
+    }
+}
diff --git a/utils/mdsal-utils/src/test/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtilsTest.java b/utils/mdsal-utils/src/test/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtilsTest.java
new file mode 100644 (file)
index 0000000..c0e9ebb
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2015 Inocybe 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.ovsdb.utils.mdsal.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+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.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
+
+/**
+ * Unit test for class {@link MdsalUtils}
+ *
+ */
+@RunWith(MockitoJUnitRunner.class)
+@SuppressWarnings({ "unchecked", "rawtypes" })
+public class MdsalUtilsTest {
+
+    @InjectMocks private MdsalUtils mdsalUtils;
+
+    @Mock private DataBroker databroker;
+
+    @Test
+    public void testDelete() {
+        WriteTransaction writeTransaction = mock(WriteTransaction.class);
+        when(databroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
+        CheckedFuture<Void, TransactionCommitFailedException> future = mock(CheckedFuture.class);
+        when(writeTransaction.submit()).thenReturn(future );
+
+        boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, mock(InstanceIdentifier.class));
+
+        verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+        verify(writeTransaction, times(1)).submit();
+
+        assertTrue("Error, the delete transaction failed", result);
+    }
+
+    @Test
+    public void testMerge() {
+        WriteTransaction writeTransaction = mock(WriteTransaction.class);
+        when(databroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
+        CheckedFuture<Void, TransactionCommitFailedException> future = mock(CheckedFuture.class);
+        when(writeTransaction.submit()).thenReturn(future );
+
+        boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, mock(InstanceIdentifier.class), mock(DataObject.class));
+
+        verify(writeTransaction, times(1)).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(DataObject.class), anyBoolean());
+        verify(writeTransaction, times(1)).submit();
+
+        assertTrue("Error, the merge transaction failed", result);
+    }
+
+    @Test
+    public void testPut() {
+        WriteTransaction writeTransaction = mock(WriteTransaction.class);
+        when(databroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
+        CheckedFuture<Void, TransactionCommitFailedException> future = mock(CheckedFuture.class);
+        when(writeTransaction.submit()).thenReturn(future );
+
+        boolean result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, mock(InstanceIdentifier.class), mock(DataObject.class));
+
+        verify(writeTransaction, times(1)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(DataObject.class), anyBoolean());
+        verify(writeTransaction, times(1)).submit();
+
+        assertTrue("Error, the put transaction failed", result);
+    }
+
+    @Test
+    public void testRead() throws ReadFailedException {
+        ReadOnlyTransaction readOnlyTransaction = mock(ReadOnlyTransaction.class);
+        when(databroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
+        CheckedFuture<Optional, ReadFailedException> future = mock(CheckedFuture.class);
+        Optional opt = mock(Optional.class);
+        when(opt.isPresent()).thenReturn(true);
+        DataObject obj = mock(DataObject.class);
+        when(opt.get()).thenReturn(obj );
+        when(future.checkedGet()).thenReturn(opt);
+        when(readOnlyTransaction.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class))).thenReturn(future);
+
+        DataObject result = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, mock(InstanceIdentifier.class));
+
+        verify(readOnlyTransaction, times(1)).read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+        verify(readOnlyTransaction, times(1)).close();
+
+        assertEquals("Error, the read transaction failed", obj, result);
+    }
+}
index 42b9b7108af005eba9bfb1ac850730069336eff9..2d57c9aa9aac49558bb09fbba3b301ee6abdef0b 100644 (file)
@@ -52,5 +52,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <module>mdsal-node</module>
     <module>mdsal-openflow</module>
     <module>servicehelper</module>
+    <module>mdsal-utils</module>
   </modules>
 </project>