App Engine Java SDK version 1.7.0
[gae.git] / java / src / main / com / google / appengine / tools / admin / UpdateProgressEvent.java
blob9eba881f0e024efbc8f21176588e87edbf5a5d07
1 // Copyright 2008 Google Inc. All Rights Reserved.
3 package com.google.appengine.tools.admin;
5 /**
6 * Received by an {@link com.google.appengine.tools.admin.UpdateListener}
7 * periodically during an operation to indicate progress.
9 */
10 public class UpdateProgressEvent {
12 private String message;
13 private int percentageComplete;
14 private Thread updateThread;
16 public UpdateProgressEvent(Thread updateThread, String message, int percentageComplete) {
17 this.message = message;
18 this.percentageComplete = percentageComplete;
19 this.updateThread = updateThread;
22 /**
23 * Cancels the operation. A
24 * {@link com.google.appengine.tools.admin.AppAdmin#rollback rollback} is
25 * implicitly issued.
27 public void cancel() {
28 updateThread.interrupt();
31 /**
32 * Retrieves the current status message.
34 * @return a not {@code null} status message.
36 public String getMessage() {
37 return message;
40 /**
41 * Retrieves the current percentage complete.
43 * @return a number inclusively between 0 and 100.
45 public int getPercentageComplete() {
46 return percentageComplete;