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