*/
@Override
public Object[] getImplementations() {
- Object[] res = { ForwardingRulesManagerImpl.class };
+ Object[] res = { ForwardingRulesManager.class };
return res;
}
*/
@Override
public void configureInstance(Component c, Object imp, String containerName) {
- if (imp.equals(ForwardingRulesManagerImpl.class)) {
+ if (imp.equals(ForwardingRulesManager.class)) {
String interfaces[] = null;
Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
Set<String> propSet = new HashSet<String>();
* the network. It also maintains the central repository of all the forwarding
* rules installed on the network nodes.
*/
-public class ForwardingRulesManagerImpl implements IForwardingRulesManager, PortGroupChangeListener,
+public class ForwardingRulesManager implements IForwardingRulesManager, PortGroupChangeListener,
IContainerListener, ISwitchManagerAware, IConfigurationContainerAware, IInventoryListener, IObjectReader,
ICacheUpdateAware<Long, String>, CommandProvider, IFlowProgrammerListener {
private static final String SAVE = "Save";
private static final String NODEDOWN = "Node is Down";
private static final String SUCCESS = StatusCode.SUCCESS.toString();
- private static final Logger log = LoggerFactory.getLogger(ForwardingRulesManagerImpl.class);
+ private static final Logger log = LoggerFactory.getLogger(ForwardingRulesManager.class);
private Map<Long, String> flowsSaveEvent;
private String frmFileName;
private String portGroupFileName;
FlowEntryInstall flowEntries = mapEntry.getValue();
// Skip internal generated static flows
if (!flowEntries.isInternal()) {
- inactiveFlows.put(flowEntries.getOriginal(), null);
+ inactiveFlows.put(flowEntries.getOriginal(), flowEntries.getOriginal());
}
}
package org.opendaylight.controller.forwardingrulesmanager.internal;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Bundle;
+
import javax.inject.Inject;
import org.junit.Assert;
-import org.junit.Test;
import org.junit.Before;
+import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
import org.opendaylight.controller.forwardingrulesmanager.IForwardingRulesManager;
import org.opendaylight.controller.sal.utils.NodeCreator;
import org.opendaylight.controller.sal.utils.Status;
import org.opendaylight.controller.sal.utils.StatusCode;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.osgi.framework.BundleContext;
-import static org.junit.Assert.*;
-import org.ops4j.pax.exam.junit.Configuration;
-import static org.ops4j.pax.exam.CoreOptions.*;
-
import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.util.PathUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@RunWith(PaxExam.class)
public class ForwardingRulesManagerIT {
// Assert if true, if false we are good to go!
assertFalse(debugit);
- ServiceReference r = bc
- .getServiceReference(IForwardingRulesManager.class.getName());
+ ServiceReference r = bc.getServiceReference(IForwardingRulesManager.class.getName());
if (r != null) {
this.manager = (IForwardingRulesManager) bc.getService(r);
}
Node node = NodeCreator.createOFNode(1L);
FlowEntry fe = new FlowEntry("g1", "f1", flow, node);
- Status stat = manager.installFlowEntry(null);
- Assert.assertTrue(stat.getCode().equals(StatusCode.NOTACCEPTABLE));
+ Status stat = manager.installFlowEntry(fe);
+
+ // OF plugin is not there in integration testing mode
+ Assert.assertTrue(stat.getCode() == StatusCode.NOSERVICE);
}
}
if (nc == null) {
return new Status(StatusCode.BADREQUEST, "Invalid NodeConnector");
}
-
HostNodeConnector host = null;
try {
host = new HostNodeConnector(dataLayerAddress, networkAddr, nc, vlan);
return new Status(StatusCode.CONFLICT, "Existing IP, Use PUT to update");
}
host.setStaticHost(true);
+ /*
+ * Check if the nc is an ISL port
+ */
+ if (topologyManager != null) {
+ if (topologyManager.isInternal(nc)) {
+ return new Status(StatusCode.BADREQUEST, "Cannot add host on ISL port");
+ }
+ }
/*
* Before adding host, Check if the switch and the port have already
* come up
import java.net.InetAddress;
import java.net.UnknownHostException;
-import java.security.Principal;
import java.util.List;
+
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
import org.opendaylight.controller.northbound.commons.exception.UnsupportedMediaTypeException;
import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
+import org.opendaylight.controller.sal.authorization.Privilege;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.utils.GlobalConstants;
import org.opendaylight.controller.sal.utils.StatusCode;
import org.opendaylight.controller.switchmanager.ISwitchManager;
-import org.opendaylight.controller.sal.authorization.Privilege;
-
/**
* Host Tracker Northbound REST APIs.<br>
* This class provides REST APIs to track host location in a network. Host
@POST
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@StatusCodes({
- @ResponseCode(code = 201, condition = "Flow Config processed successfully"),
+ @ResponseCode(code = 201, condition = "Static host created successfully"),
@ResponseCode(code = 404, condition = "The Container Name or nodeId or configuration name is not found"),
@ResponseCode(code = 406, condition = "Cannot operate on Default Container when other Containers are active"),
@ResponseCode(code = 415, condition = "Invalid IP Address passed in networkAddress parameter"),
.getLogger(SwitchHandler.class);
private static final int SWITCH_LIVENESS_TIMER = 5000;
private static final int switchLivenessTimeout = getSwitchLivenessTimeout();
- private int MESSAGE_RESPONSE_TIMER = 2000;
+ private final int MESSAGE_RESPONSE_TIMER = 2000;
- private String instanceName;
- private ISwitch thisISwitch;
- private IController core;
+ private final String instanceName;
+ private final ISwitch thisISwitch;
+ private final IController core;
private Long sid;
private Integer buffers;
private Integer capabilities;
private Byte tables;
private Integer actions;
private Selector selector;
- private SocketChannel socket;
- private BasicFactory factory;
- private AtomicInteger xid;
+ private final SocketChannel socket;
+ private final BasicFactory factory;
+ private final AtomicInteger xid;
private SwitchState state;
private Timer periodicTimer;
- private Map<Short, OFPhysicalPort> physicalPorts;
- private Map<Short, Integer> portBandwidth;
- private Date connectedDate;
+ private final Map<Short, OFPhysicalPort> physicalPorts;
+ private final Map<Short, Integer> portBandwidth;
+ private final Date connectedDate;
private Long lastMsgReceivedTimeStamp;
private Boolean probeSent;
- private ExecutorService executor;
- private ConcurrentHashMap<Integer, Callable<Object>> messageWaitingDone;
+ private final ExecutorService executor;
+ private final ConcurrentHashMap<Integer, Callable<Object>> messageWaitingDone;
private boolean running;
private IMessageReadWrite msgReadWriteService;
private Thread switchHandlerThread;
* messaging service to transmit it over the socket channel
*/
class PriorityMessageTransmit implements Runnable {
+ @Override
public void run() {
running = true;
while (running) {
try {
- while (!transmitQ.isEmpty()) {
- PriorityMessage pmsg = transmitQ.poll();
- msgReadWriteService.asyncSend(pmsg.msg);
- logger.trace("Message sent: {}", pmsg);
- /*
- * If syncReply is set to true, wait for the response
- * back.
- */
- if (pmsg.syncReply) {
- syncMessageInternal(pmsg.msg, pmsg.msg.getXid(), false);
- }
+ PriorityMessage pmsg = transmitQ.take();
+ msgReadWriteService.asyncSend(pmsg.msg);
+ /*
+ * If syncReply is set to true, wait for the response back.
+ */
+ if (pmsg.syncReply) {
+ syncMessageInternal(pmsg.msg, pmsg.msg.getXid(), false);
}
- Thread.sleep(10);
} catch (InterruptedException ie) {
reportError(new InterruptedException(
"PriorityMessageTransmit thread interrupted"));
private void startTransmitThread() {
this.transmitQ = new PriorityBlockingQueue<PriorityMessage>(11,
new Comparator<PriorityMessage>() {
+ @Override
public int compare(PriorityMessage p1, PriorityMessage p2) {
if (p2.priority != p1.priority) {
return p2.priority - p1.priority;
// the result if OFError already
if (logger.isDebugEnabled()) {
logger.debug("Send {} failed --> {}", msg.getType(),
- ((OFError) result));
+ (result));
}
}
return result;
private Timer discoveryTimer;
private DiscoveryTimerTask discoveryTimerTask;
- private long discoveryTimerTick = 1L * 1000; // per tick in msec
+ private final static long discoveryTimerTick = 2L * 1000; // per tick in msec
private int discoveryTimerTickCount = 0; // main tick counter
// Max # of ports handled in one batch
private int discoveryBatchMaxPorts = 500;
// Periodically restart batching process
private int discoveryBatchRestartTicks = getDiscoveryInterval();
- private int discoveryBatchPausePeriod = 5; // pause for few secs
+ private int discoveryBatchPausePeriod = 5;
// Pause after this point
private int discoveryBatchPauseTicks = discoveryBatchRestartTicks - discoveryBatchPausePeriod;
// Number of retries after initial timeout
private int discoveryRetry = getDiscoveryRetry();
- private int discoveryTimeoutTicks = getDiscoveryTimeout(); // timeout in sec
- private int discoveryAgeoutTicks = 120; // age out 2 min
+ private int discoveryTimeoutTicks = getDiscoveryTimeout();
+ private int discoveryAgeoutTicks = getDiscoveryAgeout();
// multiple of discoveryBatchRestartTicks
private int discoveryConsistencyCheckMultiple = 2;
// CC tick counter
}
}
+ public enum DiscoveryPeriod {
+ INTERVAL(300),
+ TIMEOUT (60),
+ AGEOUT (120);
+
+ private int time; // sec
+ private int tick; // tick
+
+ DiscoveryPeriod(int time) {
+ this.time = time;
+ this.tick = time2Tick(time);
+ }
+
+ public int getTime() {
+ return time;
+ }
+
+ public void setTime(int time) {
+ this.time = time;
+ this.tick = time2Tick(time);
+ }
+
+ public int getTick() {
+ return tick;
+ }
+
+ private int time2Tick(int time) {
+ return (int) (time / (discoveryTimerTick / 1000));
+ }
+ }
+
private RawPacket createDiscoveryPacket(NodeConnector nodeConnector) {
String nodeId = HexEncode.longToHexString((Long) nodeConnector.getNode().getID());
return sourceMac;
}
+ private int getDiscoveryTicks(DiscoveryPeriod dp, String val) {
+ if (dp == null) {
+ return 0;
+ }
+
+ if (val != null) {
+ try {
+ dp.setTime(Integer.parseInt(val));
+ } catch (Exception e) {
+ }
+ }
+
+ return dp.getTick();
+ }
+
/**
* This method returns the interval which determines how often the discovery
- * packets will be sent. Default is 300 seconds.
+ * packets will be sent.
*
- * @return The discovery interval in second
+ * @return The discovery interval in ticks
*/
private int getDiscoveryInterval() {
- String elapsedTime = System.getProperty("of.discoveryInterval");
- int rv = 300;
-
- try {
- if (elapsedTime != null) {
- rv = Integer.parseInt(elapsedTime);
- }
- } catch (Exception e) {
- }
-
- return rv;
+ String intvl = System.getProperty("of.discoveryInterval");
+ return getDiscoveryTicks(DiscoveryPeriod.INTERVAL, intvl);
}
/**
* This method returns the timeout value in waiting for response of a
- * discovery query. Default is 60 seconds.
+ * discovery query.
*
- * @return The discovery timeout in second
+ * @return The discovery timeout in ticks
*/
private int getDiscoveryTimeout() {
- String elapsedTime = System.getProperty("of.discoveryTimeout");
- int rv = 60;
-
- try {
- if (elapsedTime != null) {
- rv = Integer.parseInt(elapsedTime);
- }
- } catch (Exception e) {
- }
+ String timeout = System.getProperty("of.discoveryTimeout");
+ return getDiscoveryTicks(DiscoveryPeriod.TIMEOUT, timeout);
+ }
- return rv;
+ /**
+ * This method returns the discovery entry aging time in ticks.
+ *
+ * @return The aging time in ticks
+ */
+ private int getDiscoveryAgeout() {
+ return getDiscoveryTicks(DiscoveryPeriod.AGEOUT, null);
}
/**
import java.util.Arrays;
import org.opendaylight.controller.sal.utils.HexEncode;
+import org.opendaylight.controller.sal.utils.NetUtils;
import org.openflow.protocol.OFMatch;
import org.openflow.util.U16;
import org.openflow.util.U8;
}
this.dataLayerSourceMask = null;
- if (match.getDataLayerSource() != null) {
+ if (match.getDataLayerSource() != null && !NetUtils.isZeroMAC(match.getDataLayerSource())) {
this.setDataLayerSource(match.getDataLayerSource(), null);
} else {
- this.dataLayerSource = null;
this.dlSourceState = MatchFieldState.MATCH_ABSENT;
}
this.dataLayerDestinationMask = null;
- if (match.getDataLayerDestination() != null) {
+ if (match.getDataLayerDestination() != null && !NetUtils.isZeroMAC(match.getDataLayerDestination())) {
this.setDataLayerDestination(match.getDataLayerDestination(), null);
} else {
- this.dataLayerDestination = null;
this.dlDestState = MatchFieldState.MATCH_ABSENT;
}
}
return nbytes;
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + Arrays.hashCode(dataLayerDestinationMask);
+ result = prime * result + Arrays.hashCode(dataLayerSourceMask);
+ result = prime * result + dataLayerTypeMask;
+ result = prime * result + dataLayerVirtualLanMask;
+ result = prime * result + dataLayerVirtualLanPriorityCodePointMask;
+ result = prime * result + ((dlDestState == null) ? 0 : dlDestState.hashCode());
+ result = prime * result + ((dlSourceState == null) ? 0 : dlSourceState.hashCode());
+ result = prime * result + ((dlVlanState == null) ? 0 : dlVlanState.hashCode());
+ result = prime * result + dstIPv6SubnetMaskbits;
+ result = prime * result + ((ethTypeState == null) ? 0 : ethTypeState.hashCode());
+ result = prime * result + inputPortMask;
+ result = prime * result + ((inputPortState == null) ? 0 : inputPortState.hashCode());
+ result = prime * result + match_len;
+ result = prime * result + ((networkDestinationMask == null) ? 0 : networkDestinationMask.hashCode());
+ result = prime * result + networkProtocolMask;
+ result = prime * result + ((networkSourceMask == null) ? 0 : networkSourceMask.hashCode());
+ result = prime * result + networkTypeOfServiceMask;
+ result = prime * result + ((nwDst == null) ? 0 : nwDst.hashCode());
+ result = prime * result + ((nwDstState == null) ? 0 : nwDstState.hashCode());
+ result = prime * result + ((nwProtoState == null) ? 0 : nwProtoState.hashCode());
+ result = prime * result + ((nwSrc == null) ? 0 : nwSrc.hashCode());
+ result = prime * result + ((nwSrcState == null) ? 0 : nwSrcState.hashCode());
+ result = prime * result + ((nwTosState == null) ? 0 : nwTosState.hashCode());
+ result = prime * result + pad_size;
+ result = prime * result + srcIPv6SubnetMaskbits;
+ result = prime * result + ((tpDstState == null) ? 0 : tpDstState.hashCode());
+ result = prime * result + ((tpSrcState == null) ? 0 : tpSrcState.hashCode());
+ result = prime * result + transportDestinationMask;
+ result = prime * result + transportSourceMask;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ V6Match other = (V6Match) obj;
+ if (!Arrays.equals(dataLayerDestinationMask, other.dataLayerDestinationMask))
+ return false;
+ if (!Arrays.equals(dataLayerSourceMask, other.dataLayerSourceMask))
+ return false;
+ if (dataLayerTypeMask != other.dataLayerTypeMask)
+ return false;
+ if (dataLayerVirtualLanMask != other.dataLayerVirtualLanMask)
+ return false;
+ if (dataLayerVirtualLanPriorityCodePointMask != other.dataLayerVirtualLanPriorityCodePointMask)
+ return false;
+ if (dlDestState != other.dlDestState)
+ return false;
+ if (dlSourceState != other.dlSourceState)
+ return false;
+ if (dlVlanState != other.dlVlanState)
+ return false;
+ if (dstIPv6SubnetMaskbits != other.dstIPv6SubnetMaskbits)
+ return false;
+ if (ethTypeState != other.ethTypeState)
+ return false;
+ if (inputPortMask != other.inputPortMask)
+ return false;
+ if (inputPortState != other.inputPortState)
+ return false;
+ if (match_len != other.match_len)
+ return false;
+ if (networkDestinationMask == null) {
+ if (other.networkDestinationMask != null)
+ return false;
+ } else if (!networkDestinationMask.equals(other.networkDestinationMask))
+ return false;
+ if (networkProtocolMask != other.networkProtocolMask)
+ return false;
+ if (networkSourceMask == null) {
+ if (other.networkSourceMask != null)
+ return false;
+ } else if (!networkSourceMask.equals(other.networkSourceMask))
+ return false;
+ if (networkTypeOfServiceMask != other.networkTypeOfServiceMask)
+ return false;
+ if (nwDst == null) {
+ if (other.nwDst != null)
+ return false;
+ } else if (!nwDst.equals(other.nwDst))
+ return false;
+ if (nwDstState != other.nwDstState)
+ return false;
+ if (nwProtoState != other.nwProtoState)
+ return false;
+ if (nwSrc == null) {
+ if (other.nwSrc != null)
+ return false;
+ } else if (!nwSrc.equals(other.nwSrc))
+ return false;
+ if (nwSrcState != other.nwSrcState)
+ return false;
+ if (nwTosState != other.nwTosState)
+ return false;
+ if (pad_size != other.pad_size)
+ return false;
+ if (srcIPv6SubnetMaskbits != other.srcIPv6SubnetMaskbits)
+ return false;
+ if (tpDstState != other.tpDstState)
+ return false;
+ if (tpSrcState != other.tpSrcState)
+ return false;
+ if (transportDestinationMask != other.transportDestinationMask)
+ return false;
+ if (transportSourceMask != other.transportSourceMask)
+ return false;
+ return true;
+ }
}
package org.opendaylight.controller.sal.core;
-import java.util.Arrays;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.controller.sal.utils.HexEncode;
+
/**
* The class contains MAC address property.
*/
public class MacAddress extends Property implements Cloneable {
private static final long serialVersionUID = 1L;
@XmlElement(name="macAddress")
- private final byte[] address;
+ private final String address;
public static final String name = "macAddress";
/*
*
*
* @param nodeMacAddress
- * Data Link Address for the node
+ * Data Link Address for the node in byte array format
*
* @return the constructed object
*/
public MacAddress(byte[] nodeMacAddress) {
super(name);
- this.address = nodeMacAddress.clone();
+ this.address = HexEncode.bytesToHexStringFormat(nodeMacAddress);
+ }
+
+ /**
+ * Constructor to create DatalinkAddress property which contains the MAC
+ * address. The property will be attached to a
+ * {@link org.opendaylight.controller.sal.core.Node}.
+ *
+ *
+ * @param nodeMacAddress
+ * Data Link Address for the node in String format
+ *
+ * @return the constructed object
+ */
+ public MacAddress(String nodeMacAddress) {
+ super(name);
+ this.address = nodeMacAddress;
}
/**
- * @return the node MAC address
+ * @return the node MAC address in byte array format
*/
public byte[] getMacAddress() {
- return this.address.clone();
+ return HexEncode.bytesFromHexString(this.address);
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
- result = prime * result + Arrays.hashCode(address);
+ result = prime * result
+ + ((address == null) ? 0 : address.hashCode());
return result;
}
return false;
}
MacAddress other = (MacAddress) obj;
- if (!Arrays.equals(address, other.address)) {
+ if (!address.equals(other.address)) {
return false;
}
return true;
@Override
public String toString() {
- return "MacAddress [address=" +
- HexEncode.bytesToHexStringFormat(address) + "]";
+ return "MacAddress[" + address + "]";
}
}
}
// Set the reference to the plugin flow programmer
- public void setService(Map props, IPluginInFlowProgrammerService s) {
+ public void setService(Map<String, Object> props, IPluginInFlowProgrammerService s) {
if (this.pluginFlowProgrammer == null) {
logger.error("pluginFlowProgrammer store null");
return;
}
- logger.trace("Got a service set request {}", s);
- String type = null;
- for (Object e : props.entrySet()) {
- Map.Entry entry = (Map.Entry) e;
- logger.trace("Prop key:({}) value:({})", entry.getKey(),
- entry.getValue());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Got a service set request {}", s);
+ for (Map.Entry<String, Object> entry : props.entrySet()) {
+ logger.trace("Prop key:({}) value:({})", entry.getKey(), entry.getValue());
+ }
}
+ String type = null;
Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
if (value instanceof String) {
type = (String) value;
}
}
- public void unsetService(Map props, IPluginInFlowProgrammerService s) {
+ public void unsetService(Map<String, Object> props, IPluginInFlowProgrammerService s) {
if (this.pluginFlowProgrammer == null) {
logger.error("pluginFlowProgrammer store null");
return;
}
- String type = null;
logger.debug("Received unsetpluginFlowProgrammer request");
- for (Object e : props.entrySet()) {
- Map.Entry entry = (Map.Entry) e;
- logger.trace("Prop key:({}) value:({})", entry.getKey(),
- entry.getValue());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Got a service set request {}", s);
+ for (Map.Entry<String, Object> entry : props.entrySet()) {
+ logger.trace("Prop key:({}) value:({})", entry.getKey(), entry.getValue());
+ }
}
+ String type = null;
Object value = props.get(GlobalConstants.PROTOCOLPLUGINTYPE.toString());
if (value instanceof String) {
type = (String) value;
if (nodeSet == null) {
return;
}
+ List<String> nodeArray = new ArrayList<String>();
for (Node node : nodeSet) {
+ nodeArray.add(node.toString());
+ }
+ Collections.sort(nodeArray);
+ for (String str: nodeArray) {
+ Node node = Node.fromString(str);
Description desc = ((Description) getNodeProp(node,
Description.propertyName));
Tier tier = ((Tier) getNodeProp(node, Tier.TierPropName));
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.opendaylight.controller.clustering.services.IClusterContainerServices;
import org.opendaylight.controller.clustering.services.IClusterServices;
import org.opendaylight.controller.configuration.IConfigurationContainerAware;
-import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.Edge;
import org.opendaylight.controller.sal.core.Host;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
import org.opendaylight.controller.sal.core.Property;
import org.opendaylight.controller.sal.core.TimeStamp;
import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.core.Node.NodeIDType;
import org.opendaylight.controller.sal.topology.IListenTopoUpdates;
import org.opendaylight.controller.sal.topology.ITopologyService;
import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
-import org.opendaylight.controller.sal.utils.StatusCode;
import org.opendaylight.controller.sal.utils.GlobalConstants;
import org.opendaylight.controller.sal.utils.IObjectReader;
import org.opendaylight.controller.sal.utils.ObjectReader;
import org.opendaylight.controller.sal.utils.ObjectWriter;
import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
import org.opendaylight.controller.topologymanager.ITopologyManager;
import org.opendaylight.controller.topologymanager.ITopologyManagerAware;
import org.opendaylight.controller.topologymanager.TopologyUserLinkConfig;
if (this.hostsDB == null) {
return null;
}
+ if (this.hostsDB.get(p) == null)
+ return null;
return (this.hostsDB.get(p).getLeft());
}