Interface TaskService
-
- All Superinterfaces:
ExecutableService
,JAXRSService
- All Known Implementing Classes:
TaskServiceImpl
@Path("tasks") public interface TaskService extends ExecutableService
REST operations for tasks.
-
-
Field Summary
-
Fields inherited from interface org.apache.syncope.common.rest.api.service.JAXRSService
CRLF, DOUBLE_DASH, PARAM_ANYTYPE_KIND, PARAM_ANYTYPEKEY, PARAM_CONNID_PAGED_RESULTS_COOKIE, PARAM_DETAILS, PARAM_ENTITY_KEY, PARAM_FIQL, PARAM_KEYWORD, PARAM_MAX, PARAM_NOTIFICATION, PARAM_ORDERBY, PARAM_PAGE, PARAM_REALM, PARAM_RECURSIVE, PARAM_RESOURCE, PARAM_SIZE, PARAM_USER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.ws.rs.core.Response
create(@NotNull TaskType type, @NotNull SchedTaskTO taskTO)
Creates a new task.void
delete(@NotNull TaskType type, @NotNull String key)
Deletes the task matching the provided key.ExecTO
execute(ExecSpecs specs, SyncopeForm macroTaskForm)
Executes the macro task matching the given specs, with the provided form as input.SyncopeForm
getMacroTaskForm(@NotNull String key)
Fetches the form to fill and submit for execution, for the given macro task (if defined).javax.ws.rs.core.Response
purgePropagations(OffsetDateTime since, List<ExecStatus> statuses, List<String> resources)
Deletes all the propagation tasks whose latest execution is matching the given conditions.<T extends TaskTO>
Tread(@NotNull TaskType type, @NotNull String key, boolean details)
Returns the task matching the given key.<T extends TaskTO>
PagedResult<T>search(TaskQuery query)
Returns a paged list of existing tasks matching the given query.void
update(@NotNull TaskType type, @NotNull SchedTaskTO taskTO)
Updates the task matching the provided key.-
Methods inherited from interface org.apache.syncope.common.rest.api.service.ExecutableService
actionJob, deleteExecution, deleteExecutions, execute, getJob, listExecutions, listJobs, listRecentExecutions
-
-
-
-
Method Detail
-
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 typekey
- key of task to be readdetails
- 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"}) javax.ws.rs.core.Response create(@NotNull @PathParam("type") @NotNull TaskType type, @NotNull @NotNull SchedTaskTO taskTO)
Creates a new task.- Parameters:
type
- task typetaskTO
- 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 typetaskTO
- 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 typekey
- key of task to be deleted
-
purgePropagations
@DELETE @Path("PROPAGATION/purge") @Produces({"application/json","application/yaml","application/xml"}) javax.ws.rs.core.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 afterwardsstatuses
- execution status(es) to matchresources
- 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)
Fetches the form to fill and submit for execution, for the given macro task (if defined).- Parameters:
key
- macro task key- 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 execmacroTaskForm
- macro task form- Returns:
- execution report for the macro task matching the given specs
-
-