Package eu.planets_project.services.compare

Examples of eu.planets_project.services.compare.Compare


      try {
        url = new URL(URL_XCDLCOMPARATOR);
       
        Service service = Service.create(url, new QName(PlanetsServices.NS,
            Compare.NAME));
        Compare comparator = service.getPort(Compare.class);

          //the service call and it's result
          DigitalObject x1 = new DigitalObject.Builder(Content.byValue(xcdl1.getBytes())).build();
          DigitalObject x2 = new DigitalObject.Builder(Content.byValue(xcdl2.getBytes())).build();
          List<Property> result = comparator.compare(x1, x2, null).getProperties();
         
          if(result==null){
            throw new Exception("XCDL comparison failed - please check service logs for details");
          }
     
View Full Code Here


            Map<URL, ServiceDescription> compareServices = this.getCompareServices();
            ServiceDescription sd = compareServices.get(surl);
           
            if( sd.getType().equals(Compare.class.getCanonicalName()) ) {

                Compare chr = new CompareWrapper(surl);
                CompareResult cr = chr.compare( this.getDob1().getDob(), this.getDob2().getDob(), null);
                this.compareServiceReport = cr.getReport();

                me = this.createMeasurementEvent();
                if( me != null ) {
                    this.fillComparisonEvent(me, chr, cr);
                    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());
                    this.recordIdentifyComparison(me, ir1, this.getDobUri1(), ir2, this.getDobUri2() );
                   
                    ExperimentInspector.persistExperiment();
                }
               
            } else if(sd.getType().equals(Characterise.class.getCanonicalName())) {
                Characterise chr = new CharacteriseWrapper( surl );
                CharacteriseResult cr1 = chr.characterise( this.getDob1().getDob(), null);
                this.compareServiceReport = cr1.getReport();
                CharacteriseResult cr2 = chr.characterise( this.getDob2().getDob(), null);
                this.compareServiceReport = cr2.getReport();
               
                me = this.createMeasurementEvent();
                if( me != null ) {
                    me.setAgent(new MeasurementAgent(chr.describe()));
                    me.setDate(Calendar.getInstance());
                    this.recordPropertyComparison(me, cr1.getProperties(), this.getDobUri1(), cr2.getProperties(), this.getDobUri2() );
                   
                    ExperimentInspector.persistExperiment();
                }
View Full Code Here

TOP

Related Classes of eu.planets_project.services.compare.Compare

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.