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
  • Field Details

    • PROXY_SESSION

      public static final String PROXY_SESSION
      The proxy session name
    • DEFAULT_ENCODING

      private static final String DEFAULT_ENCODING
      See Also:
    • preferedOrder

      private 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.
    • handler

      private ProxyLogicHandler handler
      The currently selected proxy handler.
    • proxyFilter

      private ProxyFilter proxyFilter
      Parent ProxyFilter handling the session.
    • session

      private IoSession session
      The session.
    • connector

      private ProxyConnector connector
      The proxy connector.
    • proxyAddress

      private 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 String charsetName
      Name of the charset used for string encoding invalid input: '&' decoding.
    • eventQueue

      private IoSessionEventQueue eventQueue
      The session event queue.
    • authenticationFailed

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

    • ProxyIoSession

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

    • 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 the ProxyLogicHandler to use.
      Parameters:
      handler - the ProxyLogicHandler instance
    • getProxyFilter

      public ProxyFilter getProxyFilter()
      Returns:
      the ProxyFilter.
    • 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
    • getSession

      public IoSession getSession()
      Returns:
      the current IoSession.
    • 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 InetSocketAddress getProxyAddress()
      Returns:
      the IP address of the proxy server.
    • setProxyAddress

      private void setProxyAddress(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 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