Class HealthCheck.Builder

  • Enclosing class:
    HealthCheck

    public static class HealthCheck.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • isEnabled

        public HealthCheck.Builder isEnabled​(Boolean isEnabled)
        Enables or disables the health checks.
        Parameters:
        isEnabled - the value to set
        Returns:
        this builder
      • method

        public HealthCheck.Builder method​(HealthCheck.Method method)
        An HTTP verb (i.e.

        HEAD, GET, or POST) to use when performing the health check.

        Parameters:
        method - the value to set
        Returns:
        this builder
      • path

        public HealthCheck.Builder path​(String path)
        Path to visit on your origins when performing the health check.
        Parameters:
        path - the value to set
        Returns:
        this builder
      • headers

        public HealthCheck.Builder headers​(Map<String,​String> headers)
        HTTP header fields to include in health check requests, expressed as “name”: “value” properties.

        Because HTTP header field names are case-insensitive, any use of names that are case-insensitive equal to other names will be rejected. If Host is not specified, requests will include a Host header field with value matching the policy’s protected domain. If User-Agent is not specified, requests will include a User-Agent header field with value “waf health checks”.

        *Note:** The only currently-supported header fields are Host and User-Agent.

        Parameters:
        headers - the value to set
        Returns:
        this builder
      • expectedResponseCodeGroup

        public HealthCheck.Builder expectedResponseCodeGroup​(List<HealthCheck.ExpectedResponseCodeGroup> expectedResponseCodeGroup)
        The HTTP response codes that signify a healthy state.
        • 2XX: Success response code group. - 3XX: Redirection response code group. - 4XX: Client errors response code group. - 5XX: Server errors response code group.
        Parameters:
        expectedResponseCodeGroup - the value to set
        Returns:
        this builder
      • isResponseTextCheckEnabled

        public HealthCheck.Builder isResponseTextCheckEnabled​(Boolean isResponseTextCheckEnabled)
        Enables or disables additional check for predefined text in addition to response code.
        Parameters:
        isResponseTextCheckEnabled - the value to set
        Returns:
        this builder
      • expectedResponseText

        public HealthCheck.Builder expectedResponseText​(String expectedResponseText)
        Health check will search for the given text in a case-sensitive manner within the response body and will fail if the text is not found.
        Parameters:
        expectedResponseText - the value to set
        Returns:
        this builder
      • intervalInSeconds

        public HealthCheck.Builder intervalInSeconds​(Integer intervalInSeconds)
        Time between health checks of an individual origin server, in seconds.
        Parameters:
        intervalInSeconds - the value to set
        Returns:
        this builder
      • timeoutInSeconds

        public HealthCheck.Builder timeoutInSeconds​(Integer timeoutInSeconds)
        Response timeout represents wait time until request is considered failed, in seconds.
        Parameters:
        timeoutInSeconds - the value to set
        Returns:
        this builder
      • healthyThreshold

        public HealthCheck.Builder healthyThreshold​(Integer healthyThreshold)
        Number of successful health checks after which the server is marked up.
        Parameters:
        healthyThreshold - the value to set
        Returns:
        this builder
      • unhealthyThreshold

        public HealthCheck.Builder unhealthyThreshold​(Integer unhealthyThreshold)
        Number of failed health checks after which the server is marked down.
        Parameters:
        unhealthyThreshold - the value to set
        Returns:
        this builder