Package org.apache.mina.proxy.session
Class ProxyIoSession
- java.lang.Object
-
- org.apache.mina.proxy.session.ProxyIoSession
-
public class ProxyIoSession extends Object
ProxyIoSession.java - Class that contains all informations for the current proxy authentication session.- Since:
- MINA 2.0.0-M3
- Author:
- Apache MINA Project
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROXY_SESSION
The proxy session name
-
Constructor Summary
Constructors Constructor Description ProxyIoSession(InetSocketAddress proxyAddress, ProxyRequest request)
Constructor.
-
Method Summary
-
-
-
Field Detail
-
PROXY_SESSION
public static final String PROXY_SESSION
The proxy session name
-
-
Constructor Detail
-
ProxyIoSession
public ProxyIoSession(InetSocketAddress proxyAddress, ProxyRequest request)
Constructor.- Parameters:
proxyAddress
- the IP address of the proxy serverrequest
- the proxy request
-
-
Method Detail
-
getEventQueue
public IoSessionEventQueue getEventQueue()
- Returns:
- the pending event queue.
-
getPreferedOrder
public List<HttpAuthenticationMethods> getPreferedOrder()
- Returns:
- the list of the prefered order for the authentication methods.
This list is used by the
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.
-
setPreferedOrder
public void setPreferedOrder(List<HttpAuthenticationMethods> preferedOrder)
Sets the ordered list of prefered authentication mechanisms.- Parameters:
preferedOrder
- the ordered list
-
getHandler
public ProxyLogicHandler getHandler()
- Returns:
- the
ProxyLogicHandler
currently in use.
-
setHandler
public void setHandler(ProxyLogicHandler handler)
Sets theProxyLogicHandler
to use.- Parameters:
handler
- theProxyLogicHandler
instance
-
getProxyFilter
public ProxyFilter getProxyFilter()
- Returns:
- the
ProxyFilter
.
-
setProxyFilter
public void setProxyFilter(ProxyFilter proxyFilter)
Sets theProxyFilter
. Note : Please do not call this method from your code it could result in an unexpected behaviour.- Parameters:
proxyFilter
- the filter
-
getRequest
public ProxyRequest getRequest()
- Returns:
- the proxy request.
-
setSession
public void setSession(IoSession session)
Sets theIoSession
in use. Note : Please do not call this method from your code it could result in an unexpected behaviour.- Parameters:
session
- the current io session
-
getConnector
public ProxyConnector getConnector()
- Returns:
- the proxy connector.
-
setConnector
public void setConnector(ProxyConnector connector)
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
public InetSocketAddress getProxyAddress()
- Returns:
- 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
public Charset getCharset()
- Returns:
- a charset instance of the in use charset name.
-
getCharsetName
public String getCharsetName()
- Returns:
- the used charset name or DEFAULT_ENCODING if null.
-
setCharsetName
public void setCharsetName(String charsetName)
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
-
-