Class PuttyRequestHandler

    • Field Detail

      • REQUEST_SUFFIX

        public static final java.lang.String REQUEST_SUFFIX
        Suffix of all PUTTY related channel requests
        See Also:
        Constant Field Values
      • PUTTY_OPTIONS

        public static final java.util.Set<PtyMode> PUTTY_OPTIONS
    • Constructor Detail

      • PuttyRequestHandler

        public PuttyRequestHandler()
    • Method Detail

      • process

        public RequestHandler.Result process​(Channel channel,
                                             java.lang.String request,
                                             boolean wantReply,
                                             Buffer buffer)
                                      throws java.lang.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:
        java.lang.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,
                                                           java.lang.String request,
                                                           java.lang.String opcode,
                                                           boolean wantReply,
                                                           Buffer buffer)
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isPuttyRequest

        public static boolean isPuttyRequest​(java.lang.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​(java.lang.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 java.util.Map<PtyMode,​java.lang.Integer> resolveShellTtyOptions​(java.util.Map<PtyMode,​java.lang.Integer> modes)