Examples of ServiceReport


Examples of eu.planets_project.services.datatypes.ServiceReport

        return new IdentifyResult(types, IdentifyResult.Method.EXTENSION, rep);
    }
   
    private IdentifyResult returnWithErrorMessage(String message) {
        ServiceReport rep = new ServiceReport(Type.ERROR, Status.TOOL_ERROR, message);
        List<URI> type = null;
        log.severe(message);
        return new IdentifyResult(type, null, rep);
    }
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

      MigrateResult migrateResult = this.migrate.migrate(digO,
          migrateFromURI, migrateToURI, parameterList);
     
      wfResultItem.setEndTime(System.currentTimeMillis());
      wfResultItem.addLogInfo("migration from: "+migrateFromURI+" to: "+migrateToURI+" took place");
      ServiceReport report = migrateResult.getReport();
      //report service status and type
      wfResultItem.setServiceReport(report);
      if (report.getType() == Type.ERROR) {
        String s = "Service execution failed: " + report.getMessage();
        log.debug(s);
        wfResultItem.addLogInfo(s);
        throw new Exception(s);
      }
      //add report on outputDigitalObject
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

        }
       
        DigitalObject digo = this.getDataRegistry().retrieve(digoRef);
         
        IdentifyResult results = identify1.identify(digo,parameterList);
        ServiceReport report = results.getReport();
        List<URI> types = results.getTypes();
       
        if(report.getType() == Type.ERROR){
          String s = "Service execution failed: " + report.getMessage();
  
          throw new Exception(s);
        }
        if(types.size()<1){
          String s = "The specified file type is currently not supported by this workflow";
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

      CompareResult result = comparexcdl1.compare(digo1, digo2,
          configProperties);
       
      //document
      wfResultItem.setEndTime(System.currentTimeMillis());
      ServiceReport report = result.getReport();
      //report service status and type
      wfResultItem.setServiceReport(report);
      if (report.getType() == Type.ERROR) {
        String s = "Service execution failed: " + report.getMessage();
        wfResultItem.addLogInfo(s);
        throw new Exception(s);
      }
      //document: add report on outputDigitalObject
      wfResultItem.addExtractedInformation(result.getProperties().toString());
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

    private String[] runIdentification(DigitalObject digo, WorkflowResult wfresult) throws Exception {
        log.info("STEP 1: Identification...");
        List<Parameter> parameterList = new ArrayList<Parameter>();
        IdentifyResult results = identify.identify(digo, parameterList);
        ServiceReport report = results.getReport();
        List<URI> types = results.getTypes();

        if (report.getType() == Type.ERROR) {
            String s = "Service execution failed: " + report.getMessage();
            log.debug(s);
            throw new Exception(s);
        }

        if (types.size() < 1) {
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

            parameterList.add(pCompressionQuality);
        }

        MigrateResult migrateResult = this.migrate.migrate(digO, migrateFromURI, migrateToURI, parameterList);

        ServiceReport report = migrateResult.getReport();

        if (report.getType() == Type.ERROR) {
            String s = "Service execution failed: " + report.getMessage();
            log.debug(s);
            throw new Exception(s);
        }
        return migrateResult.getDigitalObject();
    }
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

        wfResultItem.setInputDigitalObject(digo);
        wfResultItem.setServiceParameters(parameterList);
        wfResultItem.setServiceEndpoint(identify.describe().getEndpoint());
       
        //have a look at the service's results
        ServiceReport report = results.getReport();
        List<URI> types = results.getTypes();

        //report service status and type
        wfResultItem.setServiceReport(report);

        if (report.getType() == Type.ERROR) {
            String s = "Service execution failed: " + report.getMessage();
            log.debug(s);
            wfResultItem.addLogInfo(s);
            throw new Exception(s);
        }
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

        // Build in a 'service failed' property.
        recs.add( new MeasurementImpl( TecRegMockup.PROP_SERVICE_EXECUTION_SUCEEDED, "false"));

        // Create a ServiceReport from the exception.
        // TODO can we distinguish tool and install error here?
        ServiceReport sr = new ServiceReport(Type.ERROR, Status.TOOL_ERROR,
                "No info");
        if (view != null && view.getReport() != null) {
            String info = view.getReport().toString();
            sr = new ServiceReport(Type.ERROR, Status.TOOL_ERROR, info);
        }
        wr.logReport(sr);

        return wr;
    }
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

  public FixityResult calculateChecksum(DigitalObject digitalObject,
      List<Parameter> parameters) {

    // The returned FixityResult & ServiceReport
    FixityResult retResult = null;
    ServiceReport retReport = null;
    try {
      // Let's get the requested message digest from the params (or default)
      URI requestedAlgId = this.getDigestIdFromParameters(parameters);

      // OK let's try to get the digest algorithm
      MessageDigest messDigest =
        MessageDigest.getInstance(JavaDigestUtils.getJavaAlgorithmName(requestedAlgId));
     
      // Now calc the result, we need the bytes from the object
      // so let's get the stream
      InputStream inStream = digitalObject.getContent().getInputStream();

      // Catch the special case of no data in the file
      if (this.addStreamBytesToDigest(messDigest,
          inStream,
          JavaDigest.DEFAULT_CHUNK_SIZE) < 1) {
        // log it, and create a new service report
        JavaDigest.log.severe(JavaDigest.NO_DATA_MESSAGE);
        retResult = this.createErrorResult(ServiceReport.Status.TOOL_ERROR, JavaDigest.NO_DATA_MESSAGE);

        // Return the result
        return retResult;
      }

      // OK, success so create the result
      retReport = new ServiceReport(ServiceReport.Type.INFO,
          ServiceReport.Status.SUCCESS,
          JavaDigest.SUCCESS_MESSAGE);

      // And wrap it in the result
      retResult = new FixityResult(JavaDigestUtils.getDefaultAlgorithmId().toString(),
View Full Code Here

Examples of eu.planets_project.services.datatypes.ServiceReport

   * @param status The ServiceReport status to use
   * @param message The String message for the ServiceReport
   * @return a FixityResult that wraps the ServiceReport for return
   */
  private FixityResult createErrorResult(ServiceReport.Status status, String message) {
    ServiceReport retReport = new ServiceReport(ServiceReport.Type.ERROR,
                            status,
                          message);
    // And wrap it in the result
    return new FixityResult(retReport);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.