public abstract class AbstractProxyLogicHandler extends java.lang.Object implements ProxyLogicHandler
Based upon SSLHandler from mina-filter-ssl.
| Modifier and Type | Class and Description |
|---|---|
private static class |
AbstractProxyLogicHandler.Event
Event wrapper class for enqueued events.
|
| Modifier and Type | Field and Description |
|---|---|
private boolean |
handshakeComplete
Has the handshake been completed.
|
private static org.slf4j.Logger |
LOGGER |
private ProxyIoSession |
proxyIoSession
Object that contains all the proxy authentication session informations.
|
private java.util.Queue<AbstractProxyLogicHandler.Event> |
writeRequestQueue
Queue of write events which occurred before the proxy handshake had completed.
|
| Constructor and Description |
|---|
AbstractProxyLogicHandler(ProxyIoSession proxyIoSession)
Creates a new
AbstractProxyLogicHandler. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeSession(java.lang.String message)
Closes the session.
|
protected void |
closeSession(java.lang.String message,
java.lang.Throwable t)
Closes the session.
|
void |
enqueueWriteRequest(IoFilter.NextFilter nextFilter,
WriteRequest writeRequest)
Enqueue a message to be written once handshaking is complete.
|
protected void |
flushPendingWriteRequests()
Send any write requests which were queued whilst waiting for handshaking to complete.
|
protected ProxyFilter |
getProxyFilter()
Returns the proxy filter
ProxyFilter. |
ProxyIoSession |
getProxyIoSession()
Returns the
ProxyIoSession object. |
protected IoSession |
getSession()
Returns the session.
|
boolean |
isHandshakeComplete()
Returns
true if handshaking is complete and
data can be sent through the proxy. |
protected void |
setHandshakeComplete()
Signals that the handshake has finished.
|
protected WriteFuture |
writeData(IoFilter.NextFilter nextFilter,
IoBuffer data)
Writes data to the proxy server.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoHandshake, messageReceivedprivate static final org.slf4j.Logger LOGGER
private ProxyIoSession proxyIoSession
private java.util.Queue<AbstractProxyLogicHandler.Event> writeRequestQueue
private boolean handshakeComplete
public AbstractProxyLogicHandler(ProxyIoSession proxyIoSession)
AbstractProxyLogicHandler.proxyIoSession - ProxyIoSession in use.protected ProxyFilter getProxyFilter()
ProxyFilter.protected IoSession getSession()
public ProxyIoSession getProxyIoSession()
ProxyIoSession object.getProxyIoSession in interface ProxyLogicHandlerprotected WriteFuture writeData(IoFilter.NextFilter nextFilter, IoBuffer data)
nextFilter - the next filterdata - Data buffer to be written.public boolean isHandshakeComplete()
true if handshaking is complete and
data can be sent through the proxy.isHandshakeComplete in interface ProxyLogicHandlertrue if handshaking is complete and
data can be sent through the proxy, false otherwise.protected final void setHandshakeComplete()
protected void flushPendingWriteRequests()
throws java.lang.Exception
java.lang.Exceptionpublic void enqueueWriteRequest(IoFilter.NextFilter nextFilter, WriteRequest writeRequest)
enqueueWriteRequest in interface ProxyLogicHandlernextFilter - the next filter in filter chainwriteRequest - the data to be writtenprotected void closeSession(java.lang.String message,
java.lang.Throwable t)
message - the error messaget - the exception which caused the session closingprotected void closeSession(java.lang.String message)
message - the error message