Class ProviderRef
- All Implemented Interfaces:
Comparable<ProviderRef>
{provider} segment of
the resource name providers/{provider}.
Beta: derived from the open specification at commit bbfc763 (see the package
documentation). The specification states that provider ids are centrally assigned and stored in
its repository; at that commit no registry file exists and governance/IMPLEMENTERS.md
lists no implementers.
Normalization
of(String) trims surrounding whitespace, removes one optional leading / and
one optional providers/ prefix, and lower-cases the remainder with Locale.ROOT.
Both spellings of the specification's ProviderSites.providerId field are accepted: its
description gives the format providers/{provider} and its inline example uses the bare
id. Two ProviderRefs are equal when their normalized ids are equal. toString()
returns the normalized id.
Well-known constants
| Constant | Id | Source |
|---|---|---|
AWS | aws |
Specification, docs/Protocols.md: /providers/aws |
GCP | gcp |
Specification, docs/Protocols.md: /providers/gcp |
OCI | oci |
Unverified. Not present in the specification; chosen to equal
CloudProviderType.ORACLE_CLOUD.shortCode() |
AZURE | azure |
Unverified. Not present in the specification; chosen to equal
CloudProviderType.AZURE.shortCode() |
EQUINIX | equinix |
Unverified. Not present in the specification; Equinix has no
CloudProviderType constant |
Bridge from the Fabric cloud-provider enum
This type lives in core and does not reference any domain package. The Fabric enum
com.eqixiac.equinix.fabric.model.implementation.cloud.CloudProviderType bridges to it
through its shortCode() method:
ProviderRef aws = ProviderRef.of(CloudProviderType.AWS.shortCode()); // equals ProviderRef.AWS
shortCode() returns aws, azure, gcp, oci,
ibm, alibaba and, for CloudProviderType.OTHER, the placeholder
cloud. The last three produce a valid ProviderRef for which
isWellKnown() is false; cloud does not identify a provider and must not
be used to build a resource name.
- Author:
- ianjones
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ProviderRefAmazon Web Services.static final ProviderRefMicrosoft Azure.static final ProviderRefEquinix.static final ProviderRefGoogle Cloud.static final ProviderRefOracle Cloud Infrastructure.static final StringThe resource-name prefix of a provider:providers/. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ProviderRef other) Orders by normalized id, lexicographically.booleaninthashCode()id()booleanstatic ProviderRefCreates aProviderReffrom a provider id ("aws"," AWS ") or a provider resource name ("providers/aws","/providers/aws").toString()
-
Field Details
-
RESOURCE_PREFIX
The resource-name prefix of a provider:providers/.- See Also:
-
AWS
Amazon Web Services. Idaws, as written in the specification'sdocs/Protocols.md. -
GCP
Google Cloud. Idgcp, as written in the specification'sdocs/Protocols.md. -
OCI
Oracle Cloud Infrastructure. Idoci; unverified, see the class table. -
AZURE
Microsoft Azure. Idazure; unverified, see the class table. -
EQUINIX
Equinix. Idequinix; unverified, see the class table.
-
-
Method Details
-
of
Creates aProviderReffrom a provider id ("aws"," AWS ") or a provider resource name ("providers/aws","/providers/aws").- Parameters:
idOrResourceName- the provider id orproviders/{id}resource name- Returns:
- the provider reference with a normalized, lower-case id
- Throws:
NullPointerException- ifidOrResourceNameis nullIllegalArgumentException- if the id is blank after normalization, or contains/or whitespace (for example a longer resource name such asproviders/aws/environments/x)
-
id
- Returns:
- the normalized, lower-case provider id (for example
aws)
-
resourceName
- Returns:
- the specification resource name of this provider:
providers/{id}
-
isWellKnown
public boolean isWellKnown()- Returns:
truewhen this id equals one of the constants declared on this class. Afalseresult does not mean the id is invalid; the specification assigns ids outside this SDK
-
compareTo
Orders by normalized id, lexicographically.- Specified by:
compareToin interfaceComparable<ProviderRef>
-
equals
-
hashCode
-
toString
-