Package fr.imag.adele.apam.util

Examples of fr.imag.adele.apam.util.ApamFilter


   * preferences and constraints filters
   */
  public void computeFilters() {

    isInitialized = true;
    ApamFilter f;

    for (String c : mngImplementationConstraints) {
      f = ApamFilter.newInstanceApam(c, linkSource);
      if (f != null) {
        allImplementationConstraintFilters.add(f);
View Full Code Here


  /**
   * Recompute the filters if there are substitutions.
   * Supposed to be called each time an attribute is changes in the component (setProperty)
   */
  public void reComputeSubstFilters () {
    ApamFilter f;

    /*
     * intrinsic constraints. To recompute only if they have substitutions.
     */
    if (!getImplementationConstraints().isEmpty()) {
View Full Code Here

  @Override
  public boolean match(String goal) {
    if (goal == null) {
      return true;
    }
    ApamFilter f = ApamFilter.newInstance(goal);
    if (f == null) {
      return false;
    }
    return goal == null || f.match(this.getAllProperties());
  }
View Full Code Here

    if (goal == null) {
      return getImpls();
    }

    Set<Implementation> ret = new HashSet<Implementation>();
    ApamFilter f = ApamFilter.newInstance(goal);
    for (Implementation impl : implementations) {
      if (impl.match(f)) {
        ret.add(impl);
      }
    }
View Full Code Here

  public Set<Instance> getInsts(String goal) {
    if (goal == null) {
      return getInsts();
    }
    Set<Instance> ret = new HashSet<Instance>();
    ApamFilter f = ApamFilter.newInstance(goal);
    for (Instance inst : instances) {
      if (inst.match(f)) {
        ret.add(inst);
      }
    }
View Full Code Here

    if (goal == null) {
      return getSpecs();
    }

    Set<Specification> ret = new HashSet<Specification>();
    ApamFilter f = ApamFilter.newInstance(goal);
    for (Specification spec : specifications) {
      if (spec.match(f)) {
        ret.add(spec);
      }
    }
View Full Code Here

  private void validate(String filter, String message) {
   
    /*
     * validate syntax
     */
    ApamFilter expression = parseFilter(filter);
    if (expression == null) {
      error(message+", invalid filter syntax "+quoted(filter));
      return;
    }
   
View Full Code Here

    if (expression == null || expression.equals(CST.V_FALSE) || expression.equals(CST.V_TRUE)) {
      return;
    }

    ApamFilter parsedExpression = parseFilter(expression);
    if (parsedExpression == null) {
      error(message+" "+quoted(expression));
    }

  }
View Full Code Here

        if (candidate.getReference().getKind() == ComponentKind.IMPLEMENTATION)
          providerInstancesQuery.append("(").append(CST.IMPLNAME).append("=").append(candidate.getReference().getName()).append(")");
      }
      providerInstancesQuery.append(")");
     
      ApamFilter query = ApamFilter.newInstance(providerInstancesQuery.toString());
     
      /*
       * TODO We can not be sure that the candidate instance corresponds to the selected revision of the implementation. We
       * are just assuming that instances can be created without considering versions, this may not be true if the implementation
       * declaration has changed in a not backward compatible way
View Full Code Here

     */
    ComponentKind searchedKind     = relation.getTargetKind();
    if (searchedKind == ComponentKind.INSTANCE)
      searchedKind = ComponentKind.IMPLEMENTATION;
   
    ApamFilter requirement = ApamFilter.newInstance(requirementQuery);
   
    Set<DeployableComponent> candidates = new HashSet<DeployableComponent>();
    for (DeployableComponent component : obrMan.getComponents(this)) {
     
      /*
 
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.util.ApamFilter

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.