Class AbstractRestPublishService.RequestInfo

  • Enclosing class:
    AbstractRestPublishService

    public static class AbstractRestPublishService.RequestInfo
    extends java.lang.Object
    Struct for storing info about a request and the results.
    • Field Detail

      • results

        protected java.util.Queue<java.lang.Object> results
      • terminated

        protected boolean terminated
      • exception

        protected java.lang.Throwable exception
      • lastcheck

        protected long lastcheck
      • future

        protected IFuture<?> future
    • Method Detail

      • setTerminated

        public void setTerminated()
        Set it to terminated.
      • isTerminated

        public boolean isTerminated()
        Check if terminated
        Returns:
        True if terminated.
      • checkForResult

        public boolean checkForResult()
        Check, if there is a result that is not yet consumed. Also increases the check timer to detect timeout when browser is disconnected.
        Returns:
        True if there is a result.
      • addResult

        public void addResult​(java.lang.Object result)
        Add a result.
        Parameters:
        result - The result to add
      • getException

        public java.lang.Throwable getException()
        Get the exception (if any).
      • setException

        public void setException​(java.lang.Throwable exception)
        Set the exception.
      • getNextResult

        public java.lang.Object getNextResult()
        Get the next result (FIFO order).
        Throws:
        java.lang.NullPointerException - if there were never any results
        java.util.NoSuchElementException - if the last result was already consumed.
      • getResults

        public java.lang.Object getResults()
        Get the results.
      • getTimestamp

        public long getTimestamp()
        Get the timestamp of the last check (i.e. last request from browser).
      • getFuture

        public IFuture<?> getFuture()
        Get the future.
        Returns:
        the future