Class TqlResourceImpl.QueryPoller

    • Method Detail

      • getQueryId

        public String getQueryId()
        Gets the ID of the query process.
        Returns:
        A String with the Query ID
      • cancel

        public void cancel()
                    throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Description copied from interface: TqlResourceImpl.QueryCancelable
        Tries to cancel the query.
        Specified by:
        cancel in interface TqlResourceImpl.QueryCancelable
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - Thrown if the query couldn't be cancelled
      • isFinished

        public boolean isFinished()
        Check if this query has finished.
        Returns:
        True if the query has finished, false otherwise
      • getResults

        public Iterable<Map<String,​Object>> getResults()
        Gets the results so far. If isFinished() is true then returns the final results, else will return whatever results where returned last time the query was polled.
        Returns:
        An iterable over the resulting objects
      • poll

        public boolean poll()
                     throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Polls the query backend to get the current status of the query.
        Returns:
        True if the query has finished
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - Thrown if the current status couldn't be returned
      • poll

        public boolean poll​(int timeout)
                     throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Polls the query backend to get the current status of the query.
        Parameters:
        timeout - Request timeout [seconds]
        Returns:
        True if the query has finished
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - Thrown if the current status couldn't be returned