tigase.jaxmpp.j2se.connection.socks5bytestream

## Class Socks5ConnectionManager

- java.lang.Object
- - tigase.jaxmpp.j2se.connection.socks5bytestream.Socks5ConnectionManager

- All Implemented Interfaces:
    ContextAware, ConnectionManager
  Direct Known Subclasses:
    JingleSocks5BytestreamsConnectionManager, Socks5BytestreamsConnectionManager

      public abstract class Socks5ConnectionManager
      extends Object
      implements ConnectionManager

  Author:
    andrzej

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Socks5ConnectionManager.State`

    - ### Nested classes/interfaces inherited from interface tigase.jaxmpp.j2se.connection.ConnectionManager

      `ConnectionManager.ConnectionClosedHandler, ConnectionManager.ConnectionEstablishedHandler, ConnectionManager.ConnectionFailedHandler, ConnectionManager.InitializedCallback`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Context` | `context`
    `protected static String` | `JAXMPP_KEY`
    `static String` | `PACKET_ID`
    `protected static String` | `PROXY_JID_KEY`
    `protected static String` | `PROXY_JID_USED_KEY`
    `protected static String` | `SID_KEY`
    `protected static String` | `STREAMHOST_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Socks5ConnectionManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `checkHash(String data, ConnectionSession session)`
    `protected static void` | `clearSessions()`
    `protected void` | `connectToProxy(JaxmppCore jaxmpp, ConnectionSession session, String sid, ConnectionEndpoint host)`
    `void` | `discoverProxy(JaxmppCore jaxmpp, ConnectionSession session, ConnectionManager.InitializedCallback callback)`
    `protected void` | `fireOnConnected(ConnectionSession session)`
    `protected void` | `fireOnConnected(ConnectionSession session, Socket socket)`
    `protected void` | `fireOnFailure(ConnectionSession session)`
    `protected static String` | `generateHash(ConnectionSession session)`
    `protected List<Streamhost>` | `getLocalStreamHosts(ConnectionSession session, String sid)`
    `protected static ConnectionSession` | `getSession(String hash)`
    `protected void` | `handleConnection(ConnectionSession session, Socket socket, boolean incoming)`
    `protected static Socks5ConnectionManager.State` | `processData(ConnectionSession ft, SocketChannel socket, Socks5ConnectionManager.State state, ByteBuffer buf)`
    `protected void` | `proxyDiscoveryError(JaxmppCore jaxmpp, ConnectionSession ft, ConnectionManager.InitializedCallback callback, String errorText)`
    `protected void` | `proxyDiscoveryFinished(JaxmppCore jaxmpp, ConnectionSession ft, ConnectionManager.InitializedCallback callback, List<JID> proxyComponents)`
    `protected static void` | `registerSession(ConnectionSession session, String sid, Socks5ConnectionManager instance)`
    `protected void` | `requestActivate(ConnectionSession session, Socket socket)`
    `void` | `setContext(Context context)`
    `protected static void` | `unregisterSession(ConnectionSession session)`

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

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

    - ### Methods inherited from interface tigase.jaxmpp.j2se.connection.ConnectionManager

      `connectTcp, connectUdp, initConnection`

- - ### Field Detail

    - #### PACKET_ID

          public static final String PACKET_ID

      See Also:
        Constant Field Values

    - #### JAXMPP_KEY

          protected static final String JAXMPP_KEY

      See Also:
        Constant Field Values

    - #### PROXY_JID_KEY

          protected static final String PROXY_JID_KEY

      See Also:
        Constant Field Values

    - #### PROXY_JID_USED_KEY

          protected static final String PROXY_JID_USED_KEY

      See Also:
        Constant Field Values

    - #### SID_KEY

          protected static final String SID_KEY

      See Also:
        Constant Field Values

    - #### STREAMHOST_KEY

          protected static final String STREAMHOST_KEY

      See Also:
        Constant Field Values

    - #### context

          protected Context context

  - ### Constructor Detail

    - #### Socks5ConnectionManager

          public Socks5ConnectionManager()

  - ### Method Detail

    - #### checkHash

          protected static boolean checkHash(String data,
                                             ConnectionSession session)

    - #### clearSessions

          protected static void clearSessions()

    - #### generateHash

          protected static String generateHash(ConnectionSession session)

    - #### getSession

          protected static ConnectionSession getSession(String hash)

    - #### processData

          protected static Socks5ConnectionManager.State processData(ConnectionSession ft,
                                                                     SocketChannel socket,
                                                                     Socks5ConnectionManager.State state,
                                                                     ByteBuffer buf)
                                                              throws IOException

      Throws:
        `IOException`

    - #### registerSession

          protected static void registerSession(ConnectionSession session,
                                                String sid,
                                                Socks5ConnectionManager instance)

    - #### unregisterSession

          protected static void unregisterSession(ConnectionSession session)

    - #### connectToProxy

          protected void connectToProxy(JaxmppCore jaxmpp,
                                        ConnectionSession session,
                                        String sid,
                                        ConnectionEndpoint host)
                                 throws IOException,
                                        JaxmppException

      Throws:
        `IOException`
        `JaxmppException`

    - #### discoverProxy

          public void discoverProxy(JaxmppCore jaxmpp,
                                    ConnectionSession session,
                                    ConnectionManager.InitializedCallback callback)
                             throws JaxmppException

      Throws:
        `JaxmppException`

    - #### fireOnConnected

          protected void fireOnConnected(ConnectionSession session)

    - #### fireOnConnected

          protected void fireOnConnected(ConnectionSession session,
                                         Socket socket)

    - #### fireOnFailure

          protected void fireOnFailure(ConnectionSession session)

    - #### getLocalStreamHosts

          protected List<Streamhost> getLocalStreamHosts(ConnectionSession session,
                                                         String sid)
                                                  throws JaxmppException

      Throws:
        `JaxmppException`

    - #### handleConnection

          protected void handleConnection(ConnectionSession session,
                                          Socket socket,
                                          boolean incoming)
                                   throws IOException

      Throws:
        `IOException`

    - #### proxyDiscoveryError

          protected void proxyDiscoveryError(JaxmppCore jaxmpp,
                                             ConnectionSession ft,
                                             ConnectionManager.InitializedCallback callback,
                                             String errorText)

    - #### proxyDiscoveryFinished

          protected void proxyDiscoveryFinished(JaxmppCore jaxmpp,
                                                ConnectionSession ft,
                                                ConnectionManager.InitializedCallback callback,
                                                List<JID> proxyComponents)

    - #### requestActivate

          protected void requestActivate(ConnectionSession session,
                                         Socket socket)
                                  throws JaxmppException

      Throws:
        `JaxmppException`

    - #### setContext

          public void setContext(Context context)

      Specified by:
        `setContext` in interface `ContextAware`

Copyright © 2006–2017 Tigase. All rights reserved.