Class TcpClientConfig


  • public final class TcpClientConfig
    extends java.lang.Object
    Configuration for TCP based clients.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ReadOnlyTcpClientConfig asReadOnly​(java.util.List<java.lang.String> supportedAlpnProtocols)
      Returns an immutable view of this config, any changes to this config will not alter the returned view.
      void enableWireLogging​(java.lang.String loggerName)
      Enable wire-logging for all connections.
      void enableWireLogging​(java.lang.String loggerName, LogLevel logLevel, java.util.function.BooleanSupplier logUserData)
      Enable wire-logging for all connections.
      void flushStrategy​(FlushStrategy flushStrategy)
      Sets FlushStrategy to use for all connections.
      void secure​(SecurityConfig securityConfig)
      Add security related config.
      <T> void socketOption​(java.net.SocketOption<T> option, T value)
      Add a SocketOption that is applied.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TcpClientConfig

        public TcpClientConfig()
        New instance.
    • Method Detail

      • asReadOnly

        public ReadOnlyTcpClientConfig asReadOnly​(java.util.List<java.lang.String> supportedAlpnProtocols)
        Returns an immutable view of this config, any changes to this config will not alter the returned view.
        Parameters:
        supportedAlpnProtocols - a list of supported protocols for ALPN configuration
        Returns:
        an immutable view of this config
      • socketOption

        public final <T> void socketOption​(java.net.SocketOption<T> option,
                                           T value)
        Add a SocketOption that is applied.
        Type Parameters:
        T - the type of the value
        Parameters:
        option - the option to apply
        value - the value
        Throws:
        java.lang.IllegalArgumentException - if the SocketOption is not supported
        See Also:
        StandardSocketOptions, ServiceTalkSocketOptions
      • flushStrategy

        public final void flushStrategy​(FlushStrategy flushStrategy)
        Sets FlushStrategy to use for all connections.
        Parameters:
        flushStrategy - FlushStrategy to use for all connections
      • enableWireLogging

        public final void enableWireLogging​(java.lang.String loggerName)
        Enable wire-logging for all connections. All wire events will be logged at trace level.
        Parameters:
        loggerName - The name of the logger to log wire events
      • enableWireLogging

        public final void enableWireLogging​(java.lang.String loggerName,
                                            LogLevel logLevel,
                                            java.util.function.BooleanSupplier logUserData)
        Enable wire-logging for all connections. All wire events will be logged at trace level.
        Parameters:
        loggerName - provides the logger to log data/events to/from the wire.
        logLevel - the level to log data/events to/from the wire.
        logUserData - true to include user data (e.g. data, headers, etc.). false to exclude user data and log only network events.
      • secure

        public final void secure​(SecurityConfig securityConfig)
        Add security related config.
        Parameters:
        securityConfig - the ReadOnlyServerSecurityConfig to use