Class PollResult<T>

  • All Implemented Interfaces:
    FutureResult<T>

    public final class PollResult<T>
    extends java.lang.Object
    implements FutureResult<T>
    Represents the result retrieved by polling on the REST API.
    • Constructor Summary

      Constructors 
      Constructor Description
      PollResult​(AbstractService service, PollHandler<?,​T> handler)
      Creates a new instance of the result to be eventually retrieved by polling on the REST API.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()
      Wait for the result to be available and return it's value
      T get​(long timeout, java.util.concurrent.TimeUnit unit)
      Wait for the result to be available up to given time and return it's value
      java.lang.String getPollingUri()
      Get URI used for polling
      boolean isDone()
      Checks if the result is available
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PollResult

        public PollResult​(AbstractService service,
                          PollHandler<?,​T> handler)
        Creates a new instance of the result to be eventually retrieved by polling on the REST API.

        For internal use by services employing polling.

        Parameters:
        service - this service
        handler - poll handler
    • Method Detail

      • isDone

        public boolean isDone()
        Description copied from interface: FutureResult
        Checks if the result is available
        Specified by:
        isDone in interface FutureResult<T>
        Returns:
        true if so
      • get

        public T get()
        Description copied from interface: FutureResult
        Wait for the result to be available and return it's value
        Specified by:
        get in interface FutureResult<T>
        Returns:
        result value
      • get

        public T get​(long timeout,
                     java.util.concurrent.TimeUnit unit)
        Description copied from interface: FutureResult
        Wait for the result to be available up to given time and return it's value
        Specified by:
        get in interface FutureResult<T>
        Parameters:
        timeout - timeout value
        unit - timeout unit
        Returns:
        result value
      • getPollingUri

        public java.lang.String getPollingUri()
        Get URI used for polling
        Specified by:
        getPollingUri in interface FutureResult<T>
        Returns:
        URI string