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   * Implements the telnet echo option RFC 857.
20   * <p>
21   * @author Bruno D'Avanzo
22   ***/
23  public class EchoOptionHandler extends TelnetOptionHandler
24  {
25      /***
26       * Constructor for the EchoOptionHandler. Allows defining desired
27       * initial setting for local/remote activation of this option and
28       * behaviour in case a local/remote activation request for this
29       * option is received.
30       * <p>
31       * @param initlocal - if set to true, a WILL is sent upon connection.
32       * @param initremote - if set to true, a DO is sent upon connection.
33       * @param acceptlocal - if set to true, any DO request is accepted.
34       * @param acceptremote - if set to true, any WILL request is accepted.
35       ***/
36      public EchoOptionHandler(boolean initlocal, boolean initremote,
37                                  boolean acceptlocal, boolean acceptremote)
38      {
39          super(TelnetOption.ECHO, initlocal, initremote,
40                                        acceptlocal, acceptremote);
41      }
42  
43      /***
44       * Constructor for the EchoOptionHandler. Initial and accept
45       * behaviour flags are set to false
46       ***/
47      public EchoOptionHandler()
48      {
49          super(TelnetOption.ECHO, false, false, false, false);
50      }
51  
52      /***
53       * Implements the abstract method of TelnetOptionHandler.
54       * <p>
55       * @param suboptionData - the sequence received, whithout IAC SB & IAC SE
56       * @param suboptionLength - the length of data in suboption_data
57       * <p>
58       * @return always null (no response to subnegotiation)
59       ***/
60      public int[] answerSubnegotiation(int suboptionData[],
61                                          int suboptionLength)
62      {
63          return null;
64      }
65  
66      /***
67       * Implements the abstract method of TelnetOptionHandler.
68       * <p>
69       * @return always null (no response to subnegotiation)
70       ***/
71      public int[] startSubnegotiationLocal()
72      {
73          return null;
74      }
75  
76      /***
77       * Implements the abstract method of TelnetOptionHandler.
78       * <p>
79       * @return always null (no response to subnegotiation)
80       ***/
81      public int[] startSubnegotiationRemote()
82      {
83          return null;
84      }
85  }