public class PuttyRequestHandler extends AbstractChannelRequestHandler
RequestHandler.Result
Modifier and Type | Field and Description |
---|---|
static PuttyRequestHandler |
INSTANCE |
static Set<PtyMode> |
PUTTY_OPTIONS |
static 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(String clientVersion) |
static boolean |
isPuttyRequest(String request) |
RequestHandler.Result |
process(Channel channel,
String request,
boolean wantReply,
Buffer buffer)
Process an SSH request.
|
protected RequestHandler.Result |
processPuttyOpcode(Channel channel,
String request,
String opcode,
boolean wantReply,
Buffer buffer) |
static Map<PtyMode,Integer> |
resolveShellTtyOptions(Map<PtyMode,Integer> modes) |
public static final String REQUEST_SUFFIX
public static final PuttyRequestHandler INSTANCE
public RequestHandler.Result process(Channel channel, String request, boolean wantReply, Buffer buffer) throws Exception
RequestHandler
channel
- The input parameterrequest
- The request stringwantReply
- Whether a reply is requestedbuffer
- The Buffer
with request specific dataRequestHandler.Result
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, String request, String opcode, boolean wantReply, Buffer buffer) throws Exception
Exception
public static boolean isPuttyRequest(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 sessionSession.getClientVersion()
,
isPuttyClient(String)
public static boolean isPuttyClient(String clientVersion)
clientVersion
- The client identification string - ignored if null
/emptytrue
if the identification starts with the Session.DEFAULT_SSH_VERSION_PREFIX
and it contains the "putty" string (case insensitive)Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.