comparison 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
comparison
equal deleted inserted replaced
272:ce2f4e397703 273:91a31873c42a
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 {
13 Channel c;
14 public ServerSessionCallback sscb;
15
16 public ServerSessionImpl(Channel c)
17 {
18 this.c = c;
19 }
20
21 public int getState()
22 {
23 return c.getState();
24 }
25
26 public InputStream getStdout()
27 {
28 return c.getStdoutStream();
29 }
30
31 public InputStream getStderr()
32 {
33 return c.getStderrStream();
34 }
35
36 public OutputStream getStdin()
37 {
38 return c.getStdinStream();
39 }
40
41 public void close()
42 {
43 try
44 {
45 c.cm.closeChannel(c, "Closed due to server request", true);
46 }
47 catch (IOException ignored)
48 {
49 }
50 }
51
52 public synchronized ServerSessionCallback getServerSessionCallback()
53 {
54 return sscb;
55 }
56
57 public synchronized void setServerSessionCallback(ServerSessionCallback sscb)
58 {
59 this.sscb = sscb;
60 }
61 }