01: //========================================================================
02: //Copyright 2006 Mort Bay Consulting Pty. Ltd.
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: //http://www.apache.org/licenses/LICENSE-2.0
08: //Unless required by applicable law or agreed to in writing, software
09: //distributed under the License is distributed on an "AS IS" BASIS,
10: //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11: //See the License for the specific language governing permissions and
12: //limitations under the License.
13: //========================================================================
14:
15: package org.mortbay.jetty.ajp;
16:
17: import org.mortbay.io.BufferCache;
18: import org.mortbay.io.Buffer;
19:
20: /**
21: * XXX Should this implement the Buffer interface?
22: *
23: * @author Markus Kobler
24: */
25: public class Ajp13RequestHeaders extends BufferCache {
26:
27: public final static int MAGIC = 0x1234;
28:
29: public final static String ACCEPT = "accept",
30: ACCEPT_CHARSET = "accept-charset",
31: ACCEPT_ENCODING = "accept-encoding",
32: ACCEPT_LANGUAGE = "accept-language",
33: AUTHORIZATION = "authorization", CONNECTION = "connection",
34: CONTENT_TYPE = "content-type",
35: CONTENT_LENGTH = "content-length", COOKIE = "cookie",
36: COOKIE2 = "cookie2", HOST = "host", PRAGMA = "pragma",
37: REFERER = "referer", USER_AGENT = "user-agent";
38:
39: public final static int ACCEPT_ORDINAL = 1,
40: ACCEPT_CHARSET_ORDINAL = 2, ACCEPT_ENCODING_ORDINAL = 3,
41: ACCEPT_LANGUAGE_ORDINAL = 4, AUTHORIZATION_ORDINAL = 5,
42: CONNECTION_ORDINAL = 6, CONTENT_TYPE_ORDINAL = 7,
43: CONTENT_LENGTH_ORDINAL = 8, COOKIE_ORDINAL = 9,
44: COOKIE2_ORDINAL = 10, HOST_ORDINAL = 11,
45: PRAGMA_ORDINAL = 12, REFERER_ORDINAL = 13,
46: USER_AGENT_ORDINAL = 14;
47:
48: public final static BufferCache CACHE = new BufferCache();
49:
50: public final static Buffer ACCEPT_BUFFER = CACHE.add(ACCEPT,
51: ACCEPT_ORDINAL), ACCEPT_CHARSET_BUFFER = CACHE.add(
52: ACCEPT_CHARSET, ACCEPT_CHARSET_ORDINAL),
53: ACCEPT_ENCODING_BUFFER = CACHE.add(ACCEPT_ENCODING,
54: ACCEPT_ENCODING_ORDINAL),
55: ACCEPT_LANGUAGE_BUFFER = CACHE.add(ACCEPT_LANGUAGE,
56: ACCEPT_LANGUAGE_ORDINAL),
57: AUTHORIZATION_BUFFER = CACHE.add(AUTHORIZATION,
58: AUTHORIZATION_ORDINAL), CONNECTION_BUFFER = CACHE
59: .add(CONNECTION, CONNECTION_ORDINAL),
60: CONTENT_TYPE_BUFFER = CACHE.add(CONTENT_TYPE,
61: CONTENT_TYPE_ORDINAL),
62: CONTENT_LENGTH_BUFFER = CACHE.add(CONTENT_LENGTH,
63: CONTENT_LENGTH_ORDINAL), COOKIE_BUFFER = CACHE.add(
64: COOKIE, COOKIE_ORDINAL), COOKIE2_BUFFER = CACHE
65: .add(COOKIE2, COOKIE2_ORDINAL), HOST_BUFFER = CACHE
66: .add(HOST, HOST_ORDINAL), PRAGMA_BUFFER = CACHE
67: .add(PRAGMA, PRAGMA_ORDINAL),
68: REFERER_BUFFER = CACHE.add(REFERER, REFERER_ORDINAL),
69: USER_AGENT_BUFFER = CACHE.add(USER_AGENT,
70: USER_AGENT_ORDINAL);
71:
72: public final static byte CONTEXT_ATTR = 1, // Legacy
73: SERVLET_PATH_ATTR = 2, // Legacy
74: REMOTE_USER_ATTR = 3,
75: AUTH_TYPE_ATTR = 4,
76: QUERY_STRING_ATTR = 5,
77: JVM_ROUTE_ATTR = 6,
78: SSL_CERT_ATTR = 7,
79: SSL_CIPHER_ATTR = 8,
80: SSL_SESSION_ATTR = 9,
81: REQUEST_ATTR = 10,
82: SSL_KEYSIZE_ATTR = 11,
83: SECRET_ATTR = 12,
84: STORED_METHOD_ATTR = 13;
85:
86: }
|