Class PublishEngageWorkflowOperationHandler
java.lang.Object
org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
org.opencastproject.workflow.handler.distribution.PublishEngageWorkflowOperationHandler
- All Implemented Interfaces:
WorkflowOperationHandler
- Direct Known Subclasses:
PublishEngageAWSS3WorkflowOperationHandler
The workflow definition for handling "engage publication" 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 voidactivate(org.osgi.service.component.ComponentContext cc) Activates this component with its properties once all of the collaborating services have been setprotected MediaPackagegetMediaPackageForSearchIndex(MediaPackage current, List<Job> jobs, MediaPackageElementFlavor downloadSubflavor, String[] downloadTargetTags, Set<String> downloadElementIds, MediaPackageElementFlavor streamingSubflavor, Set<String> streamingElementIds, String[] streamingTargetTags) Returns a mediapackage that only contains elements that are marked for distribution.protected MediaPackagemergePackages(MediaPackage updatedMp, MediaPackage publishedMp, List<MediaPackageElementFlavor> mergeForceFlavors, List<MediaPackageElementFlavor> addForceFlavors) MH-10216, Copied from the original RepublishWorkflowOperationHandler Merges the updated mediapackage with the one that is currently published in a way where the updated elements replace existing ones in the published mediapackage based on their flavor.protected voidsetDownloadDistributionService(DownloadDistributionService downloadDistributionService) Callback for the OSGi declarative services configuration.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) protected voidsetSearchService(SearchService searchService) Callback for declarative services configuration that will introduce us to the search service.voidsetServiceRegistry(ServiceRegistry serviceRegistry) Sets the service registry.protected voidsetStreamingDistributionService(StreamingDistributionService streamingDistributionService) Callback for the OSGi declarative services configuration.voidsetWorkspace(Workspace workspace) start(WorkflowInstance workflowInstance, JobContext context) Runs the workflow operation on thisWorkflowInstance.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, skip, toString, waitForStatus, waitForStatus
-
Constructor Details
-
PublishEngageWorkflowOperationHandler
public PublishEngageWorkflowOperationHandler()
-
-
Method Details
-
setStreamingDistributionService
protected void setStreamingDistributionService(StreamingDistributionService streamingDistributionService) Callback for the OSGi declarative services configuration.- Parameters:
streamingDistributionService- the streaming distribution service
-
setDownloadDistributionService
protected void setDownloadDistributionService(DownloadDistributionService downloadDistributionService) Callback for the OSGi declarative services configuration.- Parameters:
downloadDistributionService- the download distribution service
-
setSearchService
Callback for declarative services configuration that will introduce us to the search service. Implementation assumes that the reference is configured as being static.- Parameters:
searchService- an instance of the search service
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) -
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
-
setWorkspace
-
activate
protected void activate(org.osgi.service.component.ComponentContext cc) Description copied from class:AbstractWorkflowOperationHandlerActivates this component with its properties once all of the collaborating services have been set- Overrides:
activatein classAbstractWorkflowOperationHandler- Parameters:
cc- The component's context, containing the properties used for configuration
-
start
public WorkflowOperationResult start(WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException Description copied from class:AbstractWorkflowOperationHandlerRuns 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:
-
getMediaPackageForSearchIndex
protected MediaPackage getMediaPackageForSearchIndex(MediaPackage current, List<Job> jobs, MediaPackageElementFlavor downloadSubflavor, String[] downloadTargetTags, Set<String> downloadElementIds, MediaPackageElementFlavor streamingSubflavor, Set<String> streamingElementIds, String[] streamingTargetTags) throws MediaPackageException, NotFoundException, ServiceRegistryException, WorkflowOperationException Returns a mediapackage that only contains elements that are marked for distribution.- Parameters:
current- the current mediapackagejobs- the distribution jobsdownloadSubflavor- flavor to be applied to elements distributed to downloaddownloadTargetTags- tags to be applied to elements distributed to downloadsdownloadElementIds- identifiers for elements that have been distributed to downloadsstreamingSubflavor- flavor to be applied to elements distributed to streamingstreamingElementIds- identifiers for elements that have been distributed to streamingstreamingTargetTags- tags to be applied to elements distributed to streaming- Returns:
- the new mediapackage
- Throws:
MediaPackageExceptionNotFoundExceptionServiceRegistryExceptionWorkflowOperationException
-
mergePackages
protected MediaPackage mergePackages(MediaPackage updatedMp, MediaPackage publishedMp, List<MediaPackageElementFlavor> mergeForceFlavors, List<MediaPackageElementFlavor> addForceFlavors) MH-10216, Copied from the original RepublishWorkflowOperationHandler Merges the updated mediapackage with the one that is currently published in a way where the updated elements replace existing ones in the published mediapackage based on their flavor.If
publishedMpisnull, this method returns the updated mediapackage without any modifications.- Parameters:
updatedMp- the updated media packagepublishedMp- the mediapackage that is currently published- Returns:
- the merged mediapackage
-