Package org.apache.catalina.connector
Class CoyoteAdapter
- java.lang.Object
- 
- org.apache.catalina.connector.CoyoteAdapter
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intADAPTER_NOTESprotected static booleanALLOW_BACKSLASHprotected static StringManagersmThe string manager for this package.
 - 
Constructor SummaryConstructors Constructor Description CoyoteAdapter(Connector connector)Construct a new CoyoteProcessor associated with the specified connector.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasyncDispatch(Request req, Response res, SocketEvent status)static booleancheckNormalize(MessageBytes uriMB)Check that the URI is normalized following character decoding.voidcheckRecycled(Request req, Response res)Assert that request and response have been recycled.protected voidconvertMB(MessageBytes mb)Character conversion of the a US-ASCII MessageBytes.protected voidconvertURI(MessageBytes uri, Request request)Character conversion of the URI.protected static voidcopyBytes(byte[] b, int dest, int src, int len)Copy an array of bytes to a different position.java.lang.StringgetDomain()Provide the name of the domain to use to register MBeans for components associated with the connector.voidlog(Request req, Response res, long time)static booleannormalize(MessageBytes uriMB)This method normalizes "\", "//", "/./" and "/../".protected voidparsePathParameters(Request req, Request request)Extract the path parameters from the request.protected voidparseSessionCookiesId(Request request)Parse session id in Cookie.protected voidparseSessionSslId(Request request)Look for SSL session ID if required.protected booleanpostParseRequest(Request req, Request request, Response res, Response response)Perform the necessary processing after the HTTP headers have been parsed to enable the request/response pair to be passed to the start of the container pipeline for processing.booleanprepare(Request req, Response res)Prepare the given request/response for processing.voidservice(Request req, Response res)Call the service method, and notify all listeners
 
- 
- 
- 
Field Detail- 
ADAPTER_NOTESpublic static final int ADAPTER_NOTES - See Also:
- Constant Field Values
 
 - 
ALLOW_BACKSLASHprotected static final boolean ALLOW_BACKSLASH 
 - 
smprotected static final StringManager sm The string manager for this package.
 
- 
 - 
Constructor Detail- 
CoyoteAdapterpublic CoyoteAdapter(Connector connector) Construct a new CoyoteProcessor associated with the specified connector.- Parameters:
- connector- CoyoteConnector that owns this processor
 
 
- 
 - 
Method Detail- 
asyncDispatchpublic boolean asyncDispatch(Request req, Response res, SocketEvent status) throws java.lang.Exception - Specified by:
- asyncDispatchin interface- Adapter
- Throws:
- java.lang.Exception
 
 - 
servicepublic void service(Request req, Response res) throws java.lang.Exception Description copied from interface:AdapterCall the service method, and notify all listeners- Specified by:
- servicein interface- Adapter
- Parameters:
- req- The request object
- res- The response object
- Throws:
- java.lang.Exception- if an error happens during handling of the request. Common errors are:- IOException if an input/output error occurs and we are processing an included servlet (otherwise it is swallowed and handled by the top level error handler mechanism)
- ServletException if a servlet throws an exception and we are processing an included servlet (otherwise it is swallowed and handled by the top level error handler mechanism)
 
 
 - 
preparepublic boolean prepare(Request req, Response res) throws java.io.IOException, ServletException Description copied from interface:AdapterPrepare the given request/response for processing. This method requires that the request object has been populated with the information available from the HTTP headers.- Specified by:
- preparein interface- Adapter
- Parameters:
- req- The request object
- res- The response object
- Returns:
- trueif processing can continue, otherwise- falsein which case an appropriate error will have been set on the response
- Throws:
- java.io.IOException
- ServletException
 
 - 
checkRecycledpublic void checkRecycled(Request req, Response res) Description copied from interface:AdapterAssert that request and response have been recycled. If they have not then log a warning and force a recycle. This method is called as a safety check when a processor is being recycled and may be returned to a pool for reuse.- Specified by:
- checkRecycledin interface- Adapter
- Parameters:
- req- Request
- res- Response
 
 - 
getDomainpublic java.lang.String getDomain() Description copied from interface:AdapterProvide the name of the domain to use to register MBeans for components associated with the connector.
 - 
postParseRequestprotected boolean postParseRequest(Request req, Request request, Response res, Response response) throws java.io.IOException, ServletException Perform the necessary processing after the HTTP headers have been parsed to enable the request/response pair to be passed to the start of the container pipeline for processing.- Parameters:
- req- The coyote request object
- request- The catalina request object
- res- The coyote response object
- response- The catalina response object
- Returns:
- trueif the request should be passed on to the start of the container pipeline, otherwise- false
- Throws:
- java.io.IOException- If there is insufficient space in a buffer while processing headers
- ServletException- If the supported methods of the target servlet cannot be determined
 
 - 
parsePathParametersprotected void parsePathParameters(Request req, Request request) Extract the path parameters from the request. This assumes parameters are of the form /path;name=value;name2=value2/ etc. Currently only really interested in the session ID that will be in this form. Other parameters can safely be ignored.- Parameters:
- req- The Coyote request object
- request- The Servlet request object
 
 - 
parseSessionSslIdprotected void parseSessionSslId(Request request) Look for SSL session ID if required. Only look for SSL Session ID if it is the only tracking method enabled.- Parameters:
- request- The Servlet request object
 
 - 
parseSessionCookiesIdprotected void parseSessionCookiesId(Request request) Parse session id in Cookie.- Parameters:
- request- The Servlet request object
 
 - 
convertURIprotected void convertURI(MessageBytes uri, Request request) throws java.io.IOException Character conversion of the URI.- Parameters:
- uri- MessageBytes object containing the URI
- request- The Servlet request object
- Throws:
- java.io.IOException- if a IO exception occurs sending an error to the client
 
 - 
convertMBprotected void convertMB(MessageBytes mb) Character conversion of the a US-ASCII MessageBytes.- Parameters:
- mb- The MessageBytes instance containing the bytes that should be converted to chars
 
 - 
normalizepublic static boolean normalize(MessageBytes uriMB) This method normalizes "\", "//", "/./" and "/../".- Parameters:
- uriMB- URI to be normalized
- Returns:
- falseif normalizing this URI would require going above the root, or if the URI contains a null byte, otherwise- true
 
 - 
checkNormalizepublic static boolean checkNormalize(MessageBytes uriMB) Check that the URI is normalized following character decoding. This method checks for "\", 0, "//", "/./" and "/../".- Parameters:
- uriMB- URI to be checked (should be chars)
- Returns:
- falseif sequences that are supposed to be normalized are still present in the URI, otherwise- true
 
 - 
copyBytesprotected static void copyBytes(byte[] b, int dest, int src, int len)Copy an array of bytes to a different position. Used during normalization.- Parameters:
- b- The bytes that should be copied
- dest- Destination offset
- src- Source offset
- len- Length
 
 
- 
 
-