import org.opendaylight.controller.sal.core.ContainerFlow;
import org.opendaylight.controller.sal.core.Description;
import org.opendaylight.controller.sal.core.IContainerListener;
import org.opendaylight.controller.sal.core.ContainerFlow;
import org.opendaylight.controller.sal.core.Description;
import org.opendaylight.controller.sal.core.IContainerListener;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.Node.NodeIDType;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.Node.NodeIDType;
import org.opendaylight.controller.sal.core.NodeConnector;
* The class describes a shim layer that bridges inventory events from Openflow
* core to various listeners. The notifications are filtered based on container
* configurations.
* The class describes a shim layer that bridges inventory events from Openflow
* core to various listeners. The notifications are filtered based on container
* configurations.
*/
public class InventoryServiceShim implements IContainerListener,
IMessageListener, ISwitchStateListener, IStatisticsListener {
protected static final Logger logger = LoggerFactory
.getLogger(InventoryServiceShim.class);
private IController controller = null;
*/
public class InventoryServiceShim implements IContainerListener,
IMessageListener, ISwitchStateListener, IStatisticsListener {
protected static final Logger logger = LoggerFactory
.getLogger(InventoryServiceShim.class);
private IController controller = null;
- private ConcurrentMap<String, IInventoryShimInternalListener> inventoryShimInternalListeners = new ConcurrentHashMap<String, IInventoryShimInternalListener>();
- private List<IInventoryShimExternalListener> inventoryShimExternalListeners = new CopyOnWriteArrayList<IInventoryShimExternalListener>();
- private ConcurrentMap<NodeConnector, List<String>> containerMap = new ConcurrentHashMap<NodeConnector, List<String>>();
+ private final ConcurrentMap<String, IInventoryShimInternalListener> inventoryShimInternalListeners = new ConcurrentHashMap<String, IInventoryShimInternalListener>();
+ private final List<IInventoryShimExternalListener> inventoryShimExternalListeners = new CopyOnWriteArrayList<IInventoryShimExternalListener>();
+ private final ConcurrentMap<NodeConnector, List<String>> containerMap = new ConcurrentHashMap<NodeConnector, List<String>>();
* Function called by the dependency manager when at least one dependency
* become unsatisfied or when the component is shutting down because for
* example bundle is being stopped.
* Function called by the dependency manager when at least one dependency
* become unsatisfied or when the component is shutting down because for
* example bundle is being stopped.
// Add all the nodeConnectors of this switch
Map<NodeConnector, Set<Property>> ncProps = InventoryServiceHelper
// Add all the nodeConnectors of this switch
Map<NodeConnector, Set<Property>> ncProps = InventoryServiceHelper
Long connectedSinceTime = (connectedSince == null) ? 0 : connectedSince
.getTime();
props.add(new TimeStamp(connectedSinceTime, "connectedSince"));
Long connectedSinceTime = (connectedSince == null) ? 0 : connectedSince
.getTime();
props.add(new TimeStamp(connectedSinceTime, "connectedSince"));
// Notify all internal and external listeners
notifyInventoryShimListener(node, type, props);
}
// Notify all internal and external listeners
notifyInventoryShimListener(node, type, props);
}
Set<Property> properties = new HashSet<Property>(1);
Description desc = new Description(
descriptionStats.getDatapathDescription());
properties.add(desc);
Set<Property> properties = new HashSet<Property>(1);
Description desc = new Description(
descriptionStats.getDatapathDescription());
properties.add(desc);
// Notify all internal and external listeners
notifyInventoryShimListener(node, UpdateType.CHANGED, properties);
// Notify all internal and external listeners
notifyInventoryShimListener(node, UpdateType.CHANGED, properties);
+ }
+
+ private byte[] deriveMacAddress(long dpid) {
+ byte[] mac = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };