Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.core.internal; |
| 2 | |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 3 | import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject; |
Pankaj Berde | 1e2f731 | 2013-02-15 08:25:31 -0800 | [diff] [blame] | 4 | import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject; |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 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 |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 22 | public Iterable<ISwitchObject> getActiveSwitches() { |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 23 | // TODO Auto-generated method stub |
| 24 | return swStore.getActiveSwitches(); |
| 25 | } |
| 26 | |
| 27 | @Override |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 28 | public Iterable<ISwitchObject> getAllSwitches() { |
Pankaj Berde | d18c762 | 2013-02-04 10:28:35 -0800 | [diff] [blame] | 29 | // TODO Auto-generated method stub |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 30 | return swStore.getAllSwitches(); |
| 31 | } |
| 32 | |
| 33 | @Override |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 34 | public Iterable<ISwitchObject> getInactiveSwitches() { |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 35 | // TODO Auto-generated method stub |
| 36 | return swStore.getInactiveSwitches(); |
| 37 | } |
| 38 | |
| 39 | @Override |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 40 | public Iterable<IPortObject> getPortsOnSwitch(String dpid) { |
| 41 | // TODO Auto-generated method stub |
| 42 | return null; |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public IPortObject getPortOnSwitch(String dpid, short port_num) { |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 47 | // TODO Auto-generated method stub |
| 48 | return null; |
Pankaj Berde | d18c762 | 2013-02-04 10:28:35 -0800 | [diff] [blame] | 49 | } |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 50 | } |