Package org.elasticsearch.transport
Interface Transport
-
- All Superinterfaces:
AutoCloseable,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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TransportAddress[]addressesFromString(String address)Returns an address from its string representation.BoundTransportAddressboundAddress()The address the transport is bound on.List<String>getDefaultSeedAddresses()Returns a list of all local addresses for this transportRequestHandlerRegistry<? extends TransportRequest>getRequestHandler(String action)Returns the registered request handler registry for the given action ornullif it's not registeredTransport.ResponseHandlersgetResponseHandlers()TransportStatsgetStats()voidopenConnection(DiscoveryNode node, ConnectionProfile profile, ActionListener<Transport.Connection> listener)Opens a new connection to the given node.Map<String,BoundTransportAddress>profileBoundAddresses()Further profile bound addresses<Request extends TransportRequest>
voidregisterRequestHandler(RequestHandlerRegistry<Request> reg)Registers a new request handlervoidsetMessageListener(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(String action)
Returns the registered request handler registry for the given action ornullif it's not registered- Parameters:
action- the action to look up
-
setMessageListener
void setMessageListener(TransportMessageListener listener)
-
boundAddress
BoundTransportAddress boundAddress()
The address the transport is bound on.
-
profileBoundAddresses
Map<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(String address) throws UnknownHostException
Returns an address from its string representation.- Throws:
UnknownHostException
-
getDefaultSeedAddresses
List<String> getDefaultSeedAddresses()
Returns a list of all local addresses for this transport
-
openConnection
void 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. The ActionListener will be called on the calling thread or the generic thread pool.
-
getStats
TransportStats getStats()
-
getResponseHandlers
Transport.ResponseHandlers getResponseHandlers()
-
-