org.apache.mina.proxy.handlers.http
Class AbstractHttpLogicHandler

java.lang.Object
  extended by org.apache.mina.proxy.AbstractProxyLogicHandler
      extended by 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 proxy AbstractProxyLogicHandler implementations. Provides HTTP request encoding/response decoding functionality.

Since:
MINA 2.0.0-M3
Version:
$Rev: 685703 $, $Date: 2008-08-14 00:14:47 +0200 (Do, 14 Aug 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
AbstractHttpLogicHandler(ProxyIoSession proxyIoSession)
          Creates a new AbstractHttpLogicHandler.
 
Method Summary
protected  HttpProxyResponse decodeResponse(String response)
          Parse a HTTP response from the proxy server.
abstract  void handleResponse(HttpProxyResponse response)
          Handle a HTTP response from the proxy server.
 void messageReceived(IoFilter.NextFilter nextFilter, IoBuffer buf)
          Handle 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, setProxySession, 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 new AbstractHttpLogicHandler.

Parameters:
proxyIoSession - ProxyIoSession in use.
request - the requested url to negotiate with the proxy.
Method Detail

messageReceived

public void messageReceived(IoFilter.NextFilter nextFilter,
                            IoBuffer buf)
                     throws ProxyAuthException
Handle incoming data during the handshake process. Should consume only the handshake data from the buffer, leaving any extra data in place.

Throws:
ProxyAuthException

handleResponse

public abstract void handleResponse(HttpProxyResponse response)
                             throws ProxyAuthException
Handle a HTTP response from the proxy server.

Parameters:
response - The response.
Throws:
ProxyAuthException

writeRequest

public void writeRequest(IoFilter.NextFilter nextFilter,
                         HttpProxyRequest request)
                  throws ProxyAuthException
Calls#writeRequest0(NextFilter, HttpProxyRequest) to write the request. If needed a reconnection to the proxy is done previously.

Throws:
ProxyAuthException

decodeResponse

protected HttpProxyResponse decodeResponse(String response)
                                    throws Exception
Parse a HTTP response from the proxy server.

Parameters:
response - The response string.
Throws:
Exception


Copyright © 2004-2010 Apache MINA Project. All Rights Reserved.