This commit is contained in:
Shikhar Bhushan
2010-03-07 20:34:56 +01:00
parent 492a187d2f
commit bd4ebed6a5

View File

@@ -30,7 +30,7 @@ public interface Connection {
* Attach a {@link Channel} to this connection. A channel must be attached to the connection if it is to receive any * Attach a {@link Channel} to this connection. A channel must be attached to the connection if it is to receive any
* channel-specific data that is received. * channel-specific data that is received.
* *
* @param chan * @param chan the channel
*/ */
void attach(Channel chan); void attach(Channel chan);
@@ -38,35 +38,35 @@ public interface Connection {
* Attach a {@link ForwardedChannelOpener} to this connection, which will be delegated opening of any {@code * Attach a {@link ForwardedChannelOpener} to this connection, which will be delegated opening of any {@code
* CHANNEL_OPEN} packets {@link ForwardedChannelOpener#getChannelType() for which it is responsible}. * CHANNEL_OPEN} packets {@link ForwardedChannelOpener#getChannelType() for which it is responsible}.
* *
* @param opener * @param opener an opener for forwarded channels
*/ */
void attach(ForwardedChannelOpener opener); void attach(ForwardedChannelOpener opener);
/** /**
* Forget an attached {@link Channel}. * Forget an attached {@link Channel}.
* *
* @param chan * @param chan the channel
*/ */
void forget(Channel chan); void forget(Channel chan);
/** /**
* Forget an attached {@link ForwardedChannelOpener}. * Forget an attached {@link ForwardedChannelOpener}.
* *
* @param handler * @param opener the opener to forget
*/ */
void forget(ForwardedChannelOpener handler); void forget(ForwardedChannelOpener opener);
/** /**
* Returns an attached {@link Channel} of specified channel-id, or {@code null} if no such channel was attached * @param id number of the channel to retrieve
* *
* @param id * @return an attached {@link Channel} of specified channel number, or {@code null} if no such channel was attached
*/ */
Channel get(int id); Channel get(int id);
/** /**
* Wait for the situation that no channels are attached (e.g., got closed). * Wait for the situation that no channels are attached (e.g., got closed).
* *
* @throws InterruptedException * @throws InterruptedException if the thread is interrupted
*/ */
void join() void join()
throws InterruptedException; throws InterruptedException;
@@ -79,7 +79,7 @@ public interface Connection {
*/ */
ForwardedChannelOpener get(String chanType); ForwardedChannelOpener get(String chanType);
/** Returns an available ID a {@link Channel} can rightfully claim. */ /** @return an available ID a {@link Channel} can rightfully claim. */
int nextID(); int nextID();
/** /**
@@ -101,11 +101,11 @@ public interface Connection {
/** /**
* Send a {@code SSH_MSG_OPEN_FAILURE} for specified {@code Reason} and {@code message}. * Send a {@code SSH_MSG_OPEN_FAILURE} for specified {@code Reason} and {@code message}.
* *
* @param recipient * @param recipient number of the recipient channel
* @param reason * @param reason a reason for the failure
* @param message * @param message an explanatory message
* *
* @throws TransportException * @throws TransportException if there is a transport-layer error
*/ */
void sendOpenFailure(int recipient, OpenFailException.Reason reason, String message) void sendOpenFailure(int recipient, OpenFailException.Reason reason, String message)
throws TransportException; throws TransportException;
@@ -138,15 +138,16 @@ public interface Connection {
Transport getTransport(); Transport getTransport();
/** /**
* @return the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel * @return the {@code timeout} in seconds that this connection uses for blocking operations and recommends to any
* other} {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener classes} that ask for * {@link Channel other} {@link ForwardedChannelOpener classes} that ask for it.
* it.
*/ */
int getTimeout(); int getTimeout();
/** /**
* Set the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel other} * Set the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel other}
* {@link ForwardedChannelOpener classes} that ask for it. * {@link ForwardedChannelOpener classes} that ask for it.
*
* @param timeout timeout in seconds
*/ */
void setTimeout(int timeout); void setTimeout(int timeout);
} }