blob: deae4bfb95d86df70b97b33d793e6c11a2d26d68 [file] [log] [blame]
Pankaj Berded1259e82013-01-23 14:10:00 -08001package net.floodlightcontroller.core.internal;
2
3import java.util.List;
4
Pankaj Berde2497e542013-02-19 18:51:24 -08005import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
Pankaj Berde1e2f7312013-02-15 08:25:31 -08006import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
Pankaj Berded1259e82013-01-23 14:10:00 -08007import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService;
8
9public 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 Berde2497e542013-02-19 18:51:24 -080024 public Iterable<ISwitchObject> getActiveSwitches() {
Pankaj Berded1259e82013-01-23 14:10:00 -080025 // TODO Auto-generated method stub
26 return swStore.getActiveSwitches();
27 }
28
29 @Override
Pankaj Berde2497e542013-02-19 18:51:24 -080030 public Iterable<ISwitchObject> getAllSwitches() {
Pankaj Berded18c7622013-02-04 10:28:35 -080031 // TODO Auto-generated method stub
Pankaj Berded1259e82013-01-23 14:10:00 -080032 return swStore.getAllSwitches();
33 }
34
35 @Override
Pankaj Berde2497e542013-02-19 18:51:24 -080036 public Iterable<ISwitchObject> getInactiveSwitches() {
Pankaj Berded1259e82013-01-23 14:10:00 -080037 // TODO Auto-generated method stub
38 return swStore.getInactiveSwitches();
39 }
40
41 @Override
Pankaj Berde2497e542013-02-19 18:51:24 -080042 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 Berded1259e82013-01-23 14:10:00 -080049 // TODO Auto-generated method stub
50 return null;
Pankaj Berded18c7622013-02-04 10:28:35 -080051 }
Pankaj Berded1259e82013-01-23 14:10:00 -080052}