Class 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)  
    • Field Detail

      • pollClass

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

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

      • AbstractPollHandlerBase

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

      • 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
      • 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)