Skip to content

Commit 4d47ee9

Browse files
authored
[JAVA] Remove deprecated ServerAddress methods (#514)
* SocketAddress deprecations * VK review
1 parent e723689 commit 4d47ee9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

source/upgrade.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@ This driver version introduces the following breaking changes:
150150
responding in the same way as ``Decimal128`` values. In particular,
151151
``BsonDecimal128.isNumber()`` now returns ``true``, and
152152
``BsonDecimal128.asNumber()`` returns the equivalent ``BsonNumber``.
153+
154+
- This driver version removes the `ServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerAddress.html>`__
155+
methods ``getSocketAddress()`` and ``getSocketAddresses()``.
156+
157+
Instead of ``getSocketAddress()``, use the ``getByName()`` instance
158+
method of ``java.net.InetAddress``.
159+
160+
Instead of ``getSocketAddresses()``, use the ``getAllByName()`` instance
161+
method of ``java.net.InetAddress``.
162+
163+
- This driver version removes the `UnixServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/UnixServerAddress.html>`__
164+
methods ``getSocketAddress()`` and ``getUnixSocketAddress()``.
165+
166+
Instead of ``getUnixSocketAddress()``, construct an instance of
167+
``jnr.unixsocket.UnixSocketAddress``. Pass the full path of the UNIX
168+
socket file to the constructor. By default, MongoDB creates a UNIX
169+
socket file located at ``"/tmp/mongodb-27017.sock"``. To learn more
170+
about the ``UnixSocketAddress``, see the `UnixSocketAddress <https://www.javadoc.io/doc/com.github.jnr/jnr-unixsocket/latest/jnr/unixsocket/UnixSocketAddress.html>`__ API documentation.
153171

154172
- Removes the ``Parameterizable`` interface. Instead of
155173
implementing this interface on a custom ``Codec`` type,

0 commit comments

Comments
 (0)