Class InstanceFailoverGroupReadWriteEndpoint
java.lang.Object
com.azure.resourcemanager.sql.models.InstanceFailoverGroupReadWriteEndpoint
- All Implemented Interfaces:
com.azure.json.JsonSerializable<InstanceFailoverGroupReadWriteEndpoint>
public final class InstanceFailoverGroupReadWriteEndpoint
extends Object
implements com.azure.json.JsonSerializable<InstanceFailoverGroupReadWriteEndpoint>
Read-write endpoint of the failover group instance.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of InstanceFailoverGroupReadWriteEndpoint class. -
Method Summary
Modifier and TypeMethodDescriptionGet the failoverPolicy property: Failover policy of the read-write endpoint for the failover group.Get the failoverWithDataLossGracePeriodMinutes property: Grace period before failover with data loss is attempted for the read-write endpoint.fromJson(com.azure.json.JsonReader jsonReader) Reads an instance of InstanceFailoverGroupReadWriteEndpoint from the JsonReader.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withFailoverPolicy(ReadWriteEndpointFailoverPolicy failoverPolicy) Set the failoverPolicy property: Failover policy of the read-write endpoint for the failover group.withFailoverWithDataLossGracePeriodMinutes(Integer failoverWithDataLossGracePeriodMinutes) Set the failoverWithDataLossGracePeriodMinutes property: Grace period before failover with data loss is attempted for the read-write endpoint.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
InstanceFailoverGroupReadWriteEndpoint
public InstanceFailoverGroupReadWriteEndpoint()Creates an instance of InstanceFailoverGroupReadWriteEndpoint class.
-
-
Method Details
-
failoverPolicy
Get the failoverPolicy property: Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.- Returns:
- the failoverPolicy value.
-
withFailoverPolicy
public InstanceFailoverGroupReadWriteEndpoint withFailoverPolicy(ReadWriteEndpointFailoverPolicy failoverPolicy) Set the failoverPolicy property: Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.- Parameters:
failoverPolicy- the failoverPolicy value to set.- Returns:
- the InstanceFailoverGroupReadWriteEndpoint object itself.
-
failoverWithDataLossGracePeriodMinutes
Get the failoverWithDataLossGracePeriodMinutes property: Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.- Returns:
- the failoverWithDataLossGracePeriodMinutes value.
-
withFailoverWithDataLossGracePeriodMinutes
public InstanceFailoverGroupReadWriteEndpoint withFailoverWithDataLossGracePeriodMinutes(Integer failoverWithDataLossGracePeriodMinutes) Set the failoverWithDataLossGracePeriodMinutes property: Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.- Parameters:
failoverWithDataLossGracePeriodMinutes- the failoverWithDataLossGracePeriodMinutes value to set.- Returns:
- the InstanceFailoverGroupReadWriteEndpoint object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<InstanceFailoverGroupReadWriteEndpoint>- Throws:
IOException
-
fromJson
public static InstanceFailoverGroupReadWriteEndpoint fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of InstanceFailoverGroupReadWriteEndpoint from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of InstanceFailoverGroupReadWriteEndpoint if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the InstanceFailoverGroupReadWriteEndpoint.
-