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: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.pageflow;
20:
21: /**
22: * Enumeration to represent secure/unsecure/unspecified values associated with paths in the webapp.
23: */
24: public class SecurityProtocol {
25: protected static final int INT_SECURE = 0;
26: protected static final int INT_UNSECURE = 1;
27: protected static final int INT_UNSPECIFIED = 2;
28:
29: public static final SecurityProtocol SECURE = new SecurityProtocol(
30: INT_SECURE);
31: public static final SecurityProtocol UNSECURE = new SecurityProtocol(
32: INT_UNSECURE);
33: public static final SecurityProtocol UNSPECIFIED = new SecurityProtocol(
34: INT_UNSPECIFIED);
35:
36: private int _val;
37:
38: private SecurityProtocol(int val) {
39: _val = val;
40: }
41:
42: public String toString() {
43: switch (_val) {
44: case INT_SECURE:
45: return "secure";
46: case INT_UNSECURE:
47: return "unsecure";
48: case INT_UNSPECIFIED:
49: return "unspecified";
50: }
51:
52: assert false : _val;
53: return "<unknown Modifier>";
54: }
55:
56: public boolean equals(Object o) {
57: if (o == null)
58: return false;
59: if (o == this )
60: return true;
61: if (!(o instanceof SecurityProtocol))
62: return false;
63: return ((SecurityProtocol) o)._val == _val;
64: }
65:
66: public int hashCode() {
67: return _val;
68: }
69: }
|