summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.core
diff options
context:
space:
mode:
authorShireesh Anjal <shireesh@gluster.com>2011-04-14 19:16:42 +0530
committerShireesh Anjal <shireesh@gluster.com>2011-04-14 19:16:42 +0530
commit6044ba8846610911dedbce10eecaef4a7d144abd (patch)
tree1441fef647a4414c63ed4cfc0c862d5ecb2baa88 /src/com.gluster.storage.management.core
parente0efe1a6d06870034ca3eef5f50913a0ef6e957a (diff)
Remote directory creation and directory cleanup script enhanced - incorporated review comments
Diffstat (limited to 'src/com.gluster.storage.management.core')
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Status.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Status.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Status.java
index c5fdb246..45a9842b 100644
--- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Status.java
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Status.java
@@ -24,14 +24,16 @@ import com.gluster.storage.management.core.utils.ProcessResult;
@XmlRootElement(name = "status")
public class Status {
+ // TODO: Convert the status codes to an enumeration
public static final int STATUS_CODE_SUCCESS = 0;
public static final int STATUS_CODE_FAILURE = 1;
- public static final int STATUS_CODE_RUNNING = 2;
- public static final int STATUS_CODE_PAUSE = 3;
- public static final int STATUS_CODE_WARNING = 4;
+ public static final int STATUS_CODE_PART_SUCCESS = 2;
+ public static final int STATUS_CODE_RUNNING = 3;
+ public static final int STATUS_CODE_PAUSE = 4;
+ public static final int STATUS_CODE_WARNING = 5;
public static final Status STATUS_SUCCESS = new Status(STATUS_CODE_SUCCESS, "Success");
public static final Status STATUS_FAILURE = new Status(STATUS_CODE_FAILURE, "Failure");
-
+
// public static final Status
private Integer code;
@@ -43,6 +45,10 @@ public class Status {
public boolean isSuccess() {
return code == STATUS_CODE_SUCCESS;
}
+
+ public boolean isPartSuccess() {
+ return code == STATUS_CODE_PART_SUCCESS;
+ }
public Status(Integer code, String message) {
this.code = code;
@@ -74,6 +80,6 @@ public class Status {
@Override
public String toString() {
- return (isSuccess() ? "Success" : "Failure [" + getCode() + "]") + ": " + getMessage();
+ return isSuccess() ? "Success" : "[" + getCode() + "][" + getMessage() + "]";
}
} \ No newline at end of file