Class ServiceProfileOption
A provider legitimately publishes several service profiles at the same metro (a hosted Direct-Connect profile capped at 500 Mbps and a dedicated profile that lists 1G/10G/100G, for example). The optimizer resolves a single outranks winner for scoring and region preference, but that winner is chosen with zero knowledge of the connection's eventual bandwidth - so a hosted profile can win for a metro and then be paired with a 3000 Mbps connection it cannot build. To let the wizard choose a covering profile once the bandwidth is known, EVERY matching profile's capability for the metro is carried forward as one of these options.
The covers(int) rule mirrors the Layer-1 validator
(PlanValidator.checkProfile) bit-for-bit, so a profile the selector accepts is exactly a
profile the validator will not reject, and vice-versa: the per-metro ceiling
(vcBandwidthMax) must not be exceeded, AND the bandwidth must be one
of the discrete supportedBandwidths tiers - unless the profile
allowCustomBandwidth allows custom bandwidth or publishes no discrete tier list at
all, either of which lifts the discrete-tier constraint.
covers(int) answers the exact question ("can this profile build a VC at exactly
this speed?"). Bandwidth round-up - the owner's rule that a requirement with no exact tier
selects the smallest tier that satisfies it (3000 → 5000, never an error) - is a
separate primitive, coveringTier(int): the smallest thing this profile can actually build
that is not below the requirement. The wizard stamps the connection at that covering tier (which
covers() then accepts exactly), so the round-up selection and the Layer-1 tier check stay in
agreement. covers() is deliberately left exact so it keeps mirroring checkProfile.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThecoveringTier(int)sentinel returned when a profile cannot build the requested bandwidth even after rounding up - the requirement exceeds its largest tier (and its per-metro ceiling). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCover(int mbps) Whether this profile can carry the requested bandwidth after rounding up - i.e. whethercoveringTier(int)finds a satisfying tier.intA capacity yardstick for "smallest-capable-first" selection: the largest discrete tier this profile publishes, or - for a custom-bandwidth/tierless profile - its per-metro ceiling, orInteger.MAX_VALUEwhen it is unbounded.intcoveringTier(int mbps) The smallest bandwidth this profile can actually build that satisfies (is not below) the requested speed - the bandwidth round-up primitive.booleancovers(int mbps) Whether this profile can carry a connection of the given bandwidth, applying the SAME rule asPlanValidator.checkProfileso the selector and the Layer-1 validator agree exactly: the per-metro ceiling must not be exceeded, and the bandwidth must be an allowed discrete tier unless custom bandwidth is allowed or no tier list is published.intexcessTiersAbove(int mbps) How many discrete tiers this profile publishes strictly abovembps- the tie-break for two profiles with the samecapacityCeiling(): the fewer wasted tiers, the tighter.intThe largest bandwidth this profile can build in Mbps - its largest published tier clamped to the per-metro ceiling, the ceiling itself for a custom/tierless profile, orInteger.MAX_VALUEwhen it is unbounded.
-
Field Details
-
NO_COVERING_TIER
public static final int NO_COVERING_TIERThecoveringTier(int)sentinel returned when a profile cannot build the requested bandwidth even after rounding up - the requirement exceeds its largest tier (and its per-metro ceiling). Chosen negative so it sorts below every real tier in a smallest-fit comparator.- See Also:
-
-
Constructor Details
-
ServiceProfileOption
public ServiceProfileOption()
-
-
Method Details
-
covers
public boolean covers(int mbps) Whether this profile can carry a connection of the given bandwidth, applying the SAME rule asPlanValidator.checkProfileso the selector and the Layer-1 validator agree exactly: the per-metro ceiling must not be exceeded, and the bandwidth must be an allowed discrete tier unless custom bandwidth is allowed or no tier list is published.- Parameters:
mbps- the requested connection bandwidth in Mbps- Returns:
truewhen a connection ofmbpsis buildable on this profile
-
coveringTier
public int coveringTier(int mbps) The smallest bandwidth this profile can actually build that satisfies (is not below) the requested speed - the bandwidth round-up primitive. This is what the wizard stamps the connection at when the exact requirement is not an offered tier:- a discrete-tier profile returns its smallest published tier
>= mbps(so 3000 against[1000, 5000, 10000]returns 5000); - a custom-bandwidth (
allowCustomBandwidth) or tierless profile returnsmbpsitself - the exact speed is buildable, so nothing is rounded; - in either case the result is clamped to the per-metro ceiling
(
vcBandwidthMax): a tier above the ceiling is not selectable.
NO_COVERING_TIERwhen even rounding up cannot satisfy the requirement (it exceeds the largest tier this profile publishes and its ceiling). Because the returned tier is always onecovers(int)accepts exactly, stamping the connection at it keeps the selector and the Layer-1 validator in agreement.- Parameters:
mbps- the requested connection bandwidth in Mbps- Returns:
- the smallest satisfying tier in Mbps, or
NO_COVERING_TIERif none exists
- a discrete-tier profile returns its smallest published tier
-
canCover
public boolean canCover(int mbps) Whether this profile can carry the requested bandwidth after rounding up - i.e. whethercoveringTier(int)finds a satisfying tier. Distinct fromcovers(int), which is the exact-tier test: a 3000 Mbps request hascovers()==falsebutcanCover()==trueon a profile publishing a 5000 Mbps tier.- Parameters:
mbps- the requested connection bandwidth in Mbps- Returns:
truewhen a satisfying tier exists (exact or rounded up)
-
maxCoverableMbps
public int maxCoverableMbps()The largest bandwidth this profile can build in Mbps - its largest published tier clamped to the per-metro ceiling, the ceiling itself for a custom/tierless profile, orInteger.MAX_VALUEwhen it is unbounded. Used to phrase the "requirement exceeds every profile" error with the real maximum a customer could ask for instead.- Returns:
- the largest buildable bandwidth in Mbps
-
capacityCeiling
public int capacityCeiling()A capacity yardstick for "smallest-capable-first" selection: the largest discrete tier this profile publishes, or - for a custom-bandwidth/tierless profile - its per-metro ceiling, orInteger.MAX_VALUEwhen it is unbounded. A smaller value is a tighter fit, so a request both a hosted ([50..500]) and a dedicated profile could carry prefers the hosted one.- Returns:
- the profile's effective capacity ceiling in Mbps
-
excessTiersAbove
public int excessTiersAbove(int mbps) How many discrete tiers this profile publishes strictly abovembps- the tie-break for two profiles with the samecapacityCeiling(): the fewer wasted tiers, the tighter.- Parameters:
mbps- the requested connection bandwidth in Mbps- Returns:
- the count of published tiers greater than
mbps
-