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>
public class PuttyRequestHandler extends AbstractChannelRequestHandler
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
Fields Modifier and Type Field Description static PuttyRequestHandler
INSTANCE
static java.util.Set<PtyMode>
PUTTY_OPTIONS
static java.lang.String
REQUEST_SUFFIX
Suffix of all PUTTY related channel requests-
Fields 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 Constructor Description PuttyRequestHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isPuttyClient(java.lang.String clientVersion)
static boolean
isPuttyClient(Session session)
static boolean
isPuttyRequest(java.lang.String request)
RequestHandler.Result
process(Channel channel, java.lang.String request, boolean wantReply, Buffer buffer)
Process an SSH request.protected RequestHandler.Result
processPuttyOpcode(Channel channel, java.lang.String request, java.lang.String opcode, boolean wantReply, Buffer buffer)
static java.util.Map<PtyMode,java.lang.Integer>
resolveShellTtyOptions(java.util.Map<PtyMode,java.lang.Integer> modes)
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
getSimplifiedLogger
-
-
-
-
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
-
INSTANCE
public static final PuttyRequestHandler INSTANCE
-
-
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 parameterrequest
- The request stringwantReply
- Whether a reply is requestedbuffer
- TheBuffer
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 theRequestHandler.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 ifnull
/empty- Returns:
true
if the request ends inREQUEST_SUFFIX
-
isPuttyClient
public static boolean isPuttyClient(Session session)
- Parameters:
session
- The currentSession
- ignored ifnull
- Returns:
true
if it is a PUTTY session- See Also:
SessionContext.getClientVersion()
,isPuttyClient(String)
-
isPuttyClient
public static boolean isPuttyClient(java.lang.String clientVersion)
- 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)
-
-