Class ProxyIoSession
java.lang.Object
org.apache.mina.proxy.session.ProxyIoSession
ProxyIoSession.java - Class that contains all informations for the current proxy
authentication session.
- Since:
- MINA 2.0.0-M3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanSet to true when an exception has been thrown or if authentication failed.private StringName of the charset used for string encoding invalid input: '&' decoding.private ProxyConnectorThe proxy connector.private static final Stringprivate IoSessionEventQueueThe session event queue.private ProxyLogicHandlerThe currently selected proxy handler.private List<HttpAuthenticationMethods> The list contains the authentication methods to use.static final StringThe proxy session nameprivate InetSocketAddressAddress of the proxy server.private ProxyFilterParentProxyFilterhandling the session.private booleanA flag that indicates that the proxy closed the connection before handshake is done.private ProxyRequestThe request to send to the proxy.private IoSessionThe session. -
Constructor Summary
ConstructorsConstructorDescriptionProxyIoSession(InetSocketAddress proxyAddress, ProxyRequest request) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoidsetAuthenticationFailed(boolean authenticationFailed) Sets the authentication failed flag.voidsetCharsetName(String charsetName) Sets the charset to use.voidsetConnector(ProxyConnector connector) Sets the connector reference of this proxy session.voidsetHandler(ProxyLogicHandler handler) Sets theProxyLogicHandlerto use.voidsetPreferedOrder(List<HttpAuthenticationMethods> preferedOrder) Sets the ordered list of prefered authentication mechanisms.private voidsetProxyAddress(InetSocketAddress proxyAddress) Sets the IP address of the proxy server.voidsetProxyFilter(ProxyFilter proxyFilter) Sets theProxyFilter.voidsetReconnectionNeeded(boolean reconnectionNeeded) Sets the reconnection needed flag.private voidsetRequest(ProxyRequest request) Sets the proxy request.voidsetSession(IoSession session) Sets theIoSessionin use.
-
Field Details
-
PROXY_SESSION
The proxy session name -
DEFAULT_ENCODING
- See Also:
-
preferedOrder
The list contains the authentication methods to use. The order in the list is revelant : if first method is available then it will be used etc ... -
request
The request to send to the proxy. -
handler
The currently selected proxy handler. -
proxyFilter
ParentProxyFilterhandling the session. -
session
The session. -
connector
The proxy connector. -
proxyAddress
Address of the proxy server. -
reconnectionNeeded
private boolean reconnectionNeededA flag that indicates that the proxy closed the connection before handshake is done. So we need to reconnect to the proxy to continue the handshaking process. -
charsetName
Name of the charset used for string encoding invalid input: '&' decoding. -
eventQueue
The session event queue. -
authenticationFailed
private boolean authenticationFailedSet to true when an exception has been thrown or if authentication failed.
-
-
Constructor Details
-
ProxyIoSession
Constructor.- Parameters:
proxyAddress- the IP address of the proxy serverrequest- the proxy request
-
-
Method Details
-
getEventQueue
- Returns:
- the pending event queue.
-
getPreferedOrder
- Returns:
- the list of the prefered order for the authentication methods.
This list is used by the
HttpSmartProxyHandlerto 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.
-
setPreferedOrder
Sets the ordered list of prefered authentication mechanisms.- Parameters:
preferedOrder- the ordered list
-
getHandler
- Returns:
- the
ProxyLogicHandlercurrently in use.
-
setHandler
Sets theProxyLogicHandlerto use.- Parameters:
handler- theProxyLogicHandlerinstance
-
getProxyFilter
- Returns:
- the
ProxyFilter.
-
setProxyFilter
Sets theProxyFilter. Note : Please do not call this method from your code it could result in an unexpected behaviour.- Parameters:
proxyFilter- the filter
-
getRequest
- Returns:
- the proxy request.
-
setRequest
Sets the proxy request.- Parameters:
request- the proxy request
-
getSession
-
setSession
-
getConnector
- Returns:
- the proxy connector.
-
setConnector
Sets the connector reference of this proxy session. Note : Please do not call this method from your code it could result in an unexpected behaviour.- Parameters:
connector- the proxy connector
-
getProxyAddress
- Returns:
- the IP address of the proxy server.
-
setProxyAddress
Sets the IP address of the proxy server.- Parameters:
proxyAddress- the IP address of the proxy server
-
isReconnectionNeeded
public boolean isReconnectionNeeded()- Returns:
- true if the current authentication process is not finished but the server has closed the connection.
-
setReconnectionNeeded
public void setReconnectionNeeded(boolean reconnectionNeeded) Sets the reconnection needed flag. If set to true, it means that an authentication process is currently running but the proxy server did not kept the connection alive. So we need to reconnect to the server to complete the process. Note : Please do not call this method from your code it could result in an unexpected behaviour.- Parameters:
reconnectionNeeded- the value to set the flag to
-
getCharset
- Returns:
- a charset instance of the in use charset name.
-
getCharsetName
- Returns:
- the used charset name or DEFAULT_ENCODING if null.
-
setCharsetName
Sets the charset to use.- Parameters:
charsetName- the charset name
-
isAuthenticationFailed
public boolean isAuthenticationFailed()- Returns:
- true if authentication failed.
-
setAuthenticationFailed
public void setAuthenticationFailed(boolean authenticationFailed) Sets the authentication failed flag.- Parameters:
authenticationFailed- the value to set the flag to
-