comparison src/ch/ethz/ssh2/channel/ServerSessionImpl.java @ 342:175c7d68f3c4

merge ganymed into mainline
author Carl Byington <carl@five-ten-sg.com>
date Thu, 31 Jul 2014 16:33:38 -0700
parents 071eccdff8ea
children
comparison
equal deleted inserted replaced
272:ce2f4e397703 342:175c7d68f3c4
1
2 package ch.ethz.ssh2.channel;
3
4 import java.io.IOException;
5 import java.io.InputStream;
6 import java.io.OutputStream;
7
8 import ch.ethz.ssh2.ServerSession;
9 import ch.ethz.ssh2.ServerSessionCallback;
10
11 public class ServerSessionImpl implements ServerSession {
12 Channel c;
13 public ServerSessionCallback sscb;
14
15 public ServerSessionImpl(Channel c) {
16 this.c = c;
17 }
18
19 public int getState() {
20 return c.getState();
21 }
22
23 public InputStream getStdout() {
24 return c.getStdoutStream();
25 }
26
27 public InputStream getStderr() {
28 return c.getStderrStream();
29 }
30
31 public OutputStream getStdin() {
32 return c.getStdinStream();
33 }
34
35 public void close() {
36 try {
37 c.cm.closeChannel(c, "Closed due to server request", true);
38 }
39 catch (IOException ignored) {
40 }
41 }
42
43 public synchronized ServerSessionCallback getServerSessionCallback() {
44 return sscb;
45 }
46
47 public synchronized void setServerSessionCallback(ServerSessionCallback sscb) {
48 this.sscb = sscb;
49 }
50 }