Class 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.ResumableWorkflowOperationHandler
    Abstract base implementation for a resumable operation handler, which implements a simple operations for starting an operation, returning a WorkflowOperationResult with the current mediapackage and WorkflowOperationResult.Action.PAUSE and resuming an operation, returning a WorkflowOperationResult with the current mediapackage and WorkflowOperationResult.Action.CONTINUE.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.osgi.service.component.ComponentContext componentContext
      OSGi component context, obtained during component activation
      protected String holdActionTitle
      Title of this hold state
      protected org.opencastproject.rest.StaticResource staticResource
      The static resource representing the hold state ui
      protected org.osgi.framework.ServiceRegistration staticResourceRegistration
      Reference to the static resource service
      • Fields inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler

        asList, description, id, serviceRegistry
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate​(org.osgi.service.component.ComponentContext componentContext)
      void deactivate()
      Callback from the OSGi environment on component shutdown.
      String getHoldActionTitle()
      String getHoldStateUserInterfaceURL​(org.opencastproject.workflow.api.WorkflowInstance workflowInstance)
      boolean isAlwaysPause()  
      protected String registerHoldStateUserInterface​(String resourcePath)
      Registers the resource identified by resourcePath as the ui to be displayed during hold.
      org.opencastproject.workflow.api.WorkflowOperationResult resume​(org.opencastproject.workflow.api.WorkflowInstance workflowInstance, org.opencastproject.job.api.JobContext context, Map<String,​String> properties)
      protected void setHoldActionTitle​(String title)
      Sets the title that is displayed on the hold state ui.
      org.opencastproject.workflow.api.WorkflowOperationResult start​(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, hashCode, setJobBarrierPollingInterval, setServiceRegistry, skip, toString, waitForStatus, waitForStatus
      • Methods inherited from interface org.opencastproject.workflow.api.WorkflowOperationHandler

        destroy, getDescription, getId, skip
    • 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
    • Constructor Detail

      • ResumableWorkflowOperationHandlerBase

        public ResumableWorkflowOperationHandlerBase()
    • Method Detail

      • activate

        public void activate​(org.osgi.service.component.ComponentContext componentContext)
        Overrides:
        activate in class org.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:
        getHoldStateUserInterfaceURL in interface org.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:
        getHoldActionTitle in interface org.opencastproject.workflow.api.ResumableWorkflowOperationHandler
        See Also:
        ResumableWorkflowOperationHandler.getHoldActionTitle()
      • registerHoldStateUserInterface

        protected String registerHoldStateUserInterface​(String resourcePath)
        Registers the resource identified by resourcePath as 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.WorkflowOperationException
        This default implementation will put the workflow into the hold state.
        Specified by:
        start in interface org.opencastproject.workflow.api.WorkflowOperationHandler
        Specified by:
        start in class org.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:
        resume in interface org.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:
        isAlwaysPause in interface org.opencastproject.workflow.api.ResumableWorkflowOperationHandler