Class FailoverPolicy
- java.lang.Object
-
- com.azure.resourcemanager.cosmos.models.FailoverPolicy
-
public final class FailoverPolicy extends Object
The failover policy for a given region of a database account.
-
-
Constructor Summary
Constructors Constructor Description FailoverPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerfailoverPriority()Get the failoverPriority property: The failover priority of the region.Stringid()Get the id property: The unique identifier of the region in which the database account replicates to.StringlocationName()Get the locationName property: The name of the region in which the database account exists.voidvalidate()Validates the instance.FailoverPolicywithFailoverPriority(Integer failoverPriority)Set the failoverPriority property: The failover priority of the region.FailoverPolicywithLocationName(String locationName)Set the locationName property: The name of the region in which the database account exists.
-
-
-
Method Detail
-
id
public String id()
Get the id property: The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>.- Returns:
- the id value.
-
locationName
public String locationName()
Get the locationName property: The name of the region in which the database account exists.- Returns:
- the locationName value.
-
withLocationName
public FailoverPolicy withLocationName(String locationName)
Set the locationName property: The name of the region in which the database account exists.- Parameters:
locationName- the locationName value to set.- Returns:
- the FailoverPolicy object itself.
-
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:
- the failoverPriority value.
-
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:
failoverPriority- the failoverPriority value to set.- Returns:
- the FailoverPolicy object itself.
-
validate
public void validate()
Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
-