tigase.jaxmpp.core.client

## Class ResponseManager

- java.lang.Object
- - tigase.jaxmpp.core.client.ResponseManager

- Direct Known Subclasses:
    ThreadSafeResponseManager

      public class ResponseManager
      extends Object

  Class for manage responses for IQ `type='get'` stanzas.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `ResponseManager.Entry`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static long` | `DEFAULT_TIMEOUT`
    `protected Logger` | `log`
    `static String` | `RESPONSE_MANAGER_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResponseManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkTimeouts()` Checks if any requested IQ stanza waits for answer longer than declared timeout.
    `protected Map<String,ResponseManager.Entry>` | `getHandlers()`
    `static Runnable` | `getResponseHandler(Context context, Element element)`
    `Runnable` | `getResponseHandler(Element element, Context context)` Returns handler for response of sent `` stanza.
    `static ResponseManager` | `getResponseManager(SessionObject sessionObject)`
    `String` | `registerResponseHandler(Element stanza, Long timeout, AsyncCallback callback)` Register callback for response of sent `` stanza.
    `static String` | `registerResponseHandler(SessionObject sessionObject, Element stanza, Long timeout, AsyncCallback callback)`
    `static void` | `setResponseManager(SessionObject sessionObject, ResponseManager responseManager)`

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

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

- - ### Field Detail

    - #### RESPONSE_MANAGER_KEY

          public static final String RESPONSE_MANAGER_KEY

      See Also:
        Constant Field Values

    - #### DEFAULT_TIMEOUT

          protected static final long DEFAULT_TIMEOUT

      See Also:
        Constant Field Values

    - #### log

          protected final Logger log

  - ### Constructor Detail

    - #### ResponseManager

          public ResponseManager()

  - ### Method Detail

    - #### getResponseHandler

          public static Runnable getResponseHandler(Context context,
                                                    Element element)
                                             throws JaxmppException

      Throws:
        `JaxmppException`

    - #### getResponseManager

          public static final ResponseManager getResponseManager(SessionObject sessionObject)

    - #### registerResponseHandler

          public static String registerResponseHandler(SessionObject sessionObject,
                                                       Element stanza,
                                                       Long timeout,
                                                       AsyncCallback callback)
                                                throws XMLException

      Throws:
        `XMLException`

    - #### setResponseManager

          public static final void setResponseManager(SessionObject sessionObject,
                                                      ResponseManager responseManager)

    - #### checkTimeouts

          public void checkTimeouts()
                             throws JaxmppException

      Checks if any requested IQ stanza waits for answer longer than declared timeout.
      Throws:
        `JaxmppException`

    - #### getHandlers

          protected Map<String,ResponseManager.Entry> getHandlers()

    - #### getResponseHandler

          public Runnable getResponseHandler(Element element,
                                             Context context)
                                      throws JaxmppException

      Returns handler for response of sent `` stanza.
      Parameters:
        `element` - reponse `` stanza.
      Returns:
        Runnable object with handler
      Throws:
        `XMLException`
        `JaxmppException`

    - #### registerResponseHandler

          public String registerResponseHandler(Element stanza,
                                                Long timeout,
                                                AsyncCallback callback)
                                         throws XMLException

      Register callback for response of sent `` stanza.
      Parameters:
        `stanza` - sent `` stanza.
        `timeout` - timeout. After it method onTimeout() will be called.
        `callback` - callback
      Returns:
        id of stanza
      Throws:
        `XMLException`

Copyright © 2006–2023 Tigase. All rights reserved.