Class ReadRequestController


  • public final class ReadRequestController
    extends ro.pippo.controller.Controller
    Controller for read requests
    • Field Detail

      • log

        protected final org.slf4j.Logger log
    • Constructor Detail

      • ReadRequestController

        public ReadRequestController()
    • 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 device

        As 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
      • getKnxClient

        public final KnxClient getKnxClient()
      • limitAndGetAsList

        protected final <T> List<T> limitAndGetAsList​(Collection<T> list)
        Returns a range of T elements from list. May be limited using start and limit request 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