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>
--- /dev/null
+/*
+ * 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();
+ }
+}
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) {
@Override
public java.lang.AutoCloseable createInstance() {
- String vhostSocketPath = getVhostSocketPath();
- String vhostSocketPrefix = getVhostSocketPrefix();
- NeutronVppMapper neutronVppMapper = new NeutronVppMapper(vhostSocketPath, vhostSocketPrefix, getDataBrokerDependency());
- return neutronVppMapper;
+ return NoopAutoCloseable.INSTANCE;
}
}
--- /dev/null
+<?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
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