blob: e8b1bf8cca04cf040db345eca98c1a50c0e9d8dd [file] [log] [blame]
Pankaj Berded1259e82013-01-23 14:10:00 -08001package net.floodlightcontroller.core.internal;
2
Pankaj Berde2497e542013-02-19 18:51:24 -08003import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
Pankaj Berde1e2f7312013-02-15 08:25:31 -08004import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
Pankaj Berded1259e82013-01-23 14:10:00 -08005import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService;
6
7public 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 Berde2497e542013-02-19 18:51:24 -080022 public Iterable<ISwitchObject> getActiveSwitches() {
Pankaj Berded1259e82013-01-23 14:10:00 -080023 // TODO Auto-generated method stub
24 return swStore.getActiveSwitches();
25 }
26
27 @Override
Pankaj Berde2497e542013-02-19 18:51:24 -080028 public Iterable<ISwitchObject> getAllSwitches() {
Pankaj Berded18c7622013-02-04 10:28:35 -080029 // TODO Auto-generated method stub
Pankaj Berded1259e82013-01-23 14:10:00 -080030 return swStore.getAllSwitches();
31 }
32
33 @Override
Pankaj Berde2497e542013-02-19 18:51:24 -080034 public Iterable<ISwitchObject> getInactiveSwitches() {
Pankaj Berded1259e82013-01-23 14:10:00 -080035 // TODO Auto-generated method stub
36 return swStore.getInactiveSwitches();
37 }
38
39 @Override
Pankaj Berde2497e542013-02-19 18:51:24 -080040 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 Berded1259e82013-01-23 14:10:00 -080047 // TODO Auto-generated method stub
48 return null;
Pankaj Berded18c7622013-02-04 10:28:35 -080049 }
Pankaj Berded1259e82013-01-23 14:10:00 -080050}