cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [3/5] git commit: updated refs/heads/master to 765d402
Date Fri, 19 Sep 2014 13:16:50 GMT
CID-1114592 Replaced duplicate code with a call to super


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2df41e85
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2df41e85
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2df41e85

Branch: refs/heads/master
Commit: 2df41e857ec9d1398567c3dae3bd8a60f5a82759
Parents: 9cfab9b
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Fri Sep 19 14:45:13 2014 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Fri Sep 19 14:47:13 2014 +0200

----------------------------------------------------------------------
 .../cloud/storage/upload/UploadActiveState.java | 47 +++++++++-----------
 1 file changed, 22 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2df41e85/server/src/com/cloud/storage/upload/UploadActiveState.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadActiveState.java b/server/src/com/cloud/storage/upload/UploadActiveState.java
index 53bbb75..c5dcc4e 100644
--- a/server/src/com/cloud/storage/upload/UploadActiveState.java
+++ b/server/src/com/cloud/storage/upload/UploadActiveState.java
@@ -45,26 +45,26 @@ public abstract class UploadActiveState extends UploadState {
             s_logger.debug("handleAnswer, answer status=" + answer.getUploadStatus() + ",
curr state=" + getName());
         }
         switch (answer.getUploadStatus()) {
-            case UPLOAD_IN_PROGRESS:
-                getUploadListener().scheduleStatusCheck(RequestType.GET_STATUS);
-                return Status.UPLOAD_IN_PROGRESS.toString();
-            case UPLOADED:
-                getUploadListener().scheduleImmediateStatusCheck(RequestType.PURGE);
-                getUploadListener().cancelTimeoutTask();
-                return Status.UPLOADED.toString();
-            case NOT_UPLOADED:
-                getUploadListener().scheduleStatusCheck(RequestType.GET_STATUS);
-                return Status.NOT_UPLOADED.toString();
-            case UPLOAD_ERROR:
-                getUploadListener().cancelStatusTask();
-                getUploadListener().cancelTimeoutTask();
-                return Status.UPLOAD_ERROR.toString();
-            case UNKNOWN:
-                getUploadListener().cancelStatusTask();
-                getUploadListener().cancelTimeoutTask();
-                return Status.UPLOAD_ERROR.toString();
-            default:
-                return null;
+        case UPLOAD_IN_PROGRESS:
+            getUploadListener().scheduleStatusCheck(RequestType.GET_STATUS);
+            return Status.UPLOAD_IN_PROGRESS.toString();
+        case UPLOADED:
+            getUploadListener().scheduleImmediateStatusCheck(RequestType.PURGE);
+            getUploadListener().cancelTimeoutTask();
+            return Status.UPLOADED.toString();
+        case NOT_UPLOADED:
+            getUploadListener().scheduleStatusCheck(RequestType.GET_STATUS);
+            return Status.NOT_UPLOADED.toString();
+        case UPLOAD_ERROR:
+            getUploadListener().cancelStatusTask();
+            getUploadListener().cancelTimeoutTask();
+            return Status.UPLOAD_ERROR.toString();
+        case UNKNOWN:
+            getUploadListener().cancelStatusTask();
+            getUploadListener().cancelTimeoutTask();
+            return Status.UPLOAD_ERROR.toString();
+        default:
+            return null;
         }
     }
 
@@ -73,7 +73,7 @@ public abstract class UploadActiveState extends UploadState {
         if (s_logger.isTraceEnabled()) {
             getUploadListener().log("handleTimeout, updateMs=" + updateMs + ", curr state=
" + getName(), Level.TRACE);
         }
-        String newState = this.getName();
+        String newState = getName();
         if (updateMs > 5 * UploadListener.STATUS_POLL_INTERVAL) {
             newState = Status.UPLOAD_ERROR.toString();
             getUploadListener().log("timeout: transitioning to upload error state, currstate="
+ getName(), Level.DEBUG);
@@ -90,12 +90,9 @@ public abstract class UploadActiveState extends UploadState {
 
     @Override
     public void onEntry(String prevState, UploadEvent event, Object evtObj) {
-        if (s_logger.isTraceEnabled()) {
-            getUploadListener().log("onEntry, prev state= " + prevState + ", curr state="
+ getName() + ", event=" + event, Level.TRACE);
-        }
+        super.onEntry(prevState, event, evtObj);
 
         if (event == UploadEvent.UPLOAD_ANSWER) {
-            getUploadListener().updateDatabase((UploadAnswer)evtObj);
             getUploadListener().setLastUpdated();
         }
 


Mime
View raw message