Package org.springframework.boot.cloud
Enum Class CloudPlatform
- All Implemented Interfaces:
- Serializable,- Comparable<CloudPlatform>,- Constable
Simple detection for well known cloud platforms. Detection can be forced using the
 
"spring.main.cloud-platform" configuration property.- Since:
- 1.3.0
- Author:
- Phillip Webb, Brian Clozel, Nguyen Sach
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionAzure App Service platform.Cloud Foundry platform.Heroku platform.Kubernetes platform.Nomad platform.No Cloud platform.SAP Cloud platform.
- 
Method SummaryModifier and TypeMethodDescriptionstatic CloudPlatformgetActive(Environment environment) Returns the activeCloudPlatformornullif one is not active.booleanisActive(Environment environment) Determines if the platform is active (i.e.abstract booleanisDetected(Environment environment) Determines if the platform is detected by looking for platform-specific environment variables.booleanisEnforced(Binder binder) Determines if the platform is enforced by looking at the"spring.main.cloud-platform"configuration property.booleanisEnforced(Environment environment) Determines if the platform is enforced by looking at the"spring.main.cloud-platform"configuration property.booleanReturns if the platform is behind a load balancer and uses X-Forwarded-For headers.static CloudPlatformReturns the enum constant of this class with the specified name.static CloudPlatform[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
NONENo Cloud platform. Useful when false-positives are detected.
- 
CLOUD_FOUNDRYCloud Foundry platform.
- 
HEROKUHeroku platform.
- 
SAPSAP Cloud platform.
- 
NOMADNomad platform.- Since:
- 3.1.0
 
- 
KUBERNETESKubernetes platform.
- 
AZURE_APP_SERVICEAzure App Service platform.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
isActiveDetermines if the platform is active (i.e. the application is running in it).- Parameters:
- environment- the environment
- Returns:
- if the platform is active.
 
- 
isEnforcedDetermines if the platform is enforced by looking at the"spring.main.cloud-platform"configuration property.- Parameters:
- environment- the environment
- Returns:
- if the platform is enforced
- Since:
- 2.3.0
 
- 
isEnforcedDetermines if the platform is enforced by looking at the"spring.main.cloud-platform"configuration property.- Parameters:
- binder- the binder
- Returns:
- if the platform is enforced
- Since:
- 2.4.0
 
- 
isDetectedDetermines if the platform is detected by looking for platform-specific environment variables.- Parameters:
- environment- the environment
- Returns:
- if the platform is auto-detected.
- Since:
- 2.3.0
 
- 
isUsingForwardHeaderspublic boolean isUsingForwardHeaders()Returns if the platform is behind a load balancer and uses X-Forwarded-For headers.- Returns:
- if X-Forwarded-For headers are used
 
- 
getActiveReturns the activeCloudPlatformornullif one is not active.- Parameters:
- environment- the environment
- Returns:
- the CloudPlatformornull
 
 
-