|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.core.filterchain.IoFilterAdapter
org.apache.mina.proxy.filter.ProxyFilter
public class ProxyFilter
ProxyFilter.java - Proxy IoFilter.
Automatically inserted into the IoFilter chain by ProxyConnector.
Sends the initial handshake message to the proxy and handles any response
to the handshake. Once the handshake has completed and the proxied connection has been
established this filter becomes transparent to data flowing through the connection.
Based upon SSLFilter from mina-filter-ssl.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter |
|---|
IoFilter.NextFilter |
| Constructor Summary | |
|---|---|
ProxyFilter()
Create a new ProxyFilter. |
|
| Method Summary | |
|---|---|
void |
exceptionCaught(IoFilter.NextFilter nextFilter,
IoSession session,
Throwable cause)
Called when an exception occurs in the chain. |
void |
filterWrite(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
Filters outgoing writes, queueing them up if necessary while a handshake is ongoing. |
void |
messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
Receives data from the remote host, passes to the handler if a handshake is in progress, otherwise passes on transparently. |
void |
messageSent(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
Filter handshake related messages from reaching the messageSent callbacks of downstream filters. |
void |
onPreAdd(IoFilterChain chain,
String name,
IoFilter.NextFilter nextFilter)
Called before the filter is added into the filter chain. |
void |
onPreRemove(IoFilterChain chain,
String name,
IoFilter.NextFilter nextFilter)
Called when the filter is removed from the filter chain. |
void |
sessionClosed(IoFilter.NextFilter nextFilter,
IoSession session)
Event is stored in an IoSessionEventQueue for later delivery to the next filter
in the chain when the handshake would have succeed. |
void |
sessionCreated(IoFilter.NextFilter nextFilter,
IoSession session)
Called when the session is created. |
void |
sessionIdle(IoFilter.NextFilter nextFilter,
IoSession session,
IdleStatus status)
Event is stored in an IoSessionEventQueue for later delivery to the next filter
in the chain when the handshake would have succeed. |
void |
sessionOpened(IoFilter.NextFilter nextFilter,
IoSession session)
Event is stored in an IoSessionEventQueue for later delivery to the next filter
in the chain when the handshake would have succeed. |
void |
writeData(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest,
boolean isHandshakeData)
Actually write data. |
| Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter |
|---|
destroy, filterClose, init, onPostAdd, onPostRemove, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ProxyFilter()
ProxyFilter.
| Method Detail |
|---|
public void onPreAdd(IoFilterChain chain,
String name,
IoFilter.NextFilter nextFilter)
ProxyFilter instance.
onPreAdd in interface IoFilteronPreAdd in class IoFilterAdapterchain - the filter chainname - the name assigned to this filternextFilter - the next filter
IllegalStateException - if chain already contains an instance of
ProxyFilter
public void onPreRemove(IoFilterChain chain,
String name,
IoFilter.NextFilter nextFilter)
ProxyIoSession instance from the session.
onPreRemove in interface IoFilteronPreRemove in class IoFilterAdapterchain - the filter chainname - the name assigned to this filternextFilter - the next filter
public void exceptionCaught(IoFilter.NextFilter nextFilter,
IoSession session,
Throwable cause)
throws Exception
ProxyIoSession session's instance to signal that handshake
failed.
exceptionCaught in interface IoFilterexceptionCaught in class IoFilterAdapterchain - the filter chainname - the name assigned to this filternextFilter - the next filter
Exception
public void messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
throws ProxyAuthException
messageReceived in interface IoFiltermessageReceived in class IoFilterAdapternextFilter - the next filter in filter chainsession - the session objectmessage - the object holding the received data
ProxyAuthException
public void filterWrite(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
filterWrite in interface IoFilterfilterWrite in class IoFilterAdapternextFilter - the next filter in filter chainsession - the session objectwriteRequest - the data to write
public void writeData(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest,
boolean isHandshakeData)
nextFilter - the next filter in filter chainsession - the session objectwriteRequest - the data to writeisHandshakeData - true if writeRequest is written by the proxy classes.
public void messageSent(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
throws Exception
messageSent in interface IoFiltermessageSent in class IoFilterAdapternextFilter - the next filter in filter chainsession - the session objectwriteRequest - the data written
Exception
public void sessionCreated(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
ProxyIoSession.getRequest() request stored in the session. Event
is stored in an IoSessionEventQueue for later delivery to the next filter
in the chain when the handshake would have succeed. This will prevent the rest of
the filter chain from being affected by this filter internals.
Please note that this event can occur multiple times because of some http
proxies not handling keep-alive connections thus needing multiple sessions
during the handshake.
sessionCreated in interface IoFiltersessionCreated in class IoFilterAdapternextFilter - the next filter in filter chainsession - the session object
Exception
public void sessionOpened(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
IoSessionEventQueue for later delivery to the next filter
in the chain when the handshake would have succeed. This will prevent the rest of
the filter chain from being affected by this filter internals.
sessionOpened in interface IoFiltersessionOpened in class IoFilterAdapternextFilter - the next filter in filter chainsession - the session object
Exception
public void sessionIdle(IoFilter.NextFilter nextFilter,
IoSession session,
IdleStatus status)
throws Exception
IoSessionEventQueue for later delivery to the next filter
in the chain when the handshake would have succeed. This will prevent the rest of
the filter chain from being affected by this filter internals.
sessionIdle in interface IoFiltersessionIdle in class IoFilterAdapternextFilter - the next filter in filter chainsession - the session object
Exception
public void sessionClosed(IoFilter.NextFilter nextFilter,
IoSession session)
throws Exception
IoSessionEventQueue for later delivery to the next filter
in the chain when the handshake would have succeed. This will prevent the rest of
the filter chain from being affected by this filter internals.
sessionClosed in interface IoFiltersessionClosed in class IoFilterAdapternextFilter - the next filter in filter chainsession - the session object
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||