Class PuttyRequestHandler

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
All Implemented Interfaces:
ChannelRequestHandler, RequestHandler<Channel>

public class PuttyRequestHandler extends AbstractChannelRequestHandler
Handles Putty specific channel requests as indicated by Appendix F: SSH-2 names specified for PuTTY
  • Field Details

    • REQUEST_SUFFIX

      public static final String REQUEST_SUFFIX
      Suffix of all PUTTY related channel requests
      See Also:
    • PUTTY_OPTIONS

      public static final Set<org.apache.sshd.common.channel.PtyMode> PUTTY_OPTIONS
    • INSTANCE

      public static final PuttyRequestHandler INSTANCE
  • Constructor Details

    • PuttyRequestHandler

      public PuttyRequestHandler()
  • Method Details

    • process

      public RequestHandler.Result process(Channel channel, String request, boolean wantReply, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Description copied from interface: RequestHandler
      Process an SSH request. If an exception is thrown, the ConnectionService will send a failure message if needed and the request will be considered handled.
      Parameters:
      channel - The input parameter
      request - The request string
      wantReply - Whether a reply is requested
      buffer - The Buffer with request specific data
      Returns:
      The RequestHandler.Result
      Throws:
      Exception - If failed to handle the request - Note: in order to signal an unsupported request the RequestHandler.Result.Unsupported value should be returned
    • processPuttyOpcode

      protected RequestHandler.Result processPuttyOpcode(Channel channel, String request, String opcode, boolean wantReply, org.apache.sshd.common.util.buffer.Buffer buffer) throws Exception
      Throws:
      Exception
    • isPuttyRequest

      public static boolean isPuttyRequest(String request)
      Parameters:
      request - The channel request value - ignored if null/empty
      Returns:
      true if the request ends in REQUEST_SUFFIX
    • isPuttyClient

      public static boolean isPuttyClient(Session session)
      Parameters:
      session - The current Session - ignored if null
      Returns:
      true if it is a PUTTY session
      See Also:
    • isPuttyClient

      public static boolean isPuttyClient(String clientVersion)
      Parameters:
      clientVersion - The client identification string - ignored if null/empty
      Returns:
      true if the identification starts with the SessionContext.DEFAULT_SSH_VERSION_PREFIX and it contains the "putty" string (case insensitive)
    • resolveShellTtyOptions

      public static Map<org.apache.sshd.common.channel.PtyMode, Integer> resolveShellTtyOptions(Map<org.apache.sshd.common.channel.PtyMode, Integer> modes)