Location Class

  • java.lang.Object
    • com.azure.resourcemanager.cosmos.models.Location

Implements

public final class Location
implements JsonSerializable<Location>

A region in which the Azure Cosmos DB database account is deployed.

Constructor Summary

Constructor Description
Location()

Creates an instance of Location class.

Method Summary

Modifier and Type Method and Description
String documentEndpoint()

Get the documentEndpoint property: The connection endpoint for the specific region.

Integer failoverPriority()

Get the failoverPriority property: The failover priority of the region.

static Location fromJson(JsonReader jsonReader)

Reads an instance of Location from the JsonReader.

String id()

Get the id property: The unique identifier of the region within the database account.

Boolean isZoneRedundant()

Get the isZoneRedundant property: Flag to indicate whether or not this region is an AvailabilityZone region.

String locationName()

Get the locationName property: The name of the region.

String provisioningState()

Get the provisioningState property: The status of the Cosmos DB account at the time the operation was called.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

Location withFailoverPriority(Integer failoverPriority)

Set the failoverPriority property: The failover priority of the region.

Location withIsZoneRedundant(Boolean isZoneRedundant)

Set the isZoneRedundant property: Flag to indicate whether or not this region is an AvailabilityZone region.

Location withLocationName(String locationName)

Set the locationName property: The name of the region.

Methods inherited from java.lang.Object

Constructor Details

Location

public Location()

Creates an instance of Location class.

Method Details

documentEndpoint

public String documentEndpoint()

Get the documentEndpoint property: The connection endpoint for the specific region. Example: https://-.documents.azure.com:443/.

Returns:

the documentEndpoint value.

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.

fromJson

public static Location fromJson(JsonReader jsonReader)

Reads an instance of Location from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of Location if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the Location.

id

public String id()

Get the id property: The unique identifier of the region within the database account. Example: -.

Returns:

the id value.

isZoneRedundant

public Boolean isZoneRedundant()

Get the isZoneRedundant property: Flag to indicate whether or not this region is an AvailabilityZone region.

Returns:

the isZoneRedundant value.

locationName

public String locationName()

Get the locationName property: The name of the region.

Returns:

the locationName value.

provisioningState

public String provisioningState()

Get the provisioningState property: The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' \u2013 the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' \u2013 the Cosmos DB account is active for use. 'Updating' \u2013 the Cosmos DB account is being updated. 'Deleting' \u2013 the Cosmos DB account is being deleted. 'Failed' \u2013 the Cosmos DB account failed creation. 'DeletionFailed' \u2013 the Cosmos DB account deletion failed.

Returns:

the provisioningState value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withFailoverPriority

public Location 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 Location object itself.

withIsZoneRedundant

public Location withIsZoneRedundant(Boolean isZoneRedundant)

Set the isZoneRedundant property: Flag to indicate whether or not this region is an AvailabilityZone region.

Parameters:

isZoneRedundant - the isZoneRedundant value to set.

Returns:

the Location object itself.

withLocationName

public Location withLocationName(String locationName)

Set the locationName property: The name of the region.

Parameters:

locationName - the locationName value to set.

Returns:

the Location object itself.

Applies to