Group State Class
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This is an adapter class that implements the IAvailabilityGroupState logical facet for an Availability Group.
public class AvailabilityGroupState : Microsoft.SqlServer.Management.Common.IRefreshable, Microsoft.SqlServer.Management.Facets.IDmfAdapter, Microsoft.SqlServer.Management.Sdk.Sfc.IDmfFacet, Microsoft.SqlServer.Management.Smo.IAvailabilityGroupState
type AvailabilityGroupState = class interface IAvailabilityGroupState interface IDmfFacet interface IRefreshable interface IDmfAdapter
Public Class AvailabilityGroupState Implements IAvailabilityGroupState, IDmfAdapter, IDmfFacet, IRefreshable
Initializes a new instance of the AvailabilityGroupState class.
Gets a value indicating whether the failover mode of the availability group is is Automatic Failover. Accessing this property may result in an exception, so we initialize it seperately. Specifically, if the primary replica is not currently visible, we throw an exception indicating this. This only occurs when accessing this property from a secondary replica that cannot communicate with the cluster store.
Gets a value indicating whether the Availability Group is up. This is true if a functioning primary replica exists for the Availability Group.
Gets the nubmer of replicas that are not in a "Connected" state
Gets the number of replicas that are not in a "Synchronized" state. Since only synchronous replicas can be in a "synchronized" state, this does not apply to asynchronous replicas
Gets the nubmer of replicas in a "Not Synchronizing" state.
Gets the number of replicas that are neither a primary or a secondary in the Availability Group.
Gets the number of synchronous secondary replicas with Automatic Failover mode and Synchronized state.
Refresh the availability group state data.