Class JSONWindSpeedController

java.lang.Object
eu.acclimatize.unison.jsoncontroller.JSONWindSpeedController

@RestController public class JSONWindSpeedController extends Object
A controller to obtain wind speed data in a JSON format.
  • Constructor Details

    • JSONWindSpeedController

      public JSONWindSpeedController(ItemListFinder<HarmonieItem> windSpeedFinder)
      Creates an instance of WindSpeedController.
      Parameters:
      windSpeedFinder - Used to find an ordered list of wind speed data.
  • Method Details

    • windSpeed

      @GetMapping(value="/locationCollection/{name}/windSpeed", produces="application/json") public Iterable<HarmonieItem> windSpeed(@PathVariable("name") String location, @RequestParam("fromDate") @DateTimeFormat(pattern="d-M-yyyy") Date fromDate, @RequestParam("toDate") @DateTimeFormat(pattern="d-M-yyyy") Date toDate, javax.servlet.http.HttpServletResponse response)
      Finds a list of Jackson annotated wind speed data.
      Parameters:
      location - The location of interest.
      fromDate - The start date for the data (inclusive).
      toDate - The end date for the data (inclusive).
      response - The HTTP servlet response used to add the vary and cache control headers.
      Returns:
      A list of WindSpeedResult items.