private final Map<InstanceIdentifier<NodeConnector>, TransmitPacketInput> nodeConnectorMap = new ConcurrentHashMap<>();
private final ScheduledFuture<?> scheduledSpeakerTask;
private final MacAddress addressDestionation;
- private OperStatus operationalStatus = OperStatus.RUN;
+ private volatile OperStatus operationalStatus = OperStatus.RUN;
public LLDPSpeaker(final PacketProcessingService packetProcessingService,
final MacAddress addressDestionation) {
import org.opendaylight.controller.config.api.DependencyResolver;
import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.openflowplugin.applications.lldpspeaker.LLDPSpeaker;
-import org.opendaylight.openflowplugin.applications.lldpspeaker.NodeConnectorInventoryEventTranslator;
-import org.opendaylight.openflowplugin.applications.lldpspeaker.OperationalStatusChangeService;
-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.packet.service.rev130709.PacketProcessingService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
public class LLDPSpeakerModule extends AbstractLLDPSpeakerModule {
- private static final Logger LOG = LoggerFactory
- .getLogger(LLDPSpeakerModule.class);
-
- public LLDPSpeakerModule(ModuleIdentifier identifier,
- DependencyResolver dependencyResolver) {
+ public LLDPSpeakerModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
public LLDPSpeakerModule(ModuleIdentifier identifier,
- DependencyResolver dependencyResolver, LLDPSpeakerModule oldModule,
- AutoCloseable oldInstance) {
+ DependencyResolver dependencyResolver, LLDPSpeakerModule oldModule, AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
- @Override
- public void customValidation() {
- // add custom validation form module attributes here.
- }
-
@Override
public AutoCloseable createInstance() {
- LOG.trace("Creating LLDP speaker.");
-
- PacketProcessingService packetProcessingService = getRpcRegistryDependency()
- .getRpcService(PacketProcessingService.class);
- MacAddress macDestination = getAddressDestination();
-
- final LLDPSpeaker lldpSpeaker = new LLDPSpeaker(
- packetProcessingService, macDestination);
- final NodeConnectorInventoryEventTranslator eventTranslator = new NodeConnectorInventoryEventTranslator(
- getDataBrokerDependency(), lldpSpeaker);
-
- OperationalStatusChangeService operationalStatusChangeService = new OperationalStatusChangeService(
- lldpSpeaker);
- final BindingAwareBroker.RpcRegistration<LldpSpeakerService> statusServiceRegistration =
- getRpcRegistryDependency().addRpcImplementation(LldpSpeakerService.class, operationalStatusChangeService);
-
- return new AutoCloseable() {
- @Override
- public void close() {
- LOG.trace("Closing LLDP speaker.");
- eventTranslator.close();
- lldpSpeaker.close();
- statusServiceRegistration.close();
- }
- };
+ // Instances are created via blueprint so this in a no-op.
+ return NoopAutoCloseable.INSTANCE;
}
-
}
* 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.openflow.applications.lldp.speaker.rev141023;
-public class LLDPSpeakerModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.rev141023.AbstractLLDPSpeakerModuleFactory {
+
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
+public class LLDPSpeakerModuleFactory extends AbstractLLDPSpeakerModuleFactory {
}
~ This program and the accompanying materials are made available under the
~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
~ and is available at http://www.eclipse.org/legal/epl-v10.html
+
+ NOTE: This file is deprecated as wiring is now done via blueprint. This file is kept for
+ backwards compatibility. Runtime modifications are not honored.
-->
<!-- vi: set et smarttab sw=4 tabstop=4: -->
--- /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"/>
+
+ <odl:clustered-app-config id="lldpSpeakerConfig"
+ binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.lldp.speaker.config.rev160512.LldpSpeakerConfig">
+ <odl:default-config><![CDATA[
+ <lldp-speaker-config xmlns="urn:opendaylight:params:xml:ns:yang:openflow:applications:lldp-speaker:config">
+ <address-destination>01:23:00:00:00:01</address-destination>
+ </lldp-speaker-config>
+ ]]></odl:default-config>
+ </odl:clustered-app-config>
+
+ <odl:rpc-service id="packetProcessingService"
+ interface="org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService"/>
+
+ <bean id="lldpSpeaker" class="org.opendaylight.openflowplugin.applications.lldpspeaker.LLDPSpeaker"
+ destroy-method="close">
+ <argument ref="packetProcessingService"/>
+ <argument>
+ <bean factory-ref="lldpSpeakerConfig" factory-method="getAddressDestination"/>
+ </argument>
+ </bean>
+
+ <bean id="nodeConnectorEventTranslator" class="org.opendaylight.openflowplugin.applications.lldpspeaker.NodeConnectorInventoryEventTranslator"
+ destroy-method="close">
+ <argument ref="dataBroker"/>
+ <argument>
+ <array>
+ <ref component-id="lldpSpeaker"/>
+ </array>
+ </argument>
+ </bean>
+
+ <bean id="operationalStatusChangeService" class="org.opendaylight.openflowplugin.applications.lldpspeaker.OperationalStatusChangeService">
+ <argument ref="lldpSpeaker"/>
+ </bean>
+
+ <odl:rpc-implementation ref="operationalStatusChangeService"/>
+</blueprint>
\ No newline at end of file
--- /dev/null
+module lldp-speaker-config {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:openflow:applications:lldp-speaker:config";
+ prefix "lldp-speaker-config";
+
+ import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
+
+ description
+ "Configuration for LLDP speaker application.";
+
+ revision "2016-05-12" {
+ description
+ "Initial revision.";
+ }
+
+ container lldp-speaker-config {
+ leaf address-destination {
+ type yang:mac-address;
+ mandatory true;
+ }
+ }
+}
\ No newline at end of file
identity lldp-speaker {
base "config:module-type";
config:java-name-prefix LLDPSpeaker;
+ status deprecated;
}
typedef oper-status {