Package com.mongodb.connection
Class ProxySettings
java.lang.Object
com.mongodb.connection.ProxySettings
This setting is only applicable when communicating with a MongoDB server using the synchronous variant of
MongoClient
.
This setting is furthermore ignored if:
- the communication is via Unix domain socket.
- a
StreamFactoryFactory
is configured.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A builder for an instance ofProxySettings
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProxySettings.Builder
builder()
Creates aProxySettings.Builder
for creating a newProxySettings
instance.static ProxySettings.Builder
builder
(ProxySettings proxySettings) Creates aProxySettings.Builder
for creating a newProxySettings
instance.boolean
getHost()
Gets the SOCKS5 proxy host.Gets the SOCKS5 proxy password.int
getPort()
Gets the SOCKS5 proxy port.Gets the SOCKS5 proxy username.int
hashCode()
boolean
Checks if the SOCKS5 proxy is enabled.toString()
-
Method Details
-
builder
Creates aProxySettings.Builder
for creating a newProxySettings
instance.- Returns:
- a new
ProxySettings.Builder
forProxySettings
.
-
builder
Creates aProxySettings.Builder
for creating a newProxySettings
instance.- Parameters:
proxySettings
- existingProxySettings
to default the builder settings on.- Returns:
- a new
ProxySettings.Builder
forProxySettings
.
-
getHost
Gets the SOCKS5 proxy host.- Returns:
- the proxy host value.
null
if and only if the proxy functionality is not enabled. - See Also:
-
getPort
public int getPort()Gets the SOCKS5 proxy port.- Returns:
- The port number of the SOCKS5 proxy. If a custom port has been set using
ProxySettings.Builder.port(int)
, that custom port value is returned. Otherwise, the default SOCKS5 port 1080 is returned. - See Also:
-
getUsername
Gets the SOCKS5 proxy username.- Returns:
- the proxy username value.
- See Also:
-
getPassword
Gets the SOCKS5 proxy password.- Returns:
- the proxy password value.
- See Also:
-
isProxyEnabled
public boolean isProxyEnabled()Checks if the SOCKS5 proxy is enabled.- Returns:
true
if the proxy is enabled,false
otherwise.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-