01: package ch.ethz.ssh2;
02:
03: /**
04: * Contains constants that can be used to specify what conditions to wait for on
05: * a SSH-2 channel (e.g., represented by a {@link Session}).
06: *
07: * @see Session#waitForCondition(int, long)
08: *
09: * @author Christian Plattner, plattner@inf.ethz.ch
10: * @version $Id: ChannelCondition.java,v 1.6 2006/08/11 12:24:00 cplattne Exp $
11: */
12:
13: public abstract interface ChannelCondition {
14: /**
15: * A timeout has occurred, none of your requested conditions is fulfilled.
16: * However, other conditions may be true - therefore, NEVER use the "=="
17: * operator to test for this (or any other) condition. Always use
18: * something like <code>((cond & ChannelCondition.CLOSED) != 0)</code>.
19: */
20: public static final int TIMEOUT = 1;
21:
22: /**
23: * The underlying SSH-2 channel, however not necessarily the whole connection,
24: * has been closed. This implies <code>EOF</code>. Note that there may still
25: * be unread stdout or stderr data in the local window, i.e, <code>STDOUT_DATA</code>
26: * or/and <code>STDERR_DATA</code> may be set at the same time.
27: */
28: public static final int CLOSED = 2;
29:
30: /**
31: * There is stdout data available that is ready to be consumed.
32: */
33: public static final int STDOUT_DATA = 4;
34:
35: /**
36: * There is stderr data available that is ready to be consumed.
37: */
38: public static final int STDERR_DATA = 8;
39:
40: /**
41: * EOF on has been reached, no more _new_ stdout or stderr data will arrive
42: * from the remote server. However, there may be unread stdout or stderr
43: * data, i.e, <code>STDOUT_DATA</code> or/and <code>STDERR_DATA</code>
44: * may be set at the same time.
45: */
46: public static final int EOF = 16;
47:
48: /**
49: * The exit status of the remote process is available.
50: * Some servers never send the exist status, or occasionally "forget" to do so.
51: */
52: public static final int EXIT_STATUS = 32;
53:
54: /**
55: * The exit signal of the remote process is available.
56: */
57: public static final int EXIT_SIGNAL = 64;
58:
59: }
|