Class PartialImportWorkflowOperationHandler
java.lang.Object
org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
org.opencastproject.workflow.handler.composer.PartialImportWorkflowOperationHandler
- All Implemented Interfaces:
WorkflowOperationHandler
The workflow definition for handling partial import operations
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
AbstractWorkflowOperationHandler.Configuration -
Field Summary
Fields inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
asList, description, id, serviceRegistry, SOURCE_FLAVOR, SOURCE_FLAVORS, SOURCE_TAG, SOURCE_TAGS, TARGET_FLAVOR, TARGET_FLAVORS, TARGET_TAG, TARGET_TAGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longcheckForEncodeToStandard(MediaPackage mediaPackage, boolean forceEncoding, com.entwinemedia.fn.data.Opt<EncodingProfile> forceProfile, List<String> requiredExtensions, MediaPackageElementFlavor targetPresenterFlavor, MediaPackageElementFlavor targetPresentationFlavor, List<MediaPackageElement> elementsToClean) protected longcheckForMuxing(MediaPackage mediaPackage, MediaPackageElementFlavor targetPresentationFlavor, MediaPackageElementFlavor targetPresenterFlavor, boolean useSuffix, List<MediaPackageElement> elementsToClean) protected com.entwinemedia.fn.data.Opt<EncodingProfile> Get the force encoding profile from the operations config options.getRequiredExtensions(WorkflowOperationInstance operation) Get the extensions from configuration that don't need to be re-encoded.protected longmux(MediaPackage mediaPackage, Track video, Track audio, List<MediaPackageElement> elementsToClean) Mux a video and an audio track.voidsetComposerService(ComposerService composerService) Callback for the OSGi declarative services configuration.voidsetServiceRegistry(ServiceRegistry serviceRegistry) Sets the service registry.voidsetWorkspace(Workspace workspace) Callback for declarative services configuration that will introduce us to the local workspace service.start(WorkflowInstance workflowInstance, JobContext context) Runs the workflow operation on thisWorkflowInstance.protected JobstartConcatJob(EncodingProfile profile, List<Track> tracks, float outputFramerate, boolean forceDivisible) Start job to concatenate a list of tracks.protected static booleantrackNeedsTobeEncodedToStandard(Track track, List<String> requiredExtensions) Determines if the extension of a track is non-standard and therefore should be re-encoded.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, getTagsAndFlavors, hashCode, setJobBarrierPollingInterval, skip, toString, waitForStatus, waitForStatus
-
Constructor Details
-
PartialImportWorkflowOperationHandler
public PartialImportWorkflowOperationHandler()
-
-
Method Details
-
setComposerService
Callback for the OSGi declarative services configuration.- Parameters:
composerService- the local composer service
-
setWorkspace
Callback for declarative services configuration that will introduce us to the local workspace service. Implementation assumes that the reference is configured as being static.- Parameters:
workspace- an instance of the workspace
-
setServiceRegistry
Description copied from class:AbstractWorkflowOperationHandlerSets the service registry. This method is here as a convenience for developers that need the registry to do job waiting.- Overrides:
setServiceRegistryin classAbstractWorkflowOperationHandler- Parameters:
serviceRegistry- the service registry
-
start
public WorkflowOperationResult start(WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException Runs the workflow operation on thisWorkflowInstance. If the execution fails for some reason, this must throw aWorkflowOperationExceptionin order to handle the problem gracefully. Runtime exceptions will cause the entire workflow instance to fail.- Specified by:
startin interfaceWorkflowOperationHandler- Specified by:
startin classAbstractWorkflowOperationHandler- Parameters:
workflowInstance- the workflow instancecontext- the job context- Returns:
- the
WorkflowOperationResultcontaining a potentially modified MediaPackage and whether to put the workflow instance into a wait state. - Throws:
WorkflowOperationException- If the workflow operation fails to execute properly, and the default error handling should be invoked.- See Also:
-
checkForEncodeToStandard
protected long checkForEncodeToStandard(MediaPackage mediaPackage, boolean forceEncoding, com.entwinemedia.fn.data.Opt<EncodingProfile> forceProfile, List<String> requiredExtensions, MediaPackageElementFlavor targetPresenterFlavor, MediaPackageElementFlavor targetPresentationFlavor, List<MediaPackageElement> elementsToClean) throws EncoderException, IOException, MediaPackageException, NotFoundException, ServiceRegistryException, WorkflowOperationException -
startConcatJob
protected Job startConcatJob(EncodingProfile profile, List<Track> tracks, float outputFramerate, boolean forceDivisible) throws MediaPackageException, EncoderException Start job to concatenate a list of tracks.- Parameters:
profile- the encoding profile to usetracks- non empty track listforceDivisible- Whether to enforce the track's dimension to be divisible by two- Throws:
MediaPackageExceptionEncoderException
-
trackNeedsTobeEncodedToStandard
protected static boolean trackNeedsTobeEncodedToStandard(Track track, List<String> requiredExtensions) Determines if the extension of a track is non-standard and therefore should be re-encoded.- Parameters:
track- The track to check the extension on.
-
getRequiredExtensions
Get the extensions from configuration that don't need to be re-encoded.- Parameters:
operation- The WorkflowOperationInstance to get the configuration from- Returns:
- The list of extensions
-
getForceEncodingProfile
protected com.entwinemedia.fn.data.Opt<EncodingProfile> getForceEncodingProfile(WorkflowOperationInstance woi) throws WorkflowOperationException Get the force encoding profile from the operations config options.- Returns:
- the encoding profile if option "force-encoding" is true, none otherwise
- Throws:
WorkflowOperationException- if there is no such encoding profile or if no encoding profile is configured but force-encoding is true
-
checkForMuxing
protected long checkForMuxing(MediaPackage mediaPackage, MediaPackageElementFlavor targetPresentationFlavor, MediaPackageElementFlavor targetPresenterFlavor, boolean useSuffix, List<MediaPackageElement> elementsToClean) throws EncoderException, MediaPackageException, WorkflowOperationException, NotFoundException, ServiceRegistryException, IOException -
mux
protected long mux(MediaPackage mediaPackage, Track video, Track audio, List<MediaPackageElement> elementsToClean) throws EncoderException, MediaPackageException, WorkflowOperationException, NotFoundException, ServiceRegistryException, IOException Mux a video and an audio track. Add the result to media packagemediaPackagewith the same flavor as thevideo.- Returns:
- the mux job's queue time
- Throws:
EncoderExceptionMediaPackageExceptionWorkflowOperationExceptionNotFoundExceptionServiceRegistryExceptionIOException
-