title: How to check if job has been finished?
body: <p>I have json response which has three different status "processing", "pending", "finished". I want to set a timer which checks this <strong>json</strong> status if it has finished. For that I have the following code:</p>
  
  <pre><code>       json = jsonDataWrapper.wrap(jobCreateResponse, JobResponseJSON.class);
  
      final Timer timer = new Timer();
  
      timer.schedule( new TimerTask() {
          public void run() {
  
              if(json.getStatus().equals("Finished"))
                  timer.cancel();
  
          }
      }, 5, 60*1000);
  </code></pre>
  
  <p>This scheduler doesn't wait till the timer finishes its task which has been mentioned. Is there any way to check the status of <strong>json</strong> to check after certain time if it has been finished, with status "Finished" ?  </p>