Package org.apache.sshd.server.channel
Class PuttyRequestHandler
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.channel.AbstractRequestHandler<Channel>
org.apache.sshd.common.channel.AbstractChannelRequestHandler
org.apache.sshd.server.channel.PuttyRequestHandler
- All Implemented Interfaces:
ChannelRequestHandler
,RequestHandler<Channel>
Handles Putty specific channel requests as indicated by
Appendix F: SSH-2 names specified for
PuTTY
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sshd.common.channel.RequestHandler
RequestHandler.Result
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PuttyRequestHandler
static final String
Suffix of all PUTTY related channel requestsFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
Fields inherited from interface org.apache.sshd.common.channel.ChannelRequestHandler
CHANN2HNDLR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isPuttyClient
(String clientVersion) static boolean
isPuttyClient
(Session session) static boolean
isPuttyRequest
(String request) Process an SSH request.protected RequestHandler.Result
processPuttyOpcode
(Channel channel, String request, String opcode, boolean wantReply, Buffer buffer) resolveShellTtyOptions
(Map<PtyMode, Integer> modes)
-
Field Details
-
REQUEST_SUFFIX
Suffix of all PUTTY related channel requests- See Also:
-
PUTTY_OPTIONS
-
INSTANCE
-
-
Constructor Details
-
PuttyRequestHandler
public PuttyRequestHandler()
-
-
Method Details
-
process
public RequestHandler.Result process(Channel channel, String request, boolean wantReply, 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 parameterrequest
- The request stringwantReply
- Whether a reply is requestedbuffer
- TheBuffer
with request specific data- Returns:
- The
RequestHandler.Result
- Throws:
Exception
- If failed to handle the request - Note: in order to signal an unsupported request theRequestHandler.Result.Unsupported
value should be returned
-
processPuttyOpcode
protected RequestHandler.Result processPuttyOpcode(Channel channel, String request, String opcode, boolean wantReply, Buffer buffer) throws Exception - Throws:
Exception
-
isPuttyRequest
- Parameters:
request
- The channel request value - ignored ifnull
/empty- Returns:
true
if the request ends inREQUEST_SUFFIX
-
isPuttyClient
- Parameters:
session
- The currentSession
- ignored ifnull
- Returns:
true
if it is a PUTTY session- See Also:
-
isPuttyClient
- Parameters:
clientVersion
- The client identification string - ignored ifnull
/empty- Returns:
true
if the identification starts with theSessionContext.DEFAULT_SSH_VERSION_PREFIX
and it contains the "putty" string (case insensitive)
-
resolveShellTtyOptions
-