Class 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
    • Field Detail

      • PROXY_SESSION

        public static final java.lang.String PROXY_SESSION
        The proxy session name
      • DEFAULT_ENCODING

        private static final java.lang.String DEFAULT_ENCODING
        See Also:
        Constant Field Values
      • preferedOrder

        private java.util.List<HttpAuthenticationMethods> 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

        private ProxyRequest request
        The request to send to the proxy.
      • session

        private IoSession session
        The session.
      • proxyAddress

        private java.net.InetSocketAddress proxyAddress
        Address of the proxy server.
      • reconnectionNeeded

        private boolean reconnectionNeeded
        A 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

        private java.lang.String charsetName
        Name of the charset used for string encoding & decoding.
      • authenticationFailed

        private boolean authenticationFailed
        Set to true when an exception has been thrown or if authentication failed.
    • Constructor Detail

      • ProxyIoSession

        public ProxyIoSession​(java.net.InetSocketAddress proxyAddress,
                              ProxyRequest request)
        Constructor.
        Parameters:
        proxyAddress - the IP address of the proxy server
        request - the proxy request
    • Method Detail

      • 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
      • setProxyFilter

        public void setProxyFilter​(ProxyFilter proxyFilter)
        Sets the ProxyFilter. 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.
      • setRequest

        private void setRequest​(ProxyRequest request)
        Sets the proxy request.
        Parameters:
        request - the proxy request
      • setSession

        public void setSession​(IoSession session)
        Sets the IoSession 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.
      • setProxyAddress

        private void setProxyAddress​(java.net.InetSocketAddress proxyAddress)
        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

        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