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 |
| 24 | return linkStore.getActiveLinks(); |
| 25 | } |
| 26 | |
| 27 | @Override |
| 28 | public List<Link> GetLinksOnSwitch(String dpid) { |
| 29 | // TODO Auto-generated method stub |
| 30 | return linkStore.getLinks(dpid); |
| 31 | } |
| 32 | |
| 33 | } |