Class DataRest

java.lang.Object
jakarta.servlet.GenericServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, BasicUniversalConfig, DefaultConfig, DefaultHtmlConfig

public class DataRest extends PetstoreConsolePage
Data sources: a demo page built with DevPageBuilders.data() only (it has no template twin).

/orders streams one CSV row per UTC hour in [start, end) with SeriesSource. The browser requests it once per UTC day chunk and caches closed days in IndexedDB.

Example:

GET /console/dev/data GET /console/dev/data/orders?start=2026-10-01T00:00:00Z&end=2026-10-02T00:00:00Z

See Also:
  • Constructor Details

  • Method Details

    • page

      public View page(RestRequest req)
      Renders the Data sources page.
      Parameters:
      req - The request.
      Returns:
      The page.
    • orders

      public void orders(@Query("start") String start, @Query("end") String end, RestResponse res) throws IOException
      Hourly order counts in the window.

      Writes one row for each UTC hour whose start falls in [floor(start), end), where floor(start) is start rounded down to the hour. So start=00:30&end=02:30 writes the 00:00, 01:00 and 02:00 rows. A window with end before start, or longer than 31 days, is a 400.

      Parameters:
      start - The window start, ISO-8601.
      end - The window end, ISO-8601, exclusive.
      res - The response.
      Throws:
      IOException - If the response can't be written.
    • script

      public void script(RestResponse res) throws IOException
      Serves the page-local script.
      Parameters:
      res - The response.
      Throws:
      IOException - If the bundled script can't be read.