Package com.gears42.iot.webthing
Class WebThingServer.ActionIDHandler
- java.lang.Object
-
- com.gears42.iot.webthing.WebThingServer.BaseHandler
-
- com.gears42.iot.webthing.WebThingServer.ActionIDHandler
-
- All Implemented Interfaces:
fi.iki.elonen.router.RouterNanoHTTPD.UriResponder
- Enclosing class:
- WebThingServer
public static class WebThingServer.ActionIDHandler extends WebThingServer.BaseHandler
Handle a request to /actions/<action_name>/<action_id>.
-
-
Constructor Summary
Constructors Constructor Description ActionIDHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description fi.iki.elonen.NanoHTTPD.Responsedelete(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Handle a DELETE request.fi.iki.elonen.NanoHTTPD.Responseget(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Handle a GET request.java.lang.StringgetActionId(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Get the action ID from the URI.java.lang.StringgetActionName(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Get the action name from the URI.fi.iki.elonen.NanoHTTPD.Responseput(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Handle a PUT request.-
Methods inherited from class com.gears42.iot.webthing.WebThingServer.BaseHandler
corsResponse, getThing, getUriParam, isValidToken, other, parseBody, parseBodyArray, post, validateHost
-
-
-
-
Method Detail
-
getActionName
public java.lang.String getActionName(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Get the action name from the URI.- Parameters:
uriResource- The URI resource that was matchedsession- The HTTP session- Returns:
- The property name.
-
getActionId
public java.lang.String getActionId(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Get the action ID from the URI.- Parameters:
uriResource- The URI resource that was matchedsession- The HTTP session- Returns:
- The property name.
-
get
public fi.iki.elonen.NanoHTTPD.Response get(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Handle a GET request.- Specified by:
getin interfacefi.iki.elonen.router.RouterNanoHTTPD.UriResponder- Overrides:
getin classWebThingServer.BaseHandler- Parameters:
uriResource- The URI resource that was matchedurlParams- Map of URL parameterssession- The HTTP session- Returns:
- The appropriate response.
-
put
public fi.iki.elonen.NanoHTTPD.Response put(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Handle a PUT request.- Specified by:
putin interfacefi.iki.elonen.router.RouterNanoHTTPD.UriResponder- Overrides:
putin classWebThingServer.BaseHandler- Parameters:
uriResource- The URI resource that was matchedurlParams- Map of URL parameterssession- The HTTP session- Returns:
- The appropriate response.
-
delete
public fi.iki.elonen.NanoHTTPD.Response delete(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, java.util.Map<java.lang.String,java.lang.String> urlParams, fi.iki.elonen.NanoHTTPD.IHTTPSession session)Handle a DELETE request.- Specified by:
deletein interfacefi.iki.elonen.router.RouterNanoHTTPD.UriResponder- Overrides:
deletein classWebThingServer.BaseHandler- Parameters:
uriResource- The URI resource that was matchedurlParams- Map of URL parameterssession- The HTTP session- Returns:
- The appropriate response.
-
-