C# Class MongoDB.Driver.Internal.ReplicaSetMongoServerProxy

Proxy for connecting to a replica set.
Inheritance: MultipleInstanceMongoServerProxy
Show file Open project: CloudMetal/mongo-csharp-driver

Public Methods

Method Description
ReplicaSetMongoServerProxy ( MongoServerSettings settings ) : System

Initializes a new instance of the ReplicaSetMongoServerProxy class.

ReplicaSetMongoServerProxy ( MongoServerSettings serverSettings, IEnumerable instances, BlockingQueue stateChangeQueue, int connectionAttempt ) : System

Initializes a new instance of the ReplicaSetMongoServerProxy class.

Protected Methods

Method Description
ChooseServerInstance ( ConnectedInstanceCollection connectedInstances, ReadPreference readPreference ) : MongoServerInstance
DetermineServerState ( MongoServerState currentState, IEnumerable instances ) : MongoServerState

Determines the state of the server.

IsValidInstance ( MongoServerInstance instance ) : bool

Determines whether the instance is a valid. If not, the instance is removed.

ProcessConnectedInstanceStateChange ( MongoServerInstance instance ) : void

Processes the connected instance state change.

Private Methods

Method Description
GetMatchingInstance ( List instancesWithPingTime, ReadPreference readPreference, System.TimeSpan secondaryAcceptableLatency ) : MongoServerInstance

Gets a randomly selected matching instance.

ProcessConnectedPrimaryStateChange ( MongoServerInstance instance ) : void
ProcessConnectedSecondaryStateChange ( MongoServerInstance instance ) : void

Method Details

ChooseServerInstance() protected method

protected ChooseServerInstance ( ConnectedInstanceCollection connectedInstances, ReadPreference readPreference ) : MongoServerInstance
connectedInstances ConnectedInstanceCollection
readPreference ReadPreference
return MongoServerInstance

DetermineServerState() protected method

Determines the state of the server.
protected DetermineServerState ( MongoServerState currentState, IEnumerable instances ) : MongoServerState
currentState MongoServerState State of the current.
instances IEnumerable The instances.
return MongoServerState

IsValidInstance() protected method

Determines whether the instance is a valid. If not, the instance is removed.
protected IsValidInstance ( MongoServerInstance instance ) : bool
instance MongoServerInstance The instance.
return bool

ProcessConnectedInstanceStateChange() protected method

Processes the connected instance state change.
protected ProcessConnectedInstanceStateChange ( MongoServerInstance instance ) : void
instance MongoServerInstance The instance.
return void

ReplicaSetMongoServerProxy() public method

Initializes a new instance of the ReplicaSetMongoServerProxy class.
public ReplicaSetMongoServerProxy ( MongoServerSettings settings ) : System
settings MongoServerSettings The settings.
return System

ReplicaSetMongoServerProxy() public method

Initializes a new instance of the ReplicaSetMongoServerProxy class.
public ReplicaSetMongoServerProxy ( MongoServerSettings serverSettings, IEnumerable instances, BlockingQueue stateChangeQueue, int connectionAttempt ) : System
serverSettings MongoServerSettings The server settings.
instances IEnumerable The instances.
stateChangeQueue BlockingQueue The state change queue.
connectionAttempt int The connection attempt.
return System