Package org.apache.mina.proxy.session
Class ProxyIoSession
- java.lang.Object
-
- org.apache.mina.proxy.session.ProxyIoSession
-
public class ProxyIoSession extends java.lang.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 java.lang.String
PROXY_SESSION
The proxy session name
-
Constructor Summary
Constructors Constructor Description ProxyIoSession(java.net.InetSocketAddress proxyAddress, ProxyRequest request)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.charset.Charset
getCharset()
java.lang.String
getCharsetName()
ProxyConnector
getConnector()
IoSessionEventQueue
getEventQueue()
ProxyLogicHandler
getHandler()
java.util.List<HttpAuthenticationMethods>
getPreferedOrder()
java.net.InetSocketAddress
getProxyAddress()
ProxyFilter
getProxyFilter()
ProxyRequest
getRequest()
IoSession
getSession()
boolean
isAuthenticationFailed()
boolean
isReconnectionNeeded()
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 theProxyLogicHandler
to use.void
setPreferedOrder(java.util.List<HttpAuthenticationMethods> preferedOrder)
Sets the ordered list of prefered authentication mechanisms.void
setProxyFilter(ProxyFilter proxyFilter)
Sets theProxyFilter
.void
setReconnectionNeeded(boolean reconnectionNeeded)
Sets the reconnection needed flag.void
setSession(IoSession session)
Sets theIoSession
in use.
-
-
-
Constructor Detail
-
ProxyIoSession
public ProxyIoSession(java.net.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 java.util.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(java.util.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 java.net.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 java.nio.charset.Charset getCharset()
- Returns:
- a charset instance of the in use charset name.
-
getCharsetName
public java.lang.String getCharsetName()
- Returns:
- the used charset name or DEFAULT_ENCODING if null.
-
setCharsetName
public void setCharsetName(java.lang.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
-
-