|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.schmizz.sshj.AbstractService
net.schmizz.sshj.connection.ConnectionImpl
public class ConnectionImpl
Connection implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.schmizz.sshj.common.ErrorNotifiable |
|---|
ErrorNotifiable.Util |
| Field Summary |
|---|
| Fields inherited from class net.schmizz.sshj.AbstractService |
|---|
log, name, timeout, trans |
| Constructor Summary | |
|---|---|
ConnectionImpl(Transport trans)
Create with an associated Transport. |
|
| 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()
|
Transport |
getTransport()
|
int |
getWindowSize()
|
void |
handle(Message msg,
SSHPacket buf)
Delegate handling of some SSH packet to this object. |
void |
join()
Wait for the situation that no channels are attached (e.g., got closed). |
int |
nextID()
|
void |
notifyError(SSHException error)
Notifies this object of an error. |
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 |
setWindowSize(int windowSize)
Set the size for the local window this connection recommends to any Channel's that ask for it. |
| Methods inherited from class net.schmizz.sshj.AbstractService |
|---|
getName, getTimeout, notifyUnimplemented, request, setTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.schmizz.sshj.connection.Connection |
|---|
getTimeout, setTimeout |
| Constructor Detail |
|---|
public ConnectionImpl(Transport trans)
Transport.
trans - transport layer| Method Detail |
|---|
public void attach(Channel chan)
ConnectionChannel to this connection. A channel must be attached to the connection if it is to receive any
channel-specific data that is received.
attach in interface Connectionchan - the channelpublic Channel get(int id)
get in interface Connectionid - number of the channel to retrieve
Channel of specified channel number, or null if no such channel was attachedpublic ForwardedChannelOpener get(String chanType)
get in interface ConnectionchanType - channel type
ForwardedChannelOpener of specified channel-type, or null if no such channel
was attachedpublic void forget(Channel chan)
ConnectionChannel.
forget in interface Connectionchan - the channelpublic void forget(ForwardedChannelOpener opener)
ConnectionForwardedChannelOpener.
forget in interface Connectionopener - the opener to forgetpublic void attach(ForwardedChannelOpener opener)
ConnectionForwardedChannelOpener to this connection, which will be delegated opening of any CHANNEL_OPEN packets for which it is responsible.
attach in interface Connectionopener - an opener for forwarded channels
public void handle(Message msg,
SSHPacket buf)
throws SSHException
SSHPacketHandler
handle in interface SSHPacketHandlerhandle in class AbstractServicemsg - the SSH message identifierbuf - SSHPacket containing rest of the request
SSHException - if there is a non-recoverable errorpublic int getMaxPacketSize()
getMaxPacketSize in interface ConnectionChannel's that ask
for it.public Transport getTransport()
getTransport in interface ConnectionTransport.public void setMaxPacketSize(int maxPacketSize)
ConnectionChannel's that ask for
it.
setMaxPacketSize in interface ConnectionmaxPacketSize - maximum packet size in bytespublic int getWindowSize()
getWindowSize in interface ConnectionChannel's that ask for it.public void setWindowSize(int windowSize)
ConnectionChannel's that ask for it.
setWindowSize in interface ConnectionwindowSize - window size in bytes
public void join()
throws InterruptedException
Connection
join in interface ConnectionInterruptedException - if the thread is interruptedpublic int nextID()
nextID in interface ConnectionChannel can rightfully claim.
public Promise<SSHPacket,ConnectionException> sendGlobalRequest(String name,
boolean wantReply,
byte[] specifics)
throws TransportException
Connection
sendGlobalRequest in interface Connectionname - 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
public void sendOpenFailure(int recipient,
OpenFailException.Reason reason,
String message)
throws TransportException
ConnectionSSH_MSG_OPEN_FAILURE for specified Reason and message.
sendOpenFailure in interface Connectionrecipient - number of the recipient channelreason - a reason for the failuremessage - an explanatory message
TransportException - if there is a transport-layer errorpublic void notifyError(SSHException error)
ErrorNotifiableerror.
notifyError in interface ErrorNotifiablenotifyError in class AbstractService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||