Package org.opencastproject.execute.api
Interface ExecuteService
public interface ExecuteService
API for a service that runs CLI commands with MediaPackage elements as arguments
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe collection for the executor filesstatic final StringThe subdirectory of the REST endpoint for this servicestatic final StringName of the form parameter in the REST endpoints that contains the name of the commandstatic final StringName of the form parameter in the REST endpoints that contains the serialized input elementstatic final StringPlaceholder to be replaced by the actual track location in the command linestatic final StringName of the form parameter in the REST endpoints that contains the serialized input elementstatic final StringReceipt typestatic final StringName of the form parameter in the REST endpoints that contains the load estimatestatic final StringPlaceholder to be replaced by the actual mediapackage id in the command linestatic final StringPlaceholder to be replaced by the actual organization id in the command linestatic final StringPlaceholder to be replaced by the actual track location in the command linestatic final StringName of the form parameter in the REST endpoints that contains the name of the file generated by the commandstatic final StringName of the form parameter in the REST endpoints that contains the command argumentsstatic final StringName of the form parameter in the REST endpoints that contains the element type of the generated file -
Method Summary
Modifier and TypeMethodDescriptionorg.opencastproject.job.api.Jobexecute(String exec, String args, org.opencastproject.mediapackage.MediaPackageElement inElement, String outFileName, org.opencastproject.mediapackage.MediaPackageElement.Type type, float load) Execute the operation specified byexecwith the argument string indicated byargs.org.opencastproject.job.api.Jobexecute(String exec, String args, org.opencastproject.mediapackage.MediaPackage mp, String outFileName, org.opencastproject.mediapackage.MediaPackageElement.Type type, float load) Execute the operation specified byexecwith the argument string indicated byargs.
-
Field Details
-
JOB_TYPE
Receipt type- See Also:
-
INPUT_FILE_PATTERN
Placeholder to be replaced by the actual track location in the command line- See Also:
-
OUTPUT_FILE_PATTERN
Placeholder to be replaced by the actual track location in the command line- See Also:
-
ORG_ID_PATTERN
Placeholder to be replaced by the actual organization id in the command line- See Also:
-
MP_ID_PATTERN
Placeholder to be replaced by the actual mediapackage id in the command line- See Also:
-
ENDPOINT_NAME
The subdirectory of the REST endpoint for this service- See Also:
-
EXEC_FORM_PARAM
Name of the form parameter in the REST endpoints that contains the name of the command- See Also:
-
PARAMS_FORM_PARAM
Name of the form parameter in the REST endpoints that contains the command arguments- See Also:
-
LOAD_FORM_PARAM
Name of the form parameter in the REST endpoints that contains the load estimate- See Also:
-
INPUT_ELEM_FORM_PARAM
Name of the form parameter in the REST endpoints that contains the serialized input element- See Also:
-
INPUT_MP_FORM_PARAM
Name of the form parameter in the REST endpoints that contains the serialized input element- See Also:
-
OUTPUT_NAME_FORM_PARAMETER
Name of the form parameter in the REST endpoints that contains the name of the file generated by the command- See Also:
-
TYPE_FORM_PARAMETER
Name of the form parameter in the REST endpoints that contains the element type of the generated file- See Also:
-
COLLECTION
The collection for the executor files- See Also:
-
-
Method Details
-
execute
org.opencastproject.job.api.Job execute(String exec, String args, org.opencastproject.mediapackage.MediaPackageElement inElement, String outFileName, org.opencastproject.mediapackage.MediaPackageElement.Type type, float load) throws ExecuteException Execute the operation specified byexecwith the argument string indicated byargs. This method may create an output file with the nameoutFileNameand aMediaPackageElementwill be created with theMediaPackageElement.Typeindicated by the argumenttype.- Parameters:
exec- The command to be executed by this methodargs- A string containing the argument list for this command. The special argument "#{in}" will be substituted by the location of the resource represented by theinElementparameter, and "#{out}" by the file name indicated inoutFileName.inElement- AnMediaPackageElementobject to be used as an input to the commandoutFileName- The name of the file the command may possibly create.type- TheMediaPackageElement.Typeof theMediaPackageElementcreated by this command.load- A floating point estimate of the load imposed on the node by executing the command- Returns:
- A
Jobrepresenting the execution of the command. After a successful execution, the {link @Job} payload will contain a serialized mediapackage element. - Throws:
ExecuteException- if this method fails to create theJobcorrectly
-
execute
org.opencastproject.job.api.Job execute(String exec, String args, org.opencastproject.mediapackage.MediaPackage mp, String outFileName, org.opencastproject.mediapackage.MediaPackageElement.Type type, float load) throws ExecuteException Execute the operation specified byexecwith the argument string indicated byargs. This method accepts aMediaPackageas an argument, and elements within that MediaPackage may be referenced in the argument list by using certain placeholders.- Parameters:
exec- The command to be executed by this methodargs- A string containing the argument list for this command. Some special placeholders are allowed, that will be converted into the actual locations of elements in the supplied MediaPackagemp- TheMediaPackagecontainingMediaPackageElementsthat will be used as inputs of the commandoutFileName- The name of the file the command may possibly create.type- TheMediaPackageElement.Typeof theMediaPackageElementcreated by this command.load- A floating point estimate of the load imposed on the node by executing the command- Returns:
- A
Jobrepresenting the execution of the command. After a successful execution, the {link @Job} payload will contain a serialized mediapackage element. - Throws:
ExecuteException- if this method fails to create theJobcorrectly
-