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
TransportSettingsis MongoClientSettings.Builder.transportSettings(TransportSettings) configured}.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for an instance ofProxySettings. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProxySettings.Builderbuilder()Creates aProxySettings.Builderfor creating a newProxySettingsinstance.static ProxySettings.Builderbuilder(ProxySettings proxySettings) Creates aProxySettings.Builderfor creating a newProxySettingsinstance.booleangetHost()Gets the SOCKS5 proxy host.Gets the SOCKS5 proxy password.intgetPort()Gets the SOCKS5 proxy port.Gets the SOCKS5 proxy username.inthashCode()booleanChecks if the SOCKS5 proxy is enabled.toString()
-
Method Details
-
builder
Creates aProxySettings.Builderfor creating a newProxySettingsinstance.- Returns:
- a new
ProxySettings.BuilderforProxySettings.
-
builder
Creates aProxySettings.Builderfor creating a newProxySettingsinstance.- Parameters:
proxySettings- existingProxySettingsto default the builder settings on.- Returns:
- a new
ProxySettings.BuilderforProxySettings.
-
getHost
Gets the SOCKS5 proxy host.- Returns:
- the proxy host value.
nullif 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:
trueif the proxy is enabled,falseotherwise.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-