Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.core.internal; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService; |
| 6 | |
| 7 | public class TopoSwitchServiceImpl implements ITopoSwitchService { |
| 8 | |
| 9 | ThreadLocal<SwitchStorageImpl> store = new ThreadLocal<SwitchStorageImpl>() { |
| 10 | @Override |
| 11 | protected SwitchStorageImpl initialValue() { |
| 12 | SwitchStorageImpl swStore = new SwitchStorageImpl(); |
| 13 | //TODO: Get the file path from global properties |
| 14 | swStore.init("/tmp/cassandra.titan"); |
| 15 | return swStore; |
| 16 | } |
| 17 | }; |
| 18 | |
| 19 | SwitchStorageImpl swStore = store.get(); |
| 20 | |
| 21 | @Override |
| 22 | public List<String> GetActiveSwitches() { |
| 23 | // TODO Auto-generated method stub |
| 24 | return swStore.getActiveSwitches(); |
| 25 | } |
| 26 | |
| 27 | @Override |
| 28 | public List<String> GetAllSwitches() { |
| 29 | // TODO Auto-generated method stub |
| 30 | return swStore.getAllSwitches(); |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public List<String> GetInactiveSwitches() { |
| 35 | // TODO Auto-generated method stub |
| 36 | return swStore.getInactiveSwitches(); |
| 37 | } |
| 38 | |
| 39 | @Override |
| 40 | public List<String> GetPortsOnSwitch(String dpid) { |
| 41 | // TODO Auto-generated method stub |
| 42 | return null; |
| 43 | } |
| 44 | |
| 45 | } |