public class ZipWorkflowOperationHandler
extends org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPRESS_PROPERTY
The property indicating whether to apply compression to the archive
|
protected SortedMap<String,String> |
configurationOptions
The configuration properties
|
static org.opencastproject.mediapackage.MediaPackageElementFlavor |
DEFAULT_ARCHIVE_FLAVOR
The default flavor to use for a mediapackage archive
|
static String |
DEFAULT_ZIP_ARCHIVE_TEMP_DIR
The default location to use when building an zip archive relative to the
storage directory
|
static String |
DEFAULT_ZIP_COLLECTION
The default collection in the working file repository to store archives
|
static String |
INCLUDE_FLAVORS_PROPERTY
The element flavors to include in the zip file
|
static String |
TARGET_FLAVOR_PROPERTY
The zip archive's target element flavor
|
static String |
TARGET_TAGS_PROPERTY
The zip archive's target tags
|
protected File |
tempStorageDir
The temporary storage location
|
protected org.opencastproject.workspace.api.Workspace |
workspace
The workspace to use in retrieving and storing files.
|
static String |
ZIP_ARCHIVE_TEMP_DIR_CFG_KEY
Key for configuring the location of the archive-temp folder
|
static String |
ZIP_COLLECTION_PROPERTY
The workflow operation's property to consult to determine the collection to use to store an archive
|
| Constructor and Description |
|---|
ZipWorkflowOperationHandler()
The default no-arg constructor builds the configuration options set
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext cc)
Activate the component, generating the temporary storage directory for
building zip archives if necessary.
|
SortedMap<String,String> |
getConfigurationOptions() |
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) |
protected File |
zip(org.opencastproject.mediapackage.MediaPackage mediaPackage,
List<org.opencastproject.mediapackage.MediaPackageElementFlavor> flavorsToZip,
boolean compress)
Creates a zip archive of all elements in a mediapackage.
|
addConfigurationOption, asList, cfgKeyMissing, createResult, createResult, createResult, createResult, createResult, destroy, equals, getCfg, getConfig, getConfig, getConfig, getDescription, getFileNameFromElements, getId, getOptConfig, getOptConfig, hashCode, removeConfigurationOption, setJobBarrierPollingInterval, setServiceRegistry, skip, toString, waitForStatus, waitForStatuspublic static final String ZIP_COLLECTION_PROPERTY
public static final String INCLUDE_FLAVORS_PROPERTY
public static final String TARGET_FLAVOR_PROPERTY
public static final String TARGET_TAGS_PROPERTY
public static final String COMPRESS_PROPERTY
public static final String DEFAULT_ZIP_COLLECTION
public static final String DEFAULT_ZIP_ARCHIVE_TEMP_DIR
public static final String ZIP_ARCHIVE_TEMP_DIR_CFG_KEY
public static final org.opencastproject.mediapackage.MediaPackageElementFlavor DEFAULT_ARCHIVE_FLAVOR
protected File tempStorageDir
protected SortedMap<String,String> configurationOptions
protected org.opencastproject.workspace.api.Workspace workspace
public ZipWorkflowOperationHandler()
public void setWorkspace(org.opencastproject.workspace.api.Workspace workspace)
workspace - the workspaceprotected void activate(org.osgi.service.component.ComponentContext cc)
activate in class org.opencastproject.workflow.api.AbstractWorkflowOperationHandlerAbstractWorkflowOperationHandler.activate(org.osgi.service.component.ComponentContext)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
start in interface org.opencastproject.workflow.api.WorkflowOperationHandlerstart in class org.opencastproject.workflow.api.AbstractWorkflowOperationHandlerorg.opencastproject.workflow.api.WorkflowOperationExceptionAbstractWorkflowOperationHandler.start(org.opencastproject.workflow.api.WorkflowInstance,
JobContext)protected File zip(org.opencastproject.mediapackage.MediaPackage mediaPackage, List<org.opencastproject.mediapackage.MediaPackageElementFlavor> flavorsToZip, boolean compress) throws IOException, org.opencastproject.util.NotFoundException, org.opencastproject.mediapackage.MediaPackageException, org.opencastproject.workflow.api.WorkflowOperationException
mediaPackage - the mediapackage to zipIOException - If an IO exception occursorg.opencastproject.util.NotFoundException - If a file referenced in the mediapackage can not be foundorg.opencastproject.mediapackage.MediaPackageException - If the mediapackage can not be serialized to xmlorg.opencastproject.workflow.api.WorkflowOperationException - If the mediapackage is invalidpublic SortedMap<String,String> getConfigurationOptions()
getConfigurationOptions in interface org.opencastproject.workflow.api.WorkflowOperationHandlergetConfigurationOptions in class org.opencastproject.workflow.api.AbstractWorkflowOperationHandlerWorkflowOperationHandler.getConfigurationOptions()Copyright © 2009–2019 Opencast Project. All rights reserved.