Class AbstractMultiServerCluster

  • All Implemented Interfaces:
    Cluster, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    DnsMultiServerCluster, MultiServerCluster

    @Deprecated(since="2021-05-27")
    public abstract class AbstractMultiServerCluster
    extends java.lang.Object
    Deprecated.
    • Method Detail

      • close

        public void close()
        Deprecated.
        Description copied from interface: Cluster
        Closes connections to the servers in the cluster. After this is called, this cluster instance can no longer be used.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface Cluster
      • getClusterTime

        public BsonTimestamp getClusterTime()
        Deprecated.
        Description copied from interface: Cluster
        Get the last seen cluster time
        Specified by:
        getClusterTime in interface Cluster
        Returns:
        the last seen cluster time or null if not set
      • selectServer

        public Server selectServer​(ServerSelector serverSelector)
        Deprecated.
        Description copied from interface: Cluster
        Get a MongoDB server that matches the criteria defined by the serverSelector
        Specified by:
        selectServer in interface Cluster
        Parameters:
        serverSelector - a ServerSelector that defines how to select the required Server
        Returns:
        a Server that meets the requirements
      • selectServerAsync

        public void selectServerAsync​(ServerSelector serverSelector,
                                      SingleResultCallback<Server> callback)
        Deprecated.
        Description copied from interface: Cluster
        Asynchronously gets a MongoDB server that matches the criteria defined by the serverSelector.
        Specified by:
        selectServerAsync in interface Cluster
        Parameters:
        serverSelector - a ServerSelector that defines how to select the required Server
        callback - the callback to invoke when the server is found or an error occurs
      • getDescription

        public ClusterDescription getDescription()
        Deprecated.
        Description copied from interface: Cluster
        Get the description of this cluster. This method will not return normally until the cluster type is known.
        Specified by:
        getDescription in interface Cluster
        Returns:
        a ClusterDescription representing the current state of the cluster
      • getSettings

        public ClusterSettings getSettings()
        Deprecated.
        Description copied from interface: Cluster
        Gets the cluster settings with which this cluster was created.
        Specified by:
        getSettings in interface Cluster
        Returns:
        the cluster settings
      • isClosed

        public boolean isClosed()
        Deprecated.
        Description copied from interface: Cluster
        Whether all the servers in the cluster are closed or not.
        Specified by:
        isClosed in interface Cluster
        Returns:
        true if all the servers in this cluster have been closed
      • getCurrentDescription

        public ClusterDescription getCurrentDescription()
        Deprecated.
        Description copied from interface: Cluster
        Get the current description of this cluster.
        Specified by:
        getCurrentDescription in interface Cluster
        Returns:
        the current ClusterDescription representing the current state of the cluster.