Package com.mongodb
Class ServerAddress
java.lang.Object
com.mongodb.ServerAddress
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DBAddress,UnixServerAddress
@Immutable
@Deprecated(since="2021-05-27")
public class ServerAddress
extends Object
implements Serializable
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
Represents the location of a Mongo server - i.e. server name and port number
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a ServerAddress with default host and portServerAddress(String host) Deprecated.Creates a ServerAddress with default portServerAddress(String host, int port) Deprecated.Creates a ServerAddressServerAddress(InetAddress inetAddress) Deprecated.Creates a ServerAddress with default portServerAddress(InetAddress inetAddress, int port) Deprecated.Creates a ServerAddressServerAddress(InetSocketAddress inetSocketAddress) Deprecated.Creates a ServerAddress -
Method Summary
Modifier and TypeMethodDescriptionstatic StringDeprecated.Returns the default database host: "127.0.0.1"static intDeprecated.Returns the default database port: 27017booleanDeprecated.getHost()Deprecated.Gets the hostnameintgetPort()Deprecated.Gets the port numberDeprecated.Gets the underlying socket addressDeprecated.Gets all underlying socket addressesinthashCode()Deprecated.booleanDeprecated.use theequals(Object)method insteadtoString()Deprecated.
-
Constructor Details
-
ServerAddress
public ServerAddress()Deprecated.Creates a ServerAddress with default host and port -
ServerAddress
Deprecated.Creates a ServerAddress with default port- Parameters:
host- hostname
-
ServerAddress
Deprecated.Creates a ServerAddress with default port- Parameters:
inetAddress- host address
-
ServerAddress
Deprecated.Creates a ServerAddress- Parameters:
inetAddress- host addressport- mongod port
-
ServerAddress
Deprecated.Creates a ServerAddress- Parameters:
inetSocketAddress- inet socket address containing hostname and port
-
ServerAddress
Deprecated.Creates a ServerAddress- Parameters:
host- hostnameport- mongod port
-
-
Method Details
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
getHost
Deprecated.Gets the hostname- Returns:
- hostname
-
getPort
public int getPort()Deprecated.Gets the port number- Returns:
- port
-
getSocketAddress
Deprecated.Gets the underlying socket address- Returns:
- socket address
-
getSocketAddresses
Deprecated.Gets all underlying socket addresses- Returns:
- array of socket addresses
- Since:
- 3.9
-
toString
Deprecated. -
defaultHost
Deprecated.Returns the default database host: "127.0.0.1"- Returns:
- IP address of default host.
-
defaultPort
public static int defaultPort()Deprecated.Returns the default database port: 27017- Returns:
- the default port
-
sameHost
Deprecated.use theequals(Object)method insteadDetermines whether this address is the same as a given host.- Parameters:
hostName- the address to compare- Returns:
- if they are the same
-