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 and Description
    --- | ---
    `static String` | `PROXY_SESSION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProxyIoSession(InetSocketAddress proxyAddress, ProxyRequest request)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Charset` | `getCharset()` Returns a charset instance of the in use charset name.
    `String` | `getCharsetName()` Returns the used charset name or `DEFAULT_ENCODING` if null.
    `ProxyConnector` | `getConnector()` Returns the proxy connector.
    `IoSessionEventQueue` | `getEventQueue()` Returns the pending event queue.
    `ProxyLogicHandler` | `getHandler()` Returns the `ProxyLogicHandler` currently in use.
    `List<HttpAuthenticationMethods>` | `getPreferedOrder()` Returns the list of the prefered order for the authentication methods.
    `InetSocketAddress` | `getProxyAddress()` Returns the IP address of the proxy server.
    `ProxyFilter` | `getProxyFilter()` Returns the `ProxyFilter`.
    `ProxyRequest` | `getRequest()` Returns the proxy request.
    `IoSession` | `getSession()` Returns the current `IoSession`.
    `boolean` | `isAuthenticationFailed()` Returns true if authentication failed.
    `boolean` | `isReconnectionNeeded()` Returns true if the current authentication process is not finished but the server has closed the connection.
    `void` | `setAuthenticationFailed(boolean authenticationFailed)` Sets the authentication failed flag.
    `void` | `setCharsetName(String charsetName)` Sets the charset to use.
    `void` | `setConnector(ProxyConnector connector)` Sets the connector reference of this proxy session.
    `void` | `setHandler(ProxyLogicHandler handler)` Sets the `ProxyLogicHandler` to use.
    `void` | `setPreferedOrder(List<HttpAuthenticationMethods> preferedOrder)` Sets the ordered list of prefered authentication mechanisms.
    `void` | `setProxyFilter(ProxyFilter proxyFilter)` Sets the `ProxyFilter`.
    `void` | `setReconnectionNeeded(boolean reconnectionNeeded)` Sets the reconnection needed flag.
    `void` | `setSession(IoSession session)` Sets the `IoSession` in use.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROXY_SESSION

          public static final String PROXY_SESSION

  - ### Constructor Detail

    - #### ProxyIoSession

          public ProxyIoSession(InetSocketAddress proxyAddress,
                        ProxyRequest request)

      Constructor.
      Parameters:
        `proxyAddress` - the IP address of the proxy server
        `request` - 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 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.

    - #### 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.

    - #### 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

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.