Interface TaskService

All Superinterfaces:
ExecutableService, JAXRSService
All Known Implementing Classes:
TaskServiceImpl

@Path("tasks") public interface TaskService extends ExecutableService
REST operations for tasks.
  • Method Details

    • read

      @GET @Path("{type}/{key}") @Produces({"application/json","application/yaml","application/xml"}) <T extends TaskTO> T read(@NotNull @PathParam("type") @NotNull TaskType type, @NotNull @PathParam("key") @NotNull String key, @QueryParam("details") @DefaultValue("true") boolean details)
      Returns the task matching the given key.
      Type Parameters:
      T - type of taskTO
      Parameters:
      type - task type
      key - key of task to be read
      details - whether include executions or not, defaults to true
      Returns:
      task with matching key
    • search

      @GET @Path("{type}") @Produces({"application/json","application/yaml","application/xml"}) <T extends TaskTO> PagedResult<T> search(@BeanParam TaskQuery query)
      Returns a paged list of existing tasks matching the given query.
      Type Parameters:
      T - type of taskTO
      Parameters:
      query - query conditions
      Returns:
      paged list of existing tasks matching the given query
    • create

      @POST @Path("{type}") @Consumes({"application/json","application/yaml","application/xml"}) @Produces({"application/json","application/yaml","application/xml"}) Response create(@NotNull @PathParam("type") @NotNull TaskType type, @NotNull @NotNull SchedTaskTO taskTO)
      Creates a new task.
      Parameters:
      type - task type
      taskTO - task to be created
      Returns:
      Response object featuring Location header of created task
    • update

      @PUT @Path("{type}/{key}") @Consumes({"application/json","application/yaml","application/xml"}) @Produces({"application/json","application/yaml","application/xml"}) void update(@NotNull @PathParam("type") @NotNull TaskType type, @NotNull @NotNull SchedTaskTO taskTO)
      Updates the task matching the provided key.
      Parameters:
      type - task type
      taskTO - updated task to be stored
    • delete

      @DELETE @Path("{type}/{key}") @Produces({"application/json","application/yaml","application/xml"}) void delete(@NotNull @PathParam("type") @NotNull TaskType type, @NotNull @PathParam("key") @NotNull String key)
      Deletes the task matching the provided key.
      Parameters:
      type - task type
      key - key of task to be deleted
    • purgePropagations

      @DELETE @Path("PROPAGATION/purge") @Produces({"application/json","application/yaml","application/xml"}) Response purgePropagations(@QueryParam("since") OffsetDateTime since, @QueryParam("statuses") List<ExecStatus> statuses, @QueryParam("resources") List<String> resources)
      Deletes all the propagation tasks whose latest execution is matching the given conditions. At least one matching condition must be specified.
      Parameters:
      since - match all executions started afterwards
      statuses - execution status(es) to match
      resources - external resource(s) to match
      Returns:
      deleted propagation tasks
    • getMacroTaskForm

      @GET @Path("MACRO/{key}/form") @Produces({"application/json","application/yaml","application/xml"}) SyncopeForm getMacroTaskForm(@NotNull @PathParam("key") @NotNull String key, @NotNull @QueryParam("locale") @NotNull String locale)
      Fetches the form to fill and submit for execution, for the given macro task (if defined).
      Parameters:
      key - macro task key
      locale - form locale
      Returns:
      the form to fill and submit for execution, for the given macro task (if defined)
    • execute

      @POST @Path("MACRO/{key}/execute") @Consumes({"application/json","application/yaml","application/xml"}) @Produces({"application/json","application/yaml","application/xml"}) ExecTO execute(@BeanParam ExecSpecs specs, SyncopeForm macroTaskForm)
      Executes the macro task matching the given specs, with the provided form as input.
      Parameters:
      specs - conditions to exec
      macroTaskForm - macro task form
      Returns:
      execution report for the macro task matching the given specs