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. * The TelnetNotificationHandler interface can be used to handle
  19. * notification of options negotiation commands received on a telnet
  20. * session.
  21. * <p>
  22. * The user can implement this interface and register a
  23. * TelnetNotificationHandler by using the registerNotificationHandler()
  24. * of TelnetClient to be notified of option negotiation commands.
  25. * <p>
  26. * <p>
  27. * @author Bruno D'Avanzo
  28. ***/
  29. public interface TelnetNotificationHandler
  30. {
  31. /***
  32. * The remote party sent a DO command.
  33. ***/
  34. public static final int RECEIVED_DO = 1;
  35. /***
  36. * The remote party sent a DONT command.
  37. ***/
  38. public static final int RECEIVED_DONT = 2;
  39. /***
  40. * The remote party sent a WILL command.
  41. ***/
  42. public static final int RECEIVED_WILL = 3;
  43. /***
  44. * The remote party sent a WONT command.
  45. ***/
  46. public static final int RECEIVED_WONT = 4;
  47. /***
  48. * Callback method called when TelnetClient receives an option
  49. * negotiation command.
  50. * <p>
  51. * @param negotiation_code - type of negotiation command received
  52. * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
  53. * <p>
  54. * @param option_code - code of the option negotiated
  55. * <p>
  56. ***/
  57. public void receivedNegotiation(int negotiation_code, int option_code);
  58. }