01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.openejb.server.telnet;
17:
18: class TelnetOption {
19:
20: protected int optionCode;
21:
22: protected boolean supported;
23:
24: protected boolean enabled;
25:
26: protected boolean negotiated;
27:
28: protected boolean inNegotiation;
29:
30: public TelnetOption(int optionCode) {
31: this .optionCode = optionCode;
32: }
33:
34: public int getOptionId() {
35: return optionCode;
36: }
37:
38: public boolean isEnabled() {
39: return enabled;
40: }
41:
42: public void enable() {
43: enabled = true;
44: negotiated = true;
45: }
46:
47: public void disable() {
48: enabled = false;
49: negotiated = true;
50: }
51:
52: public boolean isSupported() {
53: return supported;
54: }
55:
56: public boolean hasBeenNegotiated() {
57: return negotiated;
58: }
59:
60: public boolean isInNegotiation() {
61: return inNegotiation;
62: }
63:
64: public void hasBeenNegotiated(boolean negotiated) {
65: this .negotiated = negotiated;
66: this .inNegotiation = false;
67: }
68: }
|