Pankaj Berde | 5024ec1 | 2013-01-31 17:07:29 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.linkdiscovery.internal; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | import net.floodlightcontroller.core.INetMapTopologyService.ITopoLinkService; |
| 6 | import net.floodlightcontroller.routing.Link; |
| 7 | |
| 8 | public class TopoLinkServiceImpl implements ITopoLinkService { |
| 9 | |
| 10 | ThreadLocal<LinkStorageImpl> store = new ThreadLocal<LinkStorageImpl>() { |
| 11 | @Override |
| 12 | protected LinkStorageImpl initialValue() { |
| 13 | LinkStorageImpl inStore = new LinkStorageImpl(); |
| 14 | //TODO: Get the file path from global properties |
| 15 | inStore.init("/tmp/cassandra.titan"); |
| 16 | return inStore; |
| 17 | } |
| 18 | }; |
| 19 | |
| 20 | LinkStorageImpl linkStore = store.get(); |
| 21 | @Override |
| 22 | public List<Link> GetActiveLinks() { |
| 23 | // TODO Auto-generated method stub |
Pankaj Berde | d18c762 | 2013-02-04 10:28:35 -0800 | [diff] [blame^] | 24 | List<Link> retval = linkStore.getActiveLinks(); |
| 25 | return retval; |
Pankaj Berde | 5024ec1 | 2013-01-31 17:07:29 -0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | @Override |
| 29 | public List<Link> GetLinksOnSwitch(String dpid) { |
| 30 | // TODO Auto-generated method stub |
| 31 | return linkStore.getLinks(dpid); |
| 32 | } |
Pankaj Berde | 5024ec1 | 2013-01-31 17:07:29 -0800 | [diff] [blame] | 33 | } |