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:
FutureResult
  • Method Summary

    Modifier and Type Method Description
    java.lang.Class<P> getPollClass()
    Get class of the polling object.
    default java.net.URI getPolling()
    Get URI used for polling.
    java.lang.String getPollingUri()
    Get URI used for polling.
    R getResult()
    Return result after polling.
    java.lang.Class<R> getResultClass()
    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 isDone()
    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

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

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

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

      java.lang.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 java.io.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:
      java.io.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