Class AbstractHttpLogicHandler
- java.lang.Object
-
- org.apache.mina.proxy.AbstractProxyLogicHandler
-
- org.apache.mina.proxy.handlers.http.AbstractHttpLogicHandler
-
- All Implemented Interfaces:
ProxyLogicHandler
- Direct Known Subclasses:
HttpSmartProxyHandler
public abstract class AbstractHttpLogicHandler extends AbstractProxyLogicHandler
AbstractHttpLogicHandler.java - Base class for HTTP proxyAbstractProxyLogicHandler
implementations. Provides HTTP request encoding/response decoding functionality.- Since:
- MINA 2.0.0-M3
- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description AbstractHttpLogicHandler(ProxyIoSession proxyIoSession)
Creates a newAbstractHttpLogicHandler
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected HttpProxyResponse
decodeResponse(String response)
Parse a HTTP response from the proxy server.abstract void
handleResponse(HttpProxyResponse response)
Handles a HTTP response from the proxy server.void
messageReceived(IoFilter.NextFilter nextFilter, IoBuffer buf)
Handles incoming data during the handshake process.void
writeRequest(IoFilter.NextFilter nextFilter, HttpProxyRequest request)
Calls writeRequest0(NextFilter, HttpProxyRequest) to write the request.-
Methods inherited from class org.apache.mina.proxy.AbstractProxyLogicHandler
closeSession, closeSession, enqueueWriteRequest, flushPendingWriteRequests, getProxyFilter, getProxyIoSession, getSession, isHandshakeComplete, setHandshakeComplete, writeData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.mina.proxy.ProxyLogicHandler
doHandshake
-
-
-
-
Constructor Detail
-
AbstractHttpLogicHandler
public AbstractHttpLogicHandler(ProxyIoSession proxyIoSession)
Creates a newAbstractHttpLogicHandler
.- Parameters:
proxyIoSession
- theProxyIoSession
in use.
-
-
Method Detail
-
messageReceived
public void messageReceived(IoFilter.NextFilter nextFilter, IoBuffer buf) throws ProxyAuthException
Handles incoming data during the handshake process. Should consume only the handshake data from the buffer, leaving any extra data in place.- Parameters:
nextFilter
- the next filterbuf
- the buffer holding received data- Throws:
ProxyAuthException
- if authentication fails
-
handleResponse
public abstract void handleResponse(HttpProxyResponse response) throws ProxyAuthException
Handles a HTTP response from the proxy server.- Parameters:
response
- The response.- Throws:
ProxyAuthException
- If we get an error during the proxy authentication
-
writeRequest
public void writeRequest(IoFilter.NextFilter nextFilter, HttpProxyRequest request)
Calls writeRequest0(NextFilter, HttpProxyRequest) to write the request. If needed a reconnection to the proxy is done previously.- Parameters:
nextFilter
- the next filterrequest
- the http request
-
decodeResponse
protected HttpProxyResponse decodeResponse(String response) throws Exception
Parse a HTTP response from the proxy server.- Parameters:
response
- The response string.- Returns:
- The decoded HttpResponse
- Throws:
Exception
- If we get an error while decoding the response
-
-