Skip to content
Snippets Groups Projects
Commit de6873ea authored by Vishnu Emmadi's avatar Vishnu Emmadi
Browse files

BVS-447 Flow Path Visualization

Implemented backend for the REST API to retrieve the flow path between a pair of hosts
parent 60c32cef
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,13 @@ public interface ILinkDiscoveryService extends IFloodlightService { ...@@ -40,6 +40,13 @@ public interface ILinkDiscoveryService extends IFloodlightService {
*/ */
public Map<Link, LinkInfo> getLinks(); public Map<Link, LinkInfo> getLinks();
/**
* Retrieves the link info for a given link
* @param link link for which the link info should be returned
* @return the link info for the given link
*/
public LinkInfo getLinkInfo(Link link);
/** /**
* Returns link type of a given link * Returns link type of a given link
* @param info * @param info
......
...@@ -40,6 +40,12 @@ public class LinkInfo { ...@@ -40,6 +40,12 @@ public class LinkInfo {
this.lastBddpReceivedTime = null; this.lastBddpReceivedTime = null;
} }
public LinkInfo(LinkInfo fromLinkInfo) {
this.firstSeenTime = fromLinkInfo.getFirstSeenTime();
this.lastLldpReceivedTime = fromLinkInfo.getUnicastValidTime();
this.lastBddpReceivedTime = fromLinkInfo.getMulticastValidTime();
}
protected Long firstSeenTime; protected Long firstSeenTime;
protected Long lastLldpReceivedTime; /* Standard LLLDP received time */ protected Long lastLldpReceivedTime; /* Standard LLLDP received time */
protected Long lastBddpReceivedTime; /* Modified LLDP received time */ protected Long lastBddpReceivedTime; /* Modified LLDP received time */
......
/** floodlight/src/main/java/net/floodlightcontroller/linkdiscovery/LinkInfo.java/**
* Copyright 2011, Big Switch Networks, Inc. * Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University * Originally created by David Erickson, Stanford University
* *
...@@ -508,6 +508,18 @@ public class LinkDiscoveryManager implements IOFMessageListener, ...@@ -508,6 +508,18 @@ public class LinkDiscoveryManager implements IOFMessageListener,
return result; return result;
} }
@Override
public LinkInfo getLinkInfo(Link link) {
lock.readLock().lock();
LinkInfo linkInfo = links.get(link);
LinkInfo retLinkInfo = null;
if (linkInfo != null) {
retLinkInfo = new LinkInfo(linkInfo);
}
lock.readLock().unlock();
return retLinkInfo;
}
@Override @Override
public String getName() { public String getName() {
return MODULE_NAME; return MODULE_NAME;
......
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