Class ResumableWorkflowOperationHandlerBase
- java.lang.Object
-
- org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
-
- org.opencastproject.workflow.handler.workflow.ResumableWorkflowOperationHandlerBase
-
- All Implemented Interfaces:
org.opencastproject.workflow.api.ResumableWorkflowOperationHandler,org.opencastproject.workflow.api.WorkflowOperationHandler
- Direct Known Subclasses:
ConfigureByDublinCoreTermWOH,ErrorResolutionWorkflowOperationHandler,TagByDublinCoreTermWOH
public class ResumableWorkflowOperationHandlerBase extends org.opencastproject.workflow.api.AbstractWorkflowOperationHandler implements org.opencastproject.workflow.api.ResumableWorkflowOperationHandlerAbstract base implementation for a resumable operation handler, which implements a simple operations for starting an operation, returning aWorkflowOperationResultwith the current mediapackage andWorkflowOperationResult.Action.PAUSEand resuming an operation, returning aWorkflowOperationResultwith the current mediapackage andWorkflowOperationResult.Action.CONTINUE.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.service.component.ComponentContextcomponentContextOSGi component context, obtained during component activationprotected StringholdActionTitleTitle of this hold stateprotected org.opencastproject.rest.StaticResourcestaticResourceThe static resource representing the hold state uiprotected org.osgi.framework.ServiceRegistrationstaticResourceRegistrationReference to the static resource service
-
Constructor Summary
Constructors Constructor Description ResumableWorkflowOperationHandlerBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.osgi.service.component.ComponentContext componentContext)voiddeactivate()Callback from the OSGi environment on component shutdown.StringgetHoldActionTitle()StringgetHoldStateUserInterfaceURL(org.opencastproject.workflow.api.WorkflowInstance workflowInstance)booleanisAlwaysPause()protected StringregisterHoldStateUserInterface(String resourcePath)Registers the resource identified byresourcePathas the ui to be displayed during hold.org.opencastproject.workflow.api.WorkflowOperationResultresume(org.opencastproject.workflow.api.WorkflowInstance workflowInstance, org.opencastproject.job.api.JobContext context, Map<String,String> properties)protected voidsetHoldActionTitle(String title)Sets the title that is displayed on the hold state ui.org.opencastproject.workflow.api.WorkflowOperationResultstart(org.opencastproject.workflow.api.WorkflowInstance workflowInstance, org.opencastproject.job.api.JobContext context)This default implementation will put the workflow into the hold state.-
Methods inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
asList, cfgKeyMissing, createResult, createResult, createResult, createResult, destroy, equals, getCfg, getConfig, getConfig, getConfig, getDescription, getFileNameFromElements, getId, getOptConfig, getOptConfig, getTagsAndFlavors, hashCode, setJobBarrierPollingInterval, setServiceRegistry, skip, toString, waitForStatus, waitForStatus
-
-
-
-
Field Detail
-
componentContext
protected org.osgi.service.component.ComponentContext componentContext
OSGi component context, obtained during component activation
-
staticResourceRegistration
protected org.osgi.framework.ServiceRegistration staticResourceRegistration
Reference to the static resource service
-
staticResource
protected org.opencastproject.rest.StaticResource staticResource
The static resource representing the hold state ui
-
holdActionTitle
protected String holdActionTitle
Title of this hold state
-
-
Method Detail
-
activate
public void activate(org.osgi.service.component.ComponentContext componentContext)
- Overrides:
activatein classorg.opencastproject.workflow.api.AbstractWorkflowOperationHandler- See Also:
AbstractWorkflowOperationHandler.activate(org.osgi.service.component.ComponentContext)
-
deactivate
public void deactivate()
Callback from the OSGi environment on component shutdown. Make sure to call this super implementation when overwriting this class.
-
getHoldStateUserInterfaceURL
public String getHoldStateUserInterfaceURL(org.opencastproject.workflow.api.WorkflowInstance workflowInstance) throws org.opencastproject.workflow.api.WorkflowOperationException
- Specified by:
getHoldStateUserInterfaceURLin interfaceorg.opencastproject.workflow.api.ResumableWorkflowOperationHandler- Throws:
org.opencastproject.workflow.api.WorkflowOperationException- See Also:
ResumableWorkflowOperationHandler.getHoldStateUserInterfaceURL(org.opencastproject.workflow.api.WorkflowInstance)
-
setHoldActionTitle
protected void setHoldActionTitle(String title)
Sets the title that is displayed on the hold state ui.- Parameters:
title- the title
-
getHoldActionTitle
public String getHoldActionTitle()
- Specified by:
getHoldActionTitlein interfaceorg.opencastproject.workflow.api.ResumableWorkflowOperationHandler- See Also:
ResumableWorkflowOperationHandler.getHoldActionTitle()
-
registerHoldStateUserInterface
protected String registerHoldStateUserInterface(String resourcePath)
Registers the resource identified byresourcePathas the ui to be displayed during hold.- Parameters:
resourcePath- the path to the resource- Returns:
- the URL that was created when registering the resource
-
start
public org.opencastproject.workflow.api.WorkflowOperationResult start(org.opencastproject.workflow.api.WorkflowInstance workflowInstance, org.opencastproject.job.api.JobContext context) throws org.opencastproject.workflow.api.WorkflowOperationExceptionThis default implementation will put the workflow into the hold state.- Specified by:
startin interfaceorg.opencastproject.workflow.api.WorkflowOperationHandler- Specified by:
startin classorg.opencastproject.workflow.api.AbstractWorkflowOperationHandler- Throws:
org.opencastproject.workflow.api.WorkflowOperationException- See Also:
AbstractWorkflowOperationHandler.start(org.opencastproject.workflow.api.WorkflowInstance, JobContext)
-
resume
public org.opencastproject.workflow.api.WorkflowOperationResult resume(org.opencastproject.workflow.api.WorkflowInstance workflowInstance, org.opencastproject.job.api.JobContext context, Map<String,String> properties) throws org.opencastproject.workflow.api.WorkflowOperationException- Specified by:
resumein interfaceorg.opencastproject.workflow.api.ResumableWorkflowOperationHandler- Throws:
org.opencastproject.workflow.api.WorkflowOperationException- See Also:
ResumableWorkflowOperationHandler.resume(org.opencastproject.workflow.api.WorkflowInstance, JobContext, java.util.Map)
-
isAlwaysPause
public boolean isAlwaysPause()
- Specified by:
isAlwaysPausein interfaceorg.opencastproject.workflow.api.ResumableWorkflowOperationHandler
-
-