Package eu.planets_project.services.identify

Examples of eu.planets_project.services.identify.IdentifyResult


        }else{
          parameterList = new ArrayList<Parameter>();
        }
 
        //now actually execute the identify operation of the service
        IdentifyResult results = identify.identify(digo, parameterList);
       
        //document the end-time and input digital object and the params
        wfResultItem.setEndTime(System.currentTimeMillis());
        wfResultItem.setInputDigitalObjectRef(digo.getPermanentUri());
        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) {
View Full Code Here


   
    //resolve the digital Object reference
    DigitalObject digo = this.retrieveDigitalObjectDataRegistryRef(digoRef);
   
    //call the identification service
    IdentifyResult identifyResults = identifyService.identify(digo,parameterList);
   
    // document
    wfResultItem.setEndTime(System.currentTimeMillis());
    ServiceReport report = identifyResults.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 the comparison's output
    URI ret = null;
    if((identifyResults.getTypes()!=null)&&(identifyResults.getTypes().size()>0)){
      wfResultItem.addLogInfo("identifying properties of object: "+digo.getPermanentUri());
      for(URI uri : identifyResults.getTypes()){
        if(ret == null){
          ret = uri;
        }
        String extractedInfo = "[uri: "+uri+"] \n";
        wfResultItem.addExtractedInformation(extractedInfo);
View Full Code Here

        }else{
          parameterList = new ArrayList<Parameter>();
        }
 
        //now actually execute the identify operation of the service
        IdentifyResult results = identify.identify(digo, parameterList);
       
        //document the end-time and input digital object and the params
        wfResultItem.setEndTime(System.currentTimeMillis());
        wfResultItem.setInputDigitalObjectRef(digo.getPermanentUri());
        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) {
View Full Code Here

     * Identification method.
     */
    private String[] runIdentification(DigitalObject digo, WorkflowResultItem wfResultItem) throws Exception {
      wfResultItem.addLogInfo("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();
            wfResultItem.addLogInfo(s);
            throw new Exception(s);
View Full Code Here

        ServiceReport rep = new ServiceReport(Type.INFO, Status.SUCCESS, "OK");
       
        List<URI> types = new ArrayList<URI>();
        URI typeURI = FormatRegistryFactory.getFormatRegistry().createExtensionUri(type);
        types.add(typeURI);
        return new IdentifyResult(types, IdentifyResult.Method.PARTIAL_PARSE, rep);
       
    }
View Full Code Here

     */
    private IdentifyResult returnWithErrorMessage(String message) {
        ServiceReport rep = ServiceUtils.createErrorReport(message);
        List<URI> type = null;
        log.severe(message);
        return new IdentifyResult(type, null, rep);
    }
View Full Code Here

                    ExperimentInspector.persistExperiment();
                }
               
            } else if(sd.getType().equals(Identify.class.getCanonicalName())) {
                Identify idf = new IdentifyWrapper(surl);
                IdentifyResult ir1 = idf.identify( this.getDob1().getDob(), null);
                this.compareServiceReport = ir1.getReport();
                IdentifyResult ir2 = idf.identify( this.getDob2().getDob(), null);
                this.compareServiceReport = ir2.getReport();
               
                me = this.createMeasurementEvent();
                if( me != null ) {
                    me.setAgent(new MeasurementAgent(idf.describe()));
                    me.setDate(Calendar.getInstance());
View Full Code Here

        DigitalObjectContent c1 = Content.byReference(purl.toURL());
        /* Given these, we can instantiate our object: */
        DigitalObject object = new DigitalObject.Builder(c1).permanentUri(purl).build();
       
        /* Now pass this to the service */
        IdentifyResult ir = ids.identify(object, null);
       
        /* Check the result */
        System.out.println("Recieved type: " + ir.getTypes() );
        System.out.println("Recieved service report: " + ir.getReport() );
        assertEquals("The returned type did not match the expected;", type, ir
                .getTypes().get(0));
       
    }
View Full Code Here

            URI typeURI = FormatRegistryFactory.getFormatRegistry().createExtensionUri(sanitize(imageReader.getFormatName()));
            types.add(typeURI);
            log.fine(String.format("Identified %s as %s", dob, types));
           
            ServiceReport rep = new ServiceReport(Type.INFO, Status.SUCCESS, "OK", sph.getPerformanceProperties() );
            return new IdentifyResult(types,
                    IdentifyResult.Method.PARTIAL_PARSE, rep);
        } catch (IOException e) {
            return returnWithErrorMessage(ServiceUtils.createErrorReport("IOException reading the image: " + e));
        }
View Full Code Here

    }
   
    private IdentifyResult returnWithErrorMessage(ServiceReport report) {
        List<URI> type = null;
        return new IdentifyResult(type, null, report);
    }
View Full Code Here

TOP

Related Classes of eu.planets_project.services.identify.IdentifyResult

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.