Class Replica

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

public final class Replica extends Object implements com.azure.json.JsonSerializable<Replica>
Replica properties of a server.
  • Constructor Details

    • Replica

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

    • role

      public ReplicationRole role()
      Get the role property: Role of the server in a replication set.
      Returns:
      the role value.
    • withRole

      public Replica withRole(ReplicationRole role)
      Set the role property: Role of the server in a replication set.
      Parameters:
      role - the role value to set.
      Returns:
      the Replica object itself.
    • capacity

      public Integer capacity()
      Get the capacity property: Maximum number of read replicas allowed for a server.
      Returns:
      the capacity value.
    • replicationState

      public ReplicationState replicationState()
      Get the replicationState property: Indicates the replication state of a read replica. This property is returned only when the target server is a read replica. Possible values are Active, Broken, Catchup, Provisioning, Reconfiguring, and Updating.
      Returns:
      the replicationState value.
    • promoteMode

      public ReadReplicaPromoteMode promoteMode()
      Get the promoteMode property: Type of operation to apply on the read replica. This property is write only. Standalone means that the read replica will be promoted to a standalone server, and will become a completely independent entity from the replication set. Switchover means that the read replica will roles with the primary server.
      Returns:
      the promoteMode value.
    • withPromoteMode

      public Replica withPromoteMode(ReadReplicaPromoteMode promoteMode)
      Set the promoteMode property: Type of operation to apply on the read replica. This property is write only. Standalone means that the read replica will be promoted to a standalone server, and will become a completely independent entity from the replication set. Switchover means that the read replica will roles with the primary server.
      Parameters:
      promoteMode - the promoteMode value to set.
      Returns:
      the Replica object itself.
    • promoteOption

      public ReadReplicaPromoteOption promoteOption()
      Get the promoteOption property: Data synchronization option to use when processing the operation specified in the promoteMode property. This property is write only.
      Returns:
      the promoteOption value.
    • withPromoteOption

      public Replica withPromoteOption(ReadReplicaPromoteOption promoteOption)
      Set the promoteOption property: Data synchronization option to use when processing the operation specified in the promoteMode property. This property is write only.
      Parameters:
      promoteOption - the promoteOption value to set.
      Returns:
      the Replica 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<Replica>
      Throws:
      IOException
    • fromJson

      public static Replica fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Replica from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Replica 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 Replica.