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     * The TelnetNotificationHandler interface can be used to handle
022     * notification of options negotiation commands received on a telnet
023     * session.
024     * <p>
025     * The user can implement this interface and register a
026     * TelnetNotificationHandler by using the registerNotificationHandler()
027     * of TelnetClient to be notified of option negotiation commands.
028     * <p>
029     * <p>
030     * @author Bruno D'Avanzo
031     ***/
032    
033    public interface TelnetNotificationHandler
034    {
035        /***
036         * The remote party sent a DO command.
037         ***/
038        public static final int RECEIVED_DO =   1;
039    
040        /***
041         * The remote party sent a DONT command.
042         ***/
043        public static final int RECEIVED_DONT = 2;
044    
045        /***
046         * The remote party sent a WILL command.
047         ***/
048        public static final int RECEIVED_WILL = 3;
049    
050        /***
051         * The remote party sent a WONT command.
052         ***/
053        public static final int RECEIVED_WONT = 4;
054    
055        /***
056         * Callback method called when TelnetClient receives an option
057         * negotiation command.
058         * <p>
059         * @param negotiation_code - type of negotiation command received
060         * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
061         * <p>
062         * @param option_code - code of the option negotiated
063         * <p>
064         ***/
065        public void receivedNegotiation(int negotiation_code, int option_code);
066    }