Interface DesignContext

All Known Implementing Classes:
CatalogDesignContext

public interface DesignContext
The read-only facts of one design run. An engine gathers them once (from the live Fabric catalogue, the rate cards and the spec) and hands the same context to every plug-in, so plug-ins never perform I/O and a run is reproducible from its context.

All latencies are round-trip milliseconds, the unit of Fabric's measured connectedMetros.avgLatency. An empty result means unknown, never zero.

  • Method Details

    • spec

      DesignSpec spec()
      Returns:
      the design being evaluated
    • metros

      List<MetroFacts> metros()
      Returns:
      every metro the catalogue returned, in a stable order (by code)
    • metro

      Optional<MetroFacts> metro(MetroId metro)
      Parameters:
      metro - a metro
      Returns:
      its facts, or empty when the catalogue does not list it
    • roundTripLatencyMs

      OptionalDouble roundTripLatencyMs(MetroId metro, SiteIntent site)
      Round-trip latency between a metro and a site: Fabric's measurement when the site names a metro and the pair is measured, otherwise an estimate from distance, otherwise unknown.
      Parameters:
      metro - a metro
      site - a site of the spec
      Returns:
      the latency in ms, or empty when it is unknown
    • latencyMeasured

      boolean latencyMeasured(MetroId metro, SiteIntent site)
      Parameters:
      metro - a metro
      site - a site of the spec
      Returns:
      true when roundTripLatencyMs(MetroId, SiteIntent) is a Fabric measurement, false when it is an estimate or unknown
    • roundTripLatencyMs

      OptionalDouble roundTripLatencyMs(MetroId a, MetroId b)
      Round-trip latency between two metros, measured where Fabric publishes it and estimated otherwise.
      Parameters:
      a - one metro
      b - the other metro
      Returns:
      the latency in ms, or empty when it is unknown
    • siteWeight

      double siteWeight(SiteIntent site)
      Parameters:
      site - a site of the spec
      Returns:
      the site's share of the total site weight, between 0 and 1 (weights sum to 1 across sites)
    • reachableClouds

      Set<String> reachableClouds(MetroId metro)
      Parameters:
      metro - a metro
      Returns:
      the ids of the spec's CloudIntents that can be reached privately from the metro
    • costModel

      CostModel costModel()
      Returns:
      the cost model that prices portfolios in this run
    • asOf

      Instant asOf()
      Returns:
      when the facts were gathered