Class TransportOptions

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class TransportOptions
    extends java.lang.Object
    implements java.lang.Cloneable
    Encapsulates all the Transport options in one configuration object.
    • Constructor Detail

      • TransportOptions

        public TransportOptions()
    • Method Detail

      • clone

        public TransportOptions clone()
        Overrides:
        clone in class java.lang.Object
      • getSendBufferSize

        public int getSendBufferSize()
        Returns:
        the currently set send buffer size in bytes.
      • setSendBufferSize

        public void setSendBufferSize​(int sendBufferSize)
        Sets the send buffer size in bytes, the value must be greater than zero or an IllegalArgumentException will be thrown.
        Parameters:
        sendBufferSize - the new send buffer size for the TCP Transport.
        Throws:
        java.lang.IllegalArgumentException - if the value given is not in the valid range.
      • getReceiveBufferSize

        public int getReceiveBufferSize()
        Returns:
        the currently configured receive buffer size in bytes.
      • setReceiveBufferSize

        public void setReceiveBufferSize​(int receiveBufferSize)
        Sets the receive buffer size in bytes, the value must be greater than zero or an IllegalArgumentException will be thrown.
        Parameters:
        receiveBufferSize - the new receive buffer size for the TCP Transport.
        Throws:
        java.lang.IllegalArgumentException - if the value given is not in the valid range.
      • getTrafficClass

        public int getTrafficClass()
        Returns:
        the currently configured traffic class value.
      • setTrafficClass

        public void setTrafficClass​(int trafficClass)
        Sets the traffic class value used by the TCP connection, valid range is between 0 and 255.
        Parameters:
        trafficClass - the new traffic class value.
        Throws:
        java.lang.IllegalArgumentException - if the value given is not in the valid range.
      • getSoTimeout

        public int getSoTimeout()
      • setSoTimeout

        public void setSoTimeout​(int soTimeout)
      • isTcpNoDelay

        public boolean isTcpNoDelay()
      • setTcpNoDelay

        public void setTcpNoDelay​(boolean tcpNoDelay)
      • getSoLinger

        public int getSoLinger()
      • setSoLinger

        public void setSoLinger​(int soLinger)
      • isTcpKeepAlive

        public boolean isTcpKeepAlive()
      • setTcpKeepAlive

        public void setTcpKeepAlive​(boolean keepAlive)
      • setSharedEventLoopThreads

        public void setSharedEventLoopThreads​(int numThreads)
      • getSharedEventLoopThreads

        public int getSharedEventLoopThreads()
      • getConnectTimeout

        public int getConnectTimeout()
      • setConnectTimeout

        public void setConnectTimeout​(int connectTimeout)
      • getDefaultTcpPort

        public int getDefaultTcpPort()
      • setDefaultTcpPort

        public void setDefaultTcpPort​(int defaultTcpPort)
      • getLocalAddress

        public java.lang.String getLocalAddress()
      • setLocalAddress

        public void setLocalAddress​(java.lang.String localAddress)
      • getLocalPort

        public int getLocalPort()
      • setLocalPort

        public void setLocalPort​(int localPort)
      • isUseEpoll

        public boolean isUseEpoll()
        Returns:
        true if the netty epoll transport can be used if available on this platform.
      • setUseEpoll

        public void setUseEpoll​(boolean useEpoll)
        Determines if the netty epoll transport can be used if available on this platform.
        Parameters:
        useEpoll - should use of available epoll transport be used.
      • isUseKQueue

        public boolean isUseKQueue()
        Returns:
        true if the netty kqueue transport can be used if available on this platform.
      • setUseKQueue

        public void setUseKQueue​(boolean useKQueue)
        Determines if the netty kqueue transport can be used if available on this platform.
        Parameters:
        useKQueue - should use of available kqueue transport be used.
      • isTraceBytes

        public boolean isTraceBytes()
        Returns:
        true if the transport should enable byte tracing
      • setTraceBytes

        public void setTraceBytes​(boolean traceBytes)
        Determines if the transport should add a logger for bytes in / out
        Parameters:
        traceBytes - should the transport log the bytes in and out.
      • getKeyStoreLocation

        public java.lang.String getKeyStoreLocation()
        Returns:
        the keyStoreLocation currently configured.
      • setKeyStoreLocation

        public void setKeyStoreLocation​(java.lang.String keyStoreLocation)
        Sets the location on disk of the key store to use.
        Parameters:
        keyStoreLocation - the keyStoreLocation to use to create the key manager.
      • getKeyStorePassword

        public java.lang.String getKeyStorePassword()
        Returns:
        the keyStorePassword
      • setKeyStorePassword

        public void setKeyStorePassword​(java.lang.String keyStorePassword)
        Parameters:
        keyStorePassword - the keyStorePassword to set
      • getTrustStoreLocation

        public java.lang.String getTrustStoreLocation()
        Returns:
        the trustStoreLocation
      • setTrustStoreLocation

        public void setTrustStoreLocation​(java.lang.String trustStoreLocation)
        Parameters:
        trustStoreLocation - the trustStoreLocation to set
      • getTrustStorePassword

        public java.lang.String getTrustStorePassword()
        Returns:
        the trustStorePassword
      • setTrustStorePassword

        public void setTrustStorePassword​(java.lang.String trustStorePassword)
        Parameters:
        trustStorePassword - the trustStorePassword to set
      • setStoreType

        public void setStoreType​(java.lang.String storeType)
        Parameters:
        storeType - the format that the store files are encoded in.
      • getKeyStoreType

        public java.lang.String getKeyStoreType()
        Returns:
        the keyStoreType
      • setKeyStoreType

        public void setKeyStoreType​(java.lang.String keyStoreType)
        Parameters:
        keyStoreType - the format that the keyStore file is encoded in
      • getTrustStoreType

        public java.lang.String getTrustStoreType()
        Returns:
        the trustStoreType
      • setTrustStoreType

        public void setTrustStoreType​(java.lang.String trustStoreType)
        Parameters:
        trustStoreType - the format that the trustStore file is encoded in
      • getEnabledCipherSuites

        public java.lang.String[] getEnabledCipherSuites()
        Returns:
        the enabledCipherSuites
      • setEnabledCipherSuites

        public void setEnabledCipherSuites​(java.lang.String[] enabledCipherSuites)
        Parameters:
        enabledCipherSuites - the enabledCipherSuites to set
      • getDisabledCipherSuites

        public java.lang.String[] getDisabledCipherSuites()
        Returns:
        the disabledCipherSuites
      • setDisabledCipherSuites

        public void setDisabledCipherSuites​(java.lang.String[] disabledCipherSuites)
        Parameters:
        disabledCipherSuites - the disabledCipherSuites to set
      • getEnabledProtocols

        public java.lang.String[] getEnabledProtocols()
        Returns:
        the enabledProtocols or null if the defaults should be used
      • setEnabledProtocols

        public void setEnabledProtocols​(java.lang.String[] enabledProtocols)
        The protocols to be set as enabled.
        Parameters:
        enabledProtocols - the enabled protocols to set, or null if the defaults should be used.
      • getDisabledProtocols

        public java.lang.String[] getDisabledProtocols()
        Returns:
        the protocols to disable or null if none should be
      • setDisabledProtocols

        public void setDisabledProtocols​(java.lang.String[] disabledProtocols)
        The protocols to be disable.
        Parameters:
        disabledProtocols - the protocols to disable, or null if none should be.
      • getContextProtocol

        public java.lang.String getContextProtocol()
        Returns:
        the context protocol to use
      • setContextProtocol

        public void setContextProtocol​(java.lang.String contextProtocol)
        The protocol value to use when creating an SSLContext via SSLContext.getInstance(protocol).
        Parameters:
        contextProtocol - the context protocol to use.
      • isTrustAll

        public boolean isTrustAll()
        Returns:
        the trustAll
      • setTrustAll

        public void setTrustAll​(boolean trustAll)
        Parameters:
        trustAll - the trustAll to set
      • isVerifyHost

        public boolean isVerifyHost()
        Returns:
        the verifyHost
      • setVerifyHost

        public void setVerifyHost​(boolean verifyHost)
        Parameters:
        verifyHost - the verifyHost to set
      • getKeyAlias

        public java.lang.String getKeyAlias()
        Returns:
        the key alias
      • setKeyAlias

        public void setKeyAlias​(java.lang.String keyAlias)
        Parameters:
        keyAlias - the key alias to use
      • getDefaultSslPort

        public int getDefaultSslPort()
      • setDefaultSslPort

        public void setDefaultSslPort​(int defaultSslPort)
      • setSslContextOverride

        public void setSslContextOverride​(javax.net.ssl.SSLContext sslContextOverride)
      • getSslContextOverride

        public javax.net.ssl.SSLContext getSslContextOverride()
      • getProxyHandlerSupplier

        public <T> java.util.function.Supplier<T> getProxyHandlerSupplier()
      • setProxyHandlerSupplier

        public <T> void setProxyHandlerSupplier​(java.util.function.Supplier<T> proxyHandlerFactory)
      • getHttpHeaders

        public java.util.Map<java.lang.String,​java.lang.String> getHttpHeaders()
      • isUseOpenSSL

        public boolean isUseOpenSSL()
        Returns:
        true if the netty OpenSSL support can be used if available.
      • setUseOpenSSL

        public void setUseOpenSSL​(boolean useOpenSSL)
        Parameters:
        useOpenSSL - Configure if the transport should attempt to use OpenSSL support if available.