Skip to content
Snippets Groups Projects
Commit 5ca25c26 authored by abat's avatar abat
Browse files

Merge into master from pull request #297:

Update to attachment point logic.  Ignore the attachment point if it is not picked up from oldAPlist and does not replace already known AP. (https://github.com/floodlight/floodlight/pull/297)
parents 4bf09d0d b46f6902
No related branches found
No related tags found
No related merge requests found
...@@ -329,6 +329,7 @@ entity.getLastSeenTimestamp().getTime()); ...@@ -329,6 +329,7 @@ entity.getLastSeenTimestamp().getTime());
ITopologyService topology = deviceManager.topology; ITopologyService topology = deviceManager.topology;
List<AttachmentPoint> oldAPList; List<AttachmentPoint> oldAPList;
List<AttachmentPoint> apList; List<AttachmentPoint> apList;
boolean oldAPFlag = false;
if (!deviceManager.isValidAttachmentPoint(sw, port)) return false; if (!deviceManager.isValidAttachmentPoint(sw, port)) return false;
AttachmentPoint newAP = new AttachmentPoint(sw, port, lastSeen); AttachmentPoint newAP = new AttachmentPoint(sw, port, lastSeen);
...@@ -346,6 +347,7 @@ entity.getLastSeenTimestamp().getTime()); ...@@ -346,6 +347,7 @@ entity.getLastSeenTimestamp().getTime());
newAP = oldAPList.remove(index); newAP = oldAPList.remove(index);
newAP.setLastSeen(lastSeen); newAP.setLastSeen(lastSeen);
this.oldAPs = oldAPList; this.oldAPs = oldAPList;
oldAPFlag = true;
log.debug("DEVICE_MOVE: OldAPs changed for device: {}", oldAPList); log.debug("DEVICE_MOVE: OldAPs changed for device: {}", oldAPList);
} }
...@@ -404,7 +406,8 @@ entity.getLastSeenTimestamp().getTime()); ...@@ -404,7 +406,8 @@ entity.getLastSeenTimestamp().getTime());
// possible duplicates. // possible duplicates.
oldAPList = new ArrayList<AttachmentPoint>(); oldAPList = new ArrayList<AttachmentPoint>();
if (oldAPs != null) oldAPList.addAll(oldAPs); if (oldAPs != null) oldAPList.addAll(oldAPs);
oldAPList.add(newAP); // Add ot oldAPList only if it was picked up from the oldAPList
if (oldAPFlag) oldAPList.add(newAP);
log.debug("DEVICE_MOVED: New attachment point {} does not" + log.debug("DEVICE_MOVED: New attachment point {} does not" +
" replace already existing one {}.", newAP, oldAP); " replace already existing one {}.", newAP, oldAP);
this.oldAPs = oldAPList; this.oldAPs = oldAPList;
......
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