Package com.mongodb
Class DBAddress
java.lang.Object
com.mongodb.ServerAddress
com.mongodb.DBAddress
- All Implemented Interfaces:
Serializable
Deprecated.
Represents a database address, which includes the properties of ServerAddress (host and port) and adds a database name.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Create a DBAddress using the host and port from an existing DBAddress, and connected to a given database.Deprecated.Creates a new address.Deprecated.Creates a DBAddress for the given database on the given host at the given port.Deprecated.Creates a DBAddress for the given database on the given host.DBAddress(InetAddress inetAddress, int port, String databaseName) Deprecated. -
Method Summary
Methods inherited from class com.mongodb.ServerAddress
defaultHost, defaultPort, getHost, getPort, getSocketAddress, getSocketAddresses, sameHost
-
Constructor Details
-
DBAddress
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:
-
DBAddress
Deprecated.Create a DBAddress using the host and port from an existing DBAddress, and connected to a given database.- Parameters:
other- an existingDBAddressthat gives the host and portdatabaseName- the database to which to connect
-
DBAddress
Deprecated.Creates a DBAddress for the given database on the given host.- Parameters:
host- host namedatabaseName- database name
-
DBAddress
Deprecated.Creates a DBAddress for the given database on the given host at the given port.- Parameters:
host- host nameport- database portdatabaseName- database name
-
DBAddress
Deprecated.- Parameters:
inetAddress- host addressport- database portdatabaseName- database name
-
-
Method Details
-
hashCode
public int hashCode()Deprecated.- Overrides:
hashCodein classServerAddress
-
equals
Deprecated.- Overrides:
equalsin classServerAddress
-
getSister
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
Deprecated.Gets the database name- Returns:
- the database name
-
toString
Deprecated.Gets a String representation of address as host:port/databaseName.- Overrides:
toStringin classServerAddress- Returns:
- this address
-
ServerAddressinstead.