Umesh Krishnaswamy | b56bb29 | 2013-02-12 20:28:27 -0800 | [diff] [blame^] | 1 | package net.floodlightcontroller.mastership; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | import java.util.Collection; |
| 5 | import java.util.HashMap; |
| 6 | import java.util.Map; |
| 7 | |
| 8 | import org.slf4j.Logger; |
| 9 | import org.slf4j.LoggerFactory; |
| 10 | |
| 11 | import net.floodlightcontroller.core.module.FloodlightModuleContext; |
| 12 | import net.floodlightcontroller.core.module.FloodlightModuleException; |
| 13 | import net.floodlightcontroller.core.module.IFloodlightModule; |
| 14 | import net.floodlightcontroller.core.module.IFloodlightService; |
| 15 | import net.floodlightcontroller.mastership.IMastershipService; |
| 16 | |
| 17 | public class MastershipManager implements IFloodlightModule, IMastershipService { |
| 18 | |
| 19 | protected static Logger log = LoggerFactory.getLogger(MastershipManager.class); |
| 20 | protected String mastershipId; |
| 21 | |
| 22 | @Override |
| 23 | public Collection<Class<? extends IFloodlightService>> getModuleServices() { |
| 24 | Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>(); |
| 25 | l.add(IMastershipService.class); |
| 26 | return l; |
| 27 | } |
| 28 | |
| 29 | @Override |
| 30 | public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() { |
| 31 | Map<Class<? extends IFloodlightService>, IFloodlightService> m = |
| 32 | new HashMap<Class<? extends IFloodlightService>, IFloodlightService>(); |
| 33 | m.put(IMastershipService.class, this); |
| 34 | return m; |
| 35 | } |
| 36 | |
| 37 | @Override |
| 38 | public Collection<Class<? extends IFloodlightService>> getModuleDependencies() { |
| 39 | // no module dependencies |
| 40 | return null; |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public void init (FloodlightModuleContext context) throws FloodlightModuleException { |
| 45 | //TODO |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public void startUp (FloodlightModuleContext context) { |
| 51 | //TODO |
| 52 | return; |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | public void acquireMastership(long dpid, boolean blockOk) { |
| 57 | // TODO Auto-generated method stub |
| 58 | |
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | public void releaseMastership(long dpid) { |
| 63 | // TODO Auto-generated method stub |
| 64 | |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public boolean amMaster(long dpid) { |
| 69 | // TODO Auto-generated method stub |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public void setMastershipId(String id) { |
| 75 | // TODO Auto-generated method stub |
| 76 | |
| 77 | } |
| 78 | |
| 79 | @Override |
| 80 | public String getMastershipId() { |
| 81 | // TODO Auto-generated method stub |
| 82 | return null; |
| 83 | } |
| 84 | } |