1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 /***
27 * Constructor for the SimpleOptionHandler. Allows defining desired
28 * initial setting for local/remote activation of this option and
29 * behaviour in case a local/remote activation request for this
30 * option is received.
31 * <p>
32 * @param optcode - option code.
33 * @param initlocal - if set to true, a WILL is sent upon connection.
34 * @param initremote - if set to true, a DO is sent upon connection.
35 * @param acceptlocal - if set to true, any DO request is accepted.
36 * @param acceptremote - if set to true, any WILL request is accepted.
37 ***/
38 public SimpleOptionHandler(int optcode,
39 boolean initlocal,
40 boolean initremote,
41 boolean acceptlocal,
42 boolean acceptremote)
43 {
44 super(optcode, initlocal, initremote,
45 acceptlocal, acceptremote);
46 }
47
48 /***
49 * Constructor for the SimpleOptionHandler. Initial and accept
50 * behaviour flags are set to false
51 * <p>
52 * @param optcode - option code.
53 ***/
54 public SimpleOptionHandler(int optcode)
55 {
56 super(optcode, false, false, false, false);
57 }
58
59 /***
60 * Implements the abstract method of TelnetOptionHandler.
61 * <p>
62 * @param suboptionData - the sequence received, whithout IAC SB & IAC SE
63 * @param suboptionLength - the length of data in suboption_data
64 * <p>
65 * @return always null (no response to subnegotiation)
66 ***/
67 public int[] answerSubnegotiation(int suboptionData[], int suboptionLength)
68 {
69 return null;
70 }
71
72 /***
73 * Implements the abstract method of TelnetOptionHandler.
74 * <p>
75 * @return always null (no response to subnegotiation)
76 ***/
77 public int[] startSubnegotiationLocal()
78 {
79 return null;
80 }
81
82 /***
83 * Implements the abstract method of TelnetOptionHandler.
84 * <p>
85 * @return always null (no response to subnegotiation)
86 ***/
87 public int[] startSubnegotiationRemote()
88 {
89 return null;
90 }
91 }