Class EquinixIXMapping
MetroId values entirely
from live data - no hardcoded city table.
Equinix names every IBX (facility) with its metro as a prefix - LA3/LA4 are in
Los Angeles, SV5 in Silicon Valley, DC11 in Ashburn. So a facility is resolved by
reading the IBX code out of its PeeringDB name and looking it up in the live IBX→metro map
supplied at construction (built from fabric.metros().getIbxs()); an exact IBX hit wins, and
the metro prefix is a fallback (accepted only when it names a metro present in the live map, so a
brand-new metro resolves while a stray token does not). Each resolved facility also seeds a
city→metro map, through which IXes - which carry only a city - resolve. This means even city
aliases (a "San Jose" exchange co-located with the Silicon Valley SV facilities) map
correctly, with no static table and without depending on coordinates.
Because the bridge is keyed by MetroId (not the MetroCode enum), a metro that is
live in Fabric but not yet in the enum still resolves and stays distinct.
Call mapFacilities(Map) before mapIxes(Map) (the IX bridge depends on the
facility pass).
- Author:
- ianjones
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEquinixIXMapping(Map<String, MetroId> ibxToMetro) EquinixIXMapping(Map<String, MetroId> ibxToMetro, Collection<MetroId> liveMetros) -
Method Summary
Modifier and TypeMethodDescriptionfacIdsForMetro(MetroId metro) ixIdsForMetro(MetroId metro) voidmapFacilities(Map<Integer, PeeringDbFacility> equinixFacs) Binds each Equinix facility to its metro by reading the IBX code out of the facility name, and seeds the city→metro map used bymapIxes(Map).voidmapIxes(Map<Integer, PeeringDbIx> equinixIxes) Binds each Equinix IX to a metro via the facility-derived city→metro map (IXes carry only a city, not an IBX code).metroForFacility(int facId) metroForIx(int ixId) resolveFromName(String name) Reads an Equinix IBX code out of a name (e.g.
-
Constructor Details
-
EquinixIXMapping
-
EquinixIXMapping
- Parameters:
ibxToMetro- live IBX-code → metro map, may be emptyliveMetros- every metro the livefabric.metros()catalogue returned. These gate the IBX-prefix fallback (DC1→DC). The live/fabric/v4/metrosresponse carries no per-metro IBX list (checked 2026-11-11), so without this set no PeeringDB facility could resolve.
-
-
Method Details
-
mapFacilities
Binds each Equinix facility to its metro by reading the IBX code out of the facility name, and seeds the city→metro map used bymapIxes(Map). Call this beforemapIxes(Map).- Parameters:
equinixFacs- the Equinix facility map from PeeringDB (fac ID → facility metadata)
-
mapIxes
Binds each Equinix IX to a metro via the facility-derived city→metro map (IXes carry only a city, not an IBX code). CallmapFacilities(Map)first.- Parameters:
equinixIxes- the Equinix IX map from PeeringDB (IX ID → IX metadata)
-
resolveFromName
Reads an Equinix IBX code out of a name (e.g."Equinix LA4 - Los Angeles") and resolves it to a metro: an exact match against the live IBX→metro map wins; otherwise the IBX's metro-code prefix is tried, accepted only when that prefix names a metro present in the live map.- Parameters:
name- a PeeringDB facility name (oraka)- Returns:
- the resolved metro, or
nullif the name carries no recognizable IBX code
-
metroForIx
-
metroForFacility
-
ixIdsForMetro
-
facIdsForMetro
-
metrosWithIx
-
metrosWithFacilities
-