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();
}