Package eu.planets_project.tb.impl.model.measure

Examples of eu.planets_project.tb.impl.model.measure.MeasurementTarget


   * @param value: the extracted value
   */
  private void createMeasurementAboutIdentification(ExecutionStageRecordImpl execStageRec, String dobURI1, List<String> extractedInformation){
    log.debug("extracting Measurement about identification operation for digo: "+dobURI1);
    //This encapsulates a reference to the entity that the measurement belongs to.
        MeasurementTarget target = new MeasurementTarget();
        target.setType(TargetType.DIGITAL_OBJECT);
        target.getDigitalObjects().add(0, dobURI1);
       
        //add the extracted information
    for(String value : extractedInformation){
        MeasurementImpl m = new MeasurementImpl();
        String actionIdentifier = WorkflowResultItem.SERVICE_ACTION_IDENTIFICATION;
View Full Code Here


          execStageRec.addMeasurement(m);
      }
  }
 
  private void createMeasurementAboutServiceExecTime(ExecutionStageRecordImpl execStageRec, long start, long end, String inputDigoRef, String outputDigoRef){
    MeasurementTarget target = new MeasurementTarget();
        target.setType(TargetType.SERVICE);
        Vector<String> aboutObjects = new Vector<String>();
        if(inputDigoRef!=null)
          aboutObjects.add(inputDigoRef);
        if(outputDigoRef!=null)
          aboutObjects.add(outputDigoRef);
        if(aboutObjects.size()>0)
          target.setDigitalObjects(aboutObjects);
       
        URI execStartURI = URI.create("planets://workflow/service/execution/start");
        URI execEndURI = URI.create("planets://workflow/service/execution/end");
        Property pStart = new Property.Builder(execStartURI).value(start+"").description("Planets Service Wrapper Execution start-time measured in milli-seconds").name("service execution start time").build();
        Property pEnd = new Property.Builder(execEndURI).value(end+"").description("Planets Service Wrapper Execution end-time measured in milli-seconds").name("service execution end time").build();
View Full Code Here

 
  private void createMeasurementAboutMigration(ExecutionStageRecordImpl execStageRec, String inputDigoRef, String outputDigoRef, WorkflowResultItem wfResItem) {
    //extract the information about the system's memory, etc.
    if((wfResItem.getServiceReport()!=null)&&(wfResItem.getServiceReport().getProperties()!=null)){
     
      MeasurementTarget target = new MeasurementTarget();
          target.setType(TargetType.SERVICE);
          Vector<String> aboutObjects = new Vector<String>();
          if(inputDigoRef!=null)
            aboutObjects.add(inputDigoRef);
          if(outputDigoRef!=null)
            aboutObjects.add(outputDigoRef);
          if(aboutObjects.size()>0)
            target.setDigitalObjects(aboutObjects);
         
      for(Property p : wfResItem.getServiceReport().getProperties()){
        MeasurementImpl m = new MeasurementImpl();
            //m.setMeasurementType( MeasurementType.SERVICE);
            m.setProperty(p);
View Full Code Here

      }
    }
  }
 
    private void createMeasurementAboutComparison(ExecutionStageRecordImpl execStageRec, String inputDigoRef, String outputDigoRef, List<String> extractedInformation) {
      MeasurementTarget target = new MeasurementTarget();
        target.setType(TargetType.SERVICE);
        Vector<String> aboutObjects = new Vector<String>();
        if(inputDigoRef!=null)
          aboutObjects.add(inputDigoRef);
        if(outputDigoRef!=null)
          aboutObjects.add(outputDigoRef);
        if(aboutObjects.size()>0)
          target.setDigitalObjects(aboutObjects);
     
      //add the extracted information
    for(String value : extractedInformation){
        MeasurementImpl m = new MeasurementImpl();
        String actionIdentifier = WorkflowResultItem.SERVICE_ACTION_COMPARE;
View Full Code Here

    private void fillComparisonEvent(MeasurementEventImpl me, Compare chr, CompareResult cr) {
        me.setAgent(new MeasurementAgent(chr.describe()));
        me.setDate(Calendar.getInstance());
        for( PropertyComparison pc : cr.getComparisons() ) {
            MeasurementImpl m = new MeasurementImpl( me, pc.getComparison());
            MeasurementTarget mt = new MeasurementTarget();
            mt.setType(TargetType.DIGITAL_OBJECT_PAIR);
            // Get data on the first object:
            mt.getDigitalObjects().add(0, this.getDobUri1() );
            mt.setDigitalObjectProperties(0, pc.getFirstProperties());
            log.info("Got PC1: "+pc.getFirstProperties());
            // Get data on the second object:
            mt.getDigitalObjects().add(1, this.getDobUri2() );
            mt.setDigitalObjectProperties(1, pc.getSecondProperties());
            log.info("Got PC2: "+pc.getSecondProperties());
            // Add to the measurement:
            m.setTarget( mt );
            // Equivalence Data:
            m.setEquivalence(pc.getEquivalence());
View Full Code Here

    private void recordIdentifyMeasurement( MeasurementEventImpl me, IdentifyResult ir, String dob ) {
        for( URI fmt : ir.getTypes() ) {
            MeasurementImpl m = new MeasurementImpl(IdentifyWorkflow.MEASURE_IDENTIFY_FORMAT);
            m.setValue(fmt.toASCIIString());
            m.setTarget( new MeasurementTarget() );
            m.getTarget().setType(TargetType.DIGITAL_OBJECT);
            m.getTarget().getDigitalObjects().add( dob );
            me.addMeasurement(m);

        }
        // Also record the method:
        if( ir.getMethod() != null ) {
            MeasurementImpl m = new MeasurementImpl(IdentifyWorkflow.MEASURE_IDENTIFY_METHOD);
            m.setValue(ir.getMethod().name());
            m.setTarget( new MeasurementTarget() );
            m.getTarget().setType(TargetType.DIGITAL_OBJECT);
            m.getTarget().getDigitalObjects().add( dob );
            me.addMeasurement(m);
        }
    }
View Full Code Here

    }

    private void recordPropertyMeasurements( MeasurementEventImpl me, List<Property> props, String dob ) {
        for( Property p : props ) {
            MeasurementImpl m = new MeasurementImpl(me,p);
            m.setTarget( new MeasurementTarget() );
            m.getTarget().setType(TargetType.DIGITAL_OBJECT);
            m.getTarget().getDigitalObjects().add(dob);
            me.addMeasurement(m);
        }
    }
View Full Code Here

        // Create a property from the manual one:
        m.setProperty( new Property.Builder(p).build() );
        //m.setUserEquivalence(this.newManEqu);
        m.setEquivalence( Equivalence.UNKNOWN );
        m.setValue(value);
        MeasurementTarget target = new MeasurementTarget();
        target.setType(TargetType.DIGITAL_OBJECT);
        target.getDigitalObjects().add(0, dobUri);
        /*
        target.setDigitalObjectProperty( 0,
                    new Property.Builder( p ).value(value).build()
                );
        */
 
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.impl.model.measure.MeasurementTarget

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.