/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.servicediscovery.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* A complex type that contains information about an optional custom health check. A custom health check, which requires * that you use a third-party health checker to evaluate the health of your resources, is useful in the following * circumstances: *

* * *

* If you specify a health check configuration, you can specify either HealthCheckCustomConfig or * HealthCheckConfig but not both. *

*
*

* To change the status of a custom health check, submit an UpdateInstanceCustomHealthStatus request. Cloud * Map doesn't monitor the status of the resource, it just keeps a record of the status specified in the most recent * UpdateInstanceCustomHealthStatus request. *

*

* Here's how custom health checks work: *

*
    *
  1. *

    * You create a service. *

    *
  2. *
  3. *

    * You register an instance. *

    *
  4. *
  5. *

    * You configure a third-party health checker to monitor the resource that's associated with the new instance. *

    * *

    * Cloud Map doesn't check the health of the resource directly. *

    *
  6. *
  7. *

    * The third-party health-checker determines that the resource is unhealthy and notifies your application. *

    *
  8. *
  9. *

    * Your application submits an UpdateInstanceCustomHealthStatus request. *

    *
  10. *
  11. *

    * Cloud Map waits for 30 seconds. *

    *
  12. *
  13. *

    * If another UpdateInstanceCustomHealthStatus request doesn't arrive during that time to change the status * back to healthy, Cloud Map stops routing traffic to the resource. *

    *
  14. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class HealthCheckCustomConfig implements Serializable, Cloneable, StructuredPojo { /** * *

* This parameter is no longer supported and is always set to 1. Cloud Map waits for approximately 30 seconds after * receiving an UpdateInstanceCustomHealthStatus request before changing the status of the service * instance. *

*
*

* The number of 30-second intervals that you want Cloud Map to wait after receiving an * UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance. *

*

* Sending a second or subsequent UpdateInstanceCustomHealthStatus request with the same value before * 30 seconds has passed doesn't accelerate the change. Cloud Map still waits 30 seconds after the * first request to make the change. *

*/ @Deprecated private Integer failureThreshold; /** * *

* This parameter is no longer supported and is always set to 1. Cloud Map waits for approximately 30 seconds after * receiving an UpdateInstanceCustomHealthStatus request before changing the status of the service * instance. *

*
*

* The number of 30-second intervals that you want Cloud Map to wait after receiving an * UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance. *

*

* Sending a second or subsequent UpdateInstanceCustomHealthStatus request with the same value before * 30 seconds has passed doesn't accelerate the change. Cloud Map still waits 30 seconds after the * first request to make the change. *

* * @param failureThreshold *

* This parameter is no longer supported and is always set to 1. Cloud Map waits for approximately 30 seconds * after receiving an UpdateInstanceCustomHealthStatus request before changing the status of the * service instance. *

* *

* The number of 30-second intervals that you want Cloud Map to wait after receiving an * UpdateInstanceCustomHealthStatus request before it changes the health status of a service * instance. *

*

* Sending a second or subsequent UpdateInstanceCustomHealthStatus request with the same value * before 30 seconds has passed doesn't accelerate the change. Cloud Map still waits 30 seconds * after the first request to make the change. */ @Deprecated public void setFailureThreshold(Integer failureThreshold) { this.failureThreshold = failureThreshold; } /** * *

* This parameter is no longer supported and is always set to 1. Cloud Map waits for approximately 30 seconds after * receiving an UpdateInstanceCustomHealthStatus request before changing the status of the service * instance. *

* *

* The number of 30-second intervals that you want Cloud Map to wait after receiving an * UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance. *

*

* Sending a second or subsequent UpdateInstanceCustomHealthStatus request with the same value before * 30 seconds has passed doesn't accelerate the change. Cloud Map still waits 30 seconds after the * first request to make the change. *

* * @return

* This parameter is no longer supported and is always set to 1. Cloud Map waits for approximately 30 * seconds after receiving an UpdateInstanceCustomHealthStatus request before changing the * status of the service instance. *

* *

* The number of 30-second intervals that you want Cloud Map to wait after receiving an * UpdateInstanceCustomHealthStatus request before it changes the health status of a service * instance. *

*

* Sending a second or subsequent UpdateInstanceCustomHealthStatus request with the same value * before 30 seconds has passed doesn't accelerate the change. Cloud Map still waits 30 seconds * after the first request to make the change. */ @Deprecated public Integer getFailureThreshold() { return this.failureThreshold; } /** * *

* This parameter is no longer supported and is always set to 1. Cloud Map waits for approximately 30 seconds after * receiving an UpdateInstanceCustomHealthStatus request before changing the status of the service * instance. *

* *

* The number of 30-second intervals that you want Cloud Map to wait after receiving an * UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance. *

*

* Sending a second or subsequent UpdateInstanceCustomHealthStatus request with the same value before * 30 seconds has passed doesn't accelerate the change. Cloud Map still waits 30 seconds after the * first request to make the change. *

* * @param failureThreshold *

* This parameter is no longer supported and is always set to 1. Cloud Map waits for approximately 30 seconds * after receiving an UpdateInstanceCustomHealthStatus request before changing the status of the * service instance. *

* *

* The number of 30-second intervals that you want Cloud Map to wait after receiving an * UpdateInstanceCustomHealthStatus request before it changes the health status of a service * instance. *

*

* Sending a second or subsequent UpdateInstanceCustomHealthStatus request with the same value * before 30 seconds has passed doesn't accelerate the change. Cloud Map still waits 30 seconds * after the first request to make the change. * @return Returns a reference to this object so that method calls can be chained together. */ @Deprecated public HealthCheckCustomConfig withFailureThreshold(Integer failureThreshold) { setFailureThreshold(failureThreshold); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getFailureThreshold() != null) sb.append("FailureThreshold: ").append(getFailureThreshold()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof HealthCheckCustomConfig == false) return false; HealthCheckCustomConfig other = (HealthCheckCustomConfig) obj; if (other.getFailureThreshold() == null ^ this.getFailureThreshold() == null) return false; if (other.getFailureThreshold() != null && other.getFailureThreshold().equals(this.getFailureThreshold()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFailureThreshold() == null) ? 0 : getFailureThreshold().hashCode()); return hashCode; } @Override public HealthCheckCustomConfig clone() { try { return (HealthCheckCustomConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.servicediscovery.model.transform.HealthCheckCustomConfigMarshaller.getInstance().marshall(this, protocolMarshaller); } }