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