Class WorkflowRestService
java.lang.Object
org.opencastproject.rest.AbstractJobProducerEndpoint
org.opencastproject.workflow.endpoint.WorkflowRestService
A REST endpoint for the
WorkflowService-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe constant used to switch the direction of the sorting querystring parameter.static final StringThe constant used to negate a querystring parameter.protected StringThe default server URLprotected ServiceRegistryThe service registryprotected StringThe default service URL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGI callback for component activationjavax.ws.rs.core.Responsejavax.ws.rs.core.ResponsegetConfigurationPanel(String definitionId) Returns the workflow configuration panel HTML snippet for the workflow definition specified byjavax.ws.rs.core.ResponsegetCount(WorkflowInstance.WorkflowState state, String operation) javax.ws.rs.core.Responsejavax.ws.rs.core.ResponsegetRunningWorkflowOfMediaPackage(String mediaPackageId) Returns the job producer that is backing this REST endpoint.Return the service registry.javax.ws.rs.core.ResponsegetWorkflowAsJson(long id) getWorkflowAsXml(long id) javax.ws.rs.core.ResponsegetWorkflowDefinitionAsJson(String workflowDefinitionId) javax.ws.rs.core.ResponsegetWorkflowDefinitionAsXml(String workflowDefinitionId) javax.ws.rs.core.ResponsegetWorkflowsOfMediaPackage(String mediaPackageId) javax.ws.rs.core.ResponsemediaPackageHasActiveWorkflows(String mediaPackageId) javax.ws.rs.core.Responseremove(long workflowInstanceId, boolean force) javax.ws.rs.core.Responseresume(long workflowInstanceId, String mediaPackage, LocalHashMap properties) javax.ws.rs.core.Responseresume(long workflowInstanceId, LocalHashMap properties) voidsetService(WorkflowService service) Sets the workflow serviceprotected voidsetServiceRegistry(ServiceRegistry serviceRegistry) Callback from the OSGi declarative services to set the service registry.voidsetWorkspace(Workspace workspace) Callback from the OSGi declarative services to set the workspace.start(String workflowDefinitionXmlOrId, MediaPackageImpl mp, String parentWorkflowId, LocalHashMap localMap) stop(long workflowInstanceId) javax.ws.rs.core.Responsesuspend(long workflowInstanceId) javax.ws.rs.core.Responsejavax.ws.rs.core.ResponseuserHasActiveWorkflows(String userId) Methods inherited from class org.opencastproject.rest.AbstractJobProducerEndpoint
checkHeartbeat, dispatchJob
-
Field Details
-
NEGATE_PREFIX
The constant used to negate a querystring parameter. This is only supported on some parameters.- See Also:
-
DESCENDING_SUFFIX
The constant used to switch the direction of the sorting querystring parameter.- See Also:
-
serverUrl
The default server URL -
serviceUrl
The default service URL -
serviceRegistry
The service registry
-
-
Constructor Details
-
WorkflowRestService
public WorkflowRestService()
-
-
Method Details
-
setServiceRegistry
Callback from the OSGi declarative services to set the service registry.- Parameters:
serviceRegistry- the service registry
-
setService
Sets the workflow service- Parameters:
service- the workflow service instance
-
setWorkspace
Callback from the OSGi declarative services to set the workspace.- Parameters:
workspace- the workspace
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) OSGI callback for component activation- Parameters:
cc- the OSGI declarative services component context
-
getCount
@GET @Produces("text/plain") @Path("/count") public javax.ws.rs.core.Response getCount(@QueryParam("state") WorkflowInstance.WorkflowState state, @QueryParam("operation") String operation) -
getWorkflowDefinitionsAsJson
@GET @Path("definitions.json") @Produces("application/json") public WorkflowDefinitionSet getWorkflowDefinitionsAsJson() throws Exception- Throws:
Exception
-
getWorkflowDefinitionsAsXml
@GET @Path("definitions.xml") @Produces("application/xml") public WorkflowDefinitionSet getWorkflowDefinitionsAsXml() throws Exception- Throws:
Exception
-
getWorkflowDefinitionAsJson
@GET @Produces("application/json") @Path("definition/{id}.json") public javax.ws.rs.core.Response getWorkflowDefinitionAsJson(@PathParam("id") String workflowDefinitionId) throws NotFoundException - Throws:
NotFoundException
-
getWorkflowDefinitionAsXml
@GET @Produces("text/xml") @Path("definition/{id}.xml") public javax.ws.rs.core.Response getWorkflowDefinitionAsXml(@PathParam("id") String workflowDefinitionId) throws NotFoundException - Throws:
NotFoundException
-
getConfigurationPanel
@GET @Produces("text/html") @Path("configurationPanel") public javax.ws.rs.core.Response getConfigurationPanel(@QueryParam("definitionId") String definitionId) throws NotFoundException Returns the workflow configuration panel HTML snippet for the workflow definition specified by- Parameters:
definitionId-- Returns:
- config panel HTML snippet
- Throws:
NotFoundException
-
mediaPackageHasActiveWorkflows
@GET @Produces("application/json") @Path("mediaPackage/{id}/hasActiveWorkflows") public javax.ws.rs.core.Response mediaPackageHasActiveWorkflows(@PathParam("id") String mediaPackageId) -
getWorkflowsOfMediaPackage
@GET @Produces("application/json") @Path("mediaPackage/{id}/instances.json") public javax.ws.rs.core.Response getWorkflowsOfMediaPackage(@PathParam("id") String mediaPackageId) -
getRunningWorkflowOfMediaPackage
@GET @Produces("application/json") @Path("mediaPackage/{id}/currentInstance.json") public javax.ws.rs.core.Response getRunningWorkflowOfMediaPackage(@PathParam("id") String mediaPackageId) -
userHasActiveWorkflows
@GET @Produces("application/json") @Path("user/{id}/hasActiveWorkflows") public javax.ws.rs.core.Response userHasActiveWorkflows(@PathParam("id") String userId) -
getWorkflowAsXml
@GET @Produces("text/xml") @Path("instance/{id}.xml") public JaxbWorkflowInstance getWorkflowAsXml(@PathParam("id") long id) throws WorkflowDatabaseException, NotFoundException, UnauthorizedException -
getWorkflowAsJson
@GET @Produces("application/json") @Path("instance/{id}.json") public JaxbWorkflowInstance getWorkflowAsJson(@PathParam("id") long id) throws WorkflowDatabaseException, NotFoundException, UnauthorizedException -
start
@POST @Path("start") @Produces("text/xml") public JaxbWorkflowInstance start(@FormParam("definition") String workflowDefinitionXmlOrId, @FormParam("mediapackage") MediaPackageImpl mp, @FormParam("parent") String parentWorkflowId, @FormParam("properties") LocalHashMap localMap) -
stop
@POST @Path("stop") @Produces("text/xml") public JaxbWorkflowInstance stop(@FormParam("id") long workflowInstanceId) throws WorkflowException, NotFoundException, UnauthorizedException -
remove
@DELETE @Path("remove/{id}") @Produces("text/plain") public javax.ws.rs.core.Response remove(@PathParam("id") long workflowInstanceId, @QueryParam("force") boolean force) throws WorkflowException, NotFoundException, UnauthorizedException -
suspend
@POST @Path("suspend") @Produces("text/xml") public javax.ws.rs.core.Response suspend(@FormParam("id") long workflowInstanceId) throws NotFoundException, UnauthorizedException -
resume
@POST @Path("resume") @Produces("text/xml") public javax.ws.rs.core.Response resume(@FormParam("id") long workflowInstanceId, @FormParam("properties") LocalHashMap properties) throws NotFoundException, UnauthorizedException -
resume
@POST @Path("replaceAndresume") @Produces("text/xml") public javax.ws.rs.core.Response resume(@FormParam("id") long workflowInstanceId, @FormParam("mediapackage") String mediaPackage, @FormParam("properties") LocalHashMap properties) throws NotFoundException, UnauthorizedException -
update
@POST @Path("update") public javax.ws.rs.core.Response update(@FormParam("workflow") String workflowInstance) throws NotFoundException, UnauthorizedException -
getOperationHandlers
@GET @Path("handlers.json") public javax.ws.rs.core.Response getOperationHandlers() -
getStateMappings
@GET @Path("statemappings.json") public javax.ws.rs.core.Response getStateMappings() -
cleanup
@Path("/cleanup") public javax.ws.rs.core.Response cleanup(@FormParam("buffer") int buffer, @FormParam("state") String stateParam) throws UnauthorizedException - Throws:
UnauthorizedException
-
getService
Returns the job producer that is backing this REST endpoint.- Specified by:
getServicein classAbstractJobProducerEndpoint- Returns:
- the job producer
- See Also:
-
getServiceRegistry
Return the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducerEndpoint- See Also:
-