枚举类 CloudPlatform

java.lang.Object
java.lang.Enum<CloudPlatform>
org.springframework.boot.cloud.CloudPlatform
所有已实现的接口:
Serializable, Comparable<CloudPlatform>, Constable

public enum CloudPlatform extends Enum<CloudPlatform>
Simple detection for well known cloud platforms. Detection can be forced using the "spring.main.cloud-platform" configuration property.
从以下版本开始:
1.3.0
作者:
Phillip Webb, Brian Clozel, Nguyen Sach
  • 枚举常量详细资料

    • NONE

      public static final CloudPlatform NONE
      No Cloud platform. Useful when false-positives are detected.
    • CLOUD_FOUNDRY

      public static final CloudPlatform CLOUD_FOUNDRY
      Cloud Foundry platform.
    • HEROKU

      public static final CloudPlatform HEROKU
      Heroku platform.
    • SAP

      public static final CloudPlatform SAP
      SAP Cloud platform.
    • NOMAD

      public static final CloudPlatform NOMAD
      Nomad platform.
      从以下版本开始:
      3.1.0
    • KUBERNETES

      public static final CloudPlatform KUBERNETES
      Kubernetes platform.
    • AZURE_APP_SERVICE

      public static final CloudPlatform AZURE_APP_SERVICE
      Azure App Service platform.
  • 方法详细资料

    • values

      public static CloudPlatform[] values()
      返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同
      返回:
      包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
    • valueOf

      public static CloudPlatform valueOf(String name)
      返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - 如果该枚举类没有带有指定名称的常量
      NullPointerException - 如果参数为空值
    • isActive

      public boolean isActive(Environment environment)
      Determines if the platform is active (i.e. the application is running in it).
      参数:
      environment - the environment
      返回:
      if the platform is active.
    • isEnforced

      public boolean isEnforced(Environment environment)
      Determines if the platform is enforced by looking at the "spring.main.cloud-platform" configuration property.
      参数:
      environment - the environment
      返回:
      if the platform is enforced
      从以下版本开始:
      2.3.0
    • isEnforced

      public boolean isEnforced(Binder binder)
      Determines if the platform is enforced by looking at the "spring.main.cloud-platform" configuration property.
      参数:
      binder - the binder
      返回:
      if the platform is enforced
      从以下版本开始:
      2.4.0
    • isDetected

      public abstract boolean isDetected(Environment environment)
      Determines if the platform is detected by looking for platform-specific environment variables.
      参数:
      environment - the environment
      返回:
      if the platform is auto-detected.
      从以下版本开始:
      2.3.0
    • isUsingForwardHeaders

      public boolean isUsingForwardHeaders()
      Returns if the platform is behind a load balancer and uses X-Forwarded-For headers.
      返回:
      if X-Forwarded-For headers are used
    • getActive

      public static CloudPlatform getActive(Environment environment)
      Returns the active CloudPlatform or null if one is not active.
      参数:
      environment - the environment
      返回:
      the CloudPlatform or null