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
clusterId
ClusterIdThe cluster identifier.
connectionMode
ClusterConnectionModeThe connection mode.
type
ClusterTypeThe type.
servers
IEnumerable<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
clusterId
ClusterIdThe cluster identifier.
connectionMode
ClusterConnectionModeThe connection mode.
dnsMonitorException
ExceptionThe last DNS monitor exception (null if there was none).
type
ClusterTypeThe type.
servers
IEnumerable<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
clusterId
ClusterIdThe cluster identifier.
directConnection
bool?Whether to make a direct connection.
dnsMonitorException
ExceptionThe last DNS monitor exception (null if there was none).
type
ClusterTypeThe type.
servers
IEnumerable<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
true
if 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
other
ClusterDescription
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
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
value
ExceptionThe exception.
Returns
- ClusterDescription
A ClusterDescription.
WithServerDescription(ServerDescription)
Returns a new ClusterDescription with a changed ServerDescription.
public ClusterDescription WithServerDescription(ServerDescription value)
Parameters
value
ServerDescriptionThe server description.
Returns
- ClusterDescription
A ClusterDescription.
WithType(ClusterType)
Returns a new ClusterDescription with a changed ClusterType.
public ClusterDescription WithType(ClusterType value)
Parameters
value
ClusterTypeThe value.
Returns
- ClusterDescription
A ClusterDescription.
WithoutServerDescription(EndPoint)
Returns a new ClusterDescription with a ServerDescription removed.
public ClusterDescription WithoutServerDescription(EndPoint endPoint)
Parameters
endPoint
EndPointThe end point of the server description to remove.
Returns
- ClusterDescription
A ClusterDescription.