annotate src/org/eclipse/jetty/server/Request.java @ 1067:56b515be91e1

fix use of HttpGenerator._reason
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 10 Nov 2016 00:08:39 -0700
parents eca26899c4bc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 // ========================================================================
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 // Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 // ------------------------------------------------------------------------
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 // All rights reserved. This program and the accompanying materials
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 // are made available under the terms of the Eclipse Public License v1.0
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 // and Apache License v2.0 which accompanies this distribution.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 // The Eclipse Public License is available at
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 // http://www.eclipse.org/legal/epl-v10.html
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 // The Apache License v2.0 is available at
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 // http://www.opensource.org/licenses/apache2.0.php
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 // You may elect to redistribute this code under either of these licenses.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 // ========================================================================
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 //
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 package org.eclipse.jetty.server;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 import java.io.BufferedReader;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 import java.io.ByteArrayOutputStream;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 import java.io.File;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 import java.io.IOException;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 import java.io.InputStream;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 import java.io.InputStreamReader;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 import java.io.UnsupportedEncodingException;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
28 import java.net.InetAddress;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 import java.nio.ByteBuffer;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 import java.security.Principal;
855
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
31 import java.text.DateFormat;
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
32 import java.text.SimpleDateFormat;
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
33 import java.util.TimeZone;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34 import java.util.Collection;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
35 import java.util.Collections;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
36 import java.util.Enumeration;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
37 import java.util.EventListener;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38 import java.util.HashMap;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
39 import java.util.Iterator;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
40 import java.util.List;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
41 import java.util.Locale;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
42 import java.util.Map;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
43 import java.util.Map.Entry;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
44
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
45 import javax.servlet.AsyncContext;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
46 import javax.servlet.AsyncEvent;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
47 import javax.servlet.AsyncListener;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
48 import javax.servlet.DispatcherType;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
49 import javax.servlet.RequestDispatcher;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
50 import javax.servlet.ServletContext;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
51 import javax.servlet.ServletException;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
52 import javax.servlet.ServletInputStream;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
53 import javax.servlet.ServletRequest;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
54 import javax.servlet.ServletRequestAttributeEvent;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
55 import javax.servlet.ServletRequestAttributeListener;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
56 import javax.servlet.ServletRequestEvent;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
57 import javax.servlet.ServletRequestListener;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
58 import javax.servlet.ServletResponse;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
59 import javax.servlet.http.Cookie;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
60 import javax.servlet.http.HttpServletRequest;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
61 import javax.servlet.http.HttpServletResponse;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
62 import javax.servlet.http.HttpSession;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
63 import javax.servlet.http.Part;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
64
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
65 import org.eclipse.jetty.http.HttpCookie;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
66 import org.eclipse.jetty.http.HttpFields;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
67 import org.eclipse.jetty.http.HttpHeaders;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
68 import org.eclipse.jetty.http.HttpParser;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
69 import org.eclipse.jetty.http.HttpStatus;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
70 import org.eclipse.jetty.http.HttpURI;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
71 import org.eclipse.jetty.http.HttpVersions;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
72 import org.eclipse.jetty.http.MimeTypes;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
73 import org.eclipse.jetty.io.EndPoint;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
74 import org.eclipse.jetty.server.handler.ContextHandler;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
75 import org.eclipse.jetty.util.Attributes;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
76 import org.eclipse.jetty.util.AttributesMap;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
77 import org.eclipse.jetty.util.IO;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
78 import org.eclipse.jetty.util.LazyList;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
79 import org.eclipse.jetty.util.MultiException;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
80 import org.eclipse.jetty.util.MultiMap;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
81 import org.eclipse.jetty.util.StringUtil;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
82 import org.eclipse.jetty.util.URIUtil;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
83 import org.eclipse.jetty.util.UrlEncoded;
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
84 import org.slf4j.Logger;
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
85 import org.slf4j.LoggerFactory;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
86
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
87 /* ------------------------------------------------------------ */
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
88 /**
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
89 * Jetty Request.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
90 * <p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
91 * Implements {@link javax.servlet.http.HttpServletRequest} from the <code>javax.servlet.http</code> package.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
92 * </p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
93 * <p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
94 * The standard interface of mostly getters, is extended with setters so that the request is mutable by the handlers that it is passed to. This allows the
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
95 * request object to be as lightweight as possible and not actually implement any significant behavior. For example
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
96 * <ul>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
97 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
98 * <li>The {@link Request#getContextPath()} method will return null, until the request has been passed to a {@link ContextHandler} which matches the
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
99 * {@link Request#getPathInfo()} with a context path and calls {@link Request#setContextPath(String)} as a result.</li>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
100 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
101 * <li>The {@link Request#getServletPath()} method will return null until the request has been passed to a <code>org.eclipse.jetty.servlet.ServletHandler</code>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
102 * and the pathInfo matched against the servlet URL patterns and {@link Request#setServletPath(String)} called as a result.</li>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
103 * </ul>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
104 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
105 * A request instance is created for each {@link AbstractHttpConnection} accepted by the server and recycled for each HTTP request received via that connection.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
106 * An effort is made to avoid reparsing headers and cookies that are likely to be the same for requests from the same connection.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
107 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
108 * <p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
109 * The form content that a request can process is limited to protect from Denial of Service attacks. The size in bytes is limited by
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
110 * {@link ContextHandler#getMaxFormContentSize()} or if there is no context then the "org.eclipse.jetty.server.Request.maxFormContentSize" {@link Server}
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
111 * attribute. The number of parameters keys is limited by {@link ContextHandler#getMaxFormKeys()} or if there is no context then the
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
112 * "org.eclipse.jetty.server.Request.maxFormKeys" {@link Server} attribute.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
113 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
114 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
115 */
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
116 public final class Request implements HttpServletRequest
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
117 {
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
118 private static final Logger LOG = LoggerFactory.getLogger(Request.class);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
119
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
120 private static final Collection __defaultLocale = Collections.singleton(Locale.getDefault());
998
bf176925e00f remove Request.getReader()
Franklin Schmidt <fschmidt@gmail.com>
parents: 997
diff changeset
121 private static final int __NONE = 0, _STREAM = 1;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
122
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
123 private volatile Attributes _attributes;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
124 private MultiMap<String> _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
125 private String _characterEncoding;
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
126 protected final AbstractHttpConnection _connection;
994
4e9d373bf6e9 remove ContextHandler.Context
Franklin Schmidt <fschmidt@gmail.com>
parents: 991
diff changeset
127 public ContextHandler _contextHandler = null;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
128 private String _contextPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
129 private CookieCutter _cookies;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
130 private boolean _cookiesExtracted = false;
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
131 private final EndPoint _endp;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
132 private boolean _handled = false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
133 private int _inputState = __NONE;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
134 private String _method;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
135 private MultiMap<String> _parameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
136 private boolean _paramsExtracted;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
137 private String _pathInfo;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
138 private int _port;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
139 private String _protocol = HttpVersions.HTTP_1_1;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
140 private String _queryString;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
141 private String _readerEncoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
142 private String _requestURI;
1013
6939226e0ac4 simplify URIUtil
Franklin Schmidt <fschmidt@gmail.com>
parents: 1001
diff changeset
143 private String _scheme = "http";
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
144 private String _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
145 private long _timeStamp;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
146
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
147 private HttpURI _uri;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
148
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
149 public Request(AbstractHttpConnection connection)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
150 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
151 _connection = connection;
1001
Franklin Schmidt <fschmidt@gmail.com>
parents: 1000
diff changeset
152 _endp = connection._endp;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
153 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
154
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
155 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
156 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
157 * Extract Parameters from query string and/or form _content.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
158 */
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
159 private void extractParameters()
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
160 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
161 if (_baseParameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
162 _baseParameters = new MultiMap(16);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
163
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
164 if (_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
165 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
166 if (_parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
167 _parameters = _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
168 return;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
169 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
170
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
171 _paramsExtracted = true;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
172
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
173 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
174 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
175 // Handle query string
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
176 if (_uri != null && _uri.hasQuery())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
177 {
990
83cc6e05a58f remove special attribute handling
Franklin Schmidt <fschmidt@gmail.com>
parents: 989
diff changeset
178 _uri.decodeQueryTo(_baseParameters);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
179 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
180
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
181 // handle any _content.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
182 String encoding = getCharacterEncoding();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
183 String content_type = getContentType();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
184 if (content_type != null && content_type.length() > 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
185 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
186 content_type = HttpFields.valueParameters(content_type,null);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
187
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
188 if (MimeTypes.FORM_ENCODED.equalsIgnoreCase(content_type) && _inputState == __NONE
998
bf176925e00f remove Request.getReader()
Franklin Schmidt <fschmidt@gmail.com>
parents: 997
diff changeset
189 && ("POST".equals(getMethod()) || "PUT".equals(getMethod())))
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
190 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
191 int content_length = getContentLength();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
192 if (content_length != 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
193 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
194 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
195 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
196 int maxFormContentSize = -1;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
197 int maxFormKeys = -1;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
198
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
199 if (maxFormContentSize < 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
200 {
987
af8742d31bca remove Server._attributes
Franklin Schmidt <fschmidt@gmail.com>
parents: 977
diff changeset
201 maxFormContentSize = 200000;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
202 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
203
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
204 if (maxFormKeys < 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
205 {
987
af8742d31bca remove Server._attributes
Franklin Schmidt <fschmidt@gmail.com>
parents: 977
diff changeset
206 maxFormKeys = 1000;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
207 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
208
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
209 if (content_length > maxFormContentSize && maxFormContentSize > 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
210 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
211 throw new IllegalStateException("Form too large " + content_length + ">" + maxFormContentSize);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
212 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
213 InputStream in = getInputStream();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
214
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
215 // Add form params to query params
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
216 UrlEncoded.decodeTo(in,_baseParameters,encoding,content_length < 0?maxFormContentSize:-1,maxFormKeys);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
217 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
218 catch (IOException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
219 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
220 if (LOG.isDebugEnabled())
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
221 LOG.warn("",e);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
222 else
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
223 LOG.warn(e.toString());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
224 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
225 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
226 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
227
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
228 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
229
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
230 if (_parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
231 _parameters = _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
232 else if (_parameters != _baseParameters)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
233 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
234 // Merge parameters (needed if parameters extracted after a forward).
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
235 Iterator iter = _baseParameters.entrySet().iterator();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
236 while (iter.hasNext())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
237 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
238 Map.Entry entry = (Map.Entry)iter.next();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
239 String name = (String)entry.getKey();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
240 Object values = entry.getValue();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
241 for (int i = 0; i < LazyList.size(values); i++)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
242 _parameters.add(name,LazyList.get(values,i));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
243 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
244 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
245 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
246 finally
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
247 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
248 // ensure params always set (even if empty) after extraction
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
249 if (_parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
250 _parameters = _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
251 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
252 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
253
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
254 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
255 public AsyncContext getAsyncContext()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
256 {
920
3268ddf919d4 remove AsyncContinuation.isAsyncStarted()
Franklin Schmidt <fschmidt@gmail.com>
parents: 917
diff changeset
257 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
258 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
259
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
260 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
261 public Object getAttribute(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
262 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
263 return (_attributes == null)?null:_attributes.getAttribute(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
264 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
265
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
266 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
267 public Enumeration getAttributeNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
268 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
269 if (_attributes == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
270 return Collections.enumeration(Collections.EMPTY_LIST);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
271
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
272 return AttributesMap.getAttributeNamesCopy(_attributes);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
273 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
274
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
275 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
276 public String getAuthType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
277 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
278 return null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
279 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
280
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
281 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
282 public String getCharacterEncoding()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
283 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
284 return _characterEncoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
285 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
286
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
287 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
288 public int getContentLength()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
289 {
1022
3718afd99988 HttpHeaders uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1020
diff changeset
290 return (int)_connection._requestFields.getLongField(HttpHeaders.CONTENT_LENGTH);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
291 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
292
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
293 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
294 public String getContentType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
295 {
1022
3718afd99988 HttpHeaders uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1020
diff changeset
296 return _connection._requestFields.getStringField(HttpHeaders.CONTENT_TYPE);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
297 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
298
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
299 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
300 public String getContextPath()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
301 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
302 return _contextPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
303 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
304
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
305 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
306 public Cookie[] getCookies()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
307 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
308 if (_cookiesExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
309 return _cookies == null?null:_cookies.getCookies();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
310
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
311 _cookiesExtracted = true;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
312
1022
3718afd99988 HttpHeaders uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1020
diff changeset
313 Enumeration enm = _connection._requestFields.getValues(HttpHeaders.COOKIE);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
314
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
315 // Handle no cookies
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
316 if (enm != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
317 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
318 if (_cookies == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
319 _cookies = new CookieCutter();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
320
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
321 while (enm.hasMoreElements())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
322 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
323 String c = (String)enm.nextElement();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
324 _cookies.addCookieField(c);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
325 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
326 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
327
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
328 return _cookies == null?null:_cookies.getCookies();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
329 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
330
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
331 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
332 public long getDateHeader(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
333 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
334 return _connection._requestFields.getDateField(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
335 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
336
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
337 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
338 public DispatcherType getDispatcherType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
339 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
340 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
341 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
342
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
343 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
344 public String getHeader(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
345 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
346 return _connection._requestFields.getStringField(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
347 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
348
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
349 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
350 public Enumeration getHeaderNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
351 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
352 return _connection._requestFields.getFieldNames();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
353 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
354
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
355 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
356 public Enumeration getHeaders(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
357 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
358 Enumeration e = _connection._requestFields.getValues(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
359 if (e == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
360 return Collections.enumeration(Collections.EMPTY_LIST);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
361 return e;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
362 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
363
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
364 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
365 public ServletInputStream getInputStream() throws IOException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
366 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
367 _inputState = _STREAM;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
368 return _connection.getInputStream();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
369 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
370
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
371 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
372 public int getIntHeader(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
373 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
374 return (int)_connection._requestFields.getLongField(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
375 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
376
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
377 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
378 public String getLocalAddr()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
379 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
380 return _endp.getLocalAddr();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
381 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
382
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
383 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
384 public Locale getLocale()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
385 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
386 Enumeration enm = _connection._requestFields.getValues( "Accept-Language", ", \t" );
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
387
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
388 // handle no locale
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
389 if (enm == null || !enm.hasMoreElements())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
390 return Locale.getDefault();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
391
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
392 // sort the list in quality order
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
393 List acceptLanguage = HttpFields.qualityList(enm);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
394 if (acceptLanguage.size() == 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
395 return Locale.getDefault();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
396
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
397 int size = acceptLanguage.size();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
398
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
399 if (size > 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
400 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
401 String language = (String)acceptLanguage.get(0);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
402 language = HttpFields.valueParameters(language,null);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
403 String country = "";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
404 int dash = language.indexOf('-');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
405 if (dash > -1)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
406 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
407 country = language.substring(dash + 1).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
408 language = language.substring(0,dash).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
409 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
410 return new Locale(language,country);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
411 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
412
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
413 return Locale.getDefault();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
414 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
415
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
416 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
417 public Enumeration getLocales()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
418 {
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
419
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
420 Enumeration enm = _connection._requestFields.getValues( "Accept-Language", ", \t" );
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
421
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
422 // handle no locale
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
423 if (enm == null || !enm.hasMoreElements())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
424 return Collections.enumeration(__defaultLocale);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
425
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
426 // sort the list in quality order
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
427 List acceptLanguage = HttpFields.qualityList(enm);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
428
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
429 if (acceptLanguage.size() == 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
430 return Collections.enumeration(__defaultLocale);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
431
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
432 Object langs = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
433 int size = acceptLanguage.size();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
434
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
435 // convert to locals
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
436 for (int i = 0; i < size; i++)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
437 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
438 String language = (String)acceptLanguage.get(i);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
439 language = HttpFields.valueParameters(language,null);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
440 String country = "";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
441 int dash = language.indexOf('-');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
442 if (dash > -1)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
443 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
444 country = language.substring(dash + 1).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
445 language = language.substring(0,dash).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
446 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
447 langs = LazyList.ensureSize(langs,size);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
448 langs = LazyList.add(langs,new Locale(language,country));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
449 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
450
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
451 if (LazyList.size(langs) == 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
452 return Collections.enumeration(__defaultLocale);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
453
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
454 return Collections.enumeration(LazyList.getList(langs));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
455 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
456
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
457 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
458 public String getLocalName()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
459 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
460 String local = _endp.getLocalAddr();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
461 if (local != null && local.indexOf(':') >= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
462 local = "[" + local + "]";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
463 return local;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
464 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
465
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
466 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
467 public int getLocalPort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
468 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
469 return _endp.getLocalPort();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
470 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
471
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
472 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
473 public String getMethod()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
474 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
475 return _method;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
476 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
477
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
478 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
479 public String getParameter(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
480 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
481 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
482 extractParameters();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
483 return (String)_parameters.getValue(name,0);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
484 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
485
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
486 @Override
1000
32d4b569567c simplify handle()
Franklin Schmidt <fschmidt@gmail.com>
parents: 998
diff changeset
487 public Map<String,String[]> getParameterMap()
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
488 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
489 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
490 extractParameters();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
491
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
492 return Collections.unmodifiableMap(_parameters.toStringArrayMap());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
493 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
494
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
495 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
496 public Enumeration getParameterNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
497 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
498 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
499 extractParameters();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
500 return Collections.enumeration(_parameters.keySet());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
501 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
502
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
503 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
504 public String[] getParameterValues(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
505 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
506 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
507 extractParameters();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
508 List<Object> vals = _parameters.getValues(name);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
509 if (vals == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
510 return null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
511 return vals.toArray(new String[vals.size()]);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
512 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
513
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
514 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
515 public String getPathInfo()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
516 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
517 return _pathInfo;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
518 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
519
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
520 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
521 public String getPathTranslated()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
522 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
523 return null;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
524 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
525
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
526 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
527 public String getProtocol()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
528 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
529 return _protocol;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
530 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
531
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
532 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
533 public String getQueryString()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
534 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
535 if (_queryString == null && _uri != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
536 {
990
83cc6e05a58f remove special attribute handling
Franklin Schmidt <fschmidt@gmail.com>
parents: 989
diff changeset
537 _queryString = _uri.getQuery();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
538 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
539 return _queryString;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
540 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
541
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
542 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
543 public BufferedReader getReader() throws IOException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
544 {
998
bf176925e00f remove Request.getReader()
Franklin Schmidt <fschmidt@gmail.com>
parents: 997
diff changeset
545 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
546 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
547
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
548 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
549 public String getRealPath(String path)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
550 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
551 return null;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
552 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
553
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
554 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
555 public String getRemoteAddr()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
556 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
557 return _endp.getRemoteAddr();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
558 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
559
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
560 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
561 public String getRemoteHost()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
562 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
563 return getRemoteAddr();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
564 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
565
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
566 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
567 public int getRemotePort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
568 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
569 return _endp.getRemotePort();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
570 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
571
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
572 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
573 public String getRemoteUser()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
574 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
575 return null;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
576 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
577
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
578 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
579 public RequestDispatcher getRequestDispatcher(String path)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
580 {
822
0048a843297a remove Dispatcher
Franklin Schmidt <fschmidt@gmail.com>
parents: 820
diff changeset
581 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
582 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
583
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
584 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
585 public String getRequestedSessionId()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
586 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
587 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
588 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
589
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
590 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
591 public String getRequestURI()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
592 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
593 if (_requestURI == null && _uri != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
594 _requestURI = _uri.getPathAndParam();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
595 return _requestURI;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
596 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
597
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
598 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
599 public StringBuffer getRequestURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
600 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
601 final StringBuffer url = new StringBuffer(48);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
602 synchronized (url)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
603 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
604 String scheme = getScheme();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
605 int port = getServerPort();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
606
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
607 url.append(scheme);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
608 url.append("://");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
609 url.append(getServerName());
1013
6939226e0ac4 simplify URIUtil
Franklin Schmidt <fschmidt@gmail.com>
parents: 1001
diff changeset
610 if (_port > 0 && ((scheme.equalsIgnoreCase("http") && port != 80) || (scheme.equalsIgnoreCase("https") && port != 443)))
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
611 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
612 url.append(':');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
613 url.append(_port);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
614 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
615
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
616 url.append(getRequestURI());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
617 return url;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
618 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
619 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
620
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
621 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
622 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
623 * Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and, but it does not include a
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
624 * path.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
625 * <p>
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
626 * Because this method returns a <code>StringBuffer</code>, not a string, you can modify the URL easily, for example, to append path and query parameters.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
627 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
628 * This method is useful for creating redirect messages and for reporting errors.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
629 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
630 * @return "scheme://host:port"
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
631 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
632 public StringBuilder getRootURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
633 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
634 StringBuilder url = new StringBuilder(48);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
635 String scheme = getScheme();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
636 int port = getServerPort();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
637
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
638 url.append(scheme);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
639 url.append("://");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
640 url.append(getServerName());
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
641
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
642 if (port > 0 && ((scheme.equalsIgnoreCase("http") && port != 80) || (scheme.equalsIgnoreCase("https") && port != 443)))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
643 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
644 url.append(':');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
645 url.append(port);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
646 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
647 return url;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
648 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
649
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
650 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
651 public String getScheme()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
652 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
653 return _scheme;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
654 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
655
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
656 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
657 public String getServerName()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
658 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
659 // Return already determined host
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
660 if (_serverName != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
661 return _serverName;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
662
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
663 if (_uri == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
664 throw new IllegalStateException("No uri");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
665
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
666 // Return host from absolute URI
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
667 _serverName = _uri.getHost();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
668 _port = _uri.getPort();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
669 if (_serverName != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
670 return _serverName;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
671
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
672 // Return host from header field
1022
3718afd99988 HttpHeaders uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1020
diff changeset
673 String hostPort = _connection._requestFields.getStringField(HttpHeaders.HOST);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
674 if (hostPort != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
675 {
1020
6be43ef1eb96 HttpHeaderValues uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1015
diff changeset
676 loop: for (int i = hostPort.length(); i-- > 0;)
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
677 {
1020
6be43ef1eb96 HttpHeaderValues uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1015
diff changeset
678 char ch = hostPort.charAt(i);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
679 switch (ch)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
680 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
681 case ']':
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
682 break loop;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
683
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
684 case ':':
1020
6be43ef1eb96 HttpHeaderValues uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1015
diff changeset
685 _serverName = hostPort.substring(0,i);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
686 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
687 {
1020
6be43ef1eb96 HttpHeaderValues uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1015
diff changeset
688 _port = Integer.parseInt(hostPort.substring(i + 1));
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
689 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
690 catch (NumberFormatException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
691 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
692 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
693 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
694 _connection._generator.sendError(HttpStatus.BAD_REQUEST_400,"Bad Host header",null,true);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
695 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
696 catch (IOException e1)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
697 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
698 throw new RuntimeException(e1);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
699 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
700 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
701 return _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
702 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
703 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
704 if (_serverName == null || _port < 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
705 {
1020
6be43ef1eb96 HttpHeaderValues uses StringCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 1015
diff changeset
706 _serverName = hostPort;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
707 _port = 0;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
708 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
709
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
710 return _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
711 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
712
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
713 // Return host from connection
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
714 _serverName = getLocalName();
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
715 _port = getLocalPort();
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
716 if (_serverName != null && !StringUtil.ALL_INTERFACES.equals(_serverName))
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
717 return _serverName;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
718
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
719 // Return the local host
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
720 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
721 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
722 _serverName = InetAddress.getLocalHost().getHostAddress();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
723 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
724 catch (java.net.UnknownHostException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
725 {
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
726 LOG.trace("",e);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
727 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
728 return _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
729 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
730
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
731 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
732 public int getServerPort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
733 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
734 if (_port <= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
735 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
736 if (_serverName == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
737 getServerName();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
738
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
739 if (_port <= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
740 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
741 if (_serverName != null && _uri != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
742 _port = _uri.getPort();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
743 else
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
744 _port = _endp.getLocalPort();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
745 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
746 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
747
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
748 if (_port <= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
749 {
1013
6939226e0ac4 simplify URIUtil
Franklin Schmidt <fschmidt@gmail.com>
parents: 1001
diff changeset
750 if (getScheme().equalsIgnoreCase("https"))
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
751 return 443;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
752 return 80;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
753 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
754 return _port;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
755 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
756
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
757 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
758 public ServletContext getServletContext()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
759 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
760 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
761 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
762
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
763 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
764 public String getServletPath()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
765 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
766 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
767 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
768
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
769 @Override
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
770 public HttpSession getSession()
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
771 {
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
772 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
773 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
774
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
775 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
776 public HttpSession getSession(boolean create)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
777 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
778 throw new UnsupportedOperationException();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
779 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
780
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
781 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
782 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
783 * Get Request TimeStamp
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
784 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
785 * @return The time that the request was received.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
786 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
787 public long getTimeStamp()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
788 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
789 return _timeStamp;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
790 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
791
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
792 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
793 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
794 * @return Returns the uri.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
795 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
796 public HttpURI getUri()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
797 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
798 return _uri;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
799 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
800
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
801 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
802 public Principal getUserPrincipal()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
803 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
804 return null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
805 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
806
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
807 public boolean isHandled()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
808 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
809 return _handled;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
810 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
811
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
812 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
813 public boolean isAsyncStarted()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
814 {
920
3268ddf919d4 remove AsyncContinuation.isAsyncStarted()
Franklin Schmidt <fschmidt@gmail.com>
parents: 917
diff changeset
815 return false;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
816 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
817
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
818 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
819 public boolean isAsyncSupported()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
820 {
938
a088981f9cd4 remove more async code
Franklin Schmidt <fschmidt@gmail.com>
parents: 937
diff changeset
821 return false;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
822 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
823
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
824 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
825 public boolean isRequestedSessionIdFromCookie()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
826 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
827 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
828 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
829
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
830 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
831 public boolean isRequestedSessionIdFromUrl()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
832 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
833 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
834 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
835
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
836 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
837 public boolean isRequestedSessionIdFromURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
838 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
839 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
840 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
841
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
842 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
843 public boolean isRequestedSessionIdValid()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
844 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
845 throw new UnsupportedOperationException();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
846 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
847
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
848 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
849 public boolean isSecure()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
850 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
851 return _connection.getConnector().isConfidential();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
852 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
853
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
854 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
855 public boolean isUserInRole(String role)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
856 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
857 return false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
858 }
1015
0114d373748e remove recycle()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1013
diff changeset
859 /*
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
860 protected void recycle()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
861 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
862 _handled = false;
994
4e9d373bf6e9 remove ContextHandler.Context
Franklin Schmidt <fschmidt@gmail.com>
parents: 991
diff changeset
863 if (_contextHandler != null)
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
864 throw new IllegalStateException("Request in context!");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
865 if (_attributes != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
866 _attributes.clearAttributes();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
867 _characterEncoding = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
868 _contextPath = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
869 if (_cookies != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
870 _cookies.reset();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
871 _cookiesExtracted = false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
872 _serverName = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
873 _method = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
874 _pathInfo = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
875 _port = 0;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
876 _protocol = HttpVersions.HTTP_1_1;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
877 _queryString = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
878 _requestURI = null;
1013
6939226e0ac4 simplify URIUtil
Franklin Schmidt <fschmidt@gmail.com>
parents: 1001
diff changeset
879 _scheme = "http";
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
880 _timeStamp = 0;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
881 _uri = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
882 if (_baseParameters != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
883 _baseParameters.clear();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
884 _parameters = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
885 _paramsExtracted = false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
886 _inputState = __NONE;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
887 }
1015
0114d373748e remove recycle()
Franklin Schmidt <fschmidt@gmail.com>
parents: 1013
diff changeset
888 */
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
889 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
890 public void removeAttribute(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
891 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
892 if (_attributes != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
893 _attributes.removeAttribute(name);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
894 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
895
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
896 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
897 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
898 * Set a request attribute. if the attribute name is "org.eclipse.jetty.server.server.Request.queryEncoding" then the value is also passed in a call to
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
899 * {@link #setQueryEncoding}. <p> if the attribute name is "org.eclipse.jetty.server.server.ResponseBuffer", then the response buffer is flushed with @{link
1001
Franklin Schmidt <fschmidt@gmail.com>
parents: 1000
diff changeset
900 * #flushResponseBuffer}.
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
901 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
902 * @see javax.servlet.ServletRequest#setAttribute(java.lang.String, java.lang.Object)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
903 */
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
904 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
905 public void setAttribute(String name, Object value)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
906 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
907 if (_attributes == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
908 _attributes = new AttributesMap();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
909 _attributes.setAttribute(name,value);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
910 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
911
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
912 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
913 public void setCharacterEncoding(String encoding) throws UnsupportedEncodingException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
914 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
915 if (_inputState != __NONE)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
916 return;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
917
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
918 _characterEncoding = encoding;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
919
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
920 // check encoding is supported
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
921 if (!StringUtil.isUTF8(encoding))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
922 // noinspection ResultOfMethodCallIgnored
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
923 "".getBytes(encoding);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
924 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
925
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
926 public void setCharacterEncodingUnchecked(String encoding)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
927 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
928 _characterEncoding = encoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
929 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
930
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
931 public void setContextPath(String contextPath)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
932 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
933 _contextPath = contextPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
934 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
935
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
936 /*
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
937 public void setCookies(Cookie[] cookies)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
938 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
939 if (_cookies == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
940 _cookies = new CookieCutter();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
941 _cookies.setCookies(cookies);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
942 }
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
943 */
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
944
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
945 public void setHandled(boolean h)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
946 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
947 _handled = h;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
948 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
949
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
950 public void setMethod(String method)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
951 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
952 _method = method;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
953 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
954
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
955 private void setParameters(MultiMap<String> parameters)
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
956 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
957 _parameters = (parameters == null)?_baseParameters:parameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
958 if (_paramsExtracted && _parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
959 throw new IllegalStateException();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
960 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
961
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
962 public void setPathInfo(String pathInfo)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
963 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
964 _pathInfo = pathInfo;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
965 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
966
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
967 public void setProtocol(String protocol)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
968 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
969 _protocol = protocol;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
970 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
971
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
972 public void setRequestURI(String requestURI)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
973 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
974 _requestURI = requestURI;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
975 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
976
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
977 public void setScheme(String scheme)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
978 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
979 _scheme = scheme;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
980 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
981
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
982 public void setTimeStamp(long ts)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
983 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
984 _timeStamp = ts;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
985 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
986
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
987 public void setUri(HttpURI uri)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
988 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
989 _uri = uri;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
990 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
991
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
992 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
993 public AsyncContext startAsync() throws IllegalStateException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
994 {
917
1fc8ee20cb18 remove doSuspend
Franklin Schmidt <fschmidt@gmail.com>
parents: 898
diff changeset
995 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
996 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
997
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
998 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
999 public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1000 {
917
1fc8ee20cb18 remove doSuspend
Franklin Schmidt <fschmidt@gmail.com>
parents: 898
diff changeset
1001 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1002 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1003
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1004 @Override
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1005 public String toString()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1006 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1007 return (_handled?"[":"(") + getMethod() + " " + _uri + (_handled?"]@":")@") + hashCode() + " " + super.toString();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1008 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1009
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
1010 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1011 public boolean authenticate(HttpServletResponse response) throws IOException, ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1012 {
815
07c82fabc46b remove Authentication
Franklin Schmidt <fschmidt@gmail.com>
parents: 813
diff changeset
1013 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1014 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1015
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
1016 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1017 public Part getPart(String name) throws IOException, ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1018 {
859
3dcc52e17535 simplify multipart
Franklin Schmidt <fschmidt@gmail.com>
parents: 855
diff changeset
1019 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1020 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1021
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
1022 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1023 public Collection<Part> getParts() throws IOException, ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1024 {
859
3dcc52e17535 simplify multipart
Franklin Schmidt <fschmidt@gmail.com>
parents: 855
diff changeset
1025 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1026 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1027
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
1028 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1029 public void login(String username, String password) throws ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1030 {
815
07c82fabc46b remove Authentication
Franklin Schmidt <fschmidt@gmail.com>
parents: 813
diff changeset
1031 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1032 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1033
997
7d28be82ab75 simplify Request
Franklin Schmidt <fschmidt@gmail.com>
parents: 994
diff changeset
1034 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1035 public void logout() throws ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1036 {
815
07c82fabc46b remove Authentication
Franklin Schmidt <fschmidt@gmail.com>
parents: 813
diff changeset
1037 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1038 }
855
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1039
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1040 }