Class GelfTcpTransport.Builder

java.lang.Object
codes.grow.packages.graylog.GelfTcpTransport.Builder
Enclosing class:
GelfTcpTransport

public static final class GelfTcpTransport.Builder extends Object
Builder of a GelfTcpTransport.
  • Method Details

    • port

      public GelfTcpTransport.Builder port(int port)
      Sets the port (default 12201).
      Parameters:
      port - 1..65535
      Returns:
      this builder
    • tls

      public GelfTcpTransport.Builder tls(boolean tls)
      Enables TLS (the input needs tls_enable).
      Parameters:
      tls - true to enable
      Returns:
      this builder
    • tlsOptions

      public GelfTcpTransport.Builder tlsOptions(TlsOptions options)
      Sets the TLS options (CA bundle, client certificate, insecureSkipVerify).
      Parameters:
      options - TLS options
      Returns:
      this builder
    • serverName

      public GelfTcpTransport.Builder serverName(String serverName)
      Overrides the SNI / verification host name (default: the host).
      Parameters:
      serverName - name
      Returns:
      this builder
    • connectTimeout

      public GelfTcpTransport.Builder connectTimeout(Duration d)
      Sets the connect timeout (default 10 s).
      Parameters:
      d - positive duration
      Returns:
      this builder
    • writeTimeout

      public GelfTcpTransport.Builder writeTimeout(Duration d)
      Sets the write timeout of one batch (default 30 s).
      Parameters:
      d - positive duration
      Returns:
      this builder
    • retry

      public GelfTcpTransport.Builder retry(RetryPolicy retry)
      Sets the reconnect policy (default RetryPolicy.defaults()).
      Parameters:
      retry - policy
      Returns:
      this builder
    • build

      public GelfTcpTransport build()
      Validates and builds the transport; the connection opens on first use.
      Returns:
      the transport
      Throws:
      ConfigException - for a blank host, a bad port, timeouts or TLS settings