Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.ServiceReport


        CreateViewResult view = null;
       
        try {
            view = viewService.createView(digitalObjects, null);
           
            ServiceReport report = view.getReport();
           
            if (report.getStatus() != ServiceReport.Status.SUCCESS ) {
                sessionIdentifier = "";
                return false;
            }
           
            sessionIdentifier = view.getViewURL().toExternalForm();
View Full Code Here


     */
    public CharacteriseResult characterise(DigitalObject digitalObject, List<Parameter> parameters) {
        log.info("Start...");
        // Set up property list:
        List<Property> measured = new ArrayList<Property>();
        ServiceReport sr = new ServiceReport(Type.INFO, Status.SUCCESS, "Nothing checked");
       
        // Attempt to measure size:
        measured.add( new Property( makePropertyURI(MIME_PROP_URI), MIME_PROP_URI, ""+DigitalObjectUtils.getContentSize( digitalObject ) ));

        return new CharacteriseResult(measured, sr);
View Full Code Here

        try {
            type = ftr.getMIMEType(dob.getPermanentUri().toURL());
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        ServiceReport rep = new ServiceReport(Type.INFO, Status.SUCCESS, "Nothing checked");

        List<URI> types = new ArrayList<URI>();
        types.add(FormatRegistryFactory.getFormatRegistry().createMimeUri(type));

        return new IdentifyResult(types, IdentifyResult.Method.EXTENSION, rep);
View Full Code Here

        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

      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

        }
       
        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

      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

    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

            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

        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

TOP

Related Classes of eu.planets_project.services.datatypes.ServiceReport

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.