Merge "Bug 6396: default-config.xml corrected for l2-l3-domain-extension"
authorVladimir Lavor <vlavor@cisco.com>
Wed, 24 Aug 2016 15:09:51 +0000 (15:09 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 24 Aug 2016 15:09:51 +0000 (15:09 +0000)
neutron-vpp-mapper/src/main/config/default-config.xml
neutron-vpp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/neutron_vpp_mapper/impl/NeutronVppMapperInstance.java [new file with mode: 0644]
neutron-vpp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/neutron_vpp_mapper/impl/NeutronVppMapperModule.java
neutron-vpp-mapper/src/main/resources/org/opendaylight/blueprint/neutron-vpp-mapper.xml [new file with mode: 0644]
neutron-vpp-mapper/src/main/yang/neutron-vpp-mapper-impl.yang

index 2a196a59c2b20baf449aa6886f06478e509b6fdc..2244909501e22faee9c3e2100a5bae62a59b2b28 100644 (file)
                         neutron-vpp-mapper:neutron-vpp-mapper-impl
                     </type>
                     <name>neutron-vpp-mapper-impl</name>
-                    <rpc-registry>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
-                        <name>binding-rpc-broker</name>
-                    </rpc-registry>
-                    <data-broker>
-                      <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
-                      <name>binding-data-broker</name>
-                    </data-broker>
                 </module>
             </modules>
         </data>
diff --git a/neutron-vpp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/neutron_vpp_mapper/impl/NeutronVppMapperInstance.java b/neutron-vpp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/neutron_vpp_mapper/impl/NeutronVppMapperInstance.java
new file mode 100644 (file)
index 0000000..f9a78fc
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.config.yang.config.neutron_vpp_mapper.impl;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.groupbasedpolicy.neutron.vpp.mapper.NeutronVppMapper;
+
+public class NeutronVppMapperInstance implements AutoCloseable{
+
+    private NeutronVppMapper mapper;
+
+    public NeutronVppMapperInstance (DataBroker dataBroker, String socketPath, String socketPrefix) {
+        mapper = new NeutronVppMapper(socketPath, socketPrefix, dataBroker);
+    }
+
+    @Override
+    public void close() throws Exception {
+        mapper.close();
+    }
+}
index e8a60b4d102f9ea23dba93be035a17c6a9c671de..b458050fdac19a87caebb2a3c2735e53f12c903e 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.controller.config.yang.config.neutron_vpp_mapper.impl;
 
-import org.opendaylight.groupbasedpolicy.neutron.vpp.mapper.NeutronVppMapper;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
 
 public class NeutronVppMapperModule extends org.opendaylight.controller.config.yang.config.neutron_vpp_mapper.impl.AbstractNeutronVppMapperModule {
     public NeutronVppMapperModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
@@ -25,10 +25,7 @@ public class NeutronVppMapperModule extends org.opendaylight.controller.config.y
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        String vhostSocketPath = getVhostSocketPath();
-        String vhostSocketPrefix = getVhostSocketPrefix();
-        NeutronVppMapper neutronVppMapper = new NeutronVppMapper(vhostSocketPath, vhostSocketPrefix, getDataBrokerDependency());
-        return neutronVppMapper;
+        return NoopAutoCloseable.INSTANCE;
     }
 
 }
diff --git a/neutron-vpp-mapper/src/main/resources/org/opendaylight/blueprint/neutron-vpp-mapper.xml b/neutron-vpp-mapper/src/main/resources/org/opendaylight/blueprint/neutron-vpp-mapper.xml
new file mode 100644 (file)
index 0000000..64f8891
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
+
+    <bean id="neutronVppMapper" class="org.opendaylight.controller.config.yang.config.neutron_vpp_mapper.impl.NeutronVppMapperInstance"
+        destroy-method="close">
+        <argument ref="dataBroker"/>
+        <argument value="/tmp/"/>
+        <argument value="socket_"/>
+    </bean>
+</blueprint>
\ No newline at end of file
index cac643d80f3f40e3e6ad984a4b876b85e35c715b..0ae253bc65973d33bd26ee8fbc5da78bc80699dc 100644 (file)
@@ -36,36 +36,6 @@ module neutron-vpp-mapper-impl {
     augment "/config:modules/config:module/config:configuration" {
         case neutron-vpp-mapper-impl {
             when "/config:modules/config:module/config:type = 'neutron-vpp-mapper-impl'";
-
-            container data-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-async-data-broker;
-                    }
-                }
-            }
-
-            container rpc-registry {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-rpc-registry;
-                    }
-                }
-            }
-
-            leaf vhostSocketPath {
-                description "Base system directory path for the vhost user host socket filehandle";
-                type string;
-                default "/tmp/";
-            }
-
-            leaf vhostSocketPrefix {
-                description "Prefix for the vhost user host socket filehandle";
-                type string;
-                default "socket_";
-            }
         }
     }
 }
\ No newline at end of file