org.apache.catalina.connector
Class CoyoteAdapter

java.lang.Object
  extended by org.apache.catalina.connector.CoyoteAdapter
All Implemented Interfaces:
org.apache.coyote.Adapter

public class CoyoteAdapter
extends Object
implements org.apache.coyote.Adapter

Implementation of a request processor which delegates the processing to a Coyote processor.

Version:
$Id: CoyoteAdapter.java 20256 2010-09-03 14:59:04Z alitokmen $ JOnAS-specific: Coyote Adapter with delegated context search.
Author:
Craig R. McClanahan, Remy Maucherat, Frederic Germaneau, S. Ali Tokmen
See Also:
ContextFinder

Field Summary
static int ADAPTER_NOTES
           
protected static boolean ALLOW_BACKSLASH
           
protected  org.apache.catalina.util.StringManager sm
          The string manager for this package.
protected static org.apache.catalina.util.URLEncoder urlEncoder
          Encoder for the Location URL in HTTP redirects.
 
Constructor Summary
CoyoteAdapter(Connector connector)
          Construct a new CoyoteProcessor associated with the specified connector.
 
Method Summary
static boolean checkNormalize(org.apache.tomcat.util.buf.MessageBytes uriMB)
          Check that the URI is normalized following character decoding.
protected  void convertMB(org.apache.tomcat.util.buf.MessageBytes mb)
          Character conversion of the a US-ASCII MessageBytes.
protected  void convertURI(org.apache.tomcat.util.buf.MessageBytes uri, org.apache.catalina.connector.Request request)
          Character conversion of the URI.
protected static void copyBytes(byte[] b, int dest, int src, int len)
          Copy an array of bytes to a different position.
 boolean event(org.apache.coyote.Request req, org.apache.coyote.Response res, org.apache.tomcat.util.net.SocketStatus status)
          Event method.
static boolean normalize(org.apache.tomcat.util.buf.MessageBytes uriMB)
          Normalize URI.
protected  void parseSessionCookiesId(org.apache.coyote.Request req, org.apache.catalina.connector.Request request)
          Parse session id in URL.
protected  void parseSessionId(org.apache.coyote.Request req, org.apache.catalina.connector.Request request)
          Parse session id in URL.
protected  boolean postParseRequest(org.apache.coyote.Request req, org.apache.catalina.connector.Request request, org.apache.coyote.Response res, org.apache.catalina.connector.Response response, VersionedPathBean vpb)
          Parse additional request parameters.
 void service(org.apache.coyote.Request req, org.apache.coyote.Response res)
          Service method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADAPTER_NOTES

public static final int ADAPTER_NOTES
See Also:
Constant Field Values

ALLOW_BACKSLASH

protected static final boolean ALLOW_BACKSLASH

sm

protected org.apache.catalina.util.StringManager sm
The string manager for this package.


urlEncoder

protected static org.apache.catalina.util.URLEncoder urlEncoder
Encoder for the Location URL in HTTP redirects.

Constructor Detail

CoyoteAdapter

public CoyoteAdapter(Connector connector)
Construct a new CoyoteProcessor associated with the specified connector.

Parameters:
connector - CoyoteConnector that owns this processor
Method Detail

event

public boolean event(org.apache.coyote.Request req,
                     org.apache.coyote.Response res,
                     org.apache.tomcat.util.net.SocketStatus status)
Event method.

Specified by:
event in interface org.apache.coyote.Adapter
Returns:
false to indicate an error, expected or not

service

public void service(org.apache.coyote.Request req,
                    org.apache.coyote.Response res)
             throws Exception
Service method.

Specified by:
service in interface org.apache.coyote.Adapter
Throws:
Exception

postParseRequest

protected boolean postParseRequest(org.apache.coyote.Request req,
                                   org.apache.catalina.connector.Request request,
                                   org.apache.coyote.Response res,
                                   org.apache.catalina.connector.Response response,
                                   VersionedPathBean vpb)
                            throws Exception
Parse additional request parameters.

Throws:
Exception

parseSessionId

protected void parseSessionId(org.apache.coyote.Request req,
                              org.apache.catalina.connector.Request request)
Parse session id in URL.


parseSessionCookiesId

protected void parseSessionCookiesId(org.apache.coyote.Request req,
                                     org.apache.catalina.connector.Request request)
Parse session id in URL.


convertURI

protected void convertURI(org.apache.tomcat.util.buf.MessageBytes uri,
                          org.apache.catalina.connector.Request request)
                   throws Exception
Character conversion of the URI.

Throws:
Exception

convertMB

protected void convertMB(org.apache.tomcat.util.buf.MessageBytes mb)
Character conversion of the a US-ASCII MessageBytes.


normalize

public static boolean normalize(org.apache.tomcat.util.buf.MessageBytes uriMB)
Normalize URI.

This method normalizes "\", "//", "/./" and "/../". This method will return false when trying to go above the root, or if the URI contains a null byte.

Parameters:
uriMB - URI to be normalized

checkNormalize

public static boolean checkNormalize(org.apache.tomcat.util.buf.MessageBytes uriMB)
Check that the URI is normalized following character decoding.

This method checks for "\", 0, "//", "/./" and "/../". This method will return false if sequences that are supposed to be normalized are still present in the URI.

Parameters:
uriMB - URI to be checked (should be chars)

copyBytes

protected static void copyBytes(byte[] b,
                                int dest,
                                int src,
                                int len)
Copy an array of bytes to a different position. Used during normalization.



Copyright © 2010 OW2 Consortium. All Rights Reserved.