1 16 package org.apache.commons.net.telnet; 17 18 28 public abstract class TelnetOptionHandler 29 { 30 33 private int optionCode = -1; 34 35 38 private boolean initialLocal = false; 39 40 43 private boolean initialRemote = false; 44 45 48 private boolean acceptLocal = false; 49 50 53 private boolean acceptRemote = false; 54 55 58 private boolean doFlag = false; 59 60 63 private boolean willFlag = false; 64 65 77 public TelnetOptionHandler(int optcode, 78 boolean initlocal, 79 boolean initremote, 80 boolean acceptlocal, 81 boolean acceptremote) 82 { 83 optionCode = optcode; 84 initialLocal = initlocal; 85 initialRemote = initremote; 86 acceptLocal = acceptlocal; 87 acceptRemote = acceptremote; 88 } 89 90 91 96 public int getOptionCode() 97 { 98 return (optionCode); 99 } 100 101 107 public boolean getAcceptLocal() 108 { 109 return (acceptLocal); 110 } 111 112 118 public boolean getAcceptRemote() 119 { 120 return (acceptRemote); 121 } 122 123 129 public void setAcceptLocal(boolean accept) 130 { 131 acceptLocal = accept; 132 } 133 134 140 public void setAcceptRemote(boolean accept) 141 { 142 acceptRemote = accept; 143 } 144 145 151 public boolean getInitLocal() 152 { 153 return (initialLocal); 154 } 155 156 162 public boolean getInitRemote() 163 { 164 return (initialRemote); 165 } 166 167 173 public void setInitLocal(boolean init) 174 { 175 initialLocal = init; 176 } 177 178 184 public void setInitRemote(boolean init) 185 { 186 initialRemote = init; 187 } 188 189 201 public abstract int[] answerSubnegotiation(int suboptionData[], 202 int suboptionLength); 203 204 213 public abstract int[] startSubnegotiationLocal(); 214 215 224 public abstract int[] startSubnegotiationRemote(); 225 226 232 boolean getWill() 233 { 234 return willFlag; 235 } 236 237 243 void setWill(boolean state) 244 { 245 willFlag = state; 246 } 247 248 254 boolean getDo() 255 { 256 return doFlag; 257 } 258 259 260 266 void setDo(boolean state) 267 { 268 doFlag = state; 269 } 270 } 271 | Popular Tags |