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. * Simple option handler that can be used for options
  19. * that don't require subnegotiation.
  20. * <p>
  21. * @author Bruno D'Avanzo
  22. ***/
  23. public class SimpleOptionHandler extends TelnetOptionHandler
  24. {
  25. /***
  26. * Constructor for the SimpleOptionHandler. Allows defining desired
  27. * initial setting for local/remote activation of this option and
  28. * behaviour in case a local/remote activation request for this
  29. * option is received.
  30. * <p>
  31. * @param optcode - option code.
  32. * @param initlocal - if set to true, a WILL is sent upon connection.
  33. * @param initremote - if set to true, a DO is sent upon connection.
  34. * @param acceptlocal - if set to true, any DO request is accepted.
  35. * @param acceptremote - if set to true, any WILL request is accepted.
  36. ***/
  37. public SimpleOptionHandler(int optcode,
  38. boolean initlocal,
  39. boolean initremote,
  40. boolean acceptlocal,
  41. boolean acceptremote)
  42. {
  43. super(optcode, initlocal, initremote,
  44. acceptlocal, acceptremote);
  45. }
  46. /***
  47. * Constructor for the SimpleOptionHandler. Initial and accept
  48. * behaviour flags are set to false
  49. * <p>
  50. * @param optcode - option code.
  51. ***/
  52. public SimpleOptionHandler(int optcode)
  53. {
  54. super(optcode, false, false, false, false);
  55. }
  56. /***
  57. * Implements the abstract method of TelnetOptionHandler.
  58. * <p>
  59. * @param suboptionData - the sequence received, whithout IAC SB & IAC SE
  60. * @param suboptionLength - the length of data in suboption_data
  61. * <p>
  62. * @return always null (no response to subnegotiation)
  63. ***/
  64. public int[] answerSubnegotiation(int suboptionData[], int suboptionLength)
  65. {
  66. return null;
  67. }
  68. /***
  69. * Implements the abstract method of TelnetOptionHandler.
  70. * <p>
  71. * @return always null (no response to subnegotiation)
  72. ***/
  73. public int[] startSubnegotiationLocal()
  74. {
  75. return null;
  76. }
  77. /***
  78. * Implements the abstract method of TelnetOptionHandler.
  79. * <p>
  80. * @return always null (no response to subnegotiation)
  81. ***/
  82. public int[] startSubnegotiationRemote()
  83. {
  84. return null;
  85. }
  86. }