Class CleanupWorkflowOperationHandler

  • All Implemented Interfaces:
    org.opencastproject.workflow.api.WorkflowOperationHandler

    public class CleanupWorkflowOperationHandler
    extends org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
    Removes all files in the working file repository for mediapackage elements that don't match one of the "preserve-flavors" configuration value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.opencastproject.security.api.TrustedHttpClient client
      The http client to use when connecting to remote servers
      static String DELAY
      Time to wait in seconds before removing files
      static String DELETE_EXTERNAL
      Deleting external URI's config key
      static String PRESERVE_FLAVOR_PROPERTY
      The element flavors to maintain in the original mediapackage.
      protected org.opencastproject.workspace.api.Workspace workspace
      The workspace to use in retrieving and storing files.
      • 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 cleanUpJobArgument​(org.opencastproject.workflow.api.WorkflowInstance workflowInstance)
      Deletes JobArguments for every finished Job of the WorkfloInstance
      void setTrustedHttpClient​(org.opencastproject.security.api.TrustedHttpClient client)
      Sets the trusted http client
      void setWorkspace​(org.opencastproject.workspace.api.Workspace workspace)
      Sets the workspace to use.
      org.opencastproject.workflow.api.WorkflowOperationResult start​(org.opencastproject.workflow.api.WorkflowInstance workflowInstance, org.opencastproject.job.api.JobContext context)
      • Methods inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler

        activate, asList, cfgKeyMissing, createResult, createResult, createResult, createResult, destroy, equals, getCfg, getConfig, getConfig, getConfig, getDescription, getFileNameFromElements, getId, getOptConfig, getOptConfig, hashCode, setJobBarrierPollingInterval, setServiceRegistry, skip, toString, waitForStatus, waitForStatus
    • Field Detail

      • PRESERVE_FLAVOR_PROPERTY

        public static final String PRESERVE_FLAVOR_PROPERTY
        The element flavors to maintain in the original mediapackage. All others will be removed
        See Also:
        Constant Field Values
      • workspace

        protected org.opencastproject.workspace.api.Workspace workspace
        The workspace to use in retrieving and storing files.
      • client

        protected org.opencastproject.security.api.TrustedHttpClient client
        The http client to use when connecting to remote servers
    • Constructor Detail

      • CleanupWorkflowOperationHandler

        public CleanupWorkflowOperationHandler()
    • Method Detail

      • setWorkspace

        public void setWorkspace​(org.opencastproject.workspace.api.Workspace workspace)
        Sets the workspace to use.
        Parameters:
        workspace - the workspace
      • setTrustedHttpClient

        public void setTrustedHttpClient​(org.opencastproject.security.api.TrustedHttpClient client)
        Sets the trusted http client
        Parameters:
        client - the trusted http client
      • cleanUpJobArgument

        public void cleanUpJobArgument​(org.opencastproject.workflow.api.WorkflowInstance workflowInstance)
        Deletes JobArguments for every finished Job of the WorkfloInstance
        Parameters:
        workflowInstance -
      • 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
        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)