Package com.gears42.iot.webthing
Class WebThingServer.PropertyHandler
- java.lang.Object
-
- com.gears42.iot.webthing.WebThingServer.BaseHandler
-
- com.gears42.iot.webthing.WebThingServer.PropertyHandler
-
- All Implemented Interfaces:
fi.iki.elonen.router.RouterNanoHTTPD.UriResponder
- Enclosing class:
- WebThingServer
public static class WebThingServer.PropertyHandler extends WebThingServer.BaseHandler
Handle a request to /properties/<property>.
-
-
Constructor Summary
Constructors Constructor Description PropertyHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.java.lang.String
getPropertyName(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, fi.iki.elonen.NanoHTTPD.IHTTPSession session)
Get the property name from the URI.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.-
Methods inherited from class com.gears42.iot.webthing.WebThingServer.BaseHandler
corsResponse, delete, getThing, getUriParam, isValidToken, other, parseBody, parseBodyArray, post, validateHost
-
-
-
-
Method Detail
-
getPropertyName
public java.lang.String getPropertyName(fi.iki.elonen.router.RouterNanoHTTPD.UriResource uriResource, fi.iki.elonen.NanoHTTPD.IHTTPSession session)
Get the property name 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:
get
in interfacefi.iki.elonen.router.RouterNanoHTTPD.UriResponder
- Overrides:
get
in 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:
put
in interfacefi.iki.elonen.router.RouterNanoHTTPD.UriResponder
- Overrides:
put
in classWebThingServer.BaseHandler
- Parameters:
uriResource
- The URI resource that was matchedurlParams
- Map of URL parameterssession
- The HTTP session- Returns:
- The appropriate response.
-
-