|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Connection
Connection layer of the SSH protocol. Refer to RFC 254.
| Method Summary | |
|---|---|
void |
attach(Channel chan)
Attach a Channel to this connection. |
void |
attach(ForwardedChannelOpener opener)
Attach a ForwardedChannelOpener to this connection, which will be delegated opening of any CHANNEL_OPEN packets for which it is responsible. |
void |
forget(Channel chan)
Forget an attached Channel. |
void |
forget(ForwardedChannelOpener opener)
Forget an attached ForwardedChannelOpener. |
Channel |
get(int id)
|
ForwardedChannelOpener |
get(String chanType)
|
int |
getMaxPacketSize()
|
int |
getTimeout()
|
Transport |
getTransport()
|
int |
getWindowSize()
|
void |
join()
Wait for the situation that no channels are attached (e.g., got closed). |
int |
nextID()
|
Promise<SSHPacket,ConnectionException> |
sendGlobalRequest(String name,
boolean wantReply,
byte[] specifics)
Send an SSH global request. |
void |
sendOpenFailure(int recipient,
OpenFailException.Reason reason,
String message)
Send a SSH_MSG_OPEN_FAILURE for specified Reason and message. |
void |
setMaxPacketSize(int maxPacketSize)
Set the maximum packet size for the local window this connection recommends to any Channel's that ask for
it. |
void |
setTimeout(int timeout)
Set the timeout this connection uses for blocking operations and recommends to any other
classes that ask for it. |
void |
setWindowSize(int windowSize)
Set the size for the local window this connection recommends to any Channel's that ask for it. |
| Method Detail |
|---|
void attach(Channel chan)
Channel to this connection. A channel must be attached to the connection if it is to receive any
channel-specific data that is received.
chan - the channelvoid attach(ForwardedChannelOpener opener)
ForwardedChannelOpener to this connection, which will be delegated opening of any CHANNEL_OPEN packets for which it is responsible.
opener - an opener for forwarded channelsvoid forget(Channel chan)
Channel.
chan - the channelvoid forget(ForwardedChannelOpener opener)
ForwardedChannelOpener.
opener - the opener to forgetChannel get(int id)
id - number of the channel to retrieve
Channel of specified channel number, or null if no such channel was attached
void join()
throws InterruptedException
InterruptedException - if the thread is interruptedForwardedChannelOpener get(String chanType)
chanType - channel type
ForwardedChannelOpener of specified channel-type, or null if no such channel
was attachedint nextID()
Channel can rightfully claim.
Promise<SSHPacket,ConnectionException> sendGlobalRequest(String name,
boolean wantReply,
byte[] specifics)
throws TransportException
name - request namewantReply - whether a reply is requestedspecifics - SSHPacket containing fields specific to the request
Promise for the reply data (in case wantReply is true) which allows waiting on the
reply, or null if a reply is not requested.
TransportException - if there is an error sending the request
void sendOpenFailure(int recipient,
OpenFailException.Reason reason,
String message)
throws TransportException
SSH_MSG_OPEN_FAILURE for specified Reason and message.
recipient - number of the recipient channelreason - a reason for the failuremessage - an explanatory message
TransportException - if there is a transport-layer errorint getMaxPacketSize()
Channel's that ask
for it.void setMaxPacketSize(int maxPacketSize)
Channel's that ask for
it.
maxPacketSize - maximum packet size in bytesint getWindowSize()
Channel's that ask for it.void setWindowSize(int windowSize)
Channel's that ask for it.
windowSize - window size in bytesTransport getTransport()
Transport.int getTimeout()
timeout in seconds that this connection uses for blocking operations and recommends to any
other classes that ask for it.void setTimeout(int timeout)
timeout this connection uses for blocking operations and recommends to any other
classes that ask for it.
timeout - timeout in seconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||