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 interfaceTransport.ConnectionA unidirectional connection to aDiscoveryNodestatic classTransport.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 classTransport.ResponseHandlersThis class is a registry that allows
-
Method Summary
Modifier and Type Method Description voidaddMessageListener(TransportMessageListener listener)TransportAddress[]addressesFromString(java.lang.String address, int perAddressLimit)Returns an address from its string representation.BoundTransportAddressboundAddress()The address the transport is bound on.default CircuitBreakergetInFlightRequestBreaker()java.util.List<java.lang.String>getLocalAddresses()Returns a list of all local adresses for this transportRequestHandlerRegistry<? extends TransportRequest>getRequestHandler(java.lang.String action)Returns the registered request handler registry for the given action ornullif it's not registeredTransport.ResponseHandlersgetResponseHandlers()TransportStatsgetStats()ReleasableopenConnection(DiscoveryNode node, ConnectionProfile profile, ActionListener<Transport.Connection> listener)Opens a new connection to the given node.java.util.Map<java.lang.String,BoundTransportAddress>profileBoundAddresses()Further profile bound addresses<Request extends TransportRequest>
voidregisterRequestHandler(RequestHandlerRegistry<Request> reg)Registers a new request handlerbooleanremoveMessageListener(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
-
-
-
-
Method Detail
-
registerRequestHandler
<Request extends TransportRequest> void registerRequestHandler(RequestHandlerRegistry<Request> reg)
Registers a new request handler
-
getRequestHandler
RequestHandlerRegistry<? extends TransportRequest> getRequestHandler(java.lang.String action)
Returns the registered request handler registry for the given action ornullif 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:
nulliff 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
Releasable openConnection(DiscoveryNode node, ConnectionProfile profile, ActionListener<Transport.Connection> listener)
Opens a new connection to the given node. When the connection is fully connected, the listener is called. AReleasableis returned representing the pending connection. If the caller of this method decides to move on before the listener is called with the completed connection, they should release the pending connection to prevent hanging connections.
-
getStats
TransportStats getStats()
-
getResponseHandlers
Transport.ResponseHandlers getResponseHandlers()
-
-