public class TarantoolConnectionImpl extends Object implements TarantoolConnection
Modifier and Type | Field and Description |
---|---|
protected io.netty.channel.Channel |
channel |
protected RequestFutureManager |
requestManager |
protected TarantoolVersionHolder |
versionHolder |
Constructor and Description |
---|
TarantoolConnectionImpl(RequestFutureManager requestManager,
TarantoolVersionHolder versionHolder,
io.netty.channel.Channel channel) |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionCloseListener(TarantoolConnectionCloseListener listener)
Add a listener which is invoked when the connection is closed.
|
void |
addConnectionFailureListener(TarantoolConnectionFailureListener listener)
Add a listener which is invoked when the connection is broken from the server side (e.g. server closed
the connection or a network failure has occurred).
|
void |
close() |
io.netty.channel.Channel |
getChannel()
Get the Netty channel baking this connection
|
InetSocketAddress |
getRemoteAddress()
Get the Tarantool server address for this connection
|
TarantoolVersion |
getVersion()
Get the Tarantool server version
|
boolean |
isConnected()
Get the connection status
|
TarantoolRequestMetadata |
sendRequest(TarantoolRequest request)
Send a prepared request to the Tarantool server and flush the buffer
|
protected final TarantoolVersionHolder versionHolder
protected final RequestFutureManager requestManager
protected final io.netty.channel.Channel channel
public TarantoolConnectionImpl(RequestFutureManager requestManager, TarantoolVersionHolder versionHolder, io.netty.channel.Channel channel)
public InetSocketAddress getRemoteAddress() throws TarantoolClientException
TarantoolConnection
getRemoteAddress
in interface TarantoolConnection
TarantoolClientException
- if the client is not connectedpublic TarantoolVersion getVersion() throws TarantoolClientException
TarantoolConnection
getVersion
in interface TarantoolConnection
TarantoolVersion
TarantoolClientException
- if the client is not connectedpublic boolean isConnected()
TarantoolConnection
isConnected
in interface TarantoolConnection
public TarantoolRequestMetadata sendRequest(TarantoolRequest request)
TarantoolConnection
sendRequest
in interface TarantoolConnection
request
- the requestpublic io.netty.channel.Channel getChannel()
TarantoolConnection
getChannel
in interface TarantoolConnection
public void addConnectionFailureListener(TarantoolConnectionFailureListener listener)
TarantoolConnection
addConnectionFailureListener
in interface TarantoolConnection
listener
- a TarantoolConnectionFailureListener
instancepublic void addConnectionCloseListener(TarantoolConnectionCloseListener listener)
TarantoolConnection
addConnectionCloseListener
in interface TarantoolConnection
listener
- a TarantoolConnectionCloseListener
instancepublic void close()
close
in interface AutoCloseable
Copyright © 2025 Picodata. All rights reserved.