Class ClusterBinding

  • All Implemented Interfaces:
    ReadBinding, ReadWriteBinding, ReferenceCounted, WriteBinding, com.mongodb.internal.binding.ClusterAwareReadWriteBinding

    @Deprecated
    public class ClusterBinding
    extends com.mongodb.internal.binding.AbstractReferenceCounted
    implements com.mongodb.internal.binding.ClusterAwareReadWriteBinding
    Deprecated.
    A simple ReadWriteBinding implementation that supplies write connection sources bound to a possibly different primary each time, and a read connection source bound to a possible different server each time.
    Since:
    3.0
    • Constructor Detail

      • ClusterBinding

        public ClusterBinding(Cluster cluster,
                              ReadPreference readPreference,
                              ReadConcern readConcern)
        Deprecated.
        Creates an instance.
        Parameters:
        cluster - a non-null Cluster which will be used to select a server to bind to
        readPreference - a non-null ReadPreference for read operations
        readConcern - a non-null read concern
        Since:
        3.8
    • Method Detail

      • getCluster

        public Cluster getCluster()
        Deprecated.
        Return the cluster.
        Specified by:
        getCluster in interface com.mongodb.internal.binding.ClusterAwareReadWriteBinding
        Returns:
        the cluster
        Since:
        3.11
      • getReadPreference

        public ReadPreference getReadPreference()
        Deprecated.
        Description copied from interface: ReadBinding
        The read preference that all connection sources returned by this instance will satisfy.
        Specified by:
        getReadPreference in interface ReadBinding
        Returns:
        the non-null read preference
      • getReadConnectionSource

        public ConnectionSource getReadConnectionSource()
        Deprecated.
        Description copied from interface: ReadBinding
        Returns a connection source to a server that satisfies the specified read preference.
        Specified by:
        getReadConnectionSource in interface ReadBinding
        Returns:
        the connection source
      • getConnectionSource

        public ConnectionSource getConnectionSource(ServerAddress serverAddress)
        Deprecated.
        Specified by:
        getConnectionSource in interface com.mongodb.internal.binding.ClusterAwareReadWriteBinding