Class HealthChecker.Builder
- java.lang.Object
-
- com.oracle.bmc.loadbalancer.model.HealthChecker.Builder
-
- Enclosing class:
- HealthChecker
public static class HealthChecker.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HealthCheckerbuild()HealthChecker.Buildercopy(HealthChecker model)HealthChecker.BuilderdefaultWeight(Integer defaultWeight)The fallback backend weight used when dynamic backend weights are enabled and the backend’s HTTP health check response does not include a valid X-Dynamic-Backend-Weight header value.HealthChecker.BuilderintervalInMillis(Integer intervalInMillis)The interval between health checks, in milliseconds.HealthChecker.BuilderisDynamicBackendWeightEnabled(Boolean isDynamicBackendWeightEnabled)Indicates whether dynamic backend weights are enabled for HTTP health checks.HealthChecker.BuilderisForcePlainText(Boolean isForcePlainText)Specifies if health checks should always be done using plain text instead of depending on whether or not the associated backend set is using SSL.HealthChecker.Builderport(Integer port)The backend server port against which to run the health check.HealthChecker.Builderprotocol(String protocol)The protocol the health check must use; either HTTP or TCP.HealthChecker.BuilderresponseBodyRegex(String responseBodyRegex)A regular expression for parsing the response body from the backend server.HealthChecker.Builderretries(Integer retries)The number of retries to attempt before a backend server is considered “unhealthy”.HealthChecker.BuilderreturnCode(Integer returnCode)The status code a healthy backend server should return.HealthChecker.BuildertimeoutInMillis(Integer timeoutInMillis)The maximum time, in milliseconds, to wait for a reply to a health check.HealthChecker.BuilderurlPath(String urlPath)The path against which to run the health check.
-
-
-
Method Detail
-
protocol
public HealthChecker.Builder protocol(String protocol)
The protocol the health check must use; either HTTP or TCP.Example: HTTP
- Parameters:
protocol- the value to set- Returns:
- this builder
-
urlPath
public HealthChecker.Builder urlPath(String urlPath)
The path against which to run the health check.Example: /healthcheck
- Parameters:
urlPath- the value to set- Returns:
- this builder
-
port
public HealthChecker.Builder port(Integer port)
The backend server port against which to run the health check.If the port is not specified, the load balancer uses the port information from the Backend object.
Example: 8080
- Parameters:
port- the value to set- Returns:
- this builder
-
returnCode
public HealthChecker.Builder returnCode(Integer returnCode)
The status code a healthy backend server should return.If you configure the health check policy to use the HTTP protocol, you can use common HTTP status codes such as “200”.
Example: 200
- Parameters:
returnCode- the value to set- Returns:
- this builder
-
retries
public HealthChecker.Builder retries(Integer retries)
The number of retries to attempt before a backend server is considered “unhealthy”.This number also applies when recovering a server to the “healthy” state. Defaults to 3.
Example: 3
- Parameters:
retries- the value to set- Returns:
- this builder
-
timeoutInMillis
public HealthChecker.Builder timeoutInMillis(Integer timeoutInMillis)
The maximum time, in milliseconds, to wait for a reply to a health check.A health check is successful only if a reply returns within this timeout period. Defaults to 3000 (3 seconds).
Example: 3000
- Parameters:
timeoutInMillis- the value to set- Returns:
- this builder
-
intervalInMillis
public HealthChecker.Builder intervalInMillis(Integer intervalInMillis)
The interval between health checks, in milliseconds.The default is 10000 (10 seconds).
Example: 10000
- Parameters:
intervalInMillis- the value to set- Returns:
- this builder
-
responseBodyRegex
public HealthChecker.Builder responseBodyRegex(String responseBodyRegex)
A regular expression for parsing the response body from the backend server.Example: ^((?!false).|\\s)*$
- Parameters:
responseBodyRegex- the value to set- Returns:
- this builder
-
isDynamicBackendWeightEnabled
public HealthChecker.Builder isDynamicBackendWeightEnabled(Boolean isDynamicBackendWeightEnabled)
Indicates whether dynamic backend weights are enabled for HTTP health checks.When enabled, the load balancer reads the X-Dynamic-Backend-Weight header from each backend's HTTP health check response. The load balancer uses that value as the backend's effective weight when distributing traffic.
A valid header value is an integer from 0 through 100.
If the backend response does not include this header, or includes an invalid value, the load balancer uses defaultWeight.
For TCP health checks, this field is accepted and stored, but it has no runtime effect.
- Parameters:
isDynamicBackendWeightEnabled- the value to set- Returns:
- this builder
-
defaultWeight
public HealthChecker.Builder defaultWeight(Integer defaultWeight)
The fallback backend weight used when dynamic backend weights are enabled and the backend’s HTTP health check response does not include a valid X-Dynamic-Backend-Weight header value.This value is an integer from 1 through 100.
For TCP health checks, this field is accepted and stored, but it has no runtime effect.
Example: 1
- Parameters:
defaultWeight- the value to set- Returns:
- this builder
-
isForcePlainText
public HealthChecker.Builder isForcePlainText(Boolean isForcePlainText)
Specifies if health checks should always be done using plain text instead of depending on whether or not the associated backend set is using SSL.If "true", health checks will be done using plain text even if the associated backend set is configured to use SSL.
If "false", health checks will be done using SSL encryption if the associated backend set is configured to use SSL. If the backend set is not so configured the health checks will be done using plain text.
Example: false
- Parameters:
isForcePlainText- the value to set- Returns:
- this builder
-
build
public HealthChecker build()
-
copy
public HealthChecker.Builder copy(HealthChecker model)
-
-