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 suppress go ahead option RFC 858.
020     * <p>
021     * @author Bruno D'Avanzo
022     ***/
023    public class SuppressGAOptionHandler extends TelnetOptionHandler
024    {
025        /***
026         * Constructor for the SuppressGAOptionHandler. 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 SuppressGAOptionHandler(boolean initlocal, boolean initremote,
037                                    boolean acceptlocal, boolean acceptremote)
038        {
039            super(TelnetOption.SUPPRESS_GO_AHEAD, initlocal, initremote,
040                                          acceptlocal, acceptremote);
041        }
042    
043        /***
044         * Constructor for the SuppressGAOptionHandler. Initial and accept
045         * behaviour flags are set to false
046         ***/
047        public SuppressGAOptionHandler()
048        {
049            super(TelnetOption.SUPPRESS_GO_AHEAD, 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[], int suboptionLength)
061        {
062            return null;
063        }
064    
065        /***
066         * Implements the abstract method of TelnetOptionHandler.
067         * <p>
068         * @return always null (no response to subnegotiation)
069         ***/
070        public int[] startSubnegotiationLocal()
071        {
072            return null;
073        }
074    
075        /***
076         * Implements the abstract method of TelnetOptionHandler.
077         * <p>
078         * @return always null (no response to subnegotiation)
079         ***/
080        public int[] startSubnegotiationRemote()
081        {
082            return null;
083        }
084    }