blob: 0edc35e9f5fad5bf78d829e87ee8d3078e98246f [file] [log] [blame]
Pankaj Berded1259e82013-01-23 14:10:00 -08001package net.floodlightcontroller.core.internal;
2
3import java.util.List;
4
5import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService;
Pankaj Berdeff421802013-01-29 20:28:52 -08006import net.floodlightcontroller.core.ISwitchStorage.ISwitchObject;
Pankaj Berded1259e82013-01-23 14:10:00 -08007
8public 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 Berdeff421802013-01-29 20:28:52 -080023 public Iterable<ISwitchObject> GetActiveSwitches() {
Pankaj Berded1259e82013-01-23 14:10:00 -080024 // TODO Auto-generated method stub
25 return swStore.getActiveSwitches();
26 }
27
28 @Override
Pankaj Berdeff421802013-01-29 20:28:52 -080029 public Iterable<ISwitchObject> GetAllSwitches() {
Pankaj Berded1259e82013-01-23 14:10:00 -080030 // TODO Auto-generated method stub
31 return swStore.getAllSwitches();
32 }
33
34 @Override
Pankaj Berdeff421802013-01-29 20:28:52 -080035 public Iterable<ISwitchObject> GetInactiveSwitches() {
Pankaj Berded1259e82013-01-23 14:10:00 -080036 // 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}