blob: 2f7af2978e57ba43037fc2d317e733f924458275 [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
3import org.restlet.resource.ServerResource;
4import org.slf4j.Logger;
5import org.slf4j.LoggerFactory;
6
7import net.floodlightcontroller.core.IFloodlightProviderService;
Jonathan Hart23701d12014-04-03 10:45:48 -07008import net.onrc.onos.core.flowprogrammer.IFlowPusherService;
Naoki Shiota2a35b442013-11-26 19:17:38 -08009
10public 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}