public interface Transport extends LifecycleComponent
Modifier and Type | Interface and Description |
---|---|
static interface |
Transport.Connection
A unidirectional connection to a
DiscoveryNode |
Modifier and Type | Field and Description |
---|---|
static Setting<java.lang.Boolean> |
TRANSPORT_TCP_COMPRESS |
Modifier and Type | Method and Description |
---|---|
TransportAddress[] |
addressesFromString(java.lang.String address,
int perAddressLimit)
Returns an address from its string representation.
|
boolean |
addressSupported(java.lang.Class<? extends TransportAddress> address)
Is the address type supported.
|
BoundTransportAddress |
boundAddress()
The address the transport is bound on.
|
void |
connectToNode(DiscoveryNode node,
ConnectionProfile connectionProfile,
CheckedBiConsumer<Transport.Connection,ConnectionProfile,java.io.IOException> connectionValidator)
Connects to a node with the given connection profile.
|
void |
disconnectFromNode(DiscoveryNode node)
Disconnected from the given node, if not connected, will do nothing.
|
Transport.Connection |
getConnection(DiscoveryNode node)
Returns a connection for the given node if the node is connected.
|
default CircuitBreaker |
getInFlightRequestBreaker() |
java.util.List<java.lang.String> |
getLocalAddresses() |
long |
newRequestId()
Returns a new request ID to use when sending a message via
Transport.Connection.sendRequest(long, String,
TransportRequest, TransportRequestOptions) |
boolean |
nodeConnected(DiscoveryNode node)
Returns true if the node is connected.
|
Transport.Connection |
openConnection(DiscoveryNode node,
ConnectionProfile profile)
Opens a new connection to the given node and returns it.
|
java.util.Map<java.lang.String,BoundTransportAddress> |
profileBoundAddresses()
Further profile bound addresses
|
long |
serverOpen()
Returns count of currently open connections
|
void |
transportServiceAdapter(TransportServiceAdapter service) |
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
close
static final Setting<java.lang.Boolean> TRANSPORT_TCP_COMPRESS
void transportServiceAdapter(TransportServiceAdapter service)
BoundTransportAddress boundAddress()
java.util.Map<java.lang.String,BoundTransportAddress> profileBoundAddresses()
null
iff profiles are unsupported, otherwise a map with name of profile and its bound transport addressTransportAddress[] addressesFromString(java.lang.String address, int perAddressLimit) throws java.net.UnknownHostException
java.net.UnknownHostException
boolean addressSupported(java.lang.Class<? extends TransportAddress> address)
boolean nodeConnected(DiscoveryNode node)
void connectToNode(DiscoveryNode node, ConnectionProfile connectionProfile, CheckedBiConsumer<Transport.Connection,ConnectionProfile,java.io.IOException> connectionValidator) throws ConnectTransportException
ConnectTransportException
void disconnectFromNode(DiscoveryNode node)
long serverOpen()
java.util.List<java.lang.String> getLocalAddresses()
default CircuitBreaker getInFlightRequestBreaker()
long newRequestId()
Transport.Connection.sendRequest(long, String,
TransportRequest, TransportRequestOptions)
Transport.Connection getConnection(DiscoveryNode node)
NodeNotConnectedException
- if the node is not connectedconnectToNode(DiscoveryNode, ConnectionProfile, CheckedBiConsumer)
Transport.Connection openConnection(DiscoveryNode node, ConnectionProfile profile) throws java.io.IOException
connectToNode(DiscoveryNode, ConnectionProfile, CheckedBiConsumer)
the returned connection is not managed by
the transport implementation. This connection must be closed once it's not needed anymore.
This connection type can be used to execute a handshake between two nodes before the node will be published via
connectToNode(DiscoveryNode, ConnectionProfile, CheckedBiConsumer)
.java.io.IOException