Class ComplianceZonesConstraint

java.lang.Object
com.eqixiac.equinix.design.constraint.ComplianceZonesConstraint
All Implemented Interfaces:
Constraint

public final class ComplianceZonesConstraint extends Object implements Constraint
Every metro must be in a region that at least one zone of constraints.complianceZones allows (ComplianceZone.getAllowedRegions()): the design stays within the stated zones. A metro with no known region is not admitted.
  • Field Details

  • Constructor Details

    • ComplianceZonesConstraint

      public ComplianceZonesConstraint()
  • Method Details

    • id

      public String id()
      Specified by:
      id in interface Constraint
      Returns:
      a stable id, lower_snake_case (for example max_latency)
    • admits

      public boolean admits(MetroFacts metro, DesignContext context)
      Description copied from interface: Constraint
      Cheap per-metro pruning before portfolios are formed. Return false only when no portfolio containing this metro could ever satisfy the constraint (an excluded metro, a metro outside every allowed zone). The default admits every metro.
      Specified by:
      admits in interface Constraint
      Parameters:
      metro - a candidate metro
      context - the facts of this run
      Returns:
      whether the metro may appear in a portfolio
    • check

      public ConstraintVerdict check(MetroPortfolio portfolio, DesignContext context)
      Description copied from interface: Constraint
      Checks a whole portfolio.
      Specified by:
      check in interface Constraint
      Parameters:
      portfolio - the candidate design
      context - the facts of this run
      Returns:
      the verdict with its reason