public class ThermostatEndPoint extends RestEndpoint
uri
Constructor and Description |
---|
ThermostatEndPoint(HeadlessThermostat thermostat)
Instantiates a
ThermostatEndPoint . |
Modifier and Type | Method and Description |
---|---|
HTTPResponse |
get(HTTPRequest request,
Map<String,String> headers,
Map<String,String> parameters)
Handles
GET request on this endpoint. |
HTTPResponse |
post(HTTPRequest request,
Map<String,String> headers,
Map<String,String> parameters)
Handles
POST request on this endpoint. |
delete, getURI, put
public ThermostatEndPoint(HeadlessThermostat thermostat) throws IllegalArgumentException
ThermostatEndPoint
.thermostat
- the thermostat to use.IllegalArgumentException
- if URI is emptypublic HTTPResponse get(HTTPRequest request, Map<String,String> headers, Map<String,String> parameters)
RestEndpoint
GET
request on this endpoint.
Default implementation return a a status code 501
get
in class RestEndpoint
request
- the request to handle.headers
- request headers.parameters
- parsed query and body parameters.public HTTPResponse post(HTTPRequest request, Map<String,String> headers, Map<String,String> parameters)
RestEndpoint
POST
request on this endpoint.
Default implementation return a a status code 501
post
in class RestEndpoint
request
- the request to handle.headers
- request headers.parameters
- parsed query and body parameters.