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 java.lang.Object implements InternalConnection
Deprecated.
-
-
Constructor Summary
Constructors Constructor Description InternalStreamConnection(ServerId serverId, StreamFactory streamFactory, java.util.List<MongoCompressor> compressorList, CommandListener commandListener, com.mongodb.internal.connection.InternalConnectionInitializer connectionInitializer)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.Closes the connection.ByteBufgetBuffer(int size)Deprecated.Gets a buffer with the givens capacity.ConnectionDescriptiongetDescription()Deprecated.Gets the description of this connection.booleanisClosed()Deprecated.Returns the closed state of the connectionvoidopen()Deprecated.Opens the connection so its ready for usevoidopenAsync(SingleResultCallback<java.lang.Void> callback)Deprecated.Opens the connection so its ready for usebooleanopened()Deprecated.Returns if the connection has been openedResponseBuffersreceiveMessage(int responseTo)Deprecated.Receive a response to a sent message from the server.voidreceiveMessageAsync(int responseTo, SingleResultCallback<ResponseBuffers> callback)Deprecated.Asynchronously receive a response to a sent message from the server.<T> TsendAndReceive(CommandMessage message, Decoder<T> decoder, SessionContext sessionContext)Deprecated.Send a command message to the server.<T> voidsendAndReceiveAsync(CommandMessage message, Decoder<T> decoder, SessionContext sessionContext, SingleResultCallback<T> callback)Deprecated.Send a command message to the server.voidsendMessage(java.util.List<ByteBuf> byteBuffers, int lastRequestId)Deprecated.Send a message to the server.voidsendMessageAsync(java.util.List<ByteBuf> byteBuffers, int lastRequestId, SingleResultCallback<java.lang.Void> callback)Deprecated.Asynchronously send a message to the server.
-
-
-
Constructor Detail
-
InternalStreamConnection
public InternalStreamConnection(ServerId serverId, StreamFactory streamFactory, java.util.List<MongoCompressor> compressorList, CommandListener commandListener, com.mongodb.internal.connection.InternalConnectionInitializer connectionInitializer)
Deprecated.
-
-
Method Detail
-
getDescription
public ConnectionDescription getDescription()
Deprecated.Description copied from interface:InternalConnectionGets the description of this connection.- Specified by:
getDescriptionin interfaceInternalConnection- Returns:
- the connection description
-
open
public void open()
Deprecated.Description copied from interface:InternalConnectionOpens the connection so its ready for use- Specified by:
openin interfaceInternalConnection
-
openAsync
public void openAsync(SingleResultCallback<java.lang.Void> callback)
Deprecated.Description copied from interface:InternalConnectionOpens the connection so its ready for use- Specified by:
openAsyncin interfaceInternalConnection- Parameters:
callback- the callback to be called once the connection has been opened
-
close
public void close()
Deprecated.Description copied from interface:InternalConnectionCloses the connection.- Specified by:
closein interfaceInternalConnection
-
opened
public boolean opened()
Deprecated.Description copied from interface:InternalConnectionReturns if the connection has been opened- Specified by:
openedin interfaceInternalConnection- Returns:
- true if connection has been opened
-
isClosed
public boolean isClosed()
Deprecated.Description copied from interface:InternalConnectionReturns the closed state of the connection- Specified by:
isClosedin interfaceInternalConnection- Returns:
- true if connection is closed
-
sendAndReceive
public <T> T sendAndReceive(CommandMessage message, Decoder<T> decoder, SessionContext sessionContext)
Deprecated.Description copied from interface:InternalConnectionSend a command message to the server.- Specified by:
sendAndReceivein 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:InternalConnectionSend a command message to the server.- Specified by:
sendAndReceiveAsyncin interfaceInternalConnection- Parameters:
message- the command message to sendsessionContext- the session contextcallback- the callback
-
sendMessage
public void sendMessage(java.util.List<ByteBuf> byteBuffers, int lastRequestId)
Deprecated.Description copied from interface:InternalConnectionSend a message to the server. The connection may not make any attempt to validate the integrity of the message.- Specified by:
sendMessagein interfaceInternalConnection- Parameters:
byteBuffers- the list of byte buffers to send.lastRequestId- the request id of the last message in byteBuffers
-
receiveMessage
public ResponseBuffers receiveMessage(int responseTo)
Deprecated.Description copied from interface:InternalConnectionReceive a response to a sent message from the server.- Specified by:
receiveMessagein interfaceInternalConnection- Parameters:
responseTo- the request id that this message is a response to- Returns:
- the response
-
sendMessageAsync
public void sendMessageAsync(java.util.List<ByteBuf> byteBuffers, int lastRequestId, SingleResultCallback<java.lang.Void> callback)
Deprecated.Description copied from interface:InternalConnectionAsynchronously send a message to the server. The connection may not make any attempt to validate the integrity of the message.- Specified by:
sendMessageAsyncin 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
public void receiveMessageAsync(int responseTo, SingleResultCallback<ResponseBuffers> callback)Deprecated.Description copied from interface:InternalConnectionAsynchronously receive a response to a sent message from the server.- Specified by:
receiveMessageAsyncin interfaceInternalConnection- Parameters:
responseTo- the request id that this message is a response tocallback- the callback to invoke on completion
-
getBuffer
public ByteBuf getBuffer(int size)
Deprecated.Description copied from interface:BufferProviderGets a buffer with the givens capacity.- Specified by:
getBufferin 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.
-
-