001    /*
002     * Copyright 2003-2004 The Apache Software Foundation
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.apache.commons.net.telnet;
017    
018    /***
019     * Implements the telnet echo option RFC 857.
020     * <p>
021     * @author Bruno D'Avanzo
022     ***/
023    public class EchoOptionHandler extends TelnetOptionHandler
024    {
025        /***
026         * Constructor for the EchoOptionHandler. Allows defining desired
027         * initial setting for local/remote activation of this option and
028         * behaviour in case a local/remote activation request for this
029         * option is received.
030         * <p>
031         * @param initlocal - if set to true, a WILL is sent upon connection.
032         * @param initremote - if set to true, a DO is sent upon connection.
033         * @param acceptlocal - if set to true, any DO request is accepted.
034         * @param acceptremote - if set to true, any WILL request is accepted.
035         ***/
036        public EchoOptionHandler(boolean initlocal, boolean initremote,
037                                    boolean acceptlocal, boolean acceptremote)
038        {
039            super(TelnetOption.ECHO, initlocal, initremote,
040                                          acceptlocal, acceptremote);
041        }
042    
043        /***
044         * Constructor for the EchoOptionHandler. Initial and accept
045         * behaviour flags are set to false
046         ***/
047        public EchoOptionHandler()
048        {
049            super(TelnetOption.ECHO, false, false, false, false);
050        }
051    
052        /***
053         * Implements the abstract method of TelnetOptionHandler.
054         * <p>
055         * @param suboptionData - the sequence received, whithout IAC SB & IAC SE
056         * @param suboptionLength - the length of data in suboption_data
057         * <p>
058         * @return always null (no response to subnegotiation)
059         ***/
060        public int[] answerSubnegotiation(int suboptionData[],
061                                            int suboptionLength)
062        {
063            return null;
064        }
065    
066        /***
067         * Implements the abstract method of TelnetOptionHandler.
068         * <p>
069         * @return always null (no response to subnegotiation)
070         ***/
071        public int[] startSubnegotiationLocal()
072        {
073            return null;
074        }
075    
076        /***
077         * Implements the abstract method of TelnetOptionHandler.
078         * <p>
079         * @return always null (no response to subnegotiation)
080         ***/
081        public int[] startSubnegotiationRemote()
082        {
083            return null;
084        }
085    }