01: /*
02: * Copyright 2003-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
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: * The remote party sent a DO command.
34: ***/
35: public static final int RECEIVED_DO = 1;
36:
37: /***
38: * The remote party sent a DONT command.
39: ***/
40: public static final int RECEIVED_DONT = 2;
41:
42: /***
43: * The remote party sent a WILL command.
44: ***/
45: public static final int RECEIVED_WILL = 3;
46:
47: /***
48: * The remote party sent a WONT command.
49: ***/
50: public static final int RECEIVED_WONT = 4;
51:
52: /***
53: * Callback method called when TelnetClient receives an option
54: * negotiation command.
55: * <p>
56: * @param negotiation_code - type of negotiation command received
57: * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
58: * <p>
59: * @param option_code - code of the option negotiated
60: * <p>
61: ***/
62: public void receivedNegotiation(int negotiation_code,
63: int option_code);
64: }
|