public class PuttyRequestHandler extends AbstractChannelRequestHandler
RequestHandler.Result
Modifier and Type | Field and Description |
---|---|
static PuttyRequestHandler |
INSTANCE |
static java.util.Set<PtyMode> |
PUTTY_OPTIONS |
static java.lang.String |
REQUEST_SUFFIX
Suffix of all PUTTY related channel requests
|
log
CHANN2HNDLR
Constructor and Description |
---|
PuttyRequestHandler() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isPuttyClient(Session session) |
static boolean |
isPuttyClient(java.lang.String clientVersion) |
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) |
public static final java.lang.String REQUEST_SUFFIX
public static final java.util.Set<PtyMode> PUTTY_OPTIONS
public static final PuttyRequestHandler INSTANCE
public RequestHandler.Result process(Channel channel, java.lang.String request, boolean wantReply, Buffer buffer) throws java.lang.Exception
RequestHandler
channel
- The input parameterrequest
- The request stringwantReply
- Whether a reply is requestedbuffer
- The Buffer
with request specific dataRequestHandler.Result
java.lang.Exception
- If failed to handle the request - Note: in order to signal an unsupported request the
RequestHandler.Result.Unsupported
value should be returnedprotected RequestHandler.Result processPuttyOpcode(Channel channel, java.lang.String request, java.lang.String opcode, boolean wantReply, Buffer buffer) throws java.lang.Exception
java.lang.Exception
public static boolean isPuttyRequest(java.lang.String request)
request
- The channel request value - ignored if null
/emptytrue
if the request ends in REQUEST_SUFFIX
public static boolean isPuttyClient(Session session)
session
- The current Session
- ignored if null
true
if it is a PUTTY sessionSessionContext.getClientVersion()
,
isPuttyClient(String)
public static boolean isPuttyClient(java.lang.String clientVersion)
clientVersion
- The client identification string - ignored if null
/emptytrue
if the identification starts with the
SessionContext.DEFAULT_SSH_VERSION_PREFIX
and it contains the "putty"
string (case insensitive)