01: /*
02: * Copyright 2003-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: /***
19: * Simple option handler that can be used for options
20: * that don't require subnegotiation.
21: * <p>
22: * @author Bruno D'Avanzo
23: ***/
24: public class SimpleOptionHandler extends TelnetOptionHandler {
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, boolean initlocal,
38: boolean initremote, boolean acceptlocal,
39: boolean acceptremote) {
40: super (optcode, initlocal, initremote, acceptlocal, acceptremote);
41: }
42:
43: /***
44: * Constructor for the SimpleOptionHandler. Initial and accept
45: * behaviour flags are set to false
46: * <p>
47: * @param optcode - option code.
48: ***/
49: public SimpleOptionHandler(int optcode) {
50: super (optcode, false, false, false, false);
51: }
52:
53: /***
54: * Implements the abstract method of TelnetOptionHandler.
55: * <p>
56: * @param suboptionData - the sequence received, whithout IAC SB & IAC SE
57: * @param suboptionLength - the length of data in suboption_data
58: * <p>
59: * @return always null (no response to subnegotiation)
60: ***/
61: public int[] answerSubnegotiation(int suboptionData[],
62: int suboptionLength) {
63: return null;
64: }
65:
66: /***
67: * Implements the abstract method of TelnetOptionHandler.
68: * <p>
69: * @return always null (no response to subnegotiation)
70: ***/
71: public int[] startSubnegotiationLocal() {
72: return null;
73: }
74:
75: /***
76: * Implements the abstract method of TelnetOptionHandler.
77: * <p>
78: * @return always null (no response to subnegotiation)
79: ***/
80: public int[] startSubnegotiationRemote() {
81: return null;
82: }
83: }
|