Package org.elasticsearch.transport
Interface Transport
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,LifecycleComponent
,org.elasticsearch.common.lease.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.RequestHandlers
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 -
Method Summary
Modifier and Type Method Description TransportAddress[]
addressesFromString(java.lang.String address)
Returns an address from its string representation.BoundTransportAddress
boundAddress()
The address the transport is bound on.java.util.List<java.lang.String>
getDefaultSeedAddresses()
Returns a list of all local addresses for this transportTransport.RequestHandlers
getRequestHandlers()
Transport.ResponseHandlers
getResponseHandlers()
TransportStats
getStats()
default boolean
isSecure()
void
openConnection(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 addressesdefault <Request extends TransportRequest>
voidregisterRequestHandler(RequestHandlerRegistry<Request> reg)
Registers a new request handlervoid
setMessageListener(TransportMessageListener listener)
default void
setSlowLogThreshold(org.elasticsearch.common.unit.TimeValue slowLogThreshold)
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 Details
-
registerRequestHandler
default <Request extends TransportRequest> void registerRequestHandler(RequestHandlerRegistry<Request> reg)Registers a new request handler -
setMessageListener
-
setSlowLogThreshold
default void setSlowLogThreshold(org.elasticsearch.common.unit.TimeValue slowLogThreshold) -
isSecure
default boolean isSecure() -
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) throws java.net.UnknownHostExceptionReturns an address from its string representation.- Throws:
java.net.UnknownHostException
-
getDefaultSeedAddresses
java.util.List<java.lang.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() -
getRequestHandlers
Transport.RequestHandlers getRequestHandlers()
-