From b90be512e7717ef467eeb3296d37b15d2c3f70ea Mon Sep 17 00:00:00 2001 From: Jeroen van Erp Date: Fri, 2 Sep 2016 16:08:26 +0200 Subject: [PATCH] REformatted --- .../sshj/connection/channel/Channel.java | 93 ++++++++++++------- 1 file changed, 57 insertions(+), 36 deletions(-) diff --git a/src/main/java/net/schmizz/sshj/connection/channel/Channel.java b/src/main/java/net/schmizz/sshj/connection/channel/Channel.java index 4ad9f975..3d76f9a4 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/Channel.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/Channel.java @@ -26,13 +26,15 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.concurrent.TimeUnit; -/** A channel is the basic medium for application-layer data on top of an SSH transport. */ -public interface Channel - extends Closeable, SSHPacketHandler, ErrorNotifiable { +/** + * A channel is the basic medium for application-layer data on top of an SSH transport. + */ +public interface Channel extends Closeable, SSHPacketHandler, ErrorNotifiable { - /** Direct channels are those that are initiated by us. */ - interface Direct - extends Channel { + /** + * Direct channels are those that are initiated by us. + */ + interface Direct extends Channel { /** * Request opening this channel from remote end. @@ -41,27 +43,30 @@ public interface Channel * @throws ConnectionException other connection-layer error * @throws TransportException error writing packets etc. */ - void open() - throws ConnectionException, TransportException; + void open() throws ConnectionException, TransportException; } - /** Forwarded channels are those that are initiated by the server. */ - interface Forwarded - extends Channel { + /** + * Forwarded channels are those that are initiated by the server. + */ + interface Forwarded extends Channel { /** * Confirm {@code CHANNEL_OPEN} request. * * @throws TransportException error sending confirmation packet */ - void confirm() - throws TransportException; + void confirm() throws TransportException; - /** @return the IP of where the forwarded connection originates. */ + /** + * @return the IP of where the forwarded connection originates. + */ String getOriginatorIP(); - /** @return port from which the forwarded connection originates. */ + /** + * @return port from which the forwarded connection originates. + */ int getOriginatorPort(); /** @@ -69,55 +74,73 @@ public interface Channel * * @param reason indicate {@link OpenFailException.Reason reason} for rejection of the request * @param message indicate a message for why the request is rejected - * * @throws TransportException error sending rejection packet */ - void reject(OpenFailException.Reason reason, String message) - throws TransportException; + void reject(OpenFailException.Reason reason, String message) throws TransportException; } - /** Close this channel. */ + /** + * Close this channel. + */ @Override - void close() - throws TransportException, ConnectionException; + void close() throws TransportException, ConnectionException; /** * @return whether auto-expansion of local window is set. - * * @see #setAutoExpand(boolean) */ boolean getAutoExpand(); - /** @return the channel ID */ + /** + * @return the channel ID + */ int getID(); - /** @return the {@code InputStream} for this channel. */ + /** + * @return the {@code InputStream} for this channel. + */ InputStream getInputStream(); - /** @return the maximum packet size that we have specified. */ + /** + * @return the maximum packet size that we have specified. + */ int getLocalMaxPacketSize(); - /** @return the current local window size. */ + /** + * @return the current local window size. + */ long getLocalWinSize(); - /** @return an {@code OutputStream} for this channel. */ + /** + * @return an {@code OutputStream} for this channel. + */ OutputStream getOutputStream(); - /** @return the channel ID at the remote end. */ + /** + * @return the channel ID at the remote end. + */ int getRecipient(); - /** @return the maximum packet size as specified by the remote end. */ + /** + * @return the maximum packet size as specified by the remote end. + */ int getRemoteMaxPacketSize(); - /** @return the current remote window size. */ + /** + * @return the current remote window size. + */ long getRemoteWinSize(); - /** @return the channel type identifier. */ + /** + * @return the channel type identifier. + */ String getType(); - /** @return whether the channel is open. */ + /** + * @return whether the channel is open. + */ boolean isOpen(); /** @@ -129,11 +152,9 @@ public interface Channel */ void setAutoExpand(boolean autoExpand); - void join() - throws ConnectionException; + void join() throws ConnectionException; - void join(long timeout, TimeUnit unit) - throws ConnectionException; + void join(long timeout, TimeUnit unit) throws ConnectionException; /** * Get the LoggerFactory associated with the SSH client.