X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FInventoryServiceShim.java;h=8d157ac29f694f721f232ba752fcac277c2fb1a5;hb=53c4c25db41a16aa3d820e50657e143cbc177c8c;hp=cd05f3125a460c48ac34d9d3ff97a6230ebf59ed;hpb=29f7cfb54b580928c7feac63abce028a7014b0d5;p=controller.git diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java index cd05f3125a..8d157ac29f 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryServiceShim.java @@ -20,35 +20,30 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimExternalListener; import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimInternalListener; -import org.opendaylight.controller.protocol_plugin.openflow.IOFStatisticsManager; import org.opendaylight.controller.protocol_plugin.openflow.core.IController; import org.opendaylight.controller.protocol_plugin.openflow.core.IMessageListener; import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch; import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitchStateListener; -import org.openflow.protocol.OFMessage; -import org.openflow.protocol.OFPortStatus; -import org.openflow.protocol.OFPortStatus.OFPortReason; -import org.openflow.protocol.OFType; -import org.openflow.protocol.statistics.OFDescriptionStatistics; -import org.openflow.protocol.statistics.OFStatistics; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import org.opendaylight.controller.sal.core.Actions; import org.opendaylight.controller.sal.core.Buffers; import org.opendaylight.controller.sal.core.Capabilities; import org.opendaylight.controller.sal.core.ConstructionException; import org.opendaylight.controller.sal.core.ContainerFlow; import org.opendaylight.controller.sal.core.IContainerListener; -import org.opendaylight.controller.sal.core.Name; import org.opendaylight.controller.sal.core.Node; -import org.opendaylight.controller.sal.core.Tables; import org.opendaylight.controller.sal.core.Node.NodeIDType; import org.opendaylight.controller.sal.core.NodeConnector; import org.opendaylight.controller.sal.core.Property; +import org.opendaylight.controller.sal.core.Tables; import org.opendaylight.controller.sal.core.TimeStamp; import org.opendaylight.controller.sal.core.UpdateType; import org.opendaylight.controller.sal.utils.GlobalConstants; +import org.openflow.protocol.OFMessage; +import org.openflow.protocol.OFPortStatus; +import org.openflow.protocol.OFPortStatus.OFPortReason; +import org.openflow.protocol.OFType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The class describes a shim layer that bridges inventory events from Openflow @@ -65,7 +60,6 @@ public class InventoryServiceShim implements IContainerListener, private ConcurrentMap inventoryShimInternalListeners = new ConcurrentHashMap(); private List inventoryShimExternalListeners = new CopyOnWriteArrayList(); private ConcurrentMap> containerMap = new ConcurrentHashMap>(); - private IOFStatisticsManager statsMgr; void setController(IController s) { this.controller = s; @@ -77,16 +71,6 @@ public class InventoryServiceShim implements IContainerListener, } } - void setStatisticsManager(IOFStatisticsManager s) { - this.statsMgr = s; - } - - void unsetStatisticsManager(IOFStatisticsManager s) { - if (this.statsMgr == s) { - this.statsMgr = null; - } - } - void setInventoryShimInternalListener(Map props, IInventoryShimInternalListener s) { if (props == null) { @@ -99,7 +83,7 @@ public class InventoryServiceShim implements IContainerListener, return; } if ((this.inventoryShimInternalListeners != null) - && !this.inventoryShimInternalListeners.containsKey(s)) { + && !this.inventoryShimInternalListeners.containsValue(s)) { this.inventoryShimInternalListeners.put(containerName, s); logger.trace("Added inventoryShimInternalListener for container:" + containerName); @@ -118,7 +102,10 @@ public class InventoryServiceShim implements IContainerListener, return; } if ((this.inventoryShimInternalListeners != null) - && this.inventoryShimInternalListeners.containsKey(s)) { + && this.inventoryShimInternalListeners + .get(containerName) != null + && this.inventoryShimInternalListeners + .get(containerName).equals(s)) { this.inventoryShimInternalListeners.remove(containerName); logger .trace("Removed inventoryShimInternalListener for container: " @@ -390,16 +377,6 @@ public class InventoryServiceShim implements IContainerListener, .getTime(); props.add(new TimeStamp(connectedSinceTime, "connectedSince")); - String name = ""; - if (statsMgr != null && statsMgr.getOFDescStatistics(sid) != null) { - List stats = statsMgr.getOFDescStatistics(sid); - if (stats.size() > 0) { - name = ((OFDescriptionStatistics) stats.get(0)) - .getSerialNumber(); - } - } - props.add(new Name(name)); - byte tables = sw.getTables(); Tables t = new Tables(tables); if (t != null) {