Top Description Fields Constructors Methods
org.apache.sshd.server.channel

public Class PuttyRequestHandler

extends AbstractChannelRequestHandler
Class Inheritance
Imports
java.util.Collections, .EnumSet, .Map, .Set, org.apache.sshd.common.channel.AbstractChannelRequestHandler, .Channel, .PtyMode, org.apache.sshd.common.session.Session, .SessionContext, org.apache.sshd.common.util.GenericUtils, .MapEntryUtils, org.apache.sshd.common.util.buffer.Buffer

Handles Putty specific channel requests as indicated by Appendix F: SSH-2 names specified for PuTTY

Field Summary

Modifier and TypeField and Description
public static final PuttyRequestHandler
public static final Set<PtyMode>
public static final String
REQUEST_SUFFIX

Suffix of all PUTTY related channel requests

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if it is a PUTTY session
isPuttyClient
(Session
The current Session - ignored if null
session
)

public static boolean

Returns:

true if the identification starts with the SessionContext#DEFAULT_SSH_VERSION_PREFIX and it contains the "putty" string (case insensitive)
isPuttyClient
(String
The client identification string - ignored if null/empty
clientVersion
)

public static boolean

Returns:

true if the request ends in REQUEST_SUFFIX
isPuttyRequest
(String
The channel request value - ignored if null/empty
request
)

public RequestHandler.Result
process(Channel
The input parameter
channel
,
String
The request string
request
,
boolean
Whether a reply is requested
wantReply
,
Buffer
The Buffer with request specific data
buffer
)

Implements org.apache.sshd.common.channel.ChannelRequestHandler.process, org.apache.sshd.common.channel.RequestHandler.process.

Process an SSH request.

protected RequestHandler.Result
processPuttyOpcode(Channel channel, String request, String opcode, boolean wantReply, Buffer buffer)

public static Map<PtyMode, Integer>

Field Detail

INSTANCEback to summary
public static final PuttyRequestHandler INSTANCE
PUTTY_OPTIONSback to summary
public static final Set<PtyMode> PUTTY_OPTIONS
REQUEST_SUFFIXback to summary
public static final String REQUEST_SUFFIX

Suffix of all PUTTY related channel requests

Constructor Detail

PuttyRequestHandlerback to summary
public PuttyRequestHandler()

Method Detail

isPuttyClientback to summary
public static boolean isPuttyClient(Session session)
Parameters
session:Session

The current Session - ignored if null

Returns:boolean

true if it is a PUTTY session

See Also
Session#getClientVersion(), isPuttyClient(String)
isPuttyClientback to summary
public static boolean isPuttyClient(String clientVersion)
Parameters
clientVersion:String

The client identification string - ignored if null/empty

Returns:boolean

true if the identification starts with the SessionContext#DEFAULT_SSH_VERSION_PREFIX and it contains the "putty" string (case insensitive)

isPuttyRequestback to summary
public static boolean isPuttyRequest(String request)
Parameters
request:String

The channel request value - ignored if null/empty

Returns:boolean

true if the request ends in REQUEST_SUFFIX

processback to summary
public RequestHandler.Result process(Channel channel, String request, boolean wantReply, Buffer buffer) throws Exception

Implements org.apache.sshd.common.channel.ChannelRequestHandler.process, org.apache.sshd.common.channel.RequestHandler.process.

Doc from org.apache.sshd.common.channel.RequestHandler.process.

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:Channel

The input parameter

request:String

The request string

wantReply:boolean

Whether a reply is requested

buffer:Buffer

The Buffer with request specific data

Returns:RequestHandler.Result

The Result

Annotations
@Override
Exceptions
Exception:
If failed to handle the request - Note: in order to signal an unsupported request the Result#Unsupported value should be returned
processPuttyOpcodeback to summary
protected RequestHandler.Result processPuttyOpcode(Channel channel, String request, String opcode, boolean wantReply, Buffer buffer) throws Exception
resolveShellTtyOptionsback to summary
public static Map<PtyMode, Integer> resolveShellTtyOptions(Map<PtyMode, Integer> modes)