Package com.mongodb.internal.connection
Class InternalStreamConnection
java.lang.Object
com.mongodb.internal.connection.InternalStreamConnection
- All Implemented Interfaces:
BufferProvider
,InternalConnection
@NotThreadSafe
@Deprecated(since="2021-05-27")
public class InternalStreamConnection
extends Object
implements InternalConnection
Deprecated.
-
Constructor Summary
ConstructorsConstructorDescriptionInternalStreamConnection
(ServerId serverId, StreamFactory streamFactory, List<MongoCompressor> compressorList, CommandListener commandListener, com.mongodb.internal.connection.InternalConnectionInitializer connectionInitializer) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.Closes the connection.getBuffer
(int size) Deprecated.Gets a buffer with the givens capacity.Deprecated.Gets the description of this connection.boolean
isClosed()
Deprecated.Returns the closed state of the connectionvoid
open()
Deprecated.Opens the connection so its ready for usevoid
openAsync
(SingleResultCallback<Void> callback) Deprecated.Opens the connection so its ready for useboolean
opened()
Deprecated.Returns if the connection has been openedreceiveMessage
(int responseTo) Deprecated.Receive a response to a sent message from the server.void
receiveMessageAsync
(int responseTo, SingleResultCallback<ResponseBuffers> callback) Deprecated.Asynchronously receive a response to a sent message from the server.<T> T
sendAndReceive
(CommandMessage message, Decoder<T> decoder, SessionContext sessionContext) Deprecated.Send a command message to the server.<T> void
sendAndReceiveAsync
(CommandMessage message, Decoder<T> decoder, SessionContext sessionContext, SingleResultCallback<T> callback) Deprecated.Send a command message to the server.void
sendMessage
(List<ByteBuf> byteBuffers, int lastRequestId) Deprecated.Send a message to the server.void
sendMessageAsync
(List<ByteBuf> byteBuffers, int lastRequestId, SingleResultCallback<Void> callback) Deprecated.Asynchronously send a message to the server.
-
Constructor Details
-
InternalStreamConnection
public InternalStreamConnection(ServerId serverId, StreamFactory streamFactory, List<MongoCompressor> compressorList, CommandListener commandListener, com.mongodb.internal.connection.InternalConnectionInitializer connectionInitializer) Deprecated.
-
-
Method Details
-
getDescription
Deprecated.Description copied from interface:InternalConnection
Gets the description of this connection.- Specified by:
getDescription
in interfaceInternalConnection
- Returns:
- the connection description
-
open
public void open()Deprecated.Description copied from interface:InternalConnection
Opens the connection so its ready for use- Specified by:
open
in interfaceInternalConnection
-
openAsync
Deprecated.Description copied from interface:InternalConnection
Opens the connection so its ready for use- Specified by:
openAsync
in interfaceInternalConnection
- Parameters:
callback
- the callback to be called once the connection has been opened
-
close
public void close()Deprecated.Description copied from interface:InternalConnection
Closes the connection.- Specified by:
close
in interfaceInternalConnection
-
opened
public boolean opened()Deprecated.Description copied from interface:InternalConnection
Returns if the connection has been opened- Specified by:
opened
in interfaceInternalConnection
- Returns:
- true if connection has been opened
-
isClosed
public boolean isClosed()Deprecated.Description copied from interface:InternalConnection
Returns the closed state of the connection- Specified by:
isClosed
in interfaceInternalConnection
- Returns:
- true if connection is closed
-
sendAndReceive
public <T> T sendAndReceive(CommandMessage message, Decoder<T> decoder, SessionContext sessionContext) Deprecated.Description copied from interface:InternalConnection
Send a command message to the server.- Specified by:
sendAndReceive
in interfaceInternalConnection
- Parameters:
message
- the command message to sendsessionContext
- the session context
-
sendAndReceiveAsync
public <T> void sendAndReceiveAsync(CommandMessage message, Decoder<T> decoder, SessionContext sessionContext, SingleResultCallback<T> callback) Deprecated.Description copied from interface:InternalConnection
Send a command message to the server.- Specified by:
sendAndReceiveAsync
in interfaceInternalConnection
- Parameters:
message
- the command message to sendsessionContext
- the session contextcallback
- the callback
-
sendMessage
Deprecated.Description copied from interface:InternalConnection
Send a message to the server. The connection may not make any attempt to validate the integrity of the message.- Specified by:
sendMessage
in interfaceInternalConnection
- Parameters:
byteBuffers
- the list of byte buffers to send.lastRequestId
- the request id of the last message in byteBuffers
-
receiveMessage
Deprecated.Description copied from interface:InternalConnection
Receive a response to a sent message from the server.- Specified by:
receiveMessage
in interfaceInternalConnection
- Parameters:
responseTo
- the request id that this message is a response to- Returns:
- the response
-
sendMessageAsync
public void sendMessageAsync(List<ByteBuf> byteBuffers, int lastRequestId, SingleResultCallback<Void> callback) Deprecated.Description copied from interface:InternalConnection
Asynchronously send a message to the server. The connection may not make any attempt to validate the integrity of the message.- Specified by:
sendMessageAsync
in interfaceInternalConnection
- Parameters:
byteBuffers
- the list of byte buffers to sendlastRequestId
- the request id of the last message in byteBufferscallback
- the callback to invoke on completion
-
receiveMessageAsync
Deprecated.Description copied from interface:InternalConnection
Asynchronously receive a response to a sent message from the server.- Specified by:
receiveMessageAsync
in interfaceInternalConnection
- Parameters:
responseTo
- the request id that this message is a response tocallback
- the callback to invoke on completion
-
getBuffer
Deprecated.Description copied from interface:BufferProvider
Gets a buffer with the givens capacity.- Specified by:
getBuffer
in interfaceBufferProvider
- Parameters:
size
- the size required for the buffer- Returns:
- a ByteBuf with the given size, which is now owned by the caller and must be released.
-