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 java.lang.Object
implements PollHandler<P,​R>
For internal use by services employing polling.

See Also:
FutureResult
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.Class<P> pollClass  
    protected java.lang.Class<R> resultClass  
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected AbstractPollHandlerBase​(java.lang.Class<P> pollClass, java.lang.Class<R> resultClass)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Class<P> getPollClass()
    Get class of the polling object.
    R getResult()
    Return result after polling.
    java.lang.Class<R> getResultClass()
    Get class of result after polling.
    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.
    protected void onFinish()
    Method called after polling is successfully finished (default no-op)
    protected PollHandler<P,​R> setResult​(R result)  

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.gooddata.sdk.service.PollHandler

    getPolling, getPollingUri, handlePollException, handlePollResult
  • Field Details

    • pollClass

      protected final java.lang.Class<P> pollClass
    • resultClass

      protected final java.lang.Class<R> resultClass
  • Constructor Details

    • AbstractPollHandlerBase

      protected AbstractPollHandlerBase​(java.lang.Class<P> pollClass, java.lang.Class<R> resultClass)
  • Method Details

    • getResultClass

      public final java.lang.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 java.lang.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 java.io.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:
      java.io.IOException - when there's a problem extracting data from response
    • onFinish

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