Interface ExecuteService


public interface ExecuteService
API for a service that runs CLI commands with MediaPackage elements as arguments
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The collection for the executor files
    static final String
    The subdirectory of the REST endpoint for this service
    static final String
    Name of the form parameter in the REST endpoints that contains the name of the command
    static final String
    Name of the form parameter in the REST endpoints that contains the serialized input element
    static final String
    Placeholder to be replaced by the actual track location in the command line
    static final String
    Name of the form parameter in the REST endpoints that contains the serialized input element
    static final String
    Receipt type
    static final String
    Name of the form parameter in the REST endpoints that contains the load estimate
    static final String
    Placeholder to be replaced by the actual mediapackage id in the command line
    static final String
    Placeholder to be replaced by the actual organization id in the command line
    static final String
    Placeholder to be replaced by the actual track location in the command line
    static final String
    Name of the form parameter in the REST endpoints that contains the name of the file generated by the command
    static final String
    Name of the form parameter in the REST endpoints that contains the command arguments
    static final String
    Name of the form parameter in the REST endpoints that contains the element type of the generated file
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    Execute the operation specified by exec with the argument string indicated by args.
    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)
    Execute the operation specified by exec with the argument string indicated by args.
  • Field Details

    • JOB_TYPE

      static final String JOB_TYPE
      Receipt type
      See Also:
    • INPUT_FILE_PATTERN

      static final String INPUT_FILE_PATTERN
      Placeholder to be replaced by the actual track location in the command line
      See Also:
    • OUTPUT_FILE_PATTERN

      static final String OUTPUT_FILE_PATTERN
      Placeholder to be replaced by the actual track location in the command line
      See Also:
    • ORG_ID_PATTERN

      static final String ORG_ID_PATTERN
      Placeholder to be replaced by the actual organization id in the command line
      See Also:
    • MP_ID_PATTERN

      static final String MP_ID_PATTERN
      Placeholder to be replaced by the actual mediapackage id in the command line
      See Also:
    • ENDPOINT_NAME

      static final String ENDPOINT_NAME
      The subdirectory of the REST endpoint for this service
      See Also:
    • EXEC_FORM_PARAM

      static final String EXEC_FORM_PARAM
      Name of the form parameter in the REST endpoints that contains the name of the command
      See Also:
    • PARAMS_FORM_PARAM

      static final String PARAMS_FORM_PARAM
      Name of the form parameter in the REST endpoints that contains the command arguments
      See Also:
    • LOAD_FORM_PARAM

      static final String LOAD_FORM_PARAM
      Name of the form parameter in the REST endpoints that contains the load estimate
      See Also:
    • INPUT_ELEM_FORM_PARAM

      static final String 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

      static final String 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

      static final String 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

      static final String TYPE_FORM_PARAMETER
      Name of the form parameter in the REST endpoints that contains the element type of the generated file
      See Also:
    • COLLECTION

      static final String 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 by exec with the argument string indicated by args. This method may create an output file with the name outFileName and a MediaPackageElement will be created with the MediaPackageElement.Type indicated by the argument type.
      Parameters:
      exec - The command to be executed by this method
      args - A string containing the argument list for this command. The special argument "#{in}" will be substituted by the location of the resource represented by the inElement parameter, and "#{out}" by the file name indicated in outFileName.
      inElement - An MediaPackageElement object to be used as an input to the command
      outFileName - The name of the file the command may possibly create.
      type - The MediaPackageElement.Type of the MediaPackageElement created by this command.
      load - A floating point estimate of the load imposed on the node by executing the command
      Returns:
      A Job representing 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 the Job correctly
    • 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 by exec with the argument string indicated by args. This method accepts a MediaPackage as 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 method
      args - 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 MediaPackage
      mp - The MediaPackage containing MediaPackageElements that will be used as inputs of the command
      outFileName - The name of the file the command may possibly create.
      type - The MediaPackageElement.Type of the MediaPackageElement created by this command.
      load - A floating point estimate of the load imposed on the node by executing the command
      Returns:
      A Job representing 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 the Job correctly