Package org.opencastproject.job.api

Examples of org.opencastproject.job.api.Job


      post = new HttpPost("/" + ExecuteService.ENDPOINT_NAME);
      post.setEntity(new UrlEncodedFormEntity(formStringParams));
      response = getResponse(post);

      if (response != null) {
        Job job = JobParser.parseJob(response.getEntity().getContent());
        logger.info("Completing execution of command {} using a remote execute service", exec);
        return job;
      } else
        throw new ExecuteException(String.format("Failed to execute the command %s using a remote execute service", exec));
View Full Code Here


      post = new HttpPost("/" + ExecuteService.ENDPOINT_NAME);
      post.setEntity(new UrlEncodedFormEntity(formStringParams));
      response = getResponse(post);

      if (response != null) {
        Job job = JobParser.parseJob(response.getEntity().getContent());
        logger.info("Completing execution of command {} using a remote execute service", exec);
        return job;
      } else {
        logger.error("Failed to execute the command {} using a remote execute service", exec);
        throw new ExecuteException(String.format("Failed to execute the command %s using a remote execute service", exec));
View Full Code Here

    // Process the result element
    MediaPackageElement resultElement = null;
   
    try{
      Job job = executeService.execute(exec, params, mediaPackage, outputFilename, expectedType);

      // Wait for all jobs to be finished                                                                                                                                                                                             
      if (!waitForStatus(job).isSuccess())
        throw new WorkflowOperationException("Execute operation failed");

      if (StringUtils.trimToNull(job.getPayload()) != null) {

        resultElement = MediaPackageElementParser.getFromXml(job.getPayload());

        if (resultElement.getElementType() == MediaPackageElement.Type.Track) {
          // Have the track inspected and return the result
          Job inspectionJob = null;
          inspectionJob = inspectionService.inspect(resultElement.getURI());
          JobBarrier barrier = new JobBarrier(serviceRegistry, inspectionJob);
          if (!barrier.waitForJobs().isSuccess()) {
            throw new ExecuteException("Media inspection of " + resultElement.getURI() + " failed");
          }

          resultElement = MediaPackageElementParser.getFromXml(inspectionJob.getPayload());
        }

        // Store new element to mediaPackage
        mediaPackage.add(resultElement);
        // Store new element to mediaPackage
View Full Code Here

          logger.error("Wrong element type specified: {}.", elementTypeStr);
          return Response.status(Response.Status.BAD_REQUEST).build();
        }
      }
    
      Job retJob = null;
      // FIXME: Falta o caso no que ningún estea inicializado
      if ((inputElementStr != null) && (inputMpStr != null)) {
        logger.error("Only one input MediaPackage OR input MediaPackageElement can be set at the same time");
        return Response.status(Response.Status.BAD_REQUEST).build();
      } else if ((inputElementStr != null) && (inputMpStr == null)) {
View Full Code Here

TOP

Related Classes of org.opencastproject.job.api.Job

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.