Package cross.reputation.model

Examples of cross.reputation.model.ReputationModuleBehaviour


    }   
    List<Class<? extends ReputationBehaviour>> types =
      new ArrayList<Class<? extends ReputationBehaviour>>();
    types.add(ReputationModuleBehaviour.class);
    reputationModule = getReputationAlgorithm(model, resource, types);
    ReputationModuleBehaviour repModuleBeh = null;
    for(ReputationBehaviour behaviour : reputationModule.getBehaviours()) {
      if(behaviour instanceof ReputationModuleBehaviour) {
        repModuleBeh = (ReputationModuleBehaviour) behaviour;
      }
    }   
    // Specific Attributes and Properties of ReputationModule Class //   
    // obtainsReputationsBy //
    Property obtainsReputationsBy = ResourceFactory.createProperty(
        riNamespace + "obtainsReputationsBy");
    StmtIterator stmtI1 = model.listStatements(resource,
        obtainsReputationsBy, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      /* validate obtainsReputationsBy property */
      if(!statement.getObject().isResource()) {         
        if(!ModelException.throwException(ModelException.REPUTATIONMODULE,
            "obtainsReputationsBy property of resource:"+
            resource.getURI()+" is not a resource")) {
          return null;
        }
      } else {
        ReputationAlgorithmImplementation repAlg =
          (ReputationAlgorithmImplementation) getResourceFromCache(
          statement.getObject().asResource(),ReputationAlgorithmImplementation.class);
        if(repAlg == null) {
          repAlg = getReputationAlgorithm(model,
              statement.getObject().asResource(), null);       
        }
        repModuleBeh.addObtainsReputationsBy(repAlg);         
      }
    }
    return reputationModule;
  }
View Full Code Here


    return reputationModule;
  }
 
  public ReputationBehaviour getReputationModuleBehaviour(Model model,
      Resource resource, Class<? extends ReputationBehaviour> type) throws Exception {
    ReputationModuleBehaviour behaviour = (ReputationModuleBehaviour)
      getResourceFromCache(resource, ReputationModuleBehaviour.class);
    if(behaviour != null) {
      //System.out.println("CACHE FOUND with reputationModuleBehaviour:"+behaviour);
      return behaviour;
    }   
    behaviour = new ReputationModuleBehaviour();
    addResourceInstanceToCache(resource, behaviour);
    // Specific Attributes and Properties of ReputationModule Class //
    // obtainsReputationBy //
    Property obtainsReputationBy = ResourceFactory.createProperty(
        riNamespace + "obtainsReputationBy");
    StmtIterator stmtI1 = model.listStatements(resource,
        obtainsReputationBy, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      /* validate obtainsReputationBy property */
      if(!statement.getObject().isResource()) {         
        if(!ModelException.throwException(ModelException.REPUTATIONMODULE,
            "obtainsReputationBy property of resource:"+
            resource.getURI()+" is not a resource")) {
              return null;
            }
      } else {
        ReputationAlgorithmImplementation repAlg =
          (ReputationAlgorithmImplementation) getResourceFromCache(
          statement.getObject().asResource(),ReputationAlgorithmImplementation.class);
        if(repAlg == null) {
          repAlg = getReputationAlgorithm(model,
              statement.getObject().asResource(), null);       
        }
        behaviour.addObtainsReputationsBy(repAlg);       
      }
    }
    return behaviour;
  }
View Full Code Here

            metricMappings.addAll(findMetricMappings(module));         
          }
        }
      }
      if(ReputationModuleBehaviour.class.isInstance(behaviour)) {
        ReputationModuleBehaviour module = (
            ReputationModuleBehaviour) behaviour;
        if(module.getObtainsReputationsBy() != null) {
          for(ReputationAlgorithmImplementation repAlgInside :
            module.getObtainsReputationsBy()) {
            metricMappings.addAll(findMetricMappings(repAlgInside));
          }
        }
      }
      if(ReputationImporterBehaviour.class.isInstance(behaviour)) {
View Full Code Here

            importationUnitsMap.putAll(findImportationUnits(module));         
          }
        }
      }
      if(ReputationModuleBehaviour.class.isInstance(behaviour)) {
        ReputationModuleBehaviour module = (
            ReputationModuleBehaviour) behaviour;
        if(module.getObtainsReputationsBy() != null) {
          for(ReputationAlgorithmImplementation repAlgInside :
            module.getObtainsReputationsBy()) {
            importationUnitsMap.putAll(findImportationUnits(repAlgInside));
          }
        }
      }
      if(ReputationImporterBehaviour.class.isInstance(behaviour)) {
View Full Code Here

            sortByStepIdentifier(collectingSystems,collectingSystemsInside);         
          }
        }
      }
      if(ReputationModuleBehaviour.class.isInstance(behaviour)) {
        ReputationModuleBehaviour module = (
            ReputationModuleBehaviour) behaviour;
        if(module.getObtainsReputationsBy() != null) {
          for(ReputationAlgorithmImplementation repAlgInside :
            module.getObtainsReputationsBy()) {
            ObjectWithIdentifier collectingSystemsInside =
              findCollectionSystemsInside(repAlgInside);
            if(collectingSystemsInside == null) {
              continue;
            }
View Full Code Here

TOP

Related Classes of cross.reputation.model.ReputationModuleBehaviour

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.