Class ClusterDescription
Represents information about a cluster.
public sealed class ClusterDescription : IEquatable<ClusterDescription>
- Inheritance
-
ClusterDescription
- Implements
- Inherited Members
Constructors
ClusterDescription(ClusterId, ClusterConnectionMode, ClusterType, IEnumerable<ServerDescription>)
Initializes a new instance of the ClusterDescription class.
[Obsolete("Use the constructor that has a directConnection parameter.")]
public ClusterDescription(ClusterId clusterId, ClusterConnectionMode connectionMode, ClusterType type, IEnumerable<ServerDescription> servers)
Parameters
clusterIdClusterIdThe cluster identifier.
connectionModeClusterConnectionModeThe connection mode.
typeClusterTypeThe type.
serversIEnumerable<ServerDescription>The servers.
ClusterDescription(ClusterId, ClusterConnectionMode, Exception, ClusterType, IEnumerable<ServerDescription>)
Initializes a new instance of the ClusterDescription class.
[Obsolete("Use the constructor that has a directConnection parameter.")]
public ClusterDescription(ClusterId clusterId, ClusterConnectionMode connectionMode, Exception dnsMonitorException, ClusterType type, IEnumerable<ServerDescription> servers)
Parameters
clusterIdClusterIdThe cluster identifier.
connectionModeClusterConnectionModeThe connection mode.
dnsMonitorExceptionExceptionThe last DNS monitor exception (null if there was none).
typeClusterTypeThe type.
serversIEnumerable<ServerDescription>The servers.
ClusterDescription(ClusterId, bool?, Exception, ClusterType, IEnumerable<ServerDescription>)
Initializes a new instance of the ClusterDescription class.
public ClusterDescription(ClusterId clusterId, bool? directConnection, Exception dnsMonitorException, ClusterType type, IEnumerable<ServerDescription> servers)
Parameters
clusterIdClusterIdThe cluster identifier.
directConnectionbool?Whether to make a direct connection.
dnsMonitorExceptionExceptionThe last DNS monitor exception (null if there was none).
typeClusterTypeThe type.
serversIEnumerable<ServerDescription>The servers.
Properties
ClusterId
Gets the cluster identifier.
public ClusterId ClusterId { get; }
Property Value
ConnectionMode
Gets the connection mode.
[Obsolete("Use DirectConnection instead.")]
public ClusterConnectionMode ConnectionMode { get; }
Property Value
ConnectionModeSwitch
Gets the connection mode switch.
[Obsolete("This property will be removed in a later release.")]
public ConnectionModeSwitch ConnectionModeSwitch { get; }
Property Value
DirectConnection
Gets the DirectConnection.
public bool? DirectConnection { get; }
Property Value
- bool?
DnsMonitorException
Gets the last DNS monitor exception (null if there was none).
public Exception DnsMonitorException { get; }
Property Value
IsCompatibleWithDriver
Gets a value indicating whether this cluster is compatible with the driver.
public bool IsCompatibleWithDriver { get; }
Property Value
- bool
trueif this cluster is compatible with the driver; otherwise,false.
IsDirectConnection
Gets whether the connection mode or the direct connection flag are configured as a direct connection.
public bool IsDirectConnection { get; }
Property Value
LogicalSessionTimeout
Gets the logical session timeout.
public TimeSpan? LogicalSessionTimeout { get; }
Property Value
Servers
Gets the servers.
public IReadOnlyList<ServerDescription> Servers { get; }
Property Value
State
Gets the cluster state.
public ClusterState State { get; }
Property Value
Type
Gets the cluster type.
public ClusterType Type { get; }
Property Value
Methods
Equals(ClusterDescription)
public bool Equals(ClusterDescription other)
Parameters
otherClusterDescription
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
WithDnsMonitorException(Exception)
Returns a new ClusterDescription with a changed DnsMonitorException.
public ClusterDescription WithDnsMonitorException(Exception value)
Parameters
valueExceptionThe exception.
Returns
- ClusterDescription
A ClusterDescription.
WithServerDescription(ServerDescription)
Returns a new ClusterDescription with a changed ServerDescription.
public ClusterDescription WithServerDescription(ServerDescription value)
Parameters
valueServerDescriptionThe server description.
Returns
- ClusterDescription
A ClusterDescription.
WithType(ClusterType)
Returns a new ClusterDescription with a changed ClusterType.
public ClusterDescription WithType(ClusterType value)
Parameters
valueClusterTypeThe value.
Returns
- ClusterDescription
A ClusterDescription.
WithoutServerDescription(EndPoint)
Returns a new ClusterDescription with a ServerDescription removed.
public ClusterDescription WithoutServerDescription(EndPoint endPoint)
Parameters
endPointEndPointThe end point of the server description to remove.
Returns
- ClusterDescription
A ClusterDescription.