Class DesignDecisionRecorder
java.lang.Object
com.eqixiac.equinix.design.record.DesignDecisionRecorder
Produces a
DesignDecisionRecord: runs the engines for a spec (Metro Optimizer, then resilience analysis,
then the growth and value models where the spec gives enough input, then a deployment plan) and records their
results section by section.
DesignDecisionRecord adr = DesignDecisionRecorder.forSpec(fabric, spec)
.optimization(alreadyComputed) // optional: reuse a result for this spec
.record();
Read-only: it never creates, changes or deletes anything. With forSpec(FabricGateway, DesignSpec) the catalogue is read once
and shared by every engine, and one rate card (RateCard.standardChain(fabric) unless
rateCard(RateCard) is given) prices the optimisation, the term view, the value view and the plan, so a
price is looked up once. forContext(CatalogDesignContext) runs over facts already held, with no network unless the rate card
reaches it.
A supplied result computed for another spec (a different fingerprint()) is rejected. A section whose
engine fails, or whose inputs are absent, is recorded as failed or skipped with the reason; the record is always
produced.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe status a new record carries unlessstatus(String)says otherwise. -
Method Summary
Modifier and TypeMethodDescriptionbuildPlan(boolean build) currencyConverter(CurrencyConverter converter) defaultRates(CurrencyConverter defaults) estate(EstateReport report) Adds an analysis of the existing estate: its findings join the record's risks and its headline joins the context.static DesignDecisionRecorderforContext(CatalogDesignContext context) Records over facts already gathered (offline what-ifs, tests, a cached catalogue).static DesignDecisionRecorderforSpec(FabricGateway fabric, DesignSpec spec) Records a spec against live Fabric data (read-only: catalogue reads and price searches).optimization(OptimizationResult result) Uses an optimisation already computed for this spec instead of running the optimiser.peering(PeeringIntelligenceResult result) Adds a peering analysis: its presence is drawn into the resilience graph and its summary joins the context.plan(DeploymentPlan deploymentPlan) Uses a deployment plan instead of building one.record()Runs the engines and assembles the record.resilience(ResilienceReport report) Uses a resilience analysis already computed for this spec.resilienceOptions(ResilienceOptions options)
-
Field Details
-
DEFAULT_STATUS
The status a new record carries unlessstatus(String)says otherwise.- See Also:
-
-
Method Details
-
forSpec
Records a spec against live Fabric data (read-only: catalogue reads and price searches).- Parameters:
fabric- the Fabric APIspec- the design- Returns:
- a recorder to configure and
record()
-
forContext
Records over facts already gathered (offline what-ifs, tests, a cached catalogue). Prices come from the context's cost model, or fromrateCard(RateCard); the term, value and plan views need a rate card.- Parameters:
context- the facts; its spec is the design- Returns:
- a recorder to configure and
record()
-
rateCard
- Parameters:
card- the rate card every engine prices with; defaultRateCard.standardChain(fabric)forforSpec(FabricGateway, DesignSpec), none forforContext(CatalogDesignContext)(the context's cost model prices the optimisation)- Returns:
- this recorder
-
currencyConverter
- Parameters:
converter- exchange rates ranked below rates pinned in the spec and above the default sources- Returns:
- this recorder
-
defaultRates
- Parameters:
defaults- replaces the default rate sources (live ECB rates, then the bundled table), for exampleCurrencyConverters.bundledOnly()offline- Returns:
- this recorder
-
optimization
Uses an optimisation already computed for this spec instead of running the optimiser.- Parameters:
result- the result- Returns:
- this recorder
- Throws:
IllegalArgumentException- when the result was computed for another spec
-
resilience
Uses a resilience analysis already computed for this spec.- Parameters:
report- the report- Returns:
- this recorder
- Throws:
IllegalArgumentException- when the report was computed for another spec
-
plan
Uses a deployment plan instead of building one. A plan that carries no spec fingerprint is accepted, and the record says so.- Parameters:
deploymentPlan- the plan- Returns:
- this recorder
- Throws:
IllegalArgumentException- when the plan was built for another spec
-
estate
Adds an analysis of the existing estate: its findings join the record's risks and its headline joins the context. An estate report is not derived from a spec, so it carries no fingerprint to check.- Parameters:
report- the estate report- Returns:
- this recorder
-
peering
Adds a peering analysis: its presence is drawn into the resilience graph and its summary joins the context. A result that carries no spec fingerprint is accepted, and the record says so.- Parameters:
result- the peering analysis- Returns:
- this recorder
- Throws:
IllegalArgumentException- when the analysis was run for another spec
-
resilienceOptions
- Parameters:
options- graph and simulation options for the resilience analysis- Returns:
- this recorder
-
buildPlan
- Parameters:
build- whether to build a deployment plan from the recommendation when none is supplied (defaulttrue; the plan is built offline, without deployment inputs or live validation)- Returns:
- this recorder
-
status
- Parameters:
recordStatus- the decision status written in the record (default "Proposed")- Returns:
- this recorder
-
title
- Parameters:
recordTitle- the record title (defaultMetro design for <spec name>)- Returns:
- this recorder
-
clock
- Parameters:
recordClock- the clock forgeneratedAt(fix it for reproducible documents)- Returns:
- this recorder
-
record
Runs the engines and assembles the record.- Returns:
- the record; never
null - Throws:
IllegalArgumentException- when the spec has errors (DesignSpec.validate())
-