Class Location

java.lang.Object
com.azure.resourcemanager.cosmos.models.Location
All Implemented Interfaces:
com.azure.json.JsonSerializable<Location>

public final class Location extends Object implements com.azure.json.JsonSerializable<Location>
A region in which the Azure Cosmos DB database account is deployed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of Location class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the documentEndpoint property: The connection endpoint for the specific region.
    Get the failoverPriority property: The failover priority of the region.
    static Location
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of Location from the JsonReader.
    id()
    Get the id property: The unique identifier of the region within the database account.
    Get the isZoneRedundant property: Flag to indicate whether or not this region is an AvailabilityZone region.
    Get the locationName property: The name of the region.
    Get the provisioningState property: The status of the Cosmos DB account at the time the operation was called.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withFailoverPriority(Integer failoverPriority)
    Set the failoverPriority property: The failover priority of the region.
    withIsZoneRedundant(Boolean isZoneRedundant)
    Set the isZoneRedundant property: Flag to indicate whether or not this region is an AvailabilityZone region.
    withLocationName(String locationName)
    Set the locationName property: The name of the region.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • Location

      public Location()
      Creates an instance of Location class.
  • Method Details

    • id

      public String id()
      Get the id property: The unique identifier of the region within the database account. Example: &lt;accountName&gt;-&lt;locationName&gt;.
      Returns:
      the id value.
    • locationName

      public String locationName()
      Get the locationName property: The name of the region.
      Returns:
      the locationName value.
    • 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.
    • documentEndpoint

      public String documentEndpoint()
      Get the documentEndpoint property: The connection endpoint for the specific region. Example: https://&lt;accountName&gt;-&lt;locationName&gt;.documents.azure.com:443/.
      Returns:
      the documentEndpoint 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' – 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' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed.
      Returns:
      the provisioningState 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.
    • 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.
    • isZoneRedundant

      public Boolean isZoneRedundant()
      Get the isZoneRedundant property: Flag to indicate whether or not this region is an AvailabilityZone region.
      Returns:
      the isZoneRedundant value.
    • 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.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<Location>
      Throws:
      IOException
    • fromJson

      public static Location fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.