blob: 4e1c0fce077a5a85ae2eb7ae3116fd4d42c78027 [file] [log] [blame]
Naoki Shiota2a35b442013-11-26 19:17:38 -08001package net.onrc.onos.ofcontroller.flowprogrammer.web;
2
3import org.restlet.resource.ServerResource;
4import org.slf4j.Logger;
5import org.slf4j.LoggerFactory;
6
7import net.floodlightcontroller.core.IFloodlightProviderService;
8import net.onrc.onos.ofcontroller.flowprogrammer.IFlowPusherService;
9
10public class PusherResource extends ServerResource {
11 protected final static Logger log = LoggerFactory.getLogger(PusherResource.class);
12
13 protected IFloodlightProviderService provider;
14 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 }
33}