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 | |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 5 | import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject; |
Pankaj Berde | 1e2f731 | 2013-02-15 08:25:31 -0800 | [diff] [blame] | 6 | import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject; |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 7 | import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService; |
| 8 | |
| 9 | public class TopoSwitchServiceImpl implements ITopoSwitchService { |
| 10 | |
| 11 | ThreadLocal<SwitchStorageImpl> store = new ThreadLocal<SwitchStorageImpl>() { |
| 12 | @Override |
| 13 | protected SwitchStorageImpl initialValue() { |
| 14 | SwitchStorageImpl swStore = new SwitchStorageImpl(); |
| 15 | //TODO: Get the file path from global properties |
| 16 | swStore.init("/tmp/cassandra.titan"); |
| 17 | return swStore; |
| 18 | } |
| 19 | }; |
| 20 | |
| 21 | SwitchStorageImpl swStore = store.get(); |
| 22 | |
| 23 | @Override |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 24 | public Iterable<ISwitchObject> getActiveSwitches() { |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 25 | // TODO Auto-generated method stub |
| 26 | return swStore.getActiveSwitches(); |
| 27 | } |
| 28 | |
| 29 | @Override |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 30 | public Iterable<ISwitchObject> getAllSwitches() { |
Pankaj Berde | d18c762 | 2013-02-04 10:28:35 -0800 | [diff] [blame] | 31 | // TODO Auto-generated method stub |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 32 | return swStore.getAllSwitches(); |
| 33 | } |
| 34 | |
| 35 | @Override |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 36 | public Iterable<ISwitchObject> getInactiveSwitches() { |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 37 | // TODO Auto-generated method stub |
| 38 | return swStore.getInactiveSwitches(); |
| 39 | } |
| 40 | |
| 41 | @Override |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 42 | public Iterable<IPortObject> getPortsOnSwitch(String dpid) { |
| 43 | // TODO Auto-generated method stub |
| 44 | return null; |
| 45 | } |
| 46 | |
| 47 | @Override |
| 48 | public IPortObject getPortOnSwitch(String dpid, short port_num) { |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 49 | // TODO Auto-generated method stub |
| 50 | return null; |
Pankaj Berde | d18c762 | 2013-02-04 10:28:35 -0800 | [diff] [blame] | 51 | } |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 52 | } |