@Path(value="/topologies/{topologyName}/tasks")
@Component
public class TopologyTasksResource
extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
TASK_PREFIX |
| Constructor and Description |
|---|
TopologyTasksResource() |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
checkKillFlag(String topologyName,
String taskId)
Check kill flag for the specified task.
|
eu.europeana.cloud.service.dps.DpsTask |
getTask(String topologyName,
String taskId)
Retrieves a task with the given taskId from the specified topology.
|
String |
getTaskNotification(String taskId)
Retrieves notifications for the specified task.
|
javax.ws.rs.core.Response |
getTaskProgress(String topologyName,
String taskId)
Retrieves the current progress for the requested task.
|
javax.ws.rs.core.Response |
grantPermissions(String topologyName,
String taskId,
String username)
Grants read / write permissions for a task to the specified user.
|
javax.ws.rs.core.Response |
killTask(String topologyName,
String taskId)
Submit kill flag to the specific task.
|
javax.ws.rs.core.Response |
removeKillFlag(String topologyName,
String taskId)
Remove kill flag for the specified task.
|
javax.ws.rs.core.Response |
submitTask(javax.ws.rs.container.AsyncResponse asyncResponse,
eu.europeana.cloud.service.dps.DpsTask task,
String topologyName,
javax.ws.rs.core.UriInfo uriInfo,
String authorizationHeader)
Submits a Task for execution.
|
public static final String TASK_PREFIX
@GET
@PreAuthorize(value="hasPermission(#taskId,\'DPS_Task\', read)")
@Produces(value={"application/json","application/xml"})
@Path(value="/{taskId}")
public eu.europeana.cloud.service.dps.DpsTask getTask(@PathParam(value="topologyName")
String topologyName,
@PathParam(value="taskId")
String taskId)
throws eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException
topologyName - REQUIRED Name of the topology where the task is submitted.taskId - REQUIRED Unique id that identifies the task.eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException - if topology does not exist or access to the topology is denied for the user@GET
@Path(value="{taskId}/progress")
@PreAuthorize(value="hasPermission(#taskId,\'DPS_Task\', read)")
public javax.ws.rs.core.Response getTaskProgress(@PathParam(value="topologyName")
String topologyName,
@PathParam(value="taskId")
String taskId)
throws eu.europeana.cloud.service.dps.exception.AccessDeniedOrObjectDoesNotExistException,
eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException
topologyName - REQUIRED Name of the topology where the task is submitted.taskId - REQUIRED Unique id that identifies the task.eu.europeana.cloud.service.dps.exception.AccessDeniedOrObjectDoesNotExistException - if task does not exist or access to the task is denied for the usereu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException - if topology does not exist or access to the topology is denied for the user@POST
@Consumes(value="application/json")
@PreAuthorize(value="hasPermission(#topologyName,\'Topology\', write)")
@ManagedAsync
@Path(value="/")
public javax.ws.rs.core.Response submitTask(@Suspended
javax.ws.rs.container.AsyncResponse asyncResponse,
eu.europeana.cloud.service.dps.DpsTask task,
@PathParam(value="topologyName")
String topologyName,
@Context
javax.ws.rs.core.UriInfo uriInfo,
@HeaderParam(value="Authorization")
String authorizationHeader)
throws eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException,
eu.europeana.cloud.service.dps.service.utils.validation.DpsTaskValidationException
task - REQUIRED Task to be executed. Should contain links to input data,
either in form of cloud-records or cloud-datasets.topologyName - REQUIRED Name of the topology where the task is submitted.eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException - if topology does not exist or access to the topology is denied for the usereu.europeana.cloud.service.dps.service.utils.validation.DpsTaskValidationException@GET
@Path(value="{taskId}/notification")
@PreAuthorize(value="hasPermission(#taskId,\'DPS_Task\', read)")
public String getTaskNotification(@PathParam(value="taskId")
String taskId)
taskId - REQUIRED Unique id that identifies the task.@POST
@Path(value="{taskId}/permit")
@PreAuthorize(value="hasRole(\'ROLE_ADMIN\')")
public javax.ws.rs.core.Response grantPermissions(@PathParam(value="topologyName")
String topologyName,
@PathParam(value="taskId")
String taskId,
@FormParam(value="username")
String username)
throws eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException
taskId - REQUIRED Unique id that identifies the task.topologyName - REQUIRED Name of the topology where the task is submitted.username - REQUIRED Permissions are granted to the account with this unique usernameeu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException - if topology does not exist or access to the topology is denied for the user@POST
@Path(value="{taskId}/kill")
@PreAuthorize(value="hasPermission(#taskId,\'DPS_Task\', write)")
public javax.ws.rs.core.Response killTask(@PathParam(value="topologyName")
String topologyName,
@PathParam(value="taskId")
String taskId)
throws eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException
taskId - REQUIRED Unique id that identifies the task.topologyName - REQUIRED Name of the topology where the task is submitted.eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException - if topology does not exist or access to the topology is denied for the user@GET
@Path(value="{taskId}/kill")
@PreAuthorize(value="hasPermission(#taskId,\'DPS_Task\', read)")
public Boolean checkKillFlag(@PathParam(value="topologyName")
String topologyName,
@PathParam(value="taskId")
String taskId)
throws eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException
topologyName - REQUIRED Name of the topology where the task is submitted.taskId - REQUIRED Unique id that identifies the task.eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException - if topology does not exist or access to the topology is denied for the user@DELETE
@Path(value="{taskId}/kill")
@PreAuthorize(value="hasPermission(#taskId,\'DPS_Task\', write)")
public javax.ws.rs.core.Response removeKillFlag(@PathParam(value="topologyName")
String topologyName,
@PathParam(value="taskId")
String taskId)
throws eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException
topologyName - REQUIRED Name of the topology where the task is submitted.taskId - REQUIRED Unique id that identifies the task.eu.europeana.cloud.service.dps.exception.AccessDeniedOrTopologyDoesNotExistException - if topology does not exist or access to the topology is denied for the userCopyright © 2013–2017 Europeana Cloud Development Team. All rights reserved.