Bug 1764 - moved Session related interfaces to openflowplugin-api
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / lldp / LLDPSpeakerPopListener.java
index d77b8febee08db555d3434f81aeea135915473aa..f6aacc8212819b43f9e01b81c7eb614dec44f09c 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.lldp;
 
-import org.opendaylight.openflowplugin.openflow.md.queue.PopListener;
+import org.opendaylight.openflowplugin.api.openflow.md.queue.PopListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
@@ -23,23 +23,23 @@ public class LLDPSpeakerPopListener<T> implements PopListener<T> {
 
     @Override
     public void onPop(T processedMessage) {
-        if(processedMessage instanceof NodeConnectorUpdated) {
-               NodeConnectorUpdated connector = (NodeConnectorUpdated) processedMessage;
-               FlowCapableNodeConnectorUpdated flowConnector = connector.<FlowCapableNodeConnectorUpdated>getAugmentation(FlowCapableNodeConnectorUpdated.class);
-               if(flowConnector != null) {
-                       InstanceIdentifier<NodeConnector> nodeConnectorInstanceId = (InstanceIdentifier<NodeConnector>) connector.getNodeConnectorRef().getValue();             
-                       NodeConnectorBuilder ncb = new NodeConnectorBuilder(connector);
-                       FlowCapableNodeConnectorBuilder fcncb = new FlowCapableNodeConnectorBuilder(flowConnector);
-                       ncb.addAugmentation(FlowCapableNodeConnector.class, fcncb.build());
-                       PortState portState = flowConnector.getState();
-                       PortConfig portConfig = flowConnector.getConfiguration();
-                       if((portState ==null || !portState.isLinkDown()) && (portConfig == null || !portConfig.isPORTDOWN())) {
-                               LLDPSpeaker.getInstance().addNodeConnector(nodeConnectorInstanceId,ncb.build());
-                       } else {
-                               LLDPSpeaker.getInstance().removeNodeConnector(nodeConnectorInstanceId,ncb.build());
-                       }
-               }
-        } 
+        if (processedMessage instanceof NodeConnectorUpdated) {
+            NodeConnectorUpdated connector = (NodeConnectorUpdated) processedMessage;
+            FlowCapableNodeConnectorUpdated flowConnector = connector.<FlowCapableNodeConnectorUpdated>getAugmentation(FlowCapableNodeConnectorUpdated.class);
+            if (flowConnector != null) {
+                InstanceIdentifier<NodeConnector> nodeConnectorInstanceId = (InstanceIdentifier<NodeConnector>) connector.getNodeConnectorRef().getValue();
+                NodeConnectorBuilder ncb = new NodeConnectorBuilder(connector);
+                FlowCapableNodeConnectorBuilder fcncb = new FlowCapableNodeConnectorBuilder(flowConnector);
+                ncb.addAugmentation(FlowCapableNodeConnector.class, fcncb.build());
+                PortState portState = flowConnector.getState();
+                PortConfig portConfig = flowConnector.getConfiguration();
+                if ((portState == null || !portState.isLinkDown()) && (portConfig == null || !portConfig.isPORTDOWN())) {
+                    LLDPSpeaker.getInstance().addNodeConnector(nodeConnectorInstanceId, ncb.build());
+                } else {
+                    LLDPSpeaker.getInstance().removeNodeConnector(nodeConnectorInstanceId, ncb.build());
+                }
+            }
+        }
     }
 
 }