Package org.elasticsearch.transport
Interface Transport
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,LifecycleComponent
,Releasable
- All Known Implementing Classes:
TcpTransport
public interface Transport extends LifecycleComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Transport.Connection
A unidirectional connection to aDiscoveryNode
static class
Transport.ResponseContext<T extends TransportResponse>
This class represents a response context that encapsulates the actual response handler, the action and the connection it was executed on.static class
Transport.ResponseHandlers
This class is a registry that allows
-
Field Summary
Fields Modifier and Type Field Description static Setting<java.lang.Boolean>
TRANSPORT_TCP_COMPRESS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addMessageListener(TransportMessageListener listener)
TransportAddress[]
addressesFromString(java.lang.String address, int perAddressLimit)
Returns an address from its string representation.BoundTransportAddress
boundAddress()
The address the transport is bound on.default CircuitBreaker
getInFlightRequestBreaker()
java.util.List<java.lang.String>
getLocalAddresses()
Returns a list of all local adresses for this transportRequestHandlerRegistry
getRequestHandler(java.lang.String action)
Returns the registered request handler registry for the given action ornull
if it's not registeredTransport.ResponseHandlers
getResponseHandlers()
TransportStats
getStats()
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<Request extends TransportRequest>
voidregisterRequestHandler(RequestHandlerRegistry<Request> reg)
Registers a new request handlerboolean
removeMessageListener(TransportMessageListener listener)
-
Methods inherited from interface org.elasticsearch.common.component.LifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
-
Methods inherited from interface org.elasticsearch.common.lease.Releasable
close
-
-
-
-
Field Detail
-
TRANSPORT_TCP_COMPRESS
static final Setting<java.lang.Boolean> TRANSPORT_TCP_COMPRESS
-
-
Method Detail
-
registerRequestHandler
<Request extends TransportRequest> void registerRequestHandler(RequestHandlerRegistry<Request> reg)
Registers a new request handler
-
getRequestHandler
RequestHandlerRegistry getRequestHandler(java.lang.String action)
Returns the registered request handler registry for the given action ornull
if it's not registered- Parameters:
action
- the action to look up
-
addMessageListener
void addMessageListener(TransportMessageListener listener)
-
removeMessageListener
boolean removeMessageListener(TransportMessageListener listener)
-
boundAddress
BoundTransportAddress boundAddress()
The address the transport is bound on.
-
profileBoundAddresses
java.util.Map<java.lang.String,BoundTransportAddress> profileBoundAddresses()
Further profile bound addresses- Returns:
null
iff profiles are unsupported, otherwise a map with name of profile and its bound transport address
-
addressesFromString
TransportAddress[] addressesFromString(java.lang.String address, int perAddressLimit) throws java.net.UnknownHostException
Returns an address from its string representation.- Throws:
java.net.UnknownHostException
-
getLocalAddresses
java.util.List<java.lang.String> getLocalAddresses()
Returns a list of all local adresses for this transport
-
getInFlightRequestBreaker
default CircuitBreaker getInFlightRequestBreaker()
-
openConnection
Transport.Connection openConnection(DiscoveryNode node, ConnectionProfile profile)
Opens a new connection to the given node and returns it. The returned connection is not managed by the transport implementation. This connection must be closed once it's not needed anymore.
-
getStats
TransportStats getStats()
-
getResponseHandlers
Transport.ResponseHandlers getResponseHandlers()
-
-