annotate src/org/eclipse/jetty/server/Request.java @ 994:4e9d373bf6e9

remove ContextHandler.Context
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 18 Oct 2016 16:34:18 -0600
parents 688c39c50ee3
children 7d28be82ab75
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.HttpMethods;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
69 import org.eclipse.jetty.http.HttpParser;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
70 import org.eclipse.jetty.http.HttpStatus;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
71 import org.eclipse.jetty.http.HttpURI;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
72 import org.eclipse.jetty.http.HttpVersions;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
73 import org.eclipse.jetty.http.MimeTypes;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
74 import org.eclipse.jetty.io.Buffer;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
75 import org.eclipse.jetty.io.BufferUtil;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
76 import org.eclipse.jetty.io.ByteArrayBuffer;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
77 import org.eclipse.jetty.io.EndPoint;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
78 import org.eclipse.jetty.io.nio.DirectNIOBuffer;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
79 import org.eclipse.jetty.io.nio.IndirectNIOBuffer;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
80 import org.eclipse.jetty.io.nio.NIOBuffer;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
81 import org.eclipse.jetty.server.handler.ContextHandler;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
82 import org.eclipse.jetty.util.Attributes;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
83 import org.eclipse.jetty.util.AttributesMap;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
84 import org.eclipse.jetty.util.IO;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
85 import org.eclipse.jetty.util.LazyList;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
86 import org.eclipse.jetty.util.MultiException;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
87 import org.eclipse.jetty.util.MultiMap;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
88 import org.eclipse.jetty.util.StringUtil;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
89 import org.eclipse.jetty.util.URIUtil;
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
90 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
91 import org.slf4j.Logger;
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
92 import org.slf4j.LoggerFactory;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
93
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
94 /* ------------------------------------------------------------ */
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
95 /**
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
96 * Jetty Request.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
97 * <p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
98 * 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
99 * </p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
100 * <p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
101 * 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
102 * 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
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 * <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
106 * {@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
107 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
108 * <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
109 * 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
110 * </ul>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
111 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
112 * 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
113 * 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
114 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
115 * <p>
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
116 * 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
117 * {@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
118 * 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
119 * "org.eclipse.jetty.server.Request.maxFormKeys" {@link Server} attribute.
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
120 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
121 *
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
122 */
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
123 public final class Request implements HttpServletRequest
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
124 {
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
125 public static final String __MULTIPART_CONFIG_ELEMENT = "org.eclipse.multipartConfig";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
126 public static final String __MULTIPART_INPUT_STREAM = "org.eclipse.multiPartInputStream";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
127 public static final String __MULTIPART_CONTEXT = "org.eclipse.multiPartContext";
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
128 private static final Logger LOG = LoggerFactory.getLogger(Request.class);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
129
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
130 private static final String __ASYNC_FWD = "org.eclipse.asyncfwd";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
131 private static final Collection __defaultLocale = Collections.singleton(Locale.getDefault());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
132 private static final int __NONE = 0, _STREAM = 1, __READER = 2;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
133
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
134 private volatile Attributes _attributes;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
135 private MultiMap<String> _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
136 private String _characterEncoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
137 protected AbstractHttpConnection _connection;
994
4e9d373bf6e9 remove ContextHandler.Context
Franklin Schmidt <fschmidt@gmail.com>
parents: 991
diff changeset
138 public ContextHandler _contextHandler = null;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
139 private String _contextPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
140 private CookieCutter _cookies;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
141 private boolean _cookiesExtracted = false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
142 private EndPoint _endp;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
143 private boolean _handled = false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
144 private int _inputState = __NONE;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
145 private String _method;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
146 private MultiMap<String> _parameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
147 private boolean _paramsExtracted;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
148 private String _pathInfo;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
149 private int _port;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
150 private String _protocol = HttpVersions.HTTP_1_1;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
151 private String _queryString;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
152 private BufferedReader _reader;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
153 private String _readerEncoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
154 private String _remoteAddr;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
155 private String _remoteHost;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
156 private String _requestURI;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
157 private String _scheme = URIUtil.HTTP;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
158 private String _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
159 private String _servletPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
160 private long _timeStamp;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
161 private long _dispatchTime;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
162
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
163 private Buffer _timeStampBuffer;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
164 private HttpURI _uri;
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 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
167 public Request()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
168 {
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 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
172 public Request(AbstractHttpConnection connection)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
173 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
174 setConnection(connection);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
175 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
176
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
177 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
178 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
179 * Extract Parameters from query string and/or form _content.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
180 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
181 public void extractParameters()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
182 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
183 if (_baseParameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
184 _baseParameters = new MultiMap(16);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
185
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
186 if (_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
187 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
188 if (_parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
189 _parameters = _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
190 return;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
191 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
192
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
193 _paramsExtracted = true;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
194
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
195 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
196 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
197 // Handle query string
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
198 if (_uri != null && _uri.hasQuery())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
199 {
990
83cc6e05a58f remove special attribute handling
Franklin Schmidt <fschmidt@gmail.com>
parents: 989
diff changeset
200 _uri.decodeQueryTo(_baseParameters);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
201 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
202
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
203 // handle any _content.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
204 String encoding = getCharacterEncoding();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
205 String content_type = getContentType();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
206 if (content_type != null && content_type.length() > 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
207 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
208 content_type = HttpFields.valueParameters(content_type,null);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
209
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
210 if (MimeTypes.FORM_ENCODED.equalsIgnoreCase(content_type) && _inputState == __NONE
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
211 && (HttpMethods.POST.equals(getMethod()) || HttpMethods.PUT.equals(getMethod())))
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 int content_length = getContentLength();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
214 if (content_length != 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
215 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
216 try
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 int maxFormContentSize = -1;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
219 int maxFormKeys = -1;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
220
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
221 if (maxFormContentSize < 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
222 {
987
af8742d31bca remove Server._attributes
Franklin Schmidt <fschmidt@gmail.com>
parents: 977
diff changeset
223 maxFormContentSize = 200000;
809
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 if (maxFormKeys < 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
227 {
987
af8742d31bca remove Server._attributes
Franklin Schmidt <fschmidt@gmail.com>
parents: 977
diff changeset
228 maxFormKeys = 1000;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
229 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
230
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
231 if (content_length > maxFormContentSize && maxFormContentSize > 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
232 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
233 throw new IllegalStateException("Form too large " + content_length + ">" + maxFormContentSize);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
234 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
235 InputStream in = getInputStream();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
236
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
237 // Add form params to query params
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
238 UrlEncoded.decodeTo(in,_baseParameters,encoding,content_length < 0?maxFormContentSize:-1,maxFormKeys);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
239 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
240 catch (IOException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
241 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
242 if (LOG.isDebugEnabled())
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
243 LOG.warn("",e);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
244 else
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
245 LOG.warn(e.toString());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
246 }
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 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
249
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
250 }
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 if (_parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
253 _parameters = _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
254 else if (_parameters != _baseParameters)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
255 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
256 // Merge parameters (needed if parameters extracted after a forward).
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
257 Iterator iter = _baseParameters.entrySet().iterator();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
258 while (iter.hasNext())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
259 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
260 Map.Entry entry = (Map.Entry)iter.next();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
261 String name = (String)entry.getKey();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
262 Object values = entry.getValue();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
263 for (int i = 0; i < LazyList.size(values); i++)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
264 _parameters.add(name,LazyList.get(values,i));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
265 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
266 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
267
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
268 if (content_type != null && content_type.length()>0 && content_type.startsWith("multipart/form-data") && getAttribute(__MULTIPART_CONFIG_ELEMENT)!=null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
269 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
270 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
271 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
272 getParts();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
273 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
274 catch (IOException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
275 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
276 if (LOG.isDebugEnabled())
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
277 LOG.warn("",e);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
278 else
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
279 LOG.warn(e.toString());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
280 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
281 catch (ServletException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
282 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
283 if (LOG.isDebugEnabled())
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
284 LOG.warn("",e);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
285 else
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
286 LOG.warn(e.toString());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
287 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
288 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
289 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
290 finally
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
291 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
292 // ensure params always set (even if empty) after extraction
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
293 if (_parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
294 _parameters = _baseParameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
295 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
296 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
297
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
298 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
299 public AsyncContext getAsyncContext()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
300 {
920
3268ddf919d4 remove AsyncContinuation.isAsyncStarted()
Franklin Schmidt <fschmidt@gmail.com>
parents: 917
diff changeset
301 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
302 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
303
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
304 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
305 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
306 * @see javax.servlet.ServletRequest#getAttribute(java.lang.String)
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 public Object getAttribute(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
309 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
310 if ("org.eclipse.jetty.io.EndPoint.maxIdleTime".equalsIgnoreCase(name))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
311 return new Long(getConnection().getEndPoint().getMaxIdleTime());
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
312
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
313 Object attr = (_attributes == null)?null:_attributes.getAttribute(name);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
314 return attr;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
315 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
316
809
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 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
319 * @see javax.servlet.ServletRequest#getAttributeNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
320 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
321 public Enumeration getAttributeNames()
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 if (_attributes == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
324 return Collections.enumeration(Collections.EMPTY_LIST);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
325
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
326 return AttributesMap.getAttributeNamesCopy(_attributes);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
327 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
328
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
329 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
330 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
331 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
332 public Attributes getAttributes()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
333 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
334 if (_attributes == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
335 _attributes = new AttributesMap();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
336 return _attributes;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
337 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
338
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
339 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
340 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
341 * @see javax.servlet.http.HttpServletRequest#getAuthType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
342 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
343 public String getAuthType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
344 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
345 return null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
346 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
347
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
348 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
349 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
350 * @see javax.servlet.ServletRequest#getCharacterEncoding()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
351 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
352 public String getCharacterEncoding()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
353 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
354 return _characterEncoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
355 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
356
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
357 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
358 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
359 * @return Returns the connection.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
360 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
361 public AbstractHttpConnection getConnection()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
362 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
363 return _connection;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
364 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
365
809
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 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
368 * @see javax.servlet.ServletRequest#getContentLength()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
369 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
370 public int getContentLength()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
371 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
372 return (int)_connection._requestFields.getLongField(HttpHeaders.CONTENT_LENGTH_BUFFER);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
373 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
374
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
375 public long getContentRead()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
376 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
377 if (_connection == null)
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
378 return -1;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
379
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
380 return _connection._parser.getContentRead();
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
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
383 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
384 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
385 * @see javax.servlet.ServletRequest#getContentType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
386 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
387 public String getContentType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
388 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
389 return _connection._requestFields.getStringField(HttpHeaders.CONTENT_TYPE_BUFFER);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
390 }
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 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
393 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
394 * @see javax.servlet.http.HttpServletRequest#getContextPath()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
395 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
396 public String getContextPath()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
397 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
398 return _contextPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
399 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
400
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
401 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
402 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
403 * @see javax.servlet.http.HttpServletRequest#getCookies()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
404 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
405 public Cookie[] getCookies()
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 if (_cookiesExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
408 return _cookies == null?null:_cookies.getCookies();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
409
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
410 _cookiesExtracted = true;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
411
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
412 Enumeration enm = _connection._requestFields.getValues(HttpHeaders.COOKIE_BUFFER);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
413
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
414 // Handle no cookies
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
415 if (enm != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
416 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
417 if (_cookies == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
418 _cookies = new CookieCutter();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
419
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
420 while (enm.hasMoreElements())
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 String c = (String)enm.nextElement();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
423 _cookies.addCookieField(c);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
424 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
425 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
426
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
427 return _cookies == null?null:_cookies.getCookies();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
428 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
429
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
430 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
431 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
432 * @see javax.servlet.http.HttpServletRequest#getDateHeader(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
433 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
434 public long getDateHeader(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
435 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
436 return _connection._requestFields.getDateField(name);
809
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
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
439 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
440 public DispatcherType getDispatcherType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
441 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
442 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
443 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
444
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
445 /* ------------------------------------------------------------ */
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 * @see javax.servlet.http.HttpServletRequest#getHeader(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
448 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
449 public String getHeader(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
450 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
451 return _connection._requestFields.getStringField(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
452 }
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 /* ------------------------------------------------------------ */
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 * @see javax.servlet.http.HttpServletRequest#getHeaderNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
457 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
458 public Enumeration getHeaderNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
459 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
460 return _connection._requestFields.getFieldNames();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
461 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
462
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
463 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
464 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
465 * @see javax.servlet.http.HttpServletRequest#getHeaders(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
466 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
467 public Enumeration getHeaders(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
468 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
469 Enumeration e = _connection._requestFields.getValues(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
470 if (e == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
471 return Collections.enumeration(Collections.EMPTY_LIST);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
472 return e;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
473 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
474
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
475 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
476 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
477 * @return Returns the inputState.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
478 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
479 public int getInputState()
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 return _inputState;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
482 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
483
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
484 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
485 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
486 * @see javax.servlet.ServletRequest#getInputStream()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
487 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
488 public ServletInputStream getInputStream() throws IOException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
489 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
490 if (_inputState != __NONE && _inputState != _STREAM)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
491 throw new IllegalStateException("READER");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
492 _inputState = _STREAM;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
493 return _connection.getInputStream();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
494 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
495
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
496 /* ------------------------------------------------------------ */
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 * @see javax.servlet.http.HttpServletRequest#getIntHeader(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
499 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
500 public int getIntHeader(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
501 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
502 return (int)_connection._requestFields.getLongField(name);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
503 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
504
809
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 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
507 * @see javax.servlet.ServletRequest#getLocalAddr()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
508 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
509 public String getLocalAddr()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
510 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
511 return _endp == null?null:_endp.getLocalAddr();
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
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
514 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
515 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
516 * @see javax.servlet.ServletRequest#getLocale()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
517 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
518 public Locale getLocale()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
519 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
520 Enumeration enm = _connection._requestFields.getValues( "Accept-Language", ", \t" );
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
521
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
522 // handle no locale
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
523 if (enm == null || !enm.hasMoreElements())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
524 return Locale.getDefault();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
525
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
526 // sort the list in quality order
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
527 List acceptLanguage = HttpFields.qualityList(enm);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
528 if (acceptLanguage.size() == 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
529 return Locale.getDefault();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
530
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
531 int size = acceptLanguage.size();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
532
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
533 if (size > 0)
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 String language = (String)acceptLanguage.get(0);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
536 language = HttpFields.valueParameters(language,null);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
537 String country = "";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
538 int dash = language.indexOf('-');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
539 if (dash > -1)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
540 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
541 country = language.substring(dash + 1).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
542 language = language.substring(0,dash).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
543 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
544 return new Locale(language,country);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
545 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
546
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
547 return Locale.getDefault();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
548 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
549
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
550 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
551 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
552 * @see javax.servlet.ServletRequest#getLocales()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
553 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
554 public Enumeration getLocales()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
555 {
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
556
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
557 Enumeration enm = _connection._requestFields.getValues( "Accept-Language", ", \t" );
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
558
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
559 // handle no locale
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
560 if (enm == null || !enm.hasMoreElements())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
561 return Collections.enumeration(__defaultLocale);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
562
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
563 // sort the list in quality order
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
564 List acceptLanguage = HttpFields.qualityList(enm);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
565
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
566 if (acceptLanguage.size() == 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
567 return Collections.enumeration(__defaultLocale);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
568
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
569 Object langs = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
570 int size = acceptLanguage.size();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
571
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
572 // convert to locals
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
573 for (int i = 0; i < size; i++)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
574 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
575 String language = (String)acceptLanguage.get(i);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
576 language = HttpFields.valueParameters(language,null);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
577 String country = "";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
578 int dash = language.indexOf('-');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
579 if (dash > -1)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
580 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
581 country = language.substring(dash + 1).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
582 language = language.substring(0,dash).trim();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
583 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
584 langs = LazyList.ensureSize(langs,size);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
585 langs = LazyList.add(langs,new Locale(language,country));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
586 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
587
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
588 if (LazyList.size(langs) == 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
589 return Collections.enumeration(__defaultLocale);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
590
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
591 return Collections.enumeration(LazyList.getList(langs));
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
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
594 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
595 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
596 * @see javax.servlet.ServletRequest#getLocalName()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
597 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
598 public String getLocalName()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
599 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
600 if (_endp == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
601 return null;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
602
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
603 String local = _endp.getLocalAddr();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
604 if (local != null && local.indexOf(':') >= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
605 local = "[" + local + "]";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
606 return local;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
607 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
608
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
609 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
610 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
611 * @see javax.servlet.ServletRequest#getLocalPort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
612 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
613 public int getLocalPort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
614 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
615 return _endp == null?0:_endp.getLocalPort();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
616 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
617
809
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 * @see javax.servlet.http.HttpServletRequest#getMethod()
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 public String getMethod()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
623 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
624 return _method;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
625 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
626
809
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 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
629 * @see javax.servlet.ServletRequest#getParameter(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
630 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
631 public String getParameter(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
632 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
633 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
634 extractParameters();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
635 return (String)_parameters.getValue(name,0);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
636 }
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 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
639 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
640 * @see javax.servlet.ServletRequest#getParameterMap()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
641 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
642 public Map getParameterMap()
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 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
645 extractParameters();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
646
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
647 return Collections.unmodifiableMap(_parameters.toStringArrayMap());
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
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
650 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
651 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
652 * @see javax.servlet.ServletRequest#getParameterNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
653 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
654 public Enumeration getParameterNames()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
655 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
656 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
657 extractParameters();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
658 return Collections.enumeration(_parameters.keySet());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
659 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
660
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
661 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
662 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
663 * @return Returns the parameters.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
664 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
665 public MultiMap<String> getParameters()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
666 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
667 return _parameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
668 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
669
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
670 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
671 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
672 * @see javax.servlet.ServletRequest#getParameterValues(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
673 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
674 public String[] getParameterValues(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
675 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
676 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
677 extractParameters();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
678 List<Object> vals = _parameters.getValues(name);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
679 if (vals == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
680 return null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
681 return vals.toArray(new String[vals.size()]);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
682 }
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 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
685 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
686 * @see javax.servlet.http.HttpServletRequest#getPathInfo()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
687 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
688 public String getPathInfo()
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 return _pathInfo;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
691 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
692
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
693 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
694 public String getPathTranslated()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
695 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
696 return null;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
697 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
698
809
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 * @see javax.servlet.ServletRequest#getProtocol()
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 public String getProtocol()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
704 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
705 return _protocol;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
706 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
707
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
708 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
709 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
710 * @see javax.servlet.http.HttpServletRequest#getQueryString()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
711 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
712 public String getQueryString()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
713 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
714 if (_queryString == null && _uri != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
715 {
990
83cc6e05a58f remove special attribute handling
Franklin Schmidt <fschmidt@gmail.com>
parents: 989
diff changeset
716 _queryString = _uri.getQuery();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
717 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
718 return _queryString;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
719 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
720
809
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 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
723 * @see javax.servlet.ServletRequest#getReader()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
724 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
725 public BufferedReader getReader() throws IOException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
726 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
727 if (_inputState != __NONE && _inputState != __READER)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
728 throw new IllegalStateException("STREAMED");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
729
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
730 if (_inputState == __READER)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
731 return _reader;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
732
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
733 String encoding = getCharacterEncoding();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
734 if (encoding == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
735 encoding = StringUtil.__ISO_8859_1;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
736
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
737 if (_reader == null || !encoding.equalsIgnoreCase(_readerEncoding))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
738 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
739 final ServletInputStream in = getInputStream();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
740 _readerEncoding = encoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
741 _reader = new BufferedReader(new InputStreamReader(in,encoding))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
742 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
743 @Override
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
744 public void close() throws IOException
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 in.close();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
747 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
748 };
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
749 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
750 _inputState = __READER;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
751 return _reader;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
752 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
753
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
754 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
755 public String getRealPath(String path)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
756 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
757 return null;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
758 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
759
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
760 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
761 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
762 * @see javax.servlet.ServletRequest#getRemoteAddr()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
763 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
764 public String getRemoteAddr()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
765 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
766 if (_remoteAddr != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
767 return _remoteAddr;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
768 return _endp == null?null:_endp.getRemoteAddr();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
769 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
770
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
771 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
772 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
773 * @see javax.servlet.ServletRequest#getRemoteHost()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
774 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
775 public String getRemoteHost()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
776 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
777 return getRemoteAddr();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
778 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
779
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
780 /* ------------------------------------------------------------ */
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 * @see javax.servlet.ServletRequest#getRemotePort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
783 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
784 public int getRemotePort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
785 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
786 return _endp == null?0:_endp.getRemotePort();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
787 }
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 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
790 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
791 * @see javax.servlet.http.HttpServletRequest#getRemoteUser()
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 public String getRemoteUser()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
794 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
795 Principal p = getUserPrincipal();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
796 if (p == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
797 return null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
798 return p.getName();
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
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
801 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
802 public RequestDispatcher getRequestDispatcher(String path)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
803 {
822
0048a843297a remove Dispatcher
Franklin Schmidt <fschmidt@gmail.com>
parents: 820
diff changeset
804 throw new UnsupportedOperationException();
809
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 /* ------------------------------------------------------------ */
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 * @see javax.servlet.http.HttpServletRequest#getRequestedSessionId()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
810 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
811 public String getRequestedSessionId()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
812 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
813 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
814 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
815
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
816 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
817 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
818 * @see javax.servlet.http.HttpServletRequest#getRequestURI()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
819 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
820 public String getRequestURI()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
821 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
822 if (_requestURI == null && _uri != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
823 _requestURI = _uri.getPathAndParam();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
824 return _requestURI;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
825 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
826
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
827 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
828 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
829 * @see javax.servlet.http.HttpServletRequest#getRequestURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
830 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
831 public StringBuffer getRequestURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
832 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
833 final StringBuffer url = new StringBuffer(48);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
834 synchronized (url)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
835 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
836 String scheme = getScheme();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
837 int port = getServerPort();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
838
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
839 url.append(scheme);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
840 url.append("://");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
841 url.append(getServerName());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
842 if (_port > 0 && ((scheme.equalsIgnoreCase(URIUtil.HTTP) && port != 80) || (scheme.equalsIgnoreCase(URIUtil.HTTPS) && port != 443)))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
843 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
844 url.append(':');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
845 url.append(_port);
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
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
848 url.append(getRequestURI());
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
849 return url;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
850 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
851 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
852
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
853 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
854 public Response getResponse()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
855 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
856 return _connection._response;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
857 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
858
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
859 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
860 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
861 * 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
862 * path.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
863 * <p>
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
864 * 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
865 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
866 * This method is useful for creating redirect messages and for reporting errors.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
867 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
868 * @return "scheme://host:port"
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
869 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
870 public StringBuilder getRootURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
871 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
872 StringBuilder url = new StringBuilder(48);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
873 String scheme = getScheme();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
874 int port = getServerPort();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
875
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
876 url.append(scheme);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
877 url.append("://");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
878 url.append(getServerName());
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
879
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
880 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
881 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
882 url.append(':');
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
883 url.append(port);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
884 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
885 return url;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
886 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
887
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
888 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
889 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
890 * @see javax.servlet.ServletRequest#getScheme()
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 public String getScheme()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
893 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
894 return _scheme;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
895 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
896
809
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 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
899 * @see javax.servlet.ServletRequest#getServerName()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
900 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
901 public String getServerName()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
902 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
903 // Return already determined host
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
904 if (_serverName != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
905 return _serverName;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
906
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
907 if (_uri == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
908 throw new IllegalStateException("No uri");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
909
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
910 // Return host from absolute URI
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
911 _serverName = _uri.getHost();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
912 _port = _uri.getPort();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
913 if (_serverName != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
914 return _serverName;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
915
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
916 // Return host from header field
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
917 Buffer hostPort = _connection._requestFields.get(HttpHeaders.HOST_BUFFER);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
918 if (hostPort != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
919 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
920 loop: for (int i = hostPort.putIndex(); i-- > hostPort.getIndex();)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
921 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
922 char ch = (char)(0xff & hostPort.peek(i));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
923 switch (ch)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
924 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
925 case ']':
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
926 break loop;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
927
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
928 case ':':
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
929 _serverName = BufferUtil.to8859_1_String(hostPort.peek(hostPort.getIndex(),i - hostPort.getIndex()));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
930 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
931 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
932 _port = BufferUtil.toInt(hostPort.peek(i + 1,hostPort.putIndex() - i - 1));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
933 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
934 catch (NumberFormatException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
935 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
936 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
937 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
938 if (_connection != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
939 _connection._generator.sendError(HttpStatus.BAD_REQUEST_400,"Bad Host header",null,true);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
940 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
941 catch (IOException e1)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
942 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
943 throw new RuntimeException(e1);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
944 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
945 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
946 return _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
947 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
948 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
949 if (_serverName == null || _port < 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
950 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
951 _serverName = BufferUtil.to8859_1_String(hostPort);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
952 _port = 0;
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
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
955 return _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
956 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
957
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
958 // Return host from connection
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
959 if (_connection != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
960 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
961 _serverName = getLocalName();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
962 _port = getLocalPort();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
963 if (_serverName != null && !StringUtil.ALL_INTERFACES.equals(_serverName))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
964 return _serverName;
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 // Return the local host
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
968 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
969 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
970 _serverName = InetAddress.getLocalHost().getHostAddress();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
971 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
972 catch (java.net.UnknownHostException e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
973 {
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
974 LOG.trace("",e);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
975 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
976 return _serverName;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
977 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
978
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
979 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
980 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
981 * @see javax.servlet.ServletRequest#getServerPort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
982 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
983 public int getServerPort()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
984 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
985 if (_port <= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
986 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
987 if (_serverName == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
988 getServerName();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
989
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
990 if (_port <= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
991 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
992 if (_serverName != null && _uri != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
993 _port = _uri.getPort();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
994 else
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
995 _port = _endp == null?0:_endp.getLocalPort();
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 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
998
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
999 if (_port <= 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1000 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1001 if (getScheme().equalsIgnoreCase(URIUtil.HTTPS))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1002 return 443;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1003 return 80;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1004 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1005 return _port;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1006 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1007
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
1008 @Override
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1009 public ServletContext getServletContext()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1010 {
991
688c39c50ee3 simplify ContextHandler
Franklin Schmidt <fschmidt@gmail.com>
parents: 990
diff changeset
1011 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1012 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1013
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1014 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1015 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1016 * @see javax.servlet.http.HttpServletRequest#getServletPath()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1017 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1018 public String getServletPath()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1019 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1020 if (_servletPath == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1021 _servletPath = "";
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1022 return _servletPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1023 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1024
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1025 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1026 public ServletResponse getServletResponse()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1027 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1028 return _connection.getResponse();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1029 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1030
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1031 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1032 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1033 * @see javax.servlet.http.HttpServletRequest#getSession()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1034 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1035 public HttpSession getSession()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1036 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1037 return getSession(true);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1038 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1039
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1040 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1041 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1042 * @see javax.servlet.http.HttpServletRequest#getSession(boolean)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1043 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1044 public HttpSession getSession(boolean create)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1045 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1046 throw new UnsupportedOperationException();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1047 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1048
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1049 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1050 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1051 * Get Request TimeStamp
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1052 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1053 * @return The time that the request was received.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1054 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1055 public long getTimeStamp()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1056 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1057 return _timeStamp;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1058 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1059
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1060 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1061 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1062 * Get Request TimeStamp
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1063 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1064 * @return The time that the request was received.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1065 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1066 public Buffer getTimeStampBuffer()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1067 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1068 if (_timeStampBuffer == null && _timeStamp > 0)
855
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1069 _timeStampBuffer = formatBuffer(_timeStamp);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1070 return _timeStampBuffer;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1071 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1072
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1073 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1074 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1075 * @return Returns the uri.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1076 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1077 public HttpURI getUri()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1078 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1079 return _uri;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1080 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1081
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1082 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1083 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1084 * @see javax.servlet.http.HttpServletRequest#getUserPrincipal()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1085 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1086 public Principal getUserPrincipal()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1087 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1088 return null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1089 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1090
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1091 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1092 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1093 * Get timestamp of the request dispatch
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1094 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1095 * @return timestamp
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1096 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1097 public long getDispatchTime()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1098 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1099 return _dispatchTime;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1100 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1101
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1102 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1103 public boolean isHandled()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1104 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1105 return _handled;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1106 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1107
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1108 public boolean isAsyncStarted()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1109 {
920
3268ddf919d4 remove AsyncContinuation.isAsyncStarted()
Franklin Schmidt <fschmidt@gmail.com>
parents: 917
diff changeset
1110 return false;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1111 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1112
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1113
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1114 public boolean isAsyncSupported()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1115 {
938
a088981f9cd4 remove more async code
Franklin Schmidt <fschmidt@gmail.com>
parents: 937
diff changeset
1116 return false;
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1117 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1118
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1119 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1120 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1121 * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromCookie()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1122 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1123 public boolean isRequestedSessionIdFromCookie()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1124 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
1125 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1126 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1127
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1128 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1129 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1130 * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrl()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1131 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1132 public boolean isRequestedSessionIdFromUrl()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1133 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
1134 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1135 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1136
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1137 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1138 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1139 * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1140 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1141 public boolean isRequestedSessionIdFromURL()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1142 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
1143 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1144 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1145
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1146 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1147 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1148 * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdValid()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1149 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1150 public boolean isRequestedSessionIdValid()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1151 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1152 throw new UnsupportedOperationException();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1153 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1154
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1155 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1156 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1157 * @see javax.servlet.ServletRequest#isSecure()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1158 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1159 public boolean isSecure()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1160 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
1161 return _connection.getConnector().isConfidential();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1162 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1163
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1164 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1165 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1166 * @see javax.servlet.http.HttpServletRequest#isUserInRole(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1167 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1168 public boolean isUserInRole(String role)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1169 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1170 return false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1171 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1172
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1173 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1174 public HttpSession recoverNewSession(Object key)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1175 {
811
1bedcd0ec275 remove more session code
Franklin Schmidt <fschmidt@gmail.com>
parents: 809
diff changeset
1176 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1177 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1178
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1179 protected void recycle()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1180 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1181 if (_inputState == __READER)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1182 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1183 try
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1184 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1185 int r = _reader.read();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1186 while (r != -1)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1187 r = _reader.read();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1188 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1189 catch (Exception e)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1190 {
820
8e9db0bbf4f9 remove org.eclipse.jetty.util.log and upgrade slf4j
Franklin Schmidt <fschmidt@gmail.com>
parents: 815
diff changeset
1191 LOG.trace("",e);
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1192 _reader = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1193 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1194 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1195
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1196 _handled = false;
994
4e9d373bf6e9 remove ContextHandler.Context
Franklin Schmidt <fschmidt@gmail.com>
parents: 991
diff changeset
1197 if (_contextHandler != null)
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1198 throw new IllegalStateException("Request in context!");
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1199 if (_attributes != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1200 _attributes.clearAttributes();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1201 _characterEncoding = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1202 _contextPath = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1203 if (_cookies != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1204 _cookies.reset();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1205 _cookiesExtracted = false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1206 _serverName = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1207 _method = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1208 _pathInfo = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1209 _port = 0;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1210 _protocol = HttpVersions.HTTP_1_1;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1211 _queryString = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1212 _requestURI = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1213 _scheme = URIUtil.HTTP;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1214 _servletPath = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1215 _timeStamp = 0;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1216 _timeStampBuffer = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1217 _uri = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1218 if (_baseParameters != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1219 _baseParameters.clear();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1220 _parameters = null;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1221 _paramsExtracted = false;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1222 _inputState = __NONE;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1223 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1224
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1225 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1226 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1227 * @see javax.servlet.ServletRequest#removeAttribute(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1228 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1229 public void removeAttribute(String name)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1230 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1231 if (_attributes != null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1232 _attributes.removeAttribute(name);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1233 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1234
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1235 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1236 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1237 * 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
1238 * {@link #setQueryEncoding}. <p> if the attribute name is "org.eclipse.jetty.server.server.ResponseBuffer", then the response buffer is flushed with @{link
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1239 * #flushResponseBuffer} <p> if the attribute name is "org.eclipse.jetty.io.EndPoint.maxIdleTime", then the value is passed to the associated {@link
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1240 * EndPoint#setMaxIdleTime}.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1241 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1242 * @see javax.servlet.ServletRequest#setAttribute(java.lang.String, java.lang.Object)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1243 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1244 public void setAttribute(String name, Object value)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1245 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1246 if (_attributes == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1247 _attributes = new AttributesMap();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1248 _attributes.setAttribute(name,value);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1249 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1250
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1251 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1252 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1253 * @see javax.servlet.ServletRequest#setCharacterEncoding(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1254 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1255 public void setCharacterEncoding(String encoding) throws UnsupportedEncodingException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1256 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1257 if (_inputState != __NONE)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1258 return;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1259
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1260 _characterEncoding = encoding;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1261
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1262 // check encoding is supported
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1263 if (!StringUtil.isUTF8(encoding))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1264 // noinspection ResultOfMethodCallIgnored
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1265 "".getBytes(encoding);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1266 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1267
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1268 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1269 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1270 * @see javax.servlet.ServletRequest#setCharacterEncoding(java.lang.String)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1271 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1272 public void setCharacterEncodingUnchecked(String encoding)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1273 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1274 _characterEncoding = encoding;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1275 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1276
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1277 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1278 // final so we can safely call this from constructor
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1279 protected final void setConnection(AbstractHttpConnection connection)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1280 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1281 _connection = connection;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1282 _endp = connection.getEndPoint();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1283 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1284
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1285 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1286 /*
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1287 * @see javax.servlet.ServletRequest#getContentType()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1288 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1289 public void setContentType(String contentType)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1290 {
972
5ee36654b383 simplify AbstractHttpConnection
Franklin Schmidt <fschmidt@gmail.com>
parents: 939
diff changeset
1291 _connection._requestFields.put(HttpHeaders.CONTENT_TYPE_BUFFER,contentType);
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1292
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1293 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1294
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1295 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1296 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1297 * Sets the "context path" for this request
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1298 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1299 * @see HttpServletRequest#getContextPath()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1300 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1301 public void setContextPath(String contextPath)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1302 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1303 _contextPath = contextPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1304 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1305
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1306 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1307 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1308 * @param cookies
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1309 * The cookies to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1310 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1311 public void setCookies(Cookie[] cookies)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1312 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1313 if (_cookies == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1314 _cookies = new CookieCutter();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1315 _cookies.setCookies(cookies);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1316 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1317
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1318 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1319 public void setHandled(boolean h)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1320 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1321 _handled = h;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1322 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1323
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1324 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1325 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1326 * @param method
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1327 * The method to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1328 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1329 public void setMethod(String method)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1330 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1331 _method = method;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1332 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1333
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1334 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1335 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1336 * @param parameters
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1337 * The parameters to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1338 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1339 public void setParameters(MultiMap<String> parameters)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1340 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1341 _parameters = (parameters == null)?_baseParameters:parameters;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1342 if (_paramsExtracted && _parameters == null)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1343 throw new IllegalStateException();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1344 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1345
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1346 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1347 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1348 * @param pathInfo
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1349 * The pathInfo to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1350 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1351 public void setPathInfo(String pathInfo)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1352 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1353 _pathInfo = pathInfo;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1354 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1355
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1356 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1357 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1358 * @param protocol
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1359 * The protocol to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1360 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1361 public void setProtocol(String protocol)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1362 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1363 _protocol = protocol;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1364 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1365
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1366 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1367 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1368 * @param queryString
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1369 * The queryString to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1370 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1371 public void setQueryString(String queryString)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1372 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1373 _queryString = queryString;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1374 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1375
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1376 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1377 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1378 * @param addr
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1379 * The address to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1380 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1381 public void setRemoteAddr(String addr)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1382 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1383 _remoteAddr = addr;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1384 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1385
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1386 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1387 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1388 * @param host
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1389 * The host to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1390 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1391 public void setRemoteHost(String host)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1392 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1393 _remoteHost = host;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1394 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1395
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1396 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1397 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1398 * @param requestURI
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1399 * The requestURI to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1400 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1401 public void setRequestURI(String requestURI)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1402 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1403 _requestURI = requestURI;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1404 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1405
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1406 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1407 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1408 * @param scheme
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1409 * The scheme to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1410 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1411 public void setScheme(String scheme)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1412 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1413 _scheme = scheme;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1414 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1415
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1416 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1417 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1418 * @param host
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1419 * The host to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1420 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1421 public void setServerName(String host)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1422 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1423 _serverName = host;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1424 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1425
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1426 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1427 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1428 * @param port
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1429 * The port to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1430 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1431 public void setServerPort(int port)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1432 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1433 _port = port;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1434 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1435
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1436 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1437 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1438 * @param servletPath
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1439 * The servletPath to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1440 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1441 public void setServletPath(String servletPath)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1442 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1443 _servletPath = servletPath;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1444 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1445
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1446 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1447 public void setTimeStamp(long ts)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1448 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1449 _timeStamp = ts;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1450 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1451
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1452 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1453 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1454 * @param uri
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1455 * The uri to set.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1456 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1457 public void setUri(HttpURI uri)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1458 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1459 _uri = uri;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1460 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1461
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1462 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1463 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1464 * Set timetstamp of request dispatch
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1465 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1466 * @param value
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1467 * timestamp
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1468 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1469 public void setDispatchTime(long value)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1470 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1471 _dispatchTime = value;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1472 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1473
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1474 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1475 public AsyncContext startAsync() throws IllegalStateException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1476 {
917
1fc8ee20cb18 remove doSuspend
Franklin Schmidt <fschmidt@gmail.com>
parents: 898
diff changeset
1477 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1478 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1479
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1480 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1481 public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1482 {
917
1fc8ee20cb18 remove doSuspend
Franklin Schmidt <fschmidt@gmail.com>
parents: 898
diff changeset
1483 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1484 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1485
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1486 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1487 @Override
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1488 public String toString()
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1489 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1490 return (_handled?"[":"(") + getMethod() + " " + _uri + (_handled?"]@":")@") + hashCode() + " " + super.toString();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1491 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1492
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1493 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1494 public boolean authenticate(HttpServletResponse response) throws IOException, ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1495 {
815
07c82fabc46b remove Authentication
Franklin Schmidt <fschmidt@gmail.com>
parents: 813
diff changeset
1496 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1497 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1498
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1499 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1500 public Part getPart(String name) throws IOException, ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1501 {
859
3dcc52e17535 simplify multipart
Franklin Schmidt <fschmidt@gmail.com>
parents: 855
diff changeset
1502 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1503 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1504
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1505 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1506 public Collection<Part> getParts() throws IOException, ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1507 {
859
3dcc52e17535 simplify multipart
Franklin Schmidt <fschmidt@gmail.com>
parents: 855
diff changeset
1508 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1509 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1510
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1511 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1512 public void login(String username, String password) throws ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1513 {
815
07c82fabc46b remove Authentication
Franklin Schmidt <fschmidt@gmail.com>
parents: 813
diff changeset
1514 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1515 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1516
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1517 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1518 public void logout() throws ServletException
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1519 {
815
07c82fabc46b remove Authentication
Franklin Schmidt <fschmidt@gmail.com>
parents: 813
diff changeset
1520 throw new UnsupportedOperationException();
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1521 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1522
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1523 /* ------------------------------------------------------------ */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1524 /**
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1525 * Merge in a new query string. The query string is merged with the existing parameters and {@link #setParameters(MultiMap)} and
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1526 * {@link #setQueryString(String)} are called with the result. The merge is according to the rules of the servlet dispatch forward method.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1527 *
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1528 * @param query
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1529 * The query string to merge into the request.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1530 */
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1531 public void mergeQueryString(String query)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1532 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1533 // extract parameters from dispatch query
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1534 MultiMap<String> parameters = new MultiMap<String>();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1535 UrlEncoded.decodeTo(query,parameters, StringUtil.__UTF8); //have to assume UTF-8 because we can't know otherwise
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1536
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1537 boolean merge_old_query = false;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1538
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1539 // Have we evaluated parameters
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1540 if (!_paramsExtracted)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1541 extractParameters();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1542
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1543 // Are there any existing parameters?
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1544 if (_parameters != null && _parameters.size() > 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1545 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1546 // Merge parameters; new parameters of the same name take precedence.
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1547 Iterator<Entry<String, Object>> iter = _parameters.entrySet().iterator();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1548 while (iter.hasNext())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1549 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1550 Map.Entry<String, Object> entry = iter.next();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1551 String name = entry.getKey();
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1552
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1553 // If the names match, we will need to remake the query string
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1554 if (parameters.containsKey(name))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1555 merge_old_query = true;
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1556
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1557 // Add the old values to the new parameter map
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1558 Object values = entry.getValue();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1559 for (int i = 0; i < LazyList.size(values); i++)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1560 parameters.add(name,LazyList.get(values,i));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1561 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1562 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1563
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1564 if (_queryString != null && _queryString.length() > 0)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1565 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1566 if (merge_old_query)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1567 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1568 StringBuilder overridden_query_string = new StringBuilder();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1569 MultiMap<String> overridden_old_query = new MultiMap<String>();
990
83cc6e05a58f remove special attribute handling
Franklin Schmidt <fschmidt@gmail.com>
parents: 989
diff changeset
1570 UrlEncoded.decodeTo(_queryString,overridden_old_query,null);//decode using any queryencoding set for the request
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1571
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1572
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1573 MultiMap<String> overridden_new_query = new MultiMap<String>();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1574 UrlEncoded.decodeTo(query,overridden_new_query,StringUtil.__UTF8); //have to assume utf8 as we cannot know otherwise
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1575
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1576 Iterator<Entry<String, Object>> iter = overridden_old_query.entrySet().iterator();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1577 while (iter.hasNext())
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1578 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1579 Map.Entry<String, Object> entry = iter.next();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1580 String name = entry.getKey();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1581 if (!overridden_new_query.containsKey(name))
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1582 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1583 Object values = entry.getValue();
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1584 for (int i = 0; i < LazyList.size(values); i++)
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1585 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1586 overridden_query_string.append("&").append(name).append("=").append((Object)LazyList.get(values,i));
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1587 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1588 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1589 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1590
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1591 query = query + overridden_query_string;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1592 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1593 else
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1594 {
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1595 query = query + "&" + _queryString;
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1596 }
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1597 }
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1598
809
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1599 setParameters(parameters);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1600 setQueryString(query);
09d518d313b7 remove SessionManager
Franklin Schmidt <fschmidt@gmail.com>
parents: 802
diff changeset
1601 }
855
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1602
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1603
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1604 private static Buffer _buffer;
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1605 private static String _last;
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1606 private static final DateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.US);
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1607 static {
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1608 dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1609 }
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1610
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1611 private static Buffer formatBuffer(long date) {
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1612 synchronized(dateFormat) {
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1613 String d = dateFormat.format(date);
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1614 if (d==_last)
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1615 return _buffer;
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1616 _last=d;
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1617 _buffer=new ByteArrayBuffer(d);
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1618 return _buffer;
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1619 }
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1620 }
fa6158f29c45 remove BufferDateCache and DateCache
Franklin Schmidt <fschmidt@gmail.com>
parents: 831
diff changeset
1621
802
3428c60d7cfc replace jetty jars with source
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1622 }