Interface Transport

All Superinterfaces:
AutoCloseable, Closeable, org.opensearch.common.lifecycle.LifecycleComponent, org.opensearch.common.lease.Releasable
All Known Implementing Classes:
TcpTransport

@PublicApi(since="1.0.0") public interface Transport extends org.opensearch.common.lifecycle.LifecycleComponent
OpenSearch Transport Interface
Opensearch.api:
  • Method Details

    • registerRequestHandler

      default <Request extends TransportRequest> void registerRequestHandler(RequestHandlerRegistry<Request> reg)
      Registers a new request handler
    • setMessageListener

      void setMessageListener(TransportMessageListener listener)
    • setSlowLogThreshold

      default void setSlowLogThreshold(org.opensearch.common.unit.TimeValue slowLogThreshold)
    • isSecure

      default boolean isSecure()
    • boundAddress

      org.opensearch.core.common.transport.BoundTransportAddress boundAddress()
      The address the transport is bound on.
    • profileBoundAddresses

      Map<String,org.opensearch.core.common.transport.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

      org.opensearch.core.common.transport.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, org.opensearch.core.action.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()
    • resolvePublishPort

      static int resolvePublishPort(int publishPort, List<InetSocketAddress> boundAddresses, InetAddress publishInetAddress)
      Resolve the publishPort for a server provided a list of boundAddresses and a publishInetAddress. Resolution strategy is as follows: If a configured port exists resolve to that port. If a bound address matches the publishInetAddress resolve to that port. If a bound address is a wildcard address resolve to that port. If all bound addresses share the same port resolve to that port.
      Parameters:
      publishPort - -1 if no configured publish port exists
      boundAddresses - addresses bound by the server
      publishInetAddress - address published for the server
      Returns:
      Resolved port. If publishPort is negative and no port can be resolved return publishPort.
    • resolveTransportPublishPort

      static int resolveTransportPublishPort(int publishPort, List<org.opensearch.core.common.transport.TransportAddress> boundAddresses, InetAddress publishInetAddress)