View Javadoc

1   /*
2    * Copyright 2003-2004 The Apache Software Foundation
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
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      /***
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  }