Merge "Adding copyright header to ovsdb/southbound UT"
authorFlavio Fernandes <ffernand@redhat.com>
Thu, 15 Oct 2015 17:17:06 +0000 (17:17 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 15 Oct 2015 17:17:06 +0000 (17:17 +0000)
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcProvider.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModule.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/netvirt/sfc/rev141210/NetvirtSfcModuleFactory.java
openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java
resources/commons/NetvirtSfc.json.postman_collection [new file with mode: 0644]
resources/commons/README

index 144514f9df74da5b8b09c736613b2f3ab28cf374..3dba7b4b57b779a62eaaf99b687ed665b8ea5ce9 100644 (file)
@@ -19,26 +19,17 @@ import org.slf4j.LoggerFactory;
 
 public class NetvirtSfcProvider implements BindingAwareProvider, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcProvider.class);
-    private DataBroker dataBroker = null;
-    private BundleContext bundleContext = null;
     private NetvirtSfcAclListener aclListener;
-
     private NetvirtSfcClassifierListener classfierListener;
-    private INetvirtSfcOF13Provider provider;
-
-    public NetvirtSfcProvider(BundleContext bundleContext) {
-        LOG.info("NetvirtProvider: bundleContext: {}", bundleContext);
-        this.bundleContext = bundleContext;
-    }
 
     @Override
     public void onSessionInitiated(ProviderContext session) {
         LOG.info("NetvirtSfcProvider Session Initiated");
-        dataBroker = session.getSALService(DataBroker.class);
+        DataBroker dataBroker = session.getSALService(DataBroker.class);
 
-        provider = new NetvirtSfcOF13Provider(this.dataBroker);
-        aclListener = new NetvirtSfcAclListener(provider, this.dataBroker);
-        classfierListener = new NetvirtSfcClassifierListener(provider, this.dataBroker);
+        INetvirtSfcOF13Provider provider = new NetvirtSfcOF13Provider(dataBroker);
+        aclListener = new NetvirtSfcAclListener(provider, dataBroker);
+        classfierListener = new NetvirtSfcClassifierListener(provider, dataBroker);
     }
 
     @Override
index 9135aeb68c722d3441ba31defb61e8b1a37f3cb9..137b77f8ae2a49aa2406a8219f7ba7b4aea0d694 100644 (file)
@@ -8,7 +8,6 @@ import org.osgi.framework.BundleContext;
 public class NetvirtSfcModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210.AbstractNetvirtSfcModule {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcModule.class);
-    private BundleContext bundleContext = null;
 
     public NetvirtSfcModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
@@ -26,13 +25,8 @@ public class NetvirtSfcModule extends org.opendaylight.yang.gen.v1.urn.opendayli
     @Override
     public java.lang.AutoCloseable createInstance() {
         LOG.info("Netvirt SFC module initialization.");
-        //final NetvirtSfcProvider sfcProvider = new NetvirtSfcProvider(getDataBrokerDependency());
-        final NetvirtSfcProvider sfcProvider = new NetvirtSfcProvider(bundleContext);
+        NetvirtSfcProvider sfcProvider = new NetvirtSfcProvider();
         getBrokerDependency().registerProvider(sfcProvider);
         return sfcProvider;
     }
-
-    public void setBundleContext(BundleContext bundleContext) {
-        this.bundleContext = bundleContext;
-    }
 }
index 6bbc36823822daa2a6278a038859a203119f3674..8468b165e55c84a501f16482e6eb837ab5c15257 100644 (file)
@@ -17,36 +17,4 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class NetvirtSfcModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210.AbstractNetvirtSfcModuleFactory {
-    private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcModuleFactory.class);
-
-    @Override
-    public Module createModule(String instanceName,
-                               DependencyResolver dependencyResolver,
-                               DynamicMBeanWithInstance old, BundleContext bundleContext)
-            throws Exception {
-        Module module =  super.createModule(instanceName, dependencyResolver, old, bundleContext);
-        LOG.info("Created NetvirtSfcModule1= {}!!", (module instanceof NetvirtSfcModule));
-        setModuleBundleContext(bundleContext, module);
-        return module;
-    }
-
-    @Override
-    public Module createModule(String instanceName,
-                               DependencyResolver dependencyResolver, BundleContext bundleContext) {
-        Module module = super.createModule(instanceName, dependencyResolver, bundleContext);
-        LOG.info("Created NetvirtSfcModule2= {}!!", (module instanceof NetvirtSfcModule));
-        setModuleBundleContext(bundleContext, module);
-        return module;
-    }
-
-    private void setModuleBundleContext(BundleContext bundleContext,
-                                        Module module) {
-        if (module instanceof NetvirtSfcModule) {
-            LOG.info("Setting Bundle Context for NetvirtSfcModule!!");
-            ((NetvirtSfcModule)module).setBundleContext(bundleContext);
-        } else {
-            LOG.warn("Module is of type {} expected type {}",
-                    module.getClass(), NetvirtSfcModule.class);
-        }
-    }
 }
index 9eef40d7af711119b5f4916ecadeaf123f84526e..5fbe1ca5c186069949be405f3f71be9fd33cc646 100644 (file)
@@ -181,6 +181,7 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
         }
 
         try {
+            Thread.sleep(1000);
             super.setup();
         } catch (Exception e) {
             e.printStackTrace();
diff --git a/resources/commons/NetvirtSfc.json.postman_collection b/resources/commons/NetvirtSfc.json.postman_collection
new file mode 100644 (file)
index 0000000..3c64af8
--- /dev/null
@@ -0,0 +1,105 @@
+{
+    "id": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+    "name": "NetvirtSfc",
+    "requests": [
+        {
+            "collectionId": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+            "data": "{\n    \"access-lists\": {\n        \"access-list\": [\n            {\n                \"acl-name\": \"http-acl\",\n                \"access-list-entries\": {\n                    \"access-list-entry\": [\n                        {\n                            \"rule-name\": \"http-rule\",\n                            \"matches\": {\n                                \"destination-port-range\": {\n                                    \"lower-port\": \"80\",\n                                    \"upper-port\": \"80\"\n                                }\n                            },\n                            \"actions\": {\n                                \"permit\": {}\n                            }\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}",
+            "dataMode": "raw",
+            "description": "",
+            "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+            "id": "37a68007-fc51-b406-43fe-dcaba62e3879",
+            "method": "GET",
+            "name": "Acl",
+            "responses": [],
+            "timestamp": 0,
+            "url": "http://localhost:8181/restconf/config/ietf-acl:access-lists",
+            "version": 2
+        },
+        {
+            "collectionId": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+            "data": "{\n    \"classifiers\": {\n        \"classifier\": [\n            {\n                \"name\": \"http-classifier\",\n                \"acl\": \"http-acl\",\n                \"sffs\": {\n                    \"sff\": [\n                        {\n                            \"name\": \"sff1\"\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}",
+            "dataMode": "raw",
+            "description": "",
+            "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+            "id": "718ed9fd-f7f3-3862-4a53-b12d83c880ae",
+            "method": "PUT",
+            "name": "Classifier",
+            "time": 1444924721709,
+            "timestamp": 0,
+            "url": "http://localhost:8181/restconf/config/netvirt-sfc-classifier:classifiers",
+            "version": 2
+        },
+        {
+            "collectionId": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+            "data": "{\n\t\"sfc\": {\n        \"name\": \"sfc1\"\n    }\n}",
+            "dataMode": "raw",
+            "description": "",
+            "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+            "id": "9d418a4b-197d-47c2-e85f-e68f6b5f5c40",
+            "method": "GET",
+            "name": "Sfc",
+            "responses": [],
+            "timestamp": 0,
+            "url": "http://localhost:8181/restconf/config/netvirt-sfc:sfc/",
+            "version": 2
+        },
+        {
+            "collectionId": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+            "data": "{\n    \"access-lists\": {\n        \"access-list\": [\n            {\n                \"acl-name\": \"http-acl\",\n                \"access-list-entries\": {\n                    \"access-list-entry\": [\n                        {\n                            \"rule-name\": \"http-rule\",\n                            \"matches\": {\n                                \"destination-port-range\": {\n                                    \"lower-port\": \"80\",\n                                    \"upper-port\": \"80\"\n                                }\n                            },\n                            \"actions\": {\n                                \"permit\": {}\n                            }\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}",
+            "dataMode": "raw",
+            "description": "",
+            "headers": "Content-Type: application/json\n",
+            "id": "9e688730-6234-8f89-3de2-8a9974c4ea59",
+            "method": "PUT",
+            "name": "Acl",
+            "time": 1444923678505,
+            "timestamp": 0,
+            "url": "http://localhost:8181/restconf/config/ietf-acl:access-lists",
+            "version": 2
+        },
+        {
+            "collectionId": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+            "data": "{\n    \"classifiers\": {\n        \"classifier\": [\n            {\n                \"name\": \"http-classifier\",\n                \"acl\": \"http-acl\",\n                \"sffs\": {\n                    \"sff\": [\n                        {\n                            \"name\": \"sff1\"\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}",
+            "dataMode": "raw",
+            "description": "",
+            "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
+            "id": "b2d13061-80e0-ad8f-d0e6-d6939ea2b0a4",
+            "method": "GET",
+            "name": "Classifier",
+            "responses": [],
+            "timestamp": 0,
+            "url": "http://localhost:8181/restconf/config/netvirt-sfc-classifier:classifiers",
+            "version": 2
+        },
+        {
+            "collectionId": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+            "data": "http://localhost:8181/restconf/config/ietf-acl:access-lists\n{\n    \"access-lists\": {\n        \"access-list\": [\n            {\n                \"acl-name\": \"http-acl\",\n                \"access-list-entries\": {\n                    \"access-list-entry\": [\n                        {\n                            \"rule-name\": \"http-rule\",\n                            \"matches\": {\n                                \"destination-port-range\": {\n                                    \"lower-port\": \"80\",\n                                    \"upper-port\": \"80\"\n                                }\n                            },\n                            \"actions\": {\n                                \"netvirt-sfc-acl:redirect-sfc\": \"acl\"\n                            }\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}",
+            "dataMode": "raw",
+            "description": "",
+            "headers": "Content-Type: application/json\n",
+            "id": "c3d5a025-23c6-af23-dce1-9edca74cd65c",
+            "method": "PUT",
+            "name": "Acl - redirect-sfc",
+            "responses": [],
+            "timestamp": 0,
+            "url": "http://localhost:8181/restconf/config/ietf-acl:access-lists",
+            "version": 2
+        },
+        {
+            "collectionId": "bc172f70-35df-2cdf-50a4-8ad09b8f17a2",
+            "data": "{\n\t\"sfc\": {\n        \"name\": \"sfc1\"\n    }\n}",
+            "dataMode": "raw",
+            "description": "",
+            "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+            "id": "ea1c70a0-6528-862c-cabc-a9b187d483c7",
+            "method": "PUT",
+            "name": "Sfc",
+            "responses": [],
+            "timestamp": 0,
+            "url": "http://localhost:8181/restconf/config/netvirt-sfc:sfc/",
+            "version": 2
+        }
+    ],
+    "timestamp": 1444922427094
+}
index 98de4d5babab88c807d0a487fbcb5d7e658bd0bf..25cf72cccfcd29a3282a6e2e0d7d567127c018c9 100644 (file)
@@ -27,4 +27,4 @@ Contents
 
 - 3-Node-Cluster-Setup-Environment-Variables.postman_environment : Postman environment file that defines variables for Restconf request for southbound plugin running in 3 node cluster environment
 
-
+- NetvirtSfc.json.postman_collection : Collection of REST-APIs to interact with Netvirt-Sfc.