blob: 1136a90e1d94d4cdb90ca2d0886ef2bb92a22d3e [file] [log] [blame]
Pankaj Berded1259e82013-01-23 14:10:00 -08001package net.floodlightcontroller.core.internal;
2
3import java.util.List;
4
Pankaj Berde1e2f7312013-02-15 08:25:31 -08005import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
Pankaj Berded1259e82013-01-23 14:10:00 -08006import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService;
7
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 Berded18c7622013-02-04 10:28:35 -080030 // TODO Auto-generated method stub
Pankaj Berded1259e82013-01-23 14:10:00 -080031 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;
Pankaj Berded18c7622013-02-04 10:28:35 -080044 }
Pankaj Berded1259e82013-01-23 14:10:00 -080045}