1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.telnet;
17
18 /***
19 * The TelnetNotificationHandler interface can be used to handle
20 * notification of options negotiation commands received on a telnet
21 * session.
22 * <p>
23 * The user can implement this interface and register a
24 * TelnetNotificationHandler by using the registerNotificationHandler()
25 * of TelnetClient to be notified of option negotiation commands.
26 * <p>
27 * <p>
28 * @author Bruno D'Avanzo
29 ***/
30
31 public interface TelnetNotificationHandler
32 {
33 /***
34 * The remote party sent a DO command.
35 ***/
36 public static final int RECEIVED_DO = 1;
37
38 /***
39 * The remote party sent a DONT command.
40 ***/
41 public static final int RECEIVED_DONT = 2;
42
43 /***
44 * The remote party sent a WILL command.
45 ***/
46 public static final int RECEIVED_WILL = 3;
47
48 /***
49 * The remote party sent a WONT command.
50 ***/
51 public static final int RECEIVED_WONT = 4;
52
53 /***
54 * Callback method called when TelnetClient receives an option
55 * negotiation command.
56 * <p>
57 * @param negotiation_code - type of negotiation command received
58 * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
59 * <p>
60 * @param option_code - code of the option negotiated
61 * <p>
62 ***/
63 public void receivedNegotiation(int negotiation_code, int option_code);
64 }