Class ReadRequestController
- java.lang.Object
-
- ro.pippo.controller.Controller
-
- li.pitschmann.knx.core.plugin.api.v1.controllers.ReadRequestController
-
public final class ReadRequestController extends ro.pippo.controller.ControllerController for read requests
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description ReadRequestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KnxClientgetKnxClient()XmlProjectgetXmlProject()protected <T> List<T>limitAndGetAsList(Collection<T> list)Returns a range ofTelements from list.ReadResponsereadRequest(ReadRequest readRequest)Endpoint for read request to be forwarded to KNX Net/IP device
-
-
-
Method Detail
-
readRequest
@POST("/read") @Consumes("application/json") @Produces("application/json") public ReadResponse readRequest(@Body ReadRequest readRequest)Endpoint for read request to be forwarded to KNX Net/IP deviceAs soon we get an acknowledge frame from KNX Net/IP device, we will wait for a read request frame up to 3 seconds. If successful, the API will return the actual value with details like data point type. Otherwise, we simply return a JSON response with error state.
- Parameters:
readRequest- the read request from HTTP client- Returns:
- a new instance of
ReadResponse
-
getXmlProject
@Nullable public final XmlProject getXmlProject()
-
getKnxClient
public final KnxClient getKnxClient()
-
limitAndGetAsList
protected final <T> List<T> limitAndGetAsList(Collection<T> list)
Returns a range ofTelements from list. May be limited usingstartandlimitrequest parameters.- Type Parameters:
T- the type of list value to be limited- Parameters:
list- the list that may be limited- Returns:
- a new list of elements from
Collection
-
-