Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/channel/ServerSessionImpl.java @ 273:91a31873c42a ganymed
start conversion from trilead to ganymed
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 18 Jul 2014 11:21:46 -0700 |
parents | |
children | 071eccdff8ea |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ch/ethz/ssh2/channel/ServerSessionImpl.java Fri Jul 18 11:21:46 2014 -0700 @@ -0,0 +1,61 @@ + +package ch.ethz.ssh2.channel; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import ch.ethz.ssh2.ServerSession; +import ch.ethz.ssh2.ServerSessionCallback; + +public class ServerSessionImpl implements ServerSession +{ + Channel c; + public ServerSessionCallback sscb; + + public ServerSessionImpl(Channel c) + { + this.c = c; + } + + public int getState() + { + return c.getState(); + } + + public InputStream getStdout() + { + return c.getStdoutStream(); + } + + public InputStream getStderr() + { + return c.getStderrStream(); + } + + public OutputStream getStdin() + { + return c.getStdinStream(); + } + + public void close() + { + try + { + c.cm.closeChannel(c, "Closed due to server request", true); + } + catch (IOException ignored) + { + } + } + + public synchronized ServerSessionCallback getServerSessionCallback() + { + return sscb; + } + + public synchronized void setServerSessionCallback(ServerSessionCallback sscb) + { + this.sscb = sscb; + } +}