FailoverPolicy Class
- java.
lang. Object - com.
azure. resourcemanager. cosmos. models. FailoverPolicy
- com.
Implements
public final class FailoverPolicy
implements JsonSerializable<FailoverPolicy>
The failover policy for a given region of a database account.
Constructor Summary
Constructor | Description |
---|---|
FailoverPolicy() |
Creates an instance of Failover |
Method Summary
Modifier and Type | Method and Description |
---|---|
Integer |
failoverPriority()
Get the failover |
static
Failover |
fromJson(JsonReader jsonReader)
Reads an instance of Failover |
String |
id()
Get the id property: The unique identifier of the region in which the database account replicates to. |
String |
locationName()
Get the location |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Failover |
withFailoverPriority(Integer failoverPriority)
Set the failover |
Failover |
withLocationName(String locationName)
Set the location |
Methods inherited from java.lang.Object
Constructor Details
FailoverPolicy
public FailoverPolicy()
Creates an instance of FailoverPolicy class.
Method Details
failoverPriority
public Integer failoverPriority()
Get the failoverPriority property: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Returns:
fromJson
public static FailoverPolicy fromJson(JsonReader jsonReader)
Reads an instance of FailoverPolicy from the JsonReader.
Parameters:
Returns:
Throws:
id
public String id()
Get the id property: The unique identifier of the region in which the database account replicates to. Example: -.
Returns:
locationName
public String locationName()
Get the locationName property: The name of the region in which the database account exists.
Returns:
toJson
validate
public void validate()
Validates the instance.
withFailoverPriority
public FailoverPolicy withFailoverPriority(Integer failoverPriority)
Set the failoverPriority property: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
Parameters:
Returns:
withLocationName
public FailoverPolicy withLocationName(String locationName)
Set the locationName property: The name of the region in which the database account exists.
Parameters:
Returns:
Applies to
Azure SDK for Java