public class ProxyIoSession
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
authenticationFailed
Set to true when an exception has been thrown or if authentication failed.
|
private java.lang.String |
charsetName
Name of the charset used for string encoding & decoding.
|
private ProxyConnector |
connector
The proxy connector.
|
private static java.lang.String |
DEFAULT_ENCODING |
private IoSessionEventQueue |
eventQueue
The session event queue.
|
private ProxyLogicHandler |
handler
The currently selected proxy handler.
|
private java.util.List<HttpAuthenticationMethods> |
preferedOrder
The list contains the authentication methods to use.
|
static java.lang.String |
PROXY_SESSION |
private java.net.InetSocketAddress |
proxyAddress
Address of the proxy server.
|
private ProxyFilter |
proxyFilter
Parent
ProxyFilter handling the session. |
private boolean |
reconnectionNeeded
A flag that indicates that the proxy closed the connection before handshake
is done.
|
private ProxyRequest |
request
The request to send to the proxy.
|
private IoSession |
session
The session.
|
| Constructor and Description |
|---|
ProxyIoSession(java.net.InetSocketAddress proxyAddress,
ProxyRequest request)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.charset.Charset |
getCharset()
Returns a charset instance of the in use charset name.
|
java.lang.String |
getCharsetName()
Returns the used charset name or
DEFAULT_ENCODING if null. |
ProxyConnector |
getConnector()
Returns the proxy connector.
|
IoSessionEventQueue |
getEventQueue()
Returns the pending event queue.
|
ProxyLogicHandler |
getHandler()
Returns the
ProxyLogicHandler currently in use. |
java.util.List<HttpAuthenticationMethods> |
getPreferedOrder()
Returns the list of the prefered order for the authentication methods.
|
java.net.InetSocketAddress |
getProxyAddress()
Returns the IP address of the proxy server.
|
ProxyFilter |
getProxyFilter()
Returns the
ProxyFilter. |
ProxyRequest |
getRequest()
Returns the proxy request.
|
IoSession |
getSession()
Returns the current
IoSession. |
boolean |
isAuthenticationFailed()
Returns true if authentication failed.
|
boolean |
isReconnectionNeeded()
Returns true if the current authentication process is not finished
but the server has closed the connection.
|
void |
setAuthenticationFailed(boolean authenticationFailed)
Sets the authentication failed flag.
|
void |
setCharsetName(java.lang.String charsetName)
Sets the charset to use.
|
void |
setConnector(ProxyConnector connector)
Sets the connector reference of this proxy session.
|
void |
setHandler(ProxyLogicHandler handler)
Sets the
ProxyLogicHandler to use. |
void |
setPreferedOrder(java.util.List<HttpAuthenticationMethods> preferedOrder)
Sets the ordered list of prefered authentication mechanisms.
|
private void |
setProxyAddress(java.net.InetSocketAddress proxyAddress)
Sets the IP address of the proxy server.
|
void |
setProxyFilter(ProxyFilter proxyFilter)
Sets the
ProxyFilter. |
void |
setReconnectionNeeded(boolean reconnectionNeeded)
Sets the reconnection needed flag.
|
private void |
setRequest(ProxyRequest request)
Sets the proxy request.
|
void |
setSession(IoSession session)
Sets the
IoSession in use. |
public static final java.lang.String PROXY_SESSION
private static final java.lang.String DEFAULT_ENCODING
private java.util.List<HttpAuthenticationMethods> preferedOrder
private ProxyRequest request
private ProxyLogicHandler handler
private ProxyFilter proxyFilter
ProxyFilter handling the session.private IoSession session
private ProxyConnector connector
private java.net.InetSocketAddress proxyAddress
private boolean reconnectionNeeded
private java.lang.String charsetName
private IoSessionEventQueue eventQueue
private boolean authenticationFailed
public ProxyIoSession(java.net.InetSocketAddress proxyAddress,
ProxyRequest request)
proxyAddress - the IP address of the proxy serverrequest - the proxy requestpublic IoSessionEventQueue getEventQueue()
public java.util.List<HttpAuthenticationMethods> getPreferedOrder()
HttpSmartProxyHandler to determine
which authentication mechanism to use first between those accepted by the
proxy server. This list is only used when connecting to an http proxy.public void setPreferedOrder(java.util.List<HttpAuthenticationMethods> preferedOrder)
preferedOrder - the ordered listpublic ProxyLogicHandler getHandler()
ProxyLogicHandler currently in use.public void setHandler(ProxyLogicHandler handler)
ProxyLogicHandler to use.handler - the ProxyLogicHandler instancepublic ProxyFilter getProxyFilter()
ProxyFilter.public void setProxyFilter(ProxyFilter proxyFilter)
ProxyFilter.
Note : Please do not call this method from your code it could result
in an unexpected behaviour.proxyFilter - the filterpublic ProxyRequest getRequest()
private void setRequest(ProxyRequest request)
request - the proxy requestpublic void setSession(IoSession session)
IoSession in use.
Note : Please do not call this method from your code it could result in an
unexpected behaviour.session - the current io sessionpublic ProxyConnector getConnector()
public void setConnector(ProxyConnector connector)
connector - the proxy connectorpublic java.net.InetSocketAddress getProxyAddress()
private void setProxyAddress(java.net.InetSocketAddress proxyAddress)
proxyAddress - the IP address of the proxy serverpublic boolean isReconnectionNeeded()
public void setReconnectionNeeded(boolean reconnectionNeeded)
reconnectionNeeded - the value to set the flag topublic java.nio.charset.Charset getCharset()
public java.lang.String getCharsetName()
DEFAULT_ENCODING if null.public void setCharsetName(java.lang.String charsetName)
charsetName - the charset namepublic boolean isAuthenticationFailed()
public void setAuthenticationFailed(boolean authenticationFailed)
authenticationFailed - the value to set the flag to