Class StatusTask<T>


  • public class StatusTask<T>
    extends java.lang.Object
    A reference to a Task on the DataRobot server. Client code that uses the DataRobot AI API package generally should not construct these objects directly, they should be instantiated by AI API Client methods. This object may be out of sync with the DataRobot sever, for example, if multiple processes or users have permission to modify or delete it on the server.
    • Method Detail

      • isSuccessful

        public boolean isSuccessful()
        Check if a task is successful
        Returns:
        Boolean True when the operation was successful, False when the API indicated there was an error with the operation, or if the operation is not yet complete
      • getSuccess

        public boolean getSuccess()
        Check if a task is successful
        Returns:
        Boolean True when the operation was successful, False when the API indicated there was an error with the operation, or if the operation is not yet complete
      • getError

        public java.lang.String getError()
        Returns the error of this StatusTask
        Returns:
        the error that occurred
      • getStatus

        public java.lang.String getStatus()
        Returns the current status of this StatusTask
        Returns:
        the current task status
      • getMessage

        public java.lang.String getMessage()
        Returns the current message of this StatusTask
        Returns:
        the current message
      • timeOut

        public boolean timeOut()
        Indication if this StatusTask timed out before completion.
        Returns:
        Boolean True if the operation took longer than the timeout given to getResult or if the default timeout was exceeded
      • getHttpMessageTransformer

        public Action<com.google.api.client.http.HttpRequest,​com.google.api.client.http.HttpResponse> getHttpMessageTransformer()
        internal
      • setHttpMessageTransformer

        public void setHttpMessageTransformer​(Action<com.google.api.client.http.HttpRequest,​com.google.api.client.http.HttpResponse> httpMessageTransformer)
        internal
      • getResultAsync

        public java.util.concurrent.Future<T> getResultAsync​(int timeout)
        Start the process of returning the output of this StatusTask once the operation completes. Use getResult() on the return of this object to retrieve the result.
        Parameters:
        timeout - the time in seconds to wait for this StatusTask to complete
        Returns:
        the result of this FutureStatusTask
      • getResultAsync

        public java.util.concurrent.Future<T> getResultAsync()
        Start the process of returning the output of this StatusTask once the operation completes. Use getResult() on the return of this object to retrieve the result.
        Returns:
        the result of this FutureStatusTask
      • getResult

        public T getResult()
                    throws ClientException,
                           java.lang.InterruptedException
        Wait until the operation completes, and return its output
        Returns:
        the result of this StatusTask
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
        java.lang.InterruptedException - when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
      • getResult

        public T getResult​(int timeout)
                    throws ClientException,
                           java.lang.InterruptedException
        Wait until the operation completes, and return its output
        Parameters:
        timeout - the time in seconds to wait for this StatusTask to complete
        Returns:
        the result of this StatusTask
        Throws:
        ClientException - when 4xx or 5xx response is received from server, or errors in parsing the response.
        java.lang.InterruptedException - when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object