blob: 7cfa2c13d68b30bba83b89631952bc518994630d [file] [log] [blame]
Yuta HIGUCHI238fa2a2014-05-01 09:56:46 -07001package net.onrc.onos.apps.proxyarp.web;
Jonathan Hart5afde492013-10-01 12:30:53 +13002
3import net.floodlightcontroller.restserver.RestletRoutable;
4
5import org.restlet.Context;
6import org.restlet.Restlet;
7import org.restlet.routing.Router;
8
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -07009/**
10 * Routing class for ARP module REST URLs.
11 */
Jonathan Hart5afde492013-10-01 12:30:53 +130012public class ArpWebRoutable implements RestletRoutable {
13
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070014 /**
15 * Get a router configured with ARP module REST URLs.
16 *
17 * @param context the restlet context to build a router with
18 * @return the router
19 */
20 @Override
21 public Restlet getRestlet(Context context) {
22 Router router = new Router(context);
23 router.attach("/cache/json", ArpCacheResource.class);
24 return router;
25 }
Jonathan Hart5afde492013-10-01 12:30:53 +130026
Jonathan Hart7c9a2fb2014-03-27 09:51:41 -070027 /**
28 * Get the base path of the ARP module URLs.
29 *
30 * @return the string base path
31 */
32 @Override
33 public String basePath() {
34 return "/wm/arp";
35 }
Jonathan Hart5afde492013-10-01 12:30:53 +130036}