Class AbstractPollHandlerBase<P,R>

java.lang.Object
com.gooddata.sdk.service.AbstractPollHandlerBase<P,R>
Type Parameters:
P - polling type
R - result type
All Implemented Interfaces:
PollHandler<P,R>
Direct Known Subclasses:
AbstractPollHandler

public abstract class AbstractPollHandlerBase<P,R> extends Object implements PollHandler<P,R>
For internal use by services employing polling.

See Also:
  • Field Details

    • pollClass

      protected final Class<P> pollClass
    • resultClass

      protected final Class<R> resultClass
  • Constructor Details

    • AbstractPollHandlerBase

      protected AbstractPollHandlerBase(Class<P> pollClass, Class<R> resultClass)
  • Method Details

    • getResultClass

      public final Class<R> getResultClass()
      Description copied from interface: PollHandler
      Get class of result after polling.
      Specified by:
      getResultClass in interface PollHandler<P,R>
      Returns:
      result class
    • getPollClass

      public final Class<P> getPollClass()
      Description copied from interface: PollHandler
      Get class of the polling object.
      Specified by:
      getPollClass in interface PollHandler<P,R>
      Returns:
      polling class
    • setResult

      protected PollHandler<P,R> setResult(R result)
    • isDone

      public final boolean isDone()
      Description copied from interface: PollHandler
      Returns true when the polling is done, false otherwise.
      Specified by:
      isDone in interface PollHandler<P,R>
      Returns:
      true when the polling is done, false otherwise
    • getResult

      public final R getResult()
      Description copied from interface: PollHandler
      Return result after polling.
      Specified by:
      getResult in interface PollHandler<P,R>
      Returns:
      result after polling
    • isFinished

      public boolean isFinished(org.springframework.http.client.ClientHttpResponse response) throws IOException
      Description copied from interface: PollHandler
      Check single polling response if whole polling process should finish.
      Specified by:
      isFinished in interface PollHandler<P,R>
      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
    • onFinish

      protected void onFinish()
      Method called after polling is successfully finished (default no-op)