Class EstatePricing

java.lang.Object
com.eqixiac.equinix.design.estate.EstatePricing

public final class EstatePricing extends Object
Prices existing resources through a RateCard and turns each quote into a CostLine with a range that reflects its provenance: live Equinix, contract (CUSTOM) and provider-API prices are exact; reference prices get ± EstateThresholds.referencePriceRangePercent(); estimates get ± EstateThresholds.estimatePriceRangePercent().

Every line is restated in one reporting currency (currency(), USD unless set) through CurrencyConverters, so every finding's saving is in that currency and savings can be totalled: a line quoted in another currency (live Fabric pricing quotes London in GBP) keeps its original amount and currency, the rate and the rate's source and date in CostLine.conversion(). A price whose currency no rate source covers is unpriced with that reason.

A lookup that cannot be priced returns a EstatePricing.Priced with a reason, never a zero. Lookups are cached for the life of this object, so a rule that prices the same tier many times makes one request.

  • Field Details

    • DEFAULT_CURRENCY

      public static final String DEFAULT_CURRENCY
      The reporting currency when none is set.
      See Also:
  • Constructor Details

    • EstatePricing

      public EstatePricing(RateCard rateCard, EstateThresholds thresholds)
      Creates pricing over a rate card, reporting in USD with the default rate sources (live ECB rates, then the bundled table).
      Parameters:
      rateCard - the rate card, or null to leave everything unpriced
      thresholds - the thresholds (for the price ranges)
    • EstatePricing

      public EstatePricing(RateCard rateCard, EstateThresholds thresholds, String currency, CurrencyConverter supplied, CurrencyConverter defaultRates)
      Creates pricing over a rate card in a stated reporting currency.
      Parameters:
      rateCard - the rate card, or null to leave everything unpriced
      thresholds - the thresholds (for the price ranges)
      currency - the ISO 4217 reporting currency; null for USD
      supplied - a converter ranked above the default rate sources, or null
      defaultRates - replaces the default rate sources (for example CurrencyConverters.bundledOnly()); null for the defaults
  • Method Details

    • currency

      public String currency()
      The currency every priced line is restated in.
      Returns:
      an ISO 4217 code
    • converter

      public CurrencyConverters.Chain converter()
      The converter in use (for its fallback notes).
      Returns:
      the converter chain
    • currencyNotes

      public List<String> currencyNotes()
      What happened to currencies so far: one advisory per source currency converted, and any rate source that fell back.
      Returns:
      the notes, empty when every price was already in currency()
    • unavailable

      public static EstatePricing unavailable()
      Pricing that prices nothing, for analyses run without a rate card.
      Returns:
      unavailable pricing
    • connection

      public EstatePricing.Priced connection(String label, String type, Integer bandwidthMbps, String metro, Term term)
      Prices one virtual connection.
      Parameters:
      label - the cost-line label
      type - the connection type as the API reports it (for example EVPL_VC)
      bandwidthMbps - the bandwidth
      metro - the metro code, or null
      term - the term
      Returns:
      the priced line, or the reason it could not be priced
    • router

      public EstatePricing.Priced router(String label, String packageCode, String metro, Term term)
      Prices one Cloud Router.
      Parameters:
      label - the cost-line label
      packageCode - the package code
      metro - the metro code, or null
      term - the term
      Returns:
      the priced line, or the reason it could not be priced
    • termOf

      public static Term termOf(Integer termMonths)
      The term a resource is billed on today.
      Parameters:
      termMonths - the recorded term length, or null
      Returns:
      the matching term (Term.MONTH_1 for on-demand or an unlisted length)