blob: 706445b8621a342d0b77ceb3deb71f37095873a0 [file] [log] [blame]
Jonathan Hart23701d12014-04-03 10:45:48 -07001package net.onrc.onos.core.flowprogrammer.web;
Naoki Shiota2a35b442013-11-26 19:17:38 -08002
Jonathan Harta99ec672014-04-03 11:30:34 -07003import net.floodlightcontroller.core.IFloodlightProviderService;
4import net.onrc.onos.core.flowprogrammer.IFlowPusherService;
5
Naoki Shiota2a35b442013-11-26 19:17:38 -08006import org.restlet.resource.ServerResource;
7import org.slf4j.Logger;
8import org.slf4j.LoggerFactory;
9
Naoki Shiota2a35b442013-11-26 19:17:38 -080010public class PusherResource extends ServerResource {
11 protected final static Logger log = LoggerFactory.getLogger(PusherResource.class);
12
13 protected IFloodlightProviderService provider;
Ray Milkey8e5170e2014-04-02 12:09:55 -070014 protected IFlowPusherService pusher;
15
16 protected boolean init() {
17 provider = (IFloodlightProviderService)
18 getContext().getAttributes().
19 get(IFloodlightProviderService.class.getCanonicalName());
20 if (provider == null) {
21 log.debug("ONOS FloodlightProvider not found");
22 return false;
23 }
24
25 pusher = (IFlowPusherService) getContext().getAttributes().
26 get(IFlowPusherService.class.getCanonicalName());
27 if (pusher == null) {
28 log.debug("ONOS FlowPusherService not found");
29 return false;
30 }
31 return true;
32 }
Naoki Shiota2a35b442013-11-26 19:17:38 -080033}