Interface BlackoutApi

All Superinterfaces:
ApiService

@Path("/api/v1/blackouts") @Consumes("application/json") @Produces("application/json") public interface BlackoutApi extends ApiService
Operations on blackout periods.
  • Field Details

  • Method Details

    • serviceName

      default String serviceName()
      Specified by:
      serviceName in interface ApiService
    • getBlackouts

      @GET List<Blackout> getBlackouts(@QueryParam("from") Date from, @QueryParam("to") Date to)
      Returns a list of blackout periods that overlap with the given date range.
      Parameters:
      from - the start of the date range (optional).
      to - the end of the date range (optional).
      Returns:
      the list of blackout periods.
    • getBlackouts

      List<Blackout> getBlackouts()
      Returns a list of all blackout periods.
      Returns:
      the list of all blackout periods.
    • getBlackout

      @GET @Path("/{blackoutId:.*/Blackout[^/]*}") Blackout getBlackout(@PathParam("blackoutId") String blackoutId)
      Returns the blackout period for the given identifier.
      Parameters:
      blackoutId - the full identifier of the blackout period; for example, Configuration/Blackout1.
      Returns:
      the blackout period.
    • addBlackout

      @POST Blackout addBlackout(BlackoutForm blackout)
      Creates a new blackout period.
      Parameters:
      blackout - the blackout period to add.
      Returns:
      the created blackout period.
    • addBlackout

      Blackout addBlackout(Blackout blackout)
      Creates a new blackout period.
      Parameters:
      blackout - the blackout period to add.
      Returns:
      the created blackout period.
    • updateBlackout

      @PUT @Path("/{blackoutId:.*/Blackout[^/]*}") Blackout updateBlackout(@PathParam("blackoutId") String blackoutId, BlackoutForm blackout)
      Updates the blackout period with the given identifier.
      Parameters:
      blackoutId - the full identifier of the blackout period; for example, Configuration/Blackout1.
      blackout - the new contents of the blackout period.
      Returns:
      the updated blackout period.
    • updateBlackout

      Blackout updateBlackout(Blackout blackout)
      Updates the blackout period using the identifier from the object.
      Parameters:
      blackout - the blackout period to update; must have an id set.
      Returns:
      the updated blackout period.
    • deleteBlackout

      @DELETE @Path("/{blackoutId:.*/Blackout[^/]*}") void deleteBlackout(@PathParam("blackoutId") String blackoutId)
      Deletes the blackout period with the given identifier.
      Parameters:
      blackoutId - the full identifier of the blackout period; for example, Configuration/Blackout1.
    • withinBlackout

      @GET @Path("/withinBlackout") boolean withinBlackout()
      Returns whether the current time falls within any active blackout period.
      Returns:
      true if the current time is within a blackout period, false otherwise.
    • newBlackout

      Blackout newBlackout(String label, Date startDate, Date endDate)
      Creates a new Blackout object in memory.
      Parameters:
      label - blackout text
      startDate - The start date and time of the blackout
      endDate - The end date and time of the blackout
      Returns:
      the blackout object.