org.firebirdsql.gds.ng.wire

## Interface DeferredAction

-     public interface DeferredAction

  Interface for processing deferred responses from the server.

  This interfaces is used in protocol 11 or higher.

  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `WarningMessageCallback` | `getWarningMessageCallback()`
    `default void` | `onException(java.lang.Exception exception)` Exception received when receiving or processing the response.
    `void` | `processResponse(Response response)` Steps to process the deferred response.
    `static <T> DeferredAction` | `wrapDeferredResponse(DeferredResponse<T> deferredResponse, java.util.function.Function<Response,T> responseMapper, WarningMessageCallback warningMessageCallback, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)` Wraps a `DeferredResponse` in a `DeferredAction`.

- - ### Method Detail

    - #### processResponse

          void processResponse(Response response)

      Steps to process the deferred response.
      Parameters:
        `response` - Response object.

    - #### onException

          default void onException(java.lang.Exception exception)

      Exception received when receiving or processing the response.

      The default implementation only logs the exception on debug level.

      Parameters:
        `exception` - exception received processing the response
      Since:
        5

    - #### getWarningMessageCallback

          WarningMessageCallback getWarningMessageCallback()

      Returns:
        The warning callback to use when executing this deferred action.

    - #### wrapDeferredResponse

          static <T> DeferredAction wrapDeferredResponse(DeferredResponse<T> deferredResponse,
                                                         java.util.function.Function<Response,T> responseMapper,
                                                         WarningMessageCallback warningMessageCallback,
                                                         java.util.function.Consumer<java.lang.Exception> exceptionConsumer)

      Wraps a `DeferredResponse` in a `DeferredAction`.
      Type Parameters:
        `T` - response type of the deferred response
      Parameters:
        `deferredResponse` - the deferred response to wrap
        `responseMapper` - conversion from a `Response` to the appropriate object (or `null`) to call on `DeferredResponse.onResponse(Object)`
        `warningMessageCallback` - warning message callback to use when receiving the response
        `exceptionConsumer` - action to take for exceptions
      Returns:
        deferred action

Copyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.