Package com.mongodb

Class DBAddress

  • All Implemented Interfaces:
    java.io.Serializable

    @Deprecated
    public class DBAddress
    extends ServerAddress
    Deprecated.
    This class is no longer needed, as the driver does not rely on it for anything anymore. Use ServerAddress instead.
    Represents a database address, which includes the properties of ServerAddress (host and port) and adds a database name.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DBAddress​(DBAddress other, java.lang.String databaseName)
      Deprecated.
      Create a DBAddress using the host and port from an existing DBAddress, and connected to a given database.
      DBAddress​(java.lang.String urlFormat)
      Deprecated.
      Creates a new address.
      DBAddress​(java.lang.String host, int port, java.lang.String databaseName)
      Deprecated.
      Creates a DBAddress for the given database on the given host at the given port.
      DBAddress​(java.lang.String host, java.lang.String databaseName)
      Deprecated.
      Creates a DBAddress for the given database on the given host.
      DBAddress​(java.net.InetAddress inetAddress, int port, java.lang.String databaseName)
      Deprecated.
       
    • Constructor Detail

      • DBAddress

        public DBAddress​(java.lang.String urlFormat)
        Deprecated.
        Creates a new address. Accepts as the parameter format:
        • name "mydb"
        • <host>/name "127.0.0.1/mydb"
        • <host>:<port>/name "127.0.0.1:8080/mydb"
        Parameters:
        urlFormat - the URL-formatted host and port
        See Also:
        MongoClientURI
      • DBAddress

        public DBAddress​(DBAddress other,
                         java.lang.String databaseName)
        Deprecated.
        Create a DBAddress using the host and port from an existing DBAddress, and connected to a given database.
        Parameters:
        other - an existing DBAddress that gives the host and port
        databaseName - the database to which to connect
      • DBAddress

        public DBAddress​(java.lang.String host,
                         java.lang.String databaseName)
        Deprecated.
        Creates a DBAddress for the given database on the given host.
        Parameters:
        host - host name
        databaseName - database name
      • DBAddress

        public DBAddress​(java.lang.String host,
                         int port,
                         java.lang.String databaseName)
        Deprecated.
        Creates a DBAddress for the given database on the given host at the given port.
        Parameters:
        host - host name
        port - database port
        databaseName - database name
      • DBAddress

        public DBAddress​(java.net.InetAddress inetAddress,
                         int port,
                         java.lang.String databaseName)
        Deprecated.
        Parameters:
        inetAddress - host address
        port - database port
        databaseName - database name
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Deprecated.
        Overrides:
        equals in class ServerAddress
      • getSister

        public DBAddress getSister​(java.lang.String name)
        Deprecated.
        Creates a DBAddress pointing to a different database on the same server.
        Parameters:
        name - database name
        Returns:
        the DBAddress for the given name with the same host and port as this
        Throws:
        MongoException - if failed
      • getDBName

        public java.lang.String getDBName()
        Deprecated.
        Gets the database name
        Returns:
        the database name
      • toString

        public java.lang.String toString()
        Deprecated.
        Gets a String representation of address as host:port/databaseName.
        Overrides:
        toString in class ServerAddress
        Returns:
        this address