1 5 package org.apache.catalina.connector; 6 7 import org.apache.catalina.Context; 8 import org.apache.catalina.Host; 9 import org.apache.catalina.Realm; 10 import org.apache.catalina.Session; 11 import org.apache.catalina.Wrapper; 12 import org.apache.tomcat.util.buf.B2CConverter; 13 import org.apache.tomcat.util.buf.MessageBytes; 14 import org.apache.tomcat.util.http.mapper.MappingData; 15 16 import com.tc.tomcat.session.SessionInternal; 17 import com.terracotta.session.TerracottaRequest; 18 19 import java.io.BufferedReader ; 20 import java.io.IOException ; 21 import java.io.InputStream ; 22 import java.io.UnsupportedEncodingException ; 23 import java.security.Principal ; 24 import java.util.Enumeration ; 25 import java.util.Locale ; 26 import java.util.Map ; 27 28 import javax.servlet.FilterChain ; 29 import javax.servlet.RequestDispatcher ; 30 import javax.servlet.ServletInputStream ; 31 import javax.servlet.http.Cookie ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpSession ; 34 35 public class SessionRequest55 extends Request { 36 private final Request valveReq; 37 private final TerracottaRequest sessionReq; 38 private final Realm realm; 39 private SessionResponse55 sessionRes; 40 private Session sessionInternal = null; 41 42 46 public SessionRequest55(TerracottaRequest sessionReq, Request valveReq, Realm realm) { 47 this.valveReq = valveReq; 48 this.sessionReq = sessionReq; 49 this.realm = realm; 50 } 51 52 public void setSessionResponse(SessionResponse55 sessionRes) { 53 this.sessionRes = sessionRes; 54 } 55 56 public HttpSession getSession() { 60 return sessionReq.getSession(); 61 } 62 63 public HttpSession getSession(boolean arg0) { 64 return sessionReq.getSession(arg0); 65 } 66 67 public String getRequestedSessionId() { 68 return sessionReq.getRequestedSessionId(); 69 } 70 71 public boolean isRequestedSessionIdFromCookie() { 72 return sessionReq.isRequestedSessionIdFromCookie(); 73 } 74 75 public boolean isRequestedSessionIdFromUrl() { 76 return sessionReq.isRequestedSessionIdFromUrl(); 77 } 78 79 public boolean isRequestedSessionIdFromURL() { 80 return sessionReq.isRequestedSessionIdFromURL(); 81 } 82 83 public boolean isRequestedSessionIdValid() { 84 return sessionReq.isRequestedSessionIdValid(); 85 } 86 87 public HttpServletRequest getRequest() { 88 return sessionReq; 89 } 90 91 public Response getResponse() { 92 return sessionRes; 93 } 94 95 public Session getSessionInternal() { 96 return getSessionInternal(true); 97 } 98 99 public Session getSessionInternal(boolean create) { 100 synchronized (this) { 101 if (sessionInternal != null) { return sessionInternal; } 102 103 com.terracotta.session.Session tcSession = (com.terracotta.session.Session) getSession(create); 104 if (tcSession == null) { return null; } 105 106 return sessionInternal = new SessionInternal(tcSession, realm); 107 } 108 109 } 111 112 116 public boolean equals(Object obj) { 119 return valveReq.equals(obj); 120 } 121 122 public Object getAttribute(String arg0) { 123 return valveReq.getAttribute(arg0); 124 } 125 126 public Enumeration getAttributeNames() { 127 return valveReq.getAttributeNames(); 128 } 129 130 public String getAuthType() { 131 return valveReq.getAuthType(); 132 } 133 134 public String getCharacterEncoding() { 135 return valveReq.getCharacterEncoding(); 136 } 137 138 public int getContentLength() { 139 return valveReq.getContentLength(); 140 } 141 142 public String getContentType() { 143 return valveReq.getContentType(); 144 } 145 146 public String getContextPath() { 147 return valveReq.getContextPath(); 148 } 149 150 public Cookie [] getCookies() { 151 return valveReq.getCookies(); 152 } 153 154 public long getDateHeader(String arg0) { 155 return valveReq.getDateHeader(arg0); 156 } 157 158 public String getHeader(String arg0) { 159 return valveReq.getHeader(arg0); 160 } 161 162 public Enumeration getHeaderNames() { 163 return valveReq.getHeaderNames(); 164 } 165 166 public Enumeration getHeaders(String arg0) { 167 return valveReq.getHeaders(arg0); 168 } 169 170 public ServletInputStream getInputStream() throws IOException { 171 return valveReq.getInputStream(); 172 } 173 174 public int getIntHeader(String arg0) { 175 return valveReq.getIntHeader(arg0); 176 } 177 178 public String getLocalAddr() { 179 return valveReq.getLocalAddr(); 180 } 181 182 public Locale getLocale() { 183 return valveReq.getLocale(); 184 } 185 186 public Enumeration getLocales() { 187 return valveReq.getLocales(); 188 } 189 190 public String getLocalName() { 191 return valveReq.getLocalName(); 192 } 193 194 public int getLocalPort() { 195 return valveReq.getLocalPort(); 196 } 197 198 public String getMethod() { 199 return valveReq.getMethod(); 200 } 201 202 public String getParameter(String arg0) { 203 return valveReq.getParameter(arg0); 204 } 205 206 public Map getParameterMap() { 207 return valveReq.getParameterMap(); 208 } 209 210 public Enumeration getParameterNames() { 211 return valveReq.getParameterNames(); 212 } 213 214 public String [] getParameterValues(String arg0) { 215 return valveReq.getParameterValues(arg0); 216 } 217 218 public String getPathInfo() { 219 return valveReq.getPathInfo(); 220 } 221 222 public String getPathTranslated() { 223 return valveReq.getPathTranslated(); 224 } 225 226 public String getProtocol() { 227 return valveReq.getProtocol(); 228 } 229 230 public String getQueryString() { 231 return valveReq.getQueryString(); 232 } 233 234 public BufferedReader getReader() throws IOException { 235 return valveReq.getReader(); 236 } 237 238 public String getRealPath(String arg0) { 239 return valveReq.getRealPath(arg0); 240 } 241 242 public String getRemoteAddr() { 243 return valveReq.getRemoteAddr(); 244 } 245 246 public String getRemoteHost() { 247 return valveReq.getRemoteHost(); 248 } 249 250 public int getRemotePort() { 251 return valveReq.getRemotePort(); 252 } 253 254 public String getRemoteUser() { 255 return valveReq.getRemoteUser(); 256 } 257 258 public RequestDispatcher getRequestDispatcher(String arg0) { 259 return valveReq.getRequestDispatcher(arg0); 260 } 261 262 public String getRequestURI() { 263 return valveReq.getRequestURI(); 264 } 265 266 public StringBuffer getRequestURL() { 267 return valveReq.getRequestURL(); 268 } 269 270 public String getScheme() { 271 return valveReq.getScheme(); 272 } 273 274 public String getServerName() { 275 return valveReq.getServerName(); 276 } 277 278 public int getServerPort() { 279 return valveReq.getServerPort(); 280 } 281 282 public String getServletPath() { 283 return valveReq.getServletPath(); 284 } 285 286 public Principal getUserPrincipal() { 287 return valveReq.getUserPrincipal(); 288 } 289 290 public int hashCode() { 291 return valveReq.hashCode(); 292 } 293 294 public boolean isSecure() { 295 return valveReq.isSecure(); 296 } 297 298 public boolean isUserInRole(String arg0) { 299 return valveReq.isUserInRole(arg0); 300 } 301 302 public void removeAttribute(String arg0) { 303 valveReq.removeAttribute(arg0); 304 } 305 306 public void setAttribute(String arg0, Object arg1) { 307 valveReq.setAttribute(arg0, arg1); 308 } 309 310 public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException { 311 valveReq.setCharacterEncoding(arg0); 312 } 313 314 public void addCookie(Cookie cookie) { 315 valveReq.addCookie(cookie); 316 } 317 318 public void addHeader(String s, String s1) { 319 valveReq.addHeader(s, s1); 320 } 321 322 public void addLocale(Locale locale) { 323 valveReq.addLocale(locale); 324 } 325 326 public void addParameter(String name, String [] values) { 327 valveReq.addParameter(name, values); 328 } 329 330 public void clearCookies() { 331 valveReq.clearCookies(); 332 } 333 334 public void clearHeaders() { 335 valveReq.clearHeaders(); 336 } 337 338 public void clearLocales() { 339 valveReq.clearLocales(); 340 } 341 342 public void clearParameters() { 343 valveReq.clearParameters(); 344 } 345 346 protected void configureSessionCookie(Cookie cookie) { 347 valveReq.configureSessionCookie(cookie); 348 } 349 350 public void finishRequest() throws IOException { 351 valveReq.finishRequest(); 352 } 353 354 public ServletInputStream createInputStream() throws IOException { 355 return valveReq.createInputStream(); 356 } 357 358 public Connector getConnector() { 359 return valveReq.getConnector(); 360 } 361 362 public Context getContext() { 363 return valveReq.getContext(); 364 } 365 366 public String getDecodedRequestURI() { 367 return valveReq.getDecodedRequestURI(); 368 } 369 370 public FilterChain getFilterChain() { 371 return valveReq.getFilterChain(); 372 } 373 374 public Host getHost() { 375 return valveReq.getHost(); 376 } 377 378 public String getInfo() { 379 return valveReq.getInfo(); 380 } 381 382 public Object getNote(String name) { 383 return valveReq.getNote(name); 384 } 385 386 public java.util.Iterator getNoteNames() { 387 return valveReq.getNoteNames(); 388 } 389 390 public Principal getPrincipal() { 391 return valveReq.getPrincipal(); 392 } 393 394 public java.io.InputStream getStream() { 395 return valveReq.getStream(); 396 } 397 398 public Wrapper getWrapper() { 399 return valveReq.getWrapper(); 400 } 401 402 public void recycle() { 403 valveReq.recycle(); 404 } 405 406 public void removeNote(String name) { 407 valveReq.removeNote(name); 408 } 409 410 public void setAuthType(String type) { 411 valveReq.setAuthType(type); 412 } 413 414 public void setConnector(Connector connector) { 415 valveReq.setConnector(connector); 416 } 417 418 public void setContentLength(int i) { 419 valveReq.setContentLength(i); 420 } 421 422 public String toString() { 423 return valveReq.toString(); 424 } 425 426 public void setContentType(String s) { 427 valveReq.setContentType(s); 428 } 429 430 public void setContext(Context context) { 431 valveReq.setContext(context); 432 } 433 434 public void setContextPath(String path) { 435 valveReq.setContextPath(path); 436 } 437 438 public void setCookies(Cookie [] cookies) { 439 valveReq.setCookies(cookies); 440 } 441 442 public void setDecodedRequestURI(String s) { 443 valveReq.setDecodedRequestURI(s); 444 } 445 446 public void setFilterChain(FilterChain filterChain) { 447 valveReq.setFilterChain(filterChain); 448 } 449 450 public void setHost(Host host) { 451 valveReq.setHost(host); 452 } 453 454 public void setMethod(String s) { 455 valveReq.setMethod(s); 456 } 457 458 public void setNote(String name, Object value) { 459 valveReq.setNote(name, value); 460 } 461 462 public void setPathInfo(String path) { 463 valveReq.setPathInfo(path); 464 } 465 466 public void setProtocol(String s) { 467 valveReq.setProtocol(s); 468 } 469 470 public void setQueryString(String s) { 471 valveReq.setQueryString(s); 472 } 473 474 public void setRemoteAddr(String s) { 475 valveReq.setRemoteAddr(s); 476 } 477 478 public void setRemoteHost(String s) { 479 valveReq.setRemoteHost(s); 480 } 481 482 public void setRequestedSessionCookie(boolean flag) { 483 valveReq.setRequestedSessionCookie(flag); 484 } 485 486 public void setRequestedSessionId(String id) { 487 valveReq.setRequestedSessionId(id); 488 } 489 490 public void setRequestedSessionURL(boolean flag) { 491 valveReq.setRequestedSessionURL(flag); 492 } 493 494 public void setRequestURI(String s) { 495 valveReq.setRequestURI(s); 496 } 497 498 public void setResponse(Response response) { 499 valveReq.setResponse(response); 500 } 501 502 public void setScheme(String s) { 503 valveReq.setScheme(s); 504 } 505 506 public void setSecure(boolean secure) { 507 valveReq.setSecure(secure); 508 } 509 510 public void setServerName(String name) { 511 valveReq.setServerName(name); 512 } 513 514 public void setServerPort(int port) { 515 valveReq.setServerPort(port); 516 } 517 518 public void setServletPath(String path) { 519 valveReq.setServletPath(path); 520 } 521 522 public void setStream(InputStream inputstream) { 523 valveReq.setStream(inputstream); 524 } 525 526 public void setUserPrincipal(Principal principal) { 527 valveReq.setUserPrincipal(principal); 528 } 529 530 public void setWrapper(Wrapper wrapper) { 531 valveReq.setWrapper(wrapper); 532 } 533 534 protected Session doGetSession(boolean create) { 535 return valveReq.doGetSession(create); 536 } 537 538 protected void parseCookies() { 539 valveReq.parseCookies(); 540 } 541 542 protected void parseLocales() { 543 valveReq.parseLocales(); 544 } 545 546 protected void parseLocalesHeader(String value) { 547 valveReq.parseLocalesHeader(value); 548 } 549 550 protected void parseParameters() { 551 valveReq.parseParameters(); 552 } 553 554 protected int readPostBody(byte[] body, int len) throws IOException { 555 return valveReq.readPostBody(body, len); 556 } 557 558 public MessageBytes getContextPathMB() { 559 return valveReq.getContextPathMB(); 560 } 561 562 public org.apache.coyote.Request getCoyoteRequest() { 563 return valveReq.getCoyoteRequest(); 564 } 565 566 public MessageBytes getDecodedRequestURIMB() { 567 return valveReq.getDecodedRequestURIMB(); 568 } 569 570 public MappingData getMappingData() { 571 return valveReq.getMappingData(); 572 } 573 574 public MessageBytes getPathInfoMB() { 575 return valveReq.getPathInfoMB(); 576 } 577 578 public MessageBytes getRequestPathMB() { 579 return valveReq.getRequestPathMB(); 580 } 581 582 public MessageBytes getServletPathMB() { 583 return valveReq.getServletPathMB(); 584 } 585 586 protected B2CConverter getURIConverter() { 587 return valveReq.getURIConverter(); 588 } 589 590 public void setCoyoteRequest(org.apache.coyote.Request coyoteRequest) { 591 valveReq.setCoyoteRequest(coyoteRequest); 592 } 593 594 protected void setURIConverter(B2CConverter URIConverter) { 595 valveReq.setURIConverter(URIConverter); 596 } 597 598 } 599 | Popular Tags |