static String awaitComplete ( CloudDNS api , Job job ) { RetryableException retryableException = new RetryableException ( format ( "Job %s did not complete. Check your logs." , job . id ) , null ) ; Retryer retryer = new Retryer . Default ( 500 , 1000 , 30 ) ; while ( true ) { job = api . getStatus ( job . id ) ; if ( "COMPLETED" . equals ( job . status ) ) { return job . resultId ; } else if ( "ERROR" . equals ( job . status ) ) { throw new IllegalStateException ( format ( "Job %s failed with error: %s" , job . id , job . errorDetails ) ) ; } retryer . continueOrPropagate ( retryableException ) ; } }
Returns the ID of the object created or null .