Class GeoZonesConstraint

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

public final class GeoZonesConstraint extends Object implements Constraint
Data sovereignty: every metro must belong to at least one of constraints.geoZones according to the live catalogue's geoScopes/geoZones for that metro (matched case-insensitively; CH, AU, BR, JP, CA, US also match the corresponding geo scope). A metro the catalogue lists in no zone is not admitted: membership cannot be shown.
  • Field Details

  • Constructor Details

    • GeoZonesConstraint

      public GeoZonesConstraint()
  • 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