1 package org.opendaylight.ovsdb.plugin;
3 import java.net.InetAddress;
4 import java.net.UnknownHostException;
5 import java.util.ArrayList;
7 import java.util.Dictionary;
8 import java.util.HashMap;
9 import java.util.HashSet;
10 import java.util.List;
13 import java.util.concurrent.ConcurrentHashMap;
14 import java.util.concurrent.ConcurrentMap;
16 import org.apache.felix.dm.Component;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
20 import org.opendaylight.controller.sal.core.Actions;
21 import org.opendaylight.controller.sal.core.Bandwidth;
22 import org.opendaylight.controller.sal.core.Buffers;
23 import org.opendaylight.controller.sal.core.Capabilities;
24 import org.opendaylight.controller.sal.core.Capabilities.CapabilitiesType;
25 import org.opendaylight.controller.sal.core.ConstructionException;
26 import org.opendaylight.controller.sal.core.Node;
27 import org.opendaylight.controller.sal.core.NodeConnector;
28 import org.opendaylight.controller.sal.core.Property;
29 import org.opendaylight.controller.sal.core.State;
30 import org.opendaylight.controller.sal.core.Tables;
31 import org.opendaylight.controller.sal.core.TimeStamp;
32 import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
33 import org.opendaylight.controller.sal.utils.NodeCreator;
34 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
37 * Stub Implementation for IPluginInReadService used by SAL
41 public class InventoryService implements IPluginInInventoryService, InventoryServiceInternal {
42 private static final Logger logger = LoggerFactory
43 .getLogger(InventoryService.class);
45 private ConcurrentMap<Node, Map<String, Property>> nodeProps;
46 private ConcurrentMap<NodeConnector, Map<String, Property>> nodeConnectorProps;
49 * Function called by the dependency manager when all the required
50 * dependencies are satisfied
54 nodeProps = new ConcurrentHashMap<Node, Map<String, Property>>();
55 nodeConnectorProps = new ConcurrentHashMap<NodeConnector, Map<String, Property>>();
56 Node.NodeIDType.registerIDType("OVS", String.class);
57 NodeConnector.NodeConnectorIDType.registerIDType("OVS", String.class, "OVS");
62 * Function called by the dependency manager when at least one dependency
63 * become unsatisfied or when the component is shutting down because for
64 * example bundle is being stopped.
71 * Function called by dependency manager after "init ()" is called and after
72 * the services provided by the class are registered in the service registry
79 * Function called by the dependency manager before the services exported by
80 * the component are unregistered, this will be followed by a "destroy ()"
88 * Retrieve nodes from openflow
91 public ConcurrentMap<Node, Map<String, Property>> getNodeProps() {
96 * Retrieve nodeConnectors from openflow
99 public ConcurrentMap<NodeConnector, Map<String, Property>> getNodeConnectorProps(
101 return nodeConnectorProps;