Skip to content
Snippets Groups Projects
Commit 04d6a714 authored by abat's avatar abat
Browse files

Merge into master from pull request #302:

Device moved notification must be sent after the indices are updated. (https://github.com/floodlight/floodlight/pull/302)
parents 06ff592b 3b4c61a0
No related branches found
No related tags found
No related merge requests found
...@@ -1123,27 +1123,12 @@ IFlowReconcileListener, IInfoProvider, IHAListener { ...@@ -1123,27 +1123,12 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
} }
break; break;
} else { } else {
boolean moved = false;
Device newDevice = allocateDevice(device, entity); Device newDevice = allocateDevice(device, entity);
if (entity.getSwitchDPID() != null && entity.getSwitchPort() != null) { if (entity.getSwitchDPID() != null && entity.getSwitchPort() != null) {
boolean moved = moved = newDevice.updateAttachmentPoint(entity.getSwitchDPID(),
newDevice.updateAttachmentPoint(entity.getSwitchDPID(),
entity.getSwitchPort().shortValue(), entity.getSwitchPort().shortValue(),
entity.getLastSeenTimestamp().getTime()); entity.getLastSeenTimestamp().getTime());
if (moved) {
sendDeviceMovedNotification(device);
if (logger.isDebugEnabled()) {
logger.debug("Device moved: attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Device attachment point updated: " +
"attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
}
} }
// generate updates // generate updates
...@@ -1172,6 +1157,22 @@ IFlowReconcileListener, IInfoProvider, IHAListener { ...@@ -1172,6 +1157,22 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
updateSecondaryIndices(entity, updateSecondaryIndices(entity,
device.getEntityClass(), device.getEntityClass(),
deviceKey); deviceKey);
if (moved) {
sendDeviceMovedNotification(device);
if (logger.isDebugEnabled()) {
logger.debug("Device moved: attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Device attachment point updated: " +
"attachment points {}," +
"entities {}", device.attachmentPoints,
device.entities);
}
}
break; break;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment