Brian O'Connor | 67c6e66 | 2014-02-17 15:20:44 -0800 | [diff] [blame] | 1 | package net.onrc.onos.intent.runtime; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | import java.util.Collection; |
| 5 | import java.util.Map; |
| 6 | |
| 7 | import net.floodlightcontroller.core.IFloodlightProviderService; |
| 8 | import net.floodlightcontroller.core.module.FloodlightModuleContext; |
| 9 | import net.floodlightcontroller.core.module.FloodlightModuleException; |
| 10 | import net.floodlightcontroller.core.module.IFloodlightModule; |
| 11 | import net.floodlightcontroller.core.module.IFloodlightService; |
| 12 | import net.floodlightcontroller.restserver.IRestApiService; |
| 13 | import net.onrc.onos.ofcontroller.networkgraph.INetworkGraphService; |
| 14 | |
| 15 | public class IntentRuntime implements IFloodlightModule { |
| 16 | protected volatile IFloodlightProviderService floodlightProvider; |
| 17 | protected volatile INetworkGraphService networkGraph; |
| 18 | protected volatile IRestApiService restApi; |
| 19 | |
| 20 | @Override |
| 21 | public void init(FloodlightModuleContext context) |
| 22 | throws FloodlightModuleException { |
| 23 | floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); |
| 24 | networkGraph = context.getServiceImpl(INetworkGraphService.class); |
| 25 | restApi = context.getServiceImpl(IRestApiService.class); |
| 26 | } |
| 27 | |
| 28 | @Override |
| 29 | public void startUp(FloodlightModuleContext context) { |
| 30 | restApi.addRestletRoutable(new IntentWebRoutable()); |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public Collection<Class<? extends IFloodlightService>> getModuleDependencies() { |
| 35 | Collection<Class<? extends IFloodlightService>> l = |
| 36 | new ArrayList<Class<? extends IFloodlightService>>(); |
| 37 | l.add(IFloodlightProviderService.class); |
| 38 | l.add(INetworkGraphService.class); |
| 39 | l.add(IRestApiService.class); |
| 40 | return l; |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public Collection<Class<? extends IFloodlightService>> getModuleServices() { |
| 45 | // TODO Auto-generated method stub |
| 46 | return null; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() { |
| 51 | // TODO Auto-generated method stub |
| 52 | return null; |
| 53 | } |
| 54 | |
| 55 | } |