rename topology related objects: Device -> Host
- KVDevice to be renamed later.
- Use fully qualified name for topology's Host. (HostManager.java)
Change-Id: I1538f96d7ca93ca2197d23e5a69b85d284611412
diff --git a/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java b/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
index c1c1707..969b2b7 100644
--- a/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
+++ b/src/main/java/net/onrc/onos/apps/forwarding/Forwarding.java
@@ -30,7 +30,7 @@
import net.onrc.onos.core.intent.runtime.IPathCalcRuntimeService;
import net.onrc.onos.core.packet.Ethernet;
import net.onrc.onos.core.registry.IControllerRegistryService;
-import net.onrc.onos.core.topology.Device;
+import net.onrc.onos.core.topology.Host;
import net.onrc.onos.core.topology.ITopologyService;
import net.onrc.onos.core.topology.LinkEvent;
import net.onrc.onos.core.topology.Port;
@@ -51,7 +51,7 @@
IForwardingService, IPacketListener, ChangedListener {
private static final Logger log = LoggerFactory.getLogger(Forwarding.class);
- private static final int SLEEP_TIME_FOR_DB_DEVICE_INSTALLED = 100; // milliseconds
+ private static final int SLEEP_TIME_FOR_DB_HOST_INSTALLED = 100; // milliseconds
private static final int NUMBER_OF_THREAD_FOR_EXECUTOR = 1;
private static final int SRC_SWITCH_TIMEOUT_ADJUST_SECOND = 2;
private static final int DEFAULT_IDLE_TIMEOUT = 5;
@@ -270,22 +270,22 @@
String destinationMac =
HexString.toHexString(eth.getDestinationMACAddress());
- // FIXME getDeviceByMac() is a blocking call, so it may be better way
+ // FIXME #getHostByMac() is a blocking call, so it may be better way
// to handle it to avoid the condition.
- Device deviceObject = topology.getDeviceByMac(
+ Host hostObject = topology.getHostByMac(
MACAddress.valueOf(destinationMac));
- if (deviceObject == null) {
- log.debug("No device entry found for {}",
+ if (hostObject == null) {
+ log.debug("No host entry found for {}",
destinationMac);
- //Device is not in the DB, so wait it until the device is added.
+ //Host is not in the DB, so wait it until the host is added.
EXECUTOR_SERVICE.schedule(new WaitDeviceArp(sw, inPort, eth),
- SLEEP_TIME_FOR_DB_DEVICE_INSTALLED, TimeUnit.MILLISECONDS);
+ SLEEP_TIME_FOR_DB_HOST_INSTALLED, TimeUnit.MILLISECONDS);
return;
}
- continueHandlePacketIn(sw, inPort, eth, deviceObject);
+ continueHandlePacketIn(sw, inPort, eth, hostObject);
}
private class WaitDeviceArp implements Runnable {
@@ -302,34 +302,34 @@
@Override
public void run() {
- Device deviceObject = topology.getDeviceByMac(MACAddress.valueOf(eth.getDestinationMACAddress()));
- if (deviceObject == null) {
- log.debug("wait {}ms and device was not found. " +
+ Host hostObject = topology.getHostByMac(MACAddress.valueOf(eth.getDestinationMACAddress()));
+ if (hostObject == null) {
+ log.debug("wait {}ms and host was not found. " +
"Send broadcast packet and the thread finish.",
- SLEEP_TIME_FOR_DB_DEVICE_INSTALLED);
+ SLEEP_TIME_FOR_DB_HOST_INSTALLED);
handleBroadcast(sw, inPort, eth);
return;
}
- log.debug("wait {}ms and device {} was found, continue",
- SLEEP_TIME_FOR_DB_DEVICE_INSTALLED, deviceObject.getMacAddress());
- continueHandlePacketIn(sw, inPort, eth, deviceObject);
+ log.debug("wait {}ms and host {} was found, continue",
+ SLEEP_TIME_FOR_DB_HOST_INSTALLED, hostObject.getMacAddress());
+ continueHandlePacketIn(sw, inPort, eth, hostObject);
}
}
- private void continueHandlePacketIn(Switch sw, Port inPort, Ethernet eth, Device deviceObject) {
+ private void continueHandlePacketIn(Switch sw, Port inPort, Ethernet eth, Host hostObject) {
log.trace("Start continuehandlePacketIn");
- //Iterator<IPortObject> ports = deviceObject.getAttachedPorts().iterator();
- Iterator<net.onrc.onos.core.topology.Port> ports = deviceObject.getAttachmentPoints().iterator();
+ //Iterator<IPortObject> ports = hostObject.getAttachedPorts().iterator();
+ Iterator<net.onrc.onos.core.topology.Port> ports = hostObject.getAttachmentPoints().iterator();
if (!ports.hasNext()) {
- log.debug("No attachment point found for device {} - broadcasting packet",
- deviceObject.getMacAddress());
+ log.debug("No attachment point found for host {} - broadcasting packet",
+ hostObject.getMacAddress());
handleBroadcast(sw, inPort, eth);
return;
}
- //This code assumes the device has only one port. It should be problem.
+ //This code assumes the host has only one port. It should be problem.
Port destinationPort = ports.next();
short destinationPortNum = destinationPort.getNumber().value();
Switch destinationSw = destinationPort.getSwitch();
@@ -523,7 +523,7 @@
short outPort;
if (graphPath.isEmpty()) {
outPort = (short) spfIntent.getDstPortNumber();
- log.debug("Path is empty. Maybe devices on the same switch. outPort {}", outPort);
+ log.debug("Path is empty. Maybe hosts on the same switch. outPort {}", outPort);
} else {
outPort = graphPath.get(0).getSrc().getPortNumber().value();
log.debug("path{}, outPort {}", graphPath, outPort);
diff --git a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
index 183703c..53a2b5d 100644
--- a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
@@ -28,7 +28,7 @@
import net.onrc.onos.core.packet.ARP;
import net.onrc.onos.core.packet.Ethernet;
import net.onrc.onos.core.packet.IPv4;
-import net.onrc.onos.core.topology.Device;
+import net.onrc.onos.core.topology.Host;
import net.onrc.onos.core.topology.ITopologyService;
import net.onrc.onos.core.topology.Port;
import net.onrc.onos.core.topology.Switch;
@@ -433,11 +433,11 @@
new HostArpRequester(arp, dpid, inPort), false));
topology.acquireReadLock();
- Device targetDevice = topology.getDeviceByMac(
+ Host targetHost = topology.getHostByMac(
MACAddress.valueOf(arp.getTargetHardwareAddress()));
topology.releaseReadLock();
- if (targetDevice == null) {
+ if (targetHost == null) {
if (log.isTraceEnabled()) {
log.trace("No device info found for {} - broadcasting",
target.getHostAddress());
@@ -452,7 +452,7 @@
MACAddress macAddress = MACAddress.valueOf(arp.getTargetHardwareAddress());
if (log.isTraceEnabled()) {
- log.trace("The target Device Record in DB is: {} => {} " +
+ log.trace("The target Host Record in DB is: {} => {} " +
"from ARP request host at {}/{}", new Object[]{
inetAddressToString(arp.getTargetProtocolAddress()),
macAddress, HexString.toHexString(dpid), inPort});
@@ -460,11 +460,11 @@
// sendArpReply(arp, sw.getId(), pi.getInPort(), macAddress);
- Iterable<Port> outPorts = targetDevice.getAttachmentPoints();
+ Iterable<Port> outPorts = targetHost.getAttachmentPoints();
if (!outPorts.iterator().hasNext()) {
if (log.isTraceEnabled()) {
- log.trace("Device {} exists but is not connected to any ports" +
+ log.trace("Host {} exists but is not connected to any ports" +
" - broadcasting", macAddress);
}
diff --git a/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java b/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
index 52f92ad..aa897be 100644
--- a/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
+++ b/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
@@ -16,7 +16,7 @@
import net.onrc.onos.core.datastore.utils.ByteArrayComparator;
import net.onrc.onos.core.datastore.utils.ByteArrayUtil;
import net.onrc.onos.core.datastore.utils.KVObject;
-import net.onrc.onos.core.topology.DeviceEvent;
+import net.onrc.onos.core.topology.HostEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -26,7 +26,7 @@
import com.google.protobuf.InvalidProtocolBufferException;
/**
- * Device object.
+ * Host object.
* <p/>
*/
public class KVDevice extends KVObject {
@@ -47,7 +47,7 @@
}
};
- static final String DEVICE_TABLE_SUFFIX = ":Device";
+ static final String DEVICE_TABLE_SUFFIX = ":Host";
private final byte[] mac;
private TreeSet<byte[]> portIds;
@@ -55,13 +55,13 @@
/**
* Generate a DeviceID from MAC address.
* <p/>
- * We're assuming MAC address can be an unique identifier for Device.
+ * We're assuming MAC address can be an unique identifier for Host.
*
* @param mac MAC address
* @return DeviceID
*/
public static byte[] getDeviceID(final byte[] mac) {
- return DeviceEvent.getDeviceID(mac).array();
+ return HostEvent.getDeviceID(mac).array();
}
/**
@@ -73,7 +73,7 @@
public static byte[] getMacFromKey(final byte[] key) {
ByteBuffer keyBuf = ByteBuffer.wrap(key);
if (keyBuf.getChar() != 'D') {
- throw new IllegalArgumentException("Invalid Device key");
+ throw new IllegalArgumentException("Invalid Host key");
}
byte[] mac = new byte[keyBuf.remaining()];
keyBuf.get(mac);
@@ -171,7 +171,7 @@
}
/**
- * Utility class to provide Iterator over all the Device objects.
+ * Utility class to provide Iterator over all the Host objects.
*/
public static class DeviceIterator extends AbstractObjectIterator<KVDevice> {
@@ -214,16 +214,16 @@
}
/**
- * Add a port to this Device's attachment points.
+ * Add a port to this Host's attachment points.
*
- * @param portId PortID of the port which this Device is attached
+ * @param portId PortID of the port which this Host is attached
*/
public void addPortId(final byte[] portId) {
portIds.add(portId.clone());
}
/**
- * Remove a port from this Device's attachment points.
+ * Remove a port from this Host's attachment points.
*
* @param portId PortID to remove
*/
@@ -232,16 +232,16 @@
}
/**
- * Empty this Device's attachment points.
+ * Empty this Host's attachment points.
*/
public void emptyPortIds() {
portIds.clear();
}
/**
- * Add ports to this Device's attachment points.
+ * Add ports to this Host's attachment points.
*
- * @param newPortIds PortIDs which this Device is attached
+ * @param newPortIds PortIDs which this Host is attached
*/
public void addAllToPortIds(final Collection<byte[]> newPortIds) {
// TODO: Should we copy each portId, or reference is OK.
@@ -249,7 +249,7 @@
}
/**
- * Gets all the PortIDs which this Device is attached.
+ * Gets all the PortIDs which this Host is attached.
*
* @return Unmodifiable Set view of all the PortIds;
*/
@@ -290,7 +290,7 @@
success &= deserializePropertyMap(DEVICE_KRYO.get(), props);
return success;
} catch (InvalidProtocolBufferException e) {
- log.error("Deserializing Device: " + this + " failed.", e);
+ log.error("Deserializing Host: " + this + " failed.", e);
return false;
}
}
diff --git a/src/main/java/net/onrc/onos/core/hostmanager/HostManager.java b/src/main/java/net/onrc/onos/core/hostmanager/HostManager.java
index 9e62bd9..fd34519 100644
--- a/src/main/java/net/onrc/onos/core/hostmanager/HostManager.java
+++ b/src/main/java/net/onrc/onos/core/hostmanager/HostManager.java
@@ -24,7 +24,6 @@
import net.floodlightcontroller.core.module.IFloodlightService;
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.core.packet.Ethernet;
-import net.onrc.onos.core.topology.Device;
import net.onrc.onos.core.topology.ITopologyService;
import net.onrc.onos.core.topology.Port;
import net.onrc.onos.core.topology.Topology;
@@ -172,8 +171,8 @@
log.debug("called HostCleaner");
topology.acquireReadLock();
try {
- Set<Device> deleteSet = new HashSet<Device>();
- for (Device host : topology.getDevices()) {
+ Set<net.onrc.onos.core.topology.Host> deleteSet = new HashSet<>();
+ for (net.onrc.onos.core.topology.Host host : topology.getHosts()) {
long now = System.currentTimeMillis();
if ((now - host.getLastSeenTime() > agingMillisecConfig)) {
if (log.isTraceEnabled()) {
@@ -184,7 +183,7 @@
}
}
- for (Device host : deleteSet) {
+ for (net.onrc.onos.core.topology.Host host : deleteSet) {
deleteHostByMac(host.getMacAddress());
}
} catch (Exception e) {
@@ -277,7 +276,7 @@
Host deleteHost = null;
topology.acquireReadLock();
try {
- Device host = topology.getDeviceByMac(mac);
+ net.onrc.onos.core.topology.Host host = topology.getHostByMac(mac);
for (Port switchPort : host.getAttachmentPoints()) {
// We don't handle vlan now and multiple attachment points.
diff --git a/src/main/java/net/onrc/onos/core/topology/Device.java b/src/main/java/net/onrc/onos/core/topology/Host.java
similarity index 75%
rename from src/main/java/net/onrc/onos/core/topology/Device.java
rename to src/main/java/net/onrc/onos/core/topology/Host.java
index 71eda74..71ede78 100644
--- a/src/main/java/net/onrc/onos/core/topology/Device.java
+++ b/src/main/java/net/onrc/onos/core/topology/Host.java
@@ -1,20 +1,20 @@
package net.onrc.onos.core.topology;
import net.floodlightcontroller.util.MACAddress;
-import net.onrc.onos.core.topology.web.serializers.DeviceSerializer;
+import net.onrc.onos.core.topology.web.serializers.HostSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
- * Interface of Device Object exposed to the "NB" read-only Topology.
+ * Interface of Host Object exposed to the "NB" read-only Topology.
* <p/>
- * TODO What a Device Object represent is unclear at the moment.
+ * TODO What a Host Object represent is unclear at the moment.
* <p/>
* Everything returned by these interfaces must be either Unmodifiable view,
* immutable object, or a copy of the original "SB" In-memory Topology.
*/
-@JsonSerialize(using = DeviceSerializer.class)
-public interface Device extends ITopologyElement {
+@JsonSerialize(using = HostSerializer.class)
+public interface Host extends ITopologyElement {
/**
* Get the device MAC address.
*
diff --git a/src/main/java/net/onrc/onos/core/topology/DeviceEvent.java b/src/main/java/net/onrc/onos/core/topology/HostEvent.java
similarity index 84%
rename from src/main/java/net/onrc/onos/core/topology/DeviceEvent.java
rename to src/main/java/net/onrc/onos/core/topology/HostEvent.java
index 317eb4e..8747079 100644
--- a/src/main/java/net/onrc/onos/core/topology/DeviceEvent.java
+++ b/src/main/java/net/onrc/onos/core/topology/HostEvent.java
@@ -8,27 +8,27 @@
import java.util.Objects;
import net.floodlightcontroller.util.MACAddress;
-import net.onrc.onos.core.topology.web.serializers.DeviceEventSerializer;
+import net.onrc.onos.core.topology.web.serializers.HostEventSerializer;
import net.onrc.onos.core.util.SwitchPort;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
- * Self-contained Device event(s) Object
+ * Self-contained Host event(s) Object
* <p/>
- * Device event differ from other events.
- * Device Event represent add/remove of attachmentPoint.
+ * Host event differ from other events.
+ * Host Event represent add/remove of attachmentPoint.
* Not add/remove of the DeviceObject itself.
* <p/>
* Multiple attachmentPoints can be specified to batch events into 1 object.
* Each should be treated as independent events.
* <p/>
- * TODO: Rename to match what it is. (Switch/Port/Link/Device)Snapshot?
+ * TODO: Rename to match what it is. (Switch/Port/Link/Host)Snapshot?
* FIXME: Current implementation directly use this object as
* Replication message, but should be sending update operation info.
*/
-@JsonSerialize(using = DeviceEventSerializer.class)
-public class DeviceEvent extends TopologyElement<DeviceEvent> {
+@JsonSerialize(using = HostEventSerializer.class)
+public class HostEvent extends TopologyElement<HostEvent> {
private final MACAddress mac;
private List<SwitchPort> attachmentPoints;
@@ -38,13 +38,13 @@
* Default constructor for Serializer to use.
*/
@Deprecated
- protected DeviceEvent() {
+ protected HostEvent() {
mac = null;
}
- public DeviceEvent(MACAddress mac) {
+ public HostEvent(MACAddress mac) {
if (mac == null) {
- throw new IllegalArgumentException("Device mac cannot be null");
+ throw new IllegalArgumentException("Host mac cannot be null");
}
this.mac = mac;
this.attachmentPoints = new LinkedList<>();
@@ -55,7 +55,7 @@
*
* @param original to make copy of.
*/
- public DeviceEvent(DeviceEvent original) {
+ public HostEvent(HostEvent original) {
super(original);
this.mac = original.mac;
this.attachmentPoints = new ArrayList<>(original.attachmentPoints);
@@ -106,7 +106,7 @@
@Override
public String toString() {
- return "[DeviceEvent " + mac + " attachmentPoints:" + attachmentPoints + "]";
+ return "[HostEvent " + mac + " attachmentPoints:" + attachmentPoints + "]";
}
@Override
@@ -132,7 +132,7 @@
if (getClass() != obj.getClass()) {
return false;
}
- DeviceEvent other = (DeviceEvent) obj;
+ HostEvent other = (HostEvent) obj;
if (!super.equals(obj)) {
return false;
diff --git a/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java b/src/main/java/net/onrc/onos/core/topology/HostImpl.java
similarity index 82%
rename from src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
rename to src/main/java/net/onrc/onos/core/topology/HostImpl.java
index 3c46656..8ddca10 100644
--- a/src/main/java/net/onrc/onos/core/topology/DeviceImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/HostImpl.java
@@ -9,15 +9,15 @@
import net.onrc.onos.core.util.SwitchPort;
/**
- * Device Object stored in In-memory Topology.
+ * Host Object stored in In-memory Topology.
*/
-public class DeviceImpl extends TopologyObject implements Device {
+public class HostImpl extends TopologyObject implements Host {
//////////////////////////////////////////////////////
/// Topology element attributes
/// - any changes made here needs to be replicated.
//////////////////////////////////////////////////////
- private DeviceEvent deviceObj;
+ private HostEvent deviceObj;
///////////////////
/// In-memory index
@@ -26,12 +26,12 @@
// none
/**
- * Creates a Device object based on {@link DeviceEvent}.
+ * Creates a Host object based on {@link HostEvent}.
*
* @param topology Topology instance this object belongs to
- * @param scHost self contained {@link DeviceEvent}
+ * @param scHost self contained {@link HostEvent}
*/
- public DeviceImpl(Topology topology, DeviceEvent scHost) {
+ public HostImpl(Topology topology, HostEvent scHost) {
super(topology);
Validate.notNull(scHost);
@@ -40,19 +40,19 @@
if (scHost.isFrozen()) {
this.deviceObj = scHost;
} else {
- this.deviceObj = new DeviceEvent(scHost);
+ this.deviceObj = new HostEvent(scHost);
this.deviceObj.freeze();
}
}
/**
- * Creates a Device object with empty attributes.
+ * Creates a Host object with empty attributes.
*
* @param topology Topology instance this object belongs to
* @param mac MAC address of the host
*/
- public DeviceImpl(Topology topology, MACAddress mac) {
- this(topology, new DeviceEvent(mac).freeze());
+ public HostImpl(Topology topology, MACAddress mac) {
+ this(topology, new HostEvent(mac).freeze());
}
@Override
@@ -90,7 +90,7 @@
// TODO we may no longer need this. confirm and delete later.
void setLastSeenTime(long lastSeenTime) {
// XXX Following will make this instance thread unsafe. Need to use AtomicRef.
- DeviceEvent updated = new DeviceEvent(this.deviceObj);
+ HostEvent updated = new HostEvent(this.deviceObj);
updated.setLastSeenTime(lastSeenTime);
updated.freeze();
this.deviceObj = updated;
@@ -103,7 +103,7 @@
*/
void addAttachmentPoint(Port port) {
// XXX Following will make this instance thread unsafe. Need to use AtomicRef.
- DeviceEvent updated = new DeviceEvent(this.deviceObj);
+ HostEvent updated = new HostEvent(this.deviceObj);
updated.removeAttachmentPoint(port.asSwitchPort());
updated.addAttachmentPoint(port.asSwitchPort());
updated.freeze();
@@ -117,7 +117,7 @@
*/
boolean removeAttachmentPoint(Port port) {
// XXX Following will make this instance thread unsafe. Need to use AtomicRef.
- DeviceEvent updated = new DeviceEvent(this.deviceObj);
+ HostEvent updated = new HostEvent(this.deviceObj);
final boolean result = updated.removeAttachmentPoint(port.asSwitchPort());
updated.freeze();
this.deviceObj = updated;
diff --git a/src/main/java/net/onrc/onos/core/topology/LinkEvent.java b/src/main/java/net/onrc/onos/core/topology/LinkEvent.java
index dadf3c6..1618425 100644
--- a/src/main/java/net/onrc/onos/core/topology/LinkEvent.java
+++ b/src/main/java/net/onrc/onos/core/topology/LinkEvent.java
@@ -15,7 +15,7 @@
/**
* Self-contained Link event Object.
* <p/>
- * TODO: Rename to match what it is. (Switch/Port/Link/Device)Snapshot?
+ * TODO: Rename to match what it is. (Switch/Port/Link/Host)Snapshot?
* FIXME: Current implementation directly use this object as
* Replication message, but should be sending update operation info.
*/
diff --git a/src/main/java/net/onrc/onos/core/topology/Port.java b/src/main/java/net/onrc/onos/core/topology/Port.java
index 8613537..4758b16 100644
--- a/src/main/java/net/onrc/onos/core/topology/Port.java
+++ b/src/main/java/net/onrc/onos/core/topology/Port.java
@@ -124,7 +124,7 @@
/**
* Gets all the devices attached to this port.
*
- * @return {@link Device}s attached to this port
+ * @return {@link Host}s attached to this port
*/
- public Iterable<Device> getDevices();
+ public Iterable<Host> getHosts();
}
diff --git a/src/main/java/net/onrc/onos/core/topology/PortEvent.java b/src/main/java/net/onrc/onos/core/topology/PortEvent.java
index d3a71a5..19b6a80 100644
--- a/src/main/java/net/onrc/onos/core/topology/PortEvent.java
+++ b/src/main/java/net/onrc/onos/core/topology/PortEvent.java
@@ -14,7 +14,7 @@
/**
* Self-contained Port event Object.
* <p/>
- * TODO: Rename to match what it is. (Switch/Port/Link/Device)Snapshot?
+ * TODO: Rename to match what it is. (Switch/Port/Link/Host)Snapshot?
* FIXME: Current implementation directly use this object as
* Replication message, but should be sending update operation info.
*/
diff --git a/src/main/java/net/onrc/onos/core/topology/PortImpl.java b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
index c1bb75c..a4f34d5 100644
--- a/src/main/java/net/onrc/onos/core/topology/PortImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/PortImpl.java
@@ -190,10 +190,10 @@
}
@Override
- public Iterable<Device> getDevices() {
+ public Iterable<Host> getHosts() {
topology.acquireReadLock();
try {
- return topology.getDevices(this.asSwitchPort());
+ return topology.getHosts(this.asSwitchPort());
} finally {
topology.releaseReadLock();
}
diff --git a/src/main/java/net/onrc/onos/core/topology/Switch.java b/src/main/java/net/onrc/onos/core/topology/Switch.java
index 11f3f2c..58b10c7 100644
--- a/src/main/java/net/onrc/onos/core/topology/Switch.java
+++ b/src/main/java/net/onrc/onos/core/topology/Switch.java
@@ -77,7 +77,7 @@
/**
* Gets all the devices attached to this switch.
*
- * @return {@link Device}s attached to this switch
+ * @return {@link Host}s attached to this switch
*/
- public Collection<Device> getDevices();
+ public Collection<Host> getHosts();
}
diff --git a/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java b/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java
index 0464ffc..fdc4b84 100644
--- a/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java
+++ b/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java
@@ -12,7 +12,7 @@
/**
* Self-contained Switch Object.
* <p/>
- * TODO: Rename to match what it is. (Switch/Port/Link/Device)Snapshot?
+ * TODO: Rename to match what it is. (Switch/Port/Link/Host)Snapshot?
* FIXME: Current implementation directly use this object as
* Replication message, but should be sending update operation info.
*/
diff --git a/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java b/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
index 3e2b9aa..fdd37b3 100644
--- a/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/SwitchImpl.java
@@ -117,18 +117,18 @@
}
@Override
- public Collection<Device> getDevices() {
+ public Collection<Host> getHosts() {
// TODO Should switch also store a list of attached devices to avoid
// calculating this every time?
- List<Device> devices = new ArrayList<Device>();
+ List<Host> hosts = new ArrayList<Host>();
for (Port port : getPorts()) {
- for (Device device : port.getDevices()) {
- devices.add(device);
+ for (Host host : port.getHosts()) {
+ hosts.add(host);
}
}
- return devices;
+ return hosts;
}
void replaceStringAttributes(SwitchEvent updated) {
diff --git a/src/main/java/net/onrc/onos/core/topology/Topology.java b/src/main/java/net/onrc/onos/core/topology/Topology.java
index 607d22c..ef30379 100644
--- a/src/main/java/net/onrc/onos/core/topology/Topology.java
+++ b/src/main/java/net/onrc/onos/core/topology/Topology.java
@@ -204,14 +204,14 @@
* @param address the MAC address to use.
* @return the network device for the MAC address if found, otherwise null.
*/
- public Device getDeviceByMac(MACAddress address);
+ public Host getHostByMac(MACAddress address);
/**
* Gets all devices in the network.
*
* @return all devices in the network
*/
- public Iterable<Device> getDevices();
+ public Iterable<Host> getHosts();
/**
* Gets all devices on specified port.
@@ -219,7 +219,7 @@
* @param port port which the device is attached
* @return all devices attached to the port.
*/
- public Collection<Device> getDevices(SwitchPort port);
+ public Collection<Host> getHosts(SwitchPort port);
/**
* Acquire a read lock on the entire topology. The topology will not
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyDatastore.java b/src/main/java/net/onrc/onos/core/topology/TopologyDatastore.java
index 79afc77..815958f 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyDatastore.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyDatastore.java
@@ -174,8 +174,8 @@
* @param device the device to add.
* @return true on success, otherwise false.
*/
- public boolean addDevice(DeviceEvent device) {
- log.debug("Adding device into DB. mac {}", device.getMac());
+ public boolean addHost(HostEvent device) {
+ log.debug("Adding host into DB. mac {}", device.getMac());
KVDevice rcDevice = new KVDevice(device.getMac().toBytes());
@@ -195,8 +195,8 @@
* @param device the device to remove.
* @return true on success, otherwise false.
*/
- public boolean removeDevice(DeviceEvent device) {
- log.debug("Removing device into DB. mac {}", device.getMac());
+ public boolean removeHost(HostEvent device) {
+ log.debug("Removing host into DB. mac {}", device.getMac());
KVDevice rcDevice = new KVDevice(device.getMac().toBytes());
rcDevice.forceDelete();
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyDiscoveryInterface.java b/src/main/java/net/onrc/onos/core/topology/TopologyDiscoveryInterface.java
index 16d8af1..d9c5c38 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyDiscoveryInterface.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyDiscoveryInterface.java
@@ -52,16 +52,16 @@
public void removeLinkDiscoveryEvent(LinkEvent linkEvent);
/**
- * Device discovered event.
+ * Host discovered event.
*
- * @param deviceEvent the device event.
+ * @param hostEvent the device event.
*/
- public void putDeviceDiscoveryEvent(DeviceEvent deviceEvent);
+ public void putHostDiscoveryEvent(HostEvent hostEvent);
/**
- * Device removed event.
+ * Host removed event.
*
- * @param deviceEvent the device event.
+ * @param hostEvent the device event.
*/
- public void removeDeviceDiscoveryEvent(DeviceEvent deviceEvent);
+ public void removeHostDiscoveryEvent(HostEvent hostEvent);
}
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyEvent.java b/src/main/java/net/onrc/onos/core/topology/TopologyEvent.java
index 85ebe03..f9a9f7b 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyEvent.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyEvent.java
@@ -4,14 +4,14 @@
* Self-contained Topology event Object
* <p/>
* TODO: For now the topology event contains one of the following events:
- * Switch, Port, Link, Device. In the future it will contain multiple events
+ * Switch, Port, Link, Host. In the future it will contain multiple events
* in a single transaction.
*/
public class TopologyEvent {
SwitchEvent switchEvent = null; // Set for Switch event
PortEvent portEvent = null; // Set for Port event
LinkEvent linkEvent = null; // Set for Link event
- DeviceEvent deviceEvent = null; // Set for Device event
+ HostEvent hostEvent = null; // Set for Host event
/**
* Default constructor.
@@ -47,12 +47,12 @@
}
/**
- * Constructor for given Device event.
+ * Constructor for given Host event.
*
- * @param deviceEvent the Device event to use.
+ * @param hostEvent the Host event to use.
*/
- TopologyEvent(DeviceEvent deviceEvent) {
- this.deviceEvent = deviceEvent;
+ TopologyEvent(HostEvent hostEvent) {
+ this.hostEvent = hostEvent;
}
/**
@@ -71,8 +71,8 @@
if (linkEvent != null) {
return linkEvent.toString();
}
- if (deviceEvent != null) {
- return deviceEvent.toString();
+ if (hostEvent != null) {
+ return hostEvent.toString();
}
return "[Empty TopologyEvent]";
}
@@ -92,8 +92,8 @@
if (linkEvent != null) {
return linkEvent.getID();
}
- if (deviceEvent != null) {
- return deviceEvent.getID();
+ if (hostEvent != null) {
+ return hostEvent.getID();
}
return null;
}
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyEvents.java b/src/main/java/net/onrc/onos/core/topology/TopologyEvents.java
index e553836..1900132 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyEvents.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyEvents.java
@@ -37,8 +37,8 @@
private final Collection<PortEvent> removedPortEvents;
private final Collection<LinkEvent> addedLinkEvents;
private final Collection<LinkEvent> removedLinkEvents;
- private final Collection<DeviceEvent> addedHostEvents;
- private final Collection<DeviceEvent> removedHostEvents;
+ private final Collection<HostEvent> addedHostEvents;
+ private final Collection<HostEvent> removedHostEvents;
/**
* Constructor.
@@ -61,8 +61,8 @@
Collection<PortEvent> removedPortEvents,
Collection<LinkEvent> addedLinkEvents,
Collection<LinkEvent> removedLinkEvents,
- Collection<DeviceEvent> addedHostEvents,
- Collection<DeviceEvent> removedHostEvents) {
+ Collection<HostEvent> addedHostEvents,
+ Collection<HostEvent> removedHostEvents) {
// CHECKSTYLE:ON
this.timestamp = timestamp;
this.addedSwitchEvents =
@@ -151,7 +151,7 @@
*
* @return the collection of added Host Events.
*/
- public Collection<DeviceEvent> getAddedHostEvents() {
+ public Collection<HostEvent> getAddedHostEvents() {
return addedHostEvents;
}
@@ -160,7 +160,7 @@
*
* @return the collection of removed Host Events.
*/
- public Collection<DeviceEvent> getRemovedHostEvents() {
+ public Collection<HostEvent> getRemovedHostEvents() {
return removedHostEvents;
}
}
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java b/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
index 81f3041..ed03cb5 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
@@ -35,9 +35,9 @@
// XXX may need to be careful when shallow copying.
private final ConcurrentMap<Dpid, ConcurrentMap<PortNumber, Port>> ports;
- // Index from Port to Device
- private final Multimap<SwitchPort, Device> devices;
- private final ConcurrentMap<MACAddress, Device> mac2Device;
+ // Index from Port to Host
+ private final Multimap<SwitchPort, Host> hosts;
+ private final ConcurrentMap<MACAddress, Host> mac2Host;
// SwitchPort -> (type -> Link)
private final ConcurrentMap<SwitchPort, ConcurrentMap<String, Link>> outgoingLinks;
@@ -52,9 +52,9 @@
// TODO: Does these object need to be stored in Concurrent Collection?
switches = new ConcurrentHashMap<>();
ports = new ConcurrentHashMap<>();
- devices = Multimaps.synchronizedMultimap(
- HashMultimap.<SwitchPort, Device>create());
- mac2Device = new ConcurrentHashMap<>();
+ hosts = Multimaps.synchronizedMultimap(
+ HashMultimap.<SwitchPort, Host>create());
+ mac2Host = new ConcurrentHashMap<>();
outgoingLinks = new ConcurrentHashMap<>();
incomingLinks = new ConcurrentHashMap<>();
}
@@ -301,44 +301,44 @@
}
@Override
- public Device getDeviceByMac(MACAddress address) {
- return mac2Device.get(address);
+ public Host getHostByMac(MACAddress address) {
+ return mac2Host.get(address);
}
@Override
- public Iterable<Device> getDevices() {
- return Collections.unmodifiableCollection(mac2Device.values());
+ public Iterable<Host> getHosts() {
+ return Collections.unmodifiableCollection(mac2Host.values());
}
@Override
- public Collection<Device> getDevices(SwitchPort port) {
- return Collections.unmodifiableCollection(devices.get(port));
+ public Collection<Host> getHosts(SwitchPort port) {
+ return Collections.unmodifiableCollection(hosts.get(port));
}
// This method is expected to be serialized by writeLock.
// XXX new or updated device
- protected void putDevice(Device device) {
- // assuming Device is immutable
- Device oldDevice = mac2Device.get(device.getMacAddress());
- if (oldDevice != null) {
+ protected void putHost(Host host) {
+ // assuming Host is immutable
+ Host oldHost = mac2Host.get(host.getMacAddress());
+ if (oldHost != null) {
// remove old attachment point
- removeDevice(oldDevice);
+ removeHost(oldHost);
}
// add new attachment points
- for (Port port : device.getAttachmentPoints()) {
- // TODO Won't need remove() if we define Device equality to reflect
+ for (Port port : host.getAttachmentPoints()) {
+ // TODO Won't need remove() if we define Host equality to reflect
// all of it's fields.
- devices.remove(port.asSwitchPort(), device);
- devices.put(port.asSwitchPort(), device);
+ hosts.remove(port.asSwitchPort(), host);
+ hosts.put(port.asSwitchPort(), host);
}
- mac2Device.put(device.getMacAddress(), device);
+ mac2Host.put(host.getMacAddress(), host);
}
- protected void removeDevice(Device device) {
- for (Port port : device.getAttachmentPoints()) {
- devices.remove(port.asSwitchPort(), device);
+ protected void removeHost(Host host) {
+ for (Port port : host.getAttachmentPoints()) {
+ hosts.remove(port.asSwitchPort(), host);
}
- mac2Device.remove(device.getMacAddress());
+ mac2Host.remove(host.getMacAddress());
}
@Override
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyManager.java b/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
index cfab0e8..bdc6d67 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyManager.java
@@ -73,23 +73,23 @@
new HashMap<ByteBuffer, PortEvent>();
private Map<ByteBuffer, LinkEvent> reorderedAddedLinkEvents =
new HashMap<ByteBuffer, LinkEvent>();
- private Map<ByteBuffer, DeviceEvent> reorderedAddedDeviceEvents =
- new HashMap<ByteBuffer, DeviceEvent>();
+ private Map<ByteBuffer, HostEvent> reorderedAddedHostEvents =
+ new HashMap<ByteBuffer, HostEvent>();
//
// Local state for keeping track of locally discovered events so we can
// cleanup properly when a Switch or Port is removed.
//
- // We keep all Port, (incoming) Link and Device events per Switch DPID:
+ // We keep all Port, (incoming) Link and Host events per Switch DPID:
// - If a switch goes down, we remove all corresponding Port, Link and
- // Device events.
+ // Host events.
// - If a port on a switch goes down, we remove all corresponding Link
- // and Device events discovered by this instance.
+ // and Host events discovered by this instance.
//
// How to handle side-effect of remote events.
// - Remote Port Down event -> Link Down
// Not handled. (XXX Shouldn't it be removed from discovered.. Map)
- // - Remote Device Added -> lose ownership of Device)
+ // - Remote Host Added -> lose ownership of Host)
// Not handled. (XXX Shouldn't it be removed from discovered.. Map)
//
// XXX Domain knowledge based invariant maintenance should be moved to
@@ -97,7 +97,7 @@
//
// What happens on leadership change?
// - Probably should: remove from discovered.. Maps, but not send DELETE events
- // XXX Switch/Port can be rediscovered by new leader, but Link, Device?
+ // XXX Switch/Port can be rediscovered by new leader, but Link, Host?
// - Current: There is no way to recognize leadership change?
// ZookeeperRegistry.requestControl(long, ControlChangeCallback)
// is the only way to register listener, and it allows only 1 listener,
@@ -110,7 +110,7 @@
new HashMap<>();
private Map<Dpid, Map<ByteBuffer, LinkEvent>> discoveredAddedLinkEvents =
new HashMap<>();
- private Map<Dpid, Map<ByteBuffer, DeviceEvent>> discoveredAddedDeviceEvents =
+ private Map<Dpid, Map<ByteBuffer, HostEvent>> discoveredAddedHostEvents =
new HashMap<>();
//
@@ -125,8 +125,8 @@
private List<PortEvent> apiRemovedPortEvents = new LinkedList<>();
private List<LinkEvent> apiAddedLinkEvents = new LinkedList<>();
private List<LinkEvent> apiRemovedLinkEvents = new LinkedList<>();
- private List<DeviceEvent> apiAddedDeviceEvents = new LinkedList<>();
- private List<DeviceEvent> apiRemovedDeviceEvents = new LinkedList<>();
+ private List<HostEvent> apiAddedHostEvents = new LinkedList<>();
+ private List<HostEvent> apiRemovedHostEvents = new LinkedList<>();
/**
* Constructor.
@@ -227,8 +227,8 @@
Map<ByteBuffer, PortEvent> removedPortEvents = new HashMap<>();
Map<ByteBuffer, LinkEvent> addedLinkEvents = new HashMap<>();
Map<ByteBuffer, LinkEvent> removedLinkEvents = new HashMap<>();
- Map<ByteBuffer, DeviceEvent> addedDeviceEvents = new HashMap<>();
- Map<ByteBuffer, DeviceEvent> removedDeviceEvents = new HashMap<>();
+ Map<ByteBuffer, HostEvent> addedHostEvents = new HashMap<>();
+ Map<ByteBuffer, HostEvent> removedHostEvents = new HashMap<>();
//
// Classify and suppress matching events
@@ -238,7 +238,7 @@
SwitchEvent switchEvent = topologyEvent.switchEvent;
PortEvent portEvent = topologyEvent.portEvent;
LinkEvent linkEvent = topologyEvent.linkEvent;
- DeviceEvent deviceEvent = topologyEvent.deviceEvent;
+ HostEvent hostEvent = topologyEvent.hostEvent;
//
// Extract the events
@@ -264,11 +264,11 @@
removedLinkEvents.remove(id);
reorderedAddedLinkEvents.remove(id);
}
- if (deviceEvent != null) {
- ByteBuffer id = deviceEvent.getIDasByteBuffer();
- addedDeviceEvents.put(id, deviceEvent);
- removedDeviceEvents.remove(id);
- reorderedAddedDeviceEvents.remove(id);
+ if (hostEvent != null) {
+ ByteBuffer id = hostEvent.getIDasByteBuffer();
+ addedHostEvents.put(id, hostEvent);
+ removedHostEvents.remove(id);
+ reorderedAddedHostEvents.remove(id);
}
break;
case ENTRY_REMOVE:
@@ -291,11 +291,11 @@
removedLinkEvents.put(id, linkEvent);
reorderedAddedLinkEvents.remove(id);
}
- if (deviceEvent != null) {
- ByteBuffer id = deviceEvent.getIDasByteBuffer();
- addedDeviceEvents.remove(id);
- removedDeviceEvents.put(id, deviceEvent);
- reorderedAddedDeviceEvents.remove(id);
+ if (hostEvent != null) {
+ ByteBuffer id = hostEvent.getIDasByteBuffer();
+ addedHostEvents.remove(id);
+ removedHostEvents.put(id, hostEvent);
+ reorderedAddedHostEvents.remove(id);
}
break;
default:
@@ -314,7 +314,7 @@
// Apply the classified events.
//
// Apply the "add" events in the proper order:
- // switch, port, link, device
+ // switch, port, link, host
//
for (SwitchEvent switchEvent : addedSwitchEvents.values()) {
addSwitch(switchEvent);
@@ -325,15 +325,15 @@
for (LinkEvent linkEvent : addedLinkEvents.values()) {
addLink(linkEvent);
}
- for (DeviceEvent deviceEvent : addedDeviceEvents.values()) {
- addDevice(deviceEvent);
+ for (HostEvent hostEvent : addedHostEvents.values()) {
+ addHost(hostEvent);
}
//
// Apply the "remove" events in the reverse order:
- // device, link, port, switch
+ // host, link, port, switch
//
- for (DeviceEvent deviceEvent : removedDeviceEvents.values()) {
- removeDevice(deviceEvent);
+ for (HostEvent hostEvent : removedHostEvents.values()) {
+ removeHost(hostEvent);
}
for (LinkEvent linkEvent : removedLinkEvents.values()) {
removeLink(linkEvent);
@@ -425,8 +425,8 @@
apiRemovedPortEvents.isEmpty() &&
apiAddedLinkEvents.isEmpty() &&
apiRemovedLinkEvents.isEmpty() &&
- apiAddedDeviceEvents.isEmpty() &&
- apiRemovedDeviceEvents.isEmpty()) {
+ apiAddedHostEvents.isEmpty() &&
+ apiRemovedHostEvents.isEmpty()) {
return; // No events to dispatch
}
@@ -453,11 +453,11 @@
for (LinkEvent linkEvent : apiRemovedLinkEvents) {
log.debug("Dispatch Topology Event: REMOVED {}", linkEvent);
}
- for (DeviceEvent deviceEvent : apiAddedDeviceEvents) {
- log.debug("Dispatch Topology Event: ADDED {}", deviceEvent);
+ for (HostEvent hostEvent : apiAddedHostEvents) {
+ log.debug("Dispatch Topology Event: ADDED {}", hostEvent);
}
- for (DeviceEvent deviceEvent : apiRemovedDeviceEvents) {
- log.debug("Dispatch Topology Event: REMOVED {}", deviceEvent);
+ for (HostEvent hostEvent : apiRemovedHostEvents) {
+ log.debug("Dispatch Topology Event: REMOVED {}", hostEvent);
}
}
@@ -472,8 +472,8 @@
kryo.copy(apiRemovedPortEvents),
kryo.copy(apiAddedLinkEvents),
kryo.copy(apiRemovedLinkEvents),
- kryo.copy(apiAddedDeviceEvents),
- kryo.copy(apiRemovedDeviceEvents));
+ kryo.copy(apiAddedHostEvents),
+ kryo.copy(apiRemovedHostEvents));
listener.topologyEvents(events);
}
@@ -486,8 +486,8 @@
apiRemovedPortEvents.clear();
apiAddedLinkEvents.clear();
apiRemovedLinkEvents.clear();
- apiAddedDeviceEvents.clear();
- apiRemovedDeviceEvents.clear();
+ apiAddedHostEvents.clear();
+ apiRemovedHostEvents.clear();
}
/**
@@ -509,7 +509,7 @@
// NOTE: For simplicity we try to apply all events of a particular
// type if any "parent" type event was processed:
// - Apply reordered Port Events if Switches were added
- // - Apply reordered Link and Device Events if Switches or Ports
+ // - Apply reordered Link and Host Events if Switches or Ports
// were added
//
@@ -524,7 +524,7 @@
}
}
//
- // Apply reordered Link and Device Events if Switches or Ports
+ // Apply reordered Link and Host Events if Switches or Ports
// were added.
//
Map<ByteBuffer, LinkEvent> linkEvents = reorderedAddedLinkEvents;
@@ -533,10 +533,10 @@
addLink(linkEvent);
}
//
- Map<ByteBuffer, DeviceEvent> deviceEvents = reorderedAddedDeviceEvents;
- reorderedAddedDeviceEvents = new HashMap<>();
- for (DeviceEvent deviceEvent : deviceEvents.values()) {
- addDevice(deviceEvent);
+ Map<ByteBuffer, HostEvent> hostEvents = reorderedAddedHostEvents;
+ reorderedAddedHostEvents = new HashMap<>();
+ for (HostEvent hostEvent : hostEvents.values()) {
+ addHost(hostEvent);
}
}
@@ -642,14 +642,14 @@
discoveredAddedLinkEvents.remove(switchEvent.getDpid());
}
- // Cleanup for each device
- Map<ByteBuffer, DeviceEvent> oldDeviceEvents =
- discoveredAddedDeviceEvents.get(switchEvent.getDpid());
- if (oldDeviceEvents != null) {
- for (DeviceEvent deviceEvent : new ArrayList<>(oldDeviceEvents.values())) {
- removeDeviceDiscoveryEvent(deviceEvent);
+ // Cleanup for each host
+ Map<ByteBuffer, HostEvent> oldHostEvents =
+ discoveredAddedHostEvents.get(switchEvent.getDpid());
+ if (oldHostEvents != null) {
+ for (HostEvent hostEvent : new ArrayList<>(oldHostEvents.values())) {
+ removeHostDiscoveryEvent(hostEvent);
}
- discoveredAddedDeviceEvents.remove(switchEvent.getDpid());
+ discoveredAddedHostEvents.remove(switchEvent.getDpid());
}
}
}
@@ -714,21 +714,21 @@
}
}
- // Cleanup for the connected devices
+ // Cleanup for the connected hosts
// TODO: The implementation below is probably wrong
- List<DeviceEvent> removedDeviceEvents = new LinkedList<>();
- Map<ByteBuffer, DeviceEvent> oldDeviceEvents =
- discoveredAddedDeviceEvents.get(portEvent.getDpid());
- if (oldDeviceEvents != null) {
- for (DeviceEvent deviceEvent : new ArrayList<>(oldDeviceEvents.values())) {
- for (SwitchPort swp : deviceEvent.getAttachmentPoints()) {
+ List<HostEvent> removedHostEvents = new LinkedList<>();
+ Map<ByteBuffer, HostEvent> oldHostEvents =
+ discoveredAddedHostEvents.get(portEvent.getDpid());
+ if (oldHostEvents != null) {
+ for (HostEvent hostEvent : new ArrayList<>(oldHostEvents.values())) {
+ for (SwitchPort swp : hostEvent.getAttachmentPoints()) {
if (swp.equals(portEvent.getSwitchPort())) {
- removedDeviceEvents.add(deviceEvent);
+ removedHostEvents.add(hostEvent);
}
}
}
- for (DeviceEvent deviceEvent : removedDeviceEvents) {
- removeDeviceDiscoveryEvent(deviceEvent);
+ for (HostEvent hostEvent : removedHostEvents) {
+ removeHostDiscoveryEvent(hostEvent);
}
}
}
@@ -783,54 +783,54 @@
}
/**
- * Device discovered event.
+ * Host discovered event.
*
- * @param deviceEvent the device event.
+ * @param hostEvent the host event.
*/
@Override
- public void putDeviceDiscoveryEvent(DeviceEvent deviceEvent) {
- if (datastore.addDevice(deviceEvent)) {
+ public void putHostDiscoveryEvent(HostEvent hostEvent) {
+ if (datastore.addHost(hostEvent)) {
// Send out notification
- TopologyEvent topologyEvent = new TopologyEvent(deviceEvent);
+ TopologyEvent topologyEvent = new TopologyEvent(hostEvent);
eventChannel.addEntry(topologyEvent.getID(), topologyEvent);
- log.debug("Put the device info into the cache of the topology. mac {}", deviceEvent.getMac());
+ log.debug("Put the host info into the cache of the topology. mac {}", hostEvent.getMac());
- // Store the new Device Event in the local cache
+ // Store the new Host Event in the local cache
// TODO: The implementation below is probably wrong
- for (SwitchPort swp : deviceEvent.getAttachmentPoints()) {
- Map<ByteBuffer, DeviceEvent> oldDeviceEvents =
- discoveredAddedDeviceEvents.get(swp.getDpid());
- if (oldDeviceEvents == null) {
- oldDeviceEvents = new HashMap<>();
- discoveredAddedDeviceEvents.put(swp.getDpid(),
- oldDeviceEvents);
+ for (SwitchPort swp : hostEvent.getAttachmentPoints()) {
+ Map<ByteBuffer, HostEvent> oldHostEvents =
+ discoveredAddedHostEvents.get(swp.getDpid());
+ if (oldHostEvents == null) {
+ oldHostEvents = new HashMap<>();
+ discoveredAddedHostEvents.put(swp.getDpid(),
+ oldHostEvents);
}
- ByteBuffer id = deviceEvent.getIDasByteBuffer();
- oldDeviceEvents.put(id, deviceEvent);
+ ByteBuffer id = hostEvent.getIDasByteBuffer();
+ oldHostEvents.put(id, hostEvent);
}
}
}
/**
- * Device removed event.
+ * Host removed event.
*
- * @param deviceEvent the device event.
+ * @param hostEvent the host event.
*/
@Override
- public void removeDeviceDiscoveryEvent(DeviceEvent deviceEvent) {
- if (datastore.removeDevice(deviceEvent)) {
+ public void removeHostDiscoveryEvent(HostEvent hostEvent) {
+ if (datastore.removeHost(hostEvent)) {
// Send out notification
- eventChannel.removeEntry(deviceEvent.getID());
- log.debug("Remove the device info into the cache of the topology. mac {}", deviceEvent.getMac());
+ eventChannel.removeEntry(hostEvent.getID());
+ log.debug("Remove the host info into the cache of the topology. mac {}", hostEvent.getMac());
- // Cleanup the Device Event from the local cache
+ // Cleanup the Host Event from the local cache
// TODO: The implementation below is probably wrong
- ByteBuffer id = ByteBuffer.wrap(deviceEvent.getID());
- for (SwitchPort swp : deviceEvent.getAttachmentPoints()) {
- Map<ByteBuffer, DeviceEvent> oldDeviceEvents =
- discoveredAddedDeviceEvents.get(swp.getDpid());
- if (oldDeviceEvents != null) {
- oldDeviceEvents.remove(id);
+ ByteBuffer id = ByteBuffer.wrap(hostEvent.getID());
+ for (SwitchPort swp : hostEvent.getAttachmentPoints()) {
+ Map<ByteBuffer, HostEvent> oldHostEvents =
+ discoveredAddedHostEvents.get(swp.getDpid());
+ if (oldHostEvents != null) {
+ oldHostEvents.remove(id);
}
}
}
@@ -923,7 +923,7 @@
/**
* Removes a port from the topology replica.
* <p/>
- * It will call {@link #removeDevice(DeviceEvent)} for each hosts on this port
+ * It will call {@link #removeHost(HostEvent)} for each hosts on this port
* and call {@link #removeLink(LinkEvent)} for each links on this port.
*
* @param portEvent the PortEvent with the port to remove.
@@ -944,19 +944,19 @@
}
//
- // Remove all Devices attached to the Port
+ // Remove all Hosts attached to the Port
//
- ArrayList<DeviceEvent> devicesToRemove = new ArrayList<>();
- for (Device device : port.getDevices()) {
- log.debug("Removing Device {} on Port {}", device, portEvent);
- DeviceEvent deviceEvent = new DeviceEvent(device.getMacAddress());
+ ArrayList<HostEvent> hostsToRemove = new ArrayList<>();
+ for (Host host : port.getHosts()) {
+ log.debug("Removing Host {} on Port {}", host, portEvent);
+ HostEvent hostEvent = new HostEvent(host.getMacAddress());
SwitchPort switchPort = new SwitchPort(port.getSwitch().getDpid(),
port.getNumber());
- deviceEvent.addAttachmentPoint(switchPort);
- devicesToRemove.add(deviceEvent);
+ hostEvent.addAttachmentPoint(switchPort);
+ hostsToRemove.add(hostEvent);
}
- for (DeviceEvent deviceEvent : devicesToRemove) {
- removeDevice(deviceEvent);
+ for (HostEvent hostEvent : hostsToRemove) {
+ removeHost(hostEvent);
}
//
@@ -990,7 +990,7 @@
/**
* Adds a link to the topology replica.
* <p/>
- * It will call {@link #removeDevice(DeviceEvent)} for each hosts on both ports.
+ * It will call {@link #removeHost(HostEvent)} for each hosts on both ports.
*
* @param linkEvent the LinkEvent with the link to add.
*/
@@ -1022,28 +1022,28 @@
link = new LinkImpl(topology, linkEvent);
topology.putLink(link);
- // Remove all Devices attached to the Ports
- ArrayList<DeviceEvent> devicesToRemove = new ArrayList<>();
+ // Remove all Hosts attached to the Ports
+ ArrayList<HostEvent> hostsToRemove = new ArrayList<>();
ArrayList<Port> ports = new ArrayList<>();
ports.add(srcPort);
ports.add(dstPort);
for (Port port : ports) {
- for (Device device : port.getDevices()) {
- log.error("Device {} on Port {} should have been removed prior to adding Link {}",
- device, port, linkEvent);
- // FIXME must get Device info from topology, when we add attrs.
- DeviceEvent deviceEvent =
- new DeviceEvent(device.getMacAddress());
+ for (Host host : port.getHosts()) {
+ log.error("Host {} on Port {} should have been removed prior to adding Link {}",
+ host, port, linkEvent);
+ // FIXME must get Host info from topology, when we add attrs.
+ HostEvent hostEvent =
+ new HostEvent(host.getMacAddress());
SwitchPort switchPort =
new SwitchPort(port.getSwitch().getDpid(),
port.getNumber());
// adding attachment port which needs to be removed
- deviceEvent.addAttachmentPoint(switchPort);
- devicesToRemove.add(deviceEvent);
+ hostEvent.addAttachmentPoint(switchPort);
+ hostsToRemove.add(hostEvent);
}
}
- for (DeviceEvent deviceEvent : devicesToRemove) {
- removeDevice(deviceEvent);
+ for (HostEvent hostEvent : hostsToRemove) {
+ removeHost(hostEvent);
}
} else {
// TODO: Update the link attributes
@@ -1100,38 +1100,38 @@
}
/**
- * Adds a device to the topology replica.
+ * Adds a host to the topology replica.
* <p/>
- * TODO: Device-related work is incomplete.
+ * TODO: Host-related work is incomplete.
* TODO: Eventually, we might need to consider reordering
* or addLink() and addDevice() events on the same port.
*
- * @param deviceEvent the DeviceEvent with the device to add.
+ * @param hostEvent the HostEvent with the host to add.
*/
@GuardedBy("topology.writeLock")
- private void addDevice(DeviceEvent deviceEvent) {
- log.debug("Adding a device to the topology with mac {}", deviceEvent.getMac());
- Device device = topology.getDeviceByMac(deviceEvent.getMac());
+ private void addHost(HostEvent hostEvent) {
+ log.debug("Adding a host to the topology with mac {}", hostEvent.getMac());
+ Host host = topology.getHostByMac(hostEvent.getMac());
- if (device == null) {
- log.debug("Existing device was not found in the Topology: Adding new device: mac {}", deviceEvent.getMac());
- device = new DeviceImpl(topology, deviceEvent.getMac());
+ if (host == null) {
+ log.debug("Existing host was not found in the Topology: Adding new host: mac {}", hostEvent.getMac());
+ host = new HostImpl(topology, hostEvent.getMac());
}
- DeviceImpl deviceImpl = (DeviceImpl) device;
+ HostImpl hostImpl = (HostImpl) host;
// Process each attachment point
boolean attachmentFound = false;
- for (SwitchPort swp : deviceEvent.getAttachmentPoints()) {
- // XXX domain knowledge: Port must exist before Device
+ for (SwitchPort swp : hostEvent.getAttachmentPoints()) {
+ // XXX domain knowledge: Port must exist before Host
// but this knowledge cannot be pushed down to driver.
// Attached Ports must exist
Port port = topology.getPort(swp.getDpid(), swp.getPortNumber());
if (port == null) {
// Reordered event: delay the event in local cache
- ByteBuffer id = deviceEvent.getIDasByteBuffer();
- reorderedAddedDeviceEvents.put(id, deviceEvent);
+ ByteBuffer id = hostEvent.getIDasByteBuffer();
+ reorderedAddedHostEvents.put(id, hostEvent);
continue;
}
// Attached Ports must not have Link
@@ -1143,39 +1143,39 @@
continue;
}
- // Add Device <-> Port attachment
- deviceImpl.addAttachmentPoint(port);
+ // Add Host <-> Port attachment
+ hostImpl.addAttachmentPoint(port);
attachmentFound = true;
}
- deviceImpl.setLastSeenTime(deviceEvent.getLastSeenTime());
+ hostImpl.setLastSeenTime(hostEvent.getLastSeenTime());
- // Update the device in the topology
+ // Update the host in the topology
if (attachmentFound) {
- log.debug("Storing the device info into the Topology: mac {}", deviceEvent.getMac());
- topology.putDevice(device);
- apiAddedDeviceEvents.add(deviceEvent);
+ log.debug("Storing the host info into the Topology: mac {}", hostEvent.getMac());
+ topology.putHost(host);
+ apiAddedHostEvents.add(hostEvent);
}
}
/**
- * Removes a device from the topology replica.
+ * Removes a host from the topology replica.
* <p/>
- * TODO: Device-related work is incomplete.
+ * TODO: Host-related work is incomplete.
*
- * @param deviceEvent the Device Event with the device to remove.
+ * @param hostEvent the Host Event with the host to remove.
*/
@GuardedBy("topology.writeLock")
- private void removeDevice(DeviceEvent deviceEvent) {
- log.debug("Removing a device from the topology: mac {}", deviceEvent.getMac());
- Device device = topology.getDeviceByMac(deviceEvent.getMac());
- if (device == null) {
- log.warn("Device {} already removed, ignoring", deviceEvent);
+ private void removeHost(HostEvent hostEvent) {
+ log.debug("Removing a host from the topology: mac {}", hostEvent.getMac());
+ Host host = topology.getHostByMac(hostEvent.getMac());
+ if (host == null) {
+ log.warn("Host {} already removed, ignoring", hostEvent);
return;
}
- topology.removeDevice(device);
- apiRemovedDeviceEvents.add(deviceEvent);
+ topology.removeHost(host);
+ apiRemovedHostEvents.add(hostEvent);
}
/**
@@ -1222,7 +1222,7 @@
}
for (KVDevice d : KVDevice.getAllDevices()) {
- DeviceEvent devEvent = new DeviceEvent(MACAddress.valueOf(d.getMac()));
+ HostEvent devEvent = new HostEvent(MACAddress.valueOf(d.getMac()));
for (byte[] portId : d.getAllPortIds()) {
devEvent.addAttachmentPoint(
new SwitchPort(KVPort.getDpidFromKey(portId),
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java b/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
index 1074905..186aafb 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyPublisher.java
@@ -360,21 +360,21 @@
SwitchPort sp = new SwitchPort(host.getSwitchDPID(), host.getSwitchPort());
List<SwitchPort> spLists = new ArrayList<SwitchPort>();
spLists.add(sp);
- DeviceEvent event = new DeviceEvent(host.getMacAddress());
+ HostEvent event = new HostEvent(host.getMacAddress());
event.setAttachmentPoints(spLists);
event.setLastSeenTime(host.getLastSeenTimestamp().getTime());
// Does not use vlan info now.
event.freeze();
- topologyDiscoveryInterface.putDeviceDiscoveryEvent(event);
+ topologyDiscoveryInterface.putHostDiscoveryEvent(event);
}
@Override
public void hostRemoved(Host host) {
log.debug("Called onosDeviceRemoved");
- DeviceEvent event = new DeviceEvent(host.getMacAddress());
+ HostEvent event = new HostEvent(host.getMacAddress());
//XXX shouldn't we be setting attachment points?
event.freeze();
- topologyDiscoveryInterface.removeDeviceDiscoveryEvent(event);
+ topologyDiscoveryInterface.removeHostDiscoveryEvent(event);
}
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/DevicesResource.java b/src/main/java/net/onrc/onos/core/topology/web/HostsResource.java
similarity index 88%
rename from src/main/java/net/onrc/onos/core/topology/web/DevicesResource.java
rename to src/main/java/net/onrc/onos/core/topology/web/HostsResource.java
index ef5f4a3..301fb9e 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/DevicesResource.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/HostsResource.java
@@ -11,7 +11,7 @@
/**
* A class to access hosts information from the network topology.
*/
-public class DevicesResource extends ServerResource {
+public class HostsResource extends ServerResource {
/**
* Gets the hosts information from the network topology.
*
@@ -27,7 +27,7 @@
Topology topology = topologyService.getTopology();
topology.acquireReadLock();
try {
- return eval(toRepresentation(topology.getDevices(), null));
+ return eval(toRepresentation(topology.getHosts(), null));
} finally {
topology.releaseReadLock();
}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java b/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
index 1f224d2..88085ef 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
@@ -18,7 +18,7 @@
// Topology API
router.attach("", TopologyResource.class);
- router.attach("/hosts", DevicesResource.class);
+ router.attach("/hosts", HostsResource.class);
router.attach("/links", LinksResource.class);
router.attach("/switches", SwitchesResource.class);
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceEventSerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/HostEventSerializer.java
similarity index 64%
rename from src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceEventSerializer.java
rename to src/main/java/net/onrc/onos/core/topology/web/serializers/HostEventSerializer.java
index 4ced3c3..eefb4eb 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceEventSerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/HostEventSerializer.java
@@ -2,7 +2,7 @@
import java.io.IOException;
-import net.onrc.onos.core.topology.DeviceEvent;
+import net.onrc.onos.core.topology.HostEvent;
import net.onrc.onos.core.topology.TopologyElement;
import net.onrc.onos.core.util.SwitchPort;
@@ -10,28 +10,28 @@
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
-public class DeviceEventSerializer extends SerializerBase<DeviceEvent> {
+public class HostEventSerializer extends SerializerBase<HostEvent> {
- public DeviceEventSerializer() {
- super(DeviceEvent.class);
+ public HostEventSerializer() {
+ super(HostEvent.class);
}
@Override
- public void serialize(DeviceEvent deviceEvent, JsonGenerator jsonGenerator,
+ public void serialize(HostEvent hostEvent, JsonGenerator jsonGenerator,
SerializerProvider serializerProvider) throws IOException {
//
// TODO: For now, the JSON format of the serialized output should
- // be same as the JSON format of the corresponding class Device.
+ // be same as the JSON format of the corresponding class Host.
// In the future, we will use a single serializer.
//
jsonGenerator.writeStartObject();
- jsonGenerator.writeStringField(TopologyElement.TYPE, deviceEvent.getType());
- jsonGenerator.writeStringField("mac", deviceEvent.getMac().toString());
+ jsonGenerator.writeStringField(TopologyElement.TYPE, hostEvent.getType());
+ jsonGenerator.writeStringField("mac", hostEvent.getMac().toString());
jsonGenerator.writeFieldName("attachmentPoints");
jsonGenerator.writeStartArray();
- for (SwitchPort switchPort : deviceEvent.getAttachmentPoints()) {
+ for (SwitchPort switchPort : hostEvent.getAttachmentPoints()) {
jsonGenerator.writeObject(switchPort);
}
jsonGenerator.writeEndArray();
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceSerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/HostSerializer.java
similarity index 67%
rename from src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceSerializer.java
rename to src/main/java/net/onrc/onos/core/topology/web/serializers/HostSerializer.java
index 1445787..c706f26 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceSerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/HostSerializer.java
@@ -2,7 +2,7 @@
import java.io.IOException;
-import net.onrc.onos.core.topology.Device;
+import net.onrc.onos.core.topology.Host;
import net.onrc.onos.core.topology.Port;
import net.onrc.onos.core.topology.TopologyElement;
@@ -10,28 +10,28 @@
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
-public class DeviceSerializer extends SerializerBase<Device> {
+public class HostSerializer extends SerializerBase<Host> {
- public DeviceSerializer() {
- super(Device.class);
+ public HostSerializer() {
+ super(Host.class);
}
@Override
- public void serialize(Device dev, JsonGenerator jsonGenerator,
+ public void serialize(Host host, JsonGenerator jsonGenerator,
SerializerProvider serializerProvider) throws IOException {
//
// TODO: For now, the JSON format of the serialized output should
- // be same as the JSON format of the corresponding class DeviceEvent.
+ // be same as the JSON format of the corresponding class HostEvent.
// In the future, we will use a single serializer.
//
jsonGenerator.writeStartObject();
- jsonGenerator.writeStringField(TopologyElement.TYPE, dev.getType());
- jsonGenerator.writeStringField("mac", dev.getMacAddress().toString());
+ jsonGenerator.writeStringField(TopologyElement.TYPE, host.getType());
+ jsonGenerator.writeStringField("mac", host.getMacAddress().toString());
jsonGenerator.writeFieldName("attachmentPoints");
jsonGenerator.writeStartArray();
- for (Port port : dev.getAttachmentPoints()) {
+ for (Port port : host.getAttachmentPoints()) {
jsonGenerator.writeObject(port.asSwitchPort());
}
jsonGenerator.writeEndArray();
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologyEventsSerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologyEventsSerializer.java
index e5f81c0..713969b 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologyEventsSerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologyEventsSerializer.java
@@ -1,6 +1,6 @@
package net.onrc.onos.core.topology.web.serializers;
-import net.onrc.onos.core.topology.DeviceEvent;
+import net.onrc.onos.core.topology.HostEvent;
import net.onrc.onos.core.topology.LinkEvent;
import net.onrc.onos.core.topology.PortEvent;
import net.onrc.onos.core.topology.SwitchEvent;
@@ -87,14 +87,14 @@
// Output the added hosts array
jsonGenerator.writeArrayFieldStart("addedHosts");
- for (final DeviceEvent hostEvent : topologyEvents.getAddedHostEvents()) {
+ for (final HostEvent hostEvent : topologyEvents.getAddedHostEvents()) {
jsonGenerator.writeObject(hostEvent);
}
jsonGenerator.writeEndArray();
// Output the removed hosts array
jsonGenerator.writeArrayFieldStart("removedHosts");
- for (final DeviceEvent hostEvent : topologyEvents.getRemovedHostEvents()) {
+ for (final HostEvent hostEvent : topologyEvents.getRemovedHostEvents()) {
jsonGenerator.writeObject(hostEvent);
}
jsonGenerator.writeEndArray();
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologySerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologySerializer.java
index 48a5cfc..db3bdeb 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologySerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/TopologySerializer.java
@@ -1,6 +1,6 @@
package net.onrc.onos.core.topology.web.serializers;
-import net.onrc.onos.core.topology.Device;
+import net.onrc.onos.core.topology.Host;
import net.onrc.onos.core.topology.Link;
import net.onrc.onos.core.topology.Switch;
import net.onrc.onos.core.topology.Topology;
@@ -57,8 +57,8 @@
// Output the hosts array
jsonGenerator.writeArrayFieldStart("hosts");
- for (final Device device : topology.getDevices()) {
- jsonGenerator.writeObject(device);
+ for (final Host host : topology.getHosts()) {
+ jsonGenerator.writeObject(host);
}
jsonGenerator.writeEndArray();
diff --git a/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java b/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java
index 9fdc506..18de585 100644
--- a/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java
+++ b/src/main/java/net/onrc/onos/core/util/serializers/KryoFactory.java
@@ -25,7 +25,7 @@
import net.onrc.onos.core.packetservice.BroadcastPacketOutNotification;
import net.onrc.onos.core.packetservice.PacketOutNotification;
import net.onrc.onos.core.packetservice.SinglePacketOutNotification;
-import net.onrc.onos.core.topology.DeviceEvent;
+import net.onrc.onos.core.topology.HostEvent;
import net.onrc.onos.core.topology.LinkEvent;
import net.onrc.onos.core.topology.PortEvent;
import net.onrc.onos.core.topology.SwitchEvent;
@@ -197,7 +197,7 @@
kryo.register(LinkTuple.class);
// New data model-related classes
- kryo.register(DeviceEvent.class);
+ kryo.register(HostEvent.class);
kryo.register(LinkedList.class);
kryo.register(LinkEvent.class);
kryo.register(PortEvent.class);
@@ -221,7 +221,7 @@
kryo.register(IntentStateList.class);
kryo.register(HashMap.class);
- // Device-related classes
+ // Host-related classes
kryo.register(HashSet.class);
kryo.register(Host.class);
kryo.register(Date.class);