Interface PollHandler<P,R>

Type Parameters:
P - polling type
R - result type
All Known Implementing Classes:
AbstractPollHandler, AbstractPollHandlerBase, SimplePollHandler

public interface PollHandler<P,R>
For internal use by services employing polling.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Get class of the polling object.
    default URI
    Get URI used for polling.
    Get URI used for polling.
    Return result after polling.
    Get class of result after polling.
    void
    handlePollException(com.gooddata.sdk.common.GoodDataRestException e)
    Handle exception while polling.
    void
    handlePollResult(P pollResult)
    Handle result of single polling request.
    boolean
    Returns true when the polling is done, false otherwise.
    boolean
    isFinished(org.springframework.http.client.ClientHttpResponse response)
    Check single polling response if whole polling process should finish.
  • Method Details

    • getPollingUri

      String getPollingUri()
      Get URI used for polling.
      Returns:
      URI string
    • getPolling

      default URI getPolling()
      Get URI used for polling.
      Returns:
      URI string
    • getResultClass

      Class<R> getResultClass()
      Get class of result after polling.
      Returns:
      result class
    • getPollClass

      Class<P> getPollClass()
      Get class of the polling object.
      Returns:
      polling class
    • isDone

      boolean isDone()
      Returns true when the polling is done, false otherwise.
      Returns:
      true when the polling is done, false otherwise
    • getResult

      R getResult()
      Return result after polling.
      Returns:
      result after polling
    • isFinished

      boolean isFinished(org.springframework.http.client.ClientHttpResponse response) throws IOException
      Check single polling response if whole polling process should finish.
      Parameters:
      response - client side HTTP response
      Returns:
      true if polling should finish, false otherwise
      Throws:
      IOException - when there's a problem extracting data from response
    • handlePollResult

      void handlePollResult(P pollResult)
      Handle result of single polling request.
      Parameters:
      pollResult - result of polling request
    • handlePollException

      void handlePollException(com.gooddata.sdk.common.GoodDataRestException e)
      Handle exception while polling. The implementing class should throw instance of GoodDataException (or ancestor) with the given argument as cause.
      Parameters:
      e - the exception