Class ProtocolContext

java.lang.Object
com.sshtools.synergy.nio.ProtocolContext
Direct Known Subclasses:
SshContext

public abstract class ProtocolContext extends Object
A protocol context defines the behavior for a listening interface.
  • Field Details

    • keepAlive

      protected boolean keepAlive
    • tcpNoDelay

      protected boolean tcpNoDelay
    • reuseAddress

      protected boolean reuseAddress
    • receiveBufferSize

      protected int receiveBufferSize
    • sendBufferSize

      protected int sendBufferSize
  • Constructor Details

    • ProtocolContext

      public ProtocolContext()
  • Method Details

    • createEngine

      protected abstract ProtocolEngine createEngine(ConnectRequestFuture connectFuture) throws IOException
      Create a protocol engine.
      Returns:
      ProtocolEngine
      Throws:
      IOException
    • getSocketOptionKeepAlive

      public boolean getSocketOptionKeepAlive()
      Indicates whether the SO_KEEPALIVE socket option is set on connected sockets.
      Returns:
      boolean
    • getSocketOptionReuseAddress

      public boolean getSocketOptionReuseAddress()
      Indicates whether the SO_REUSEADDR socket option will be set on a server socket.
      Returns:
      boolean
    • setSocketOptionReuseAddress

      public void setSocketOptionReuseAddress(boolean reuseAddress)
      Indicates whether the SO_REUSEADDR socket option will be set on a server socket.
      Parameters:
      reuseAddress - boolean
    • setSocketOptionKeepAlive

      public void setSocketOptionKeepAlive(boolean keepAlive)
      Set the SO_KEEPALIVE socket option on connected sockets.
      Parameters:
      keepAlive - boolean
    • getSocketOptionTcpNoDelay

      public boolean getSocketOptionTcpNoDelay()
      Indicates whether the TCP_NODELAY socket option is set on connected sockets.
      Returns:
      boolean
    • setSocketOptionTcpNoDelay

      public void setSocketOptionTcpNoDelay(boolean tcpNoDelay)
      Set the TCP_NODELAY socket option on connected sockets.
      Parameters:
      tcpNoDelay - boolean
    • setReceiveBufferSize

      public void setReceiveBufferSize(int receiveBufferSize)
      Set the receive buffer size for sockets.
      Parameters:
      receiveBufferSize - int
    • setSendBufferSize

      public void setSendBufferSize(int sendBufferSize)
      Set the send buffer size for sockets.
      Parameters:
      sendBufferSize - int
    • getReceiveBufferSize

      public int getReceiveBufferSize()
      Get the socket receive buffer size.
      Returns:
      int
    • getSendBufferSize

      public int getSendBufferSize()
      Get the socket send buffer size.
      Returns:
      int
    • getSocketConnectionFactory

      public SocketConnectionFactory getSocketConnectionFactory()
    • setSocketConnectionFactory

      public void setSocketConnectionFactory(SocketConnectionFactory socketConnectionFactory)
    • shutdown

      public abstract void shutdown()
    • enableSocks4Proxy

      public void enableSocks4Proxy(String proxyHostname, int proxyPort, String proxyUsername)
    • enableSocks5Proxy

      public void enableSocks5Proxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword, boolean localLookup)
    • enableHTTPProxy

      public void enableHTTPProxy(String proxyHostname, int proxyPort)
    • enableHTTPProxy

      public void enableHTTPProxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword)
    • enableHTTPProxy

      public void enableHTTPProxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword, String userAgent)
    • enableHTTPProxy

      public void enableHTTPProxy(String proxyHostname, int proxyPort, String proxyUsername, String proxyPassword, String userAgent, Map<String,String> optionalHeaders)
    • isProxyEnabled

      public boolean isProxyEnabled()
    • getProxyHostname

      public String getProxyHostname()
    • getProxyPort

      public int getProxyPort()
    • getProxyUsername

      public String getProxyUsername()
    • getProxyPassword

      public String getProxyPassword()
    • isResolveLocally

      public boolean isResolveLocally()
    • getUserAgent

      public String getUserAgent()
    • getOptionalHeaders

      public Map<String,String> getOptionalHeaders()
    • getProxyType

      public ProxyType getProxyType()