summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.core
diff options
context:
space:
mode:
authorShireesh Anjal <shireesh@gluster.com>2011-05-25 18:12:48 +0530
committerShireesh Anjal <shireesh@gluster.com>2011-05-30 12:20:17 +0530
commit66eeb6a273b1a60813375a4bf55bcc38e1a3d00a (patch)
tree74826193b1f83e558768e04b97da1c054e8cf259 /src/com.gluster.storage.management.core
parent4435678fe7c1ca8f857dd008088b3d33ddec0484 (diff)
Design changes - introducing cluster-server mapping on gateway
Diffstat (limited to 'src/com.gluster.storage.management.core')
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java31
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/exceptions/ConnectionException.java37
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/response/StringListResponse.java3
3 files changed, 57 insertions, 14 deletions
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java
index 1b70b84d..80622992 100644
--- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java
@@ -24,15 +24,22 @@ package com.gluster.storage.management.core.constants;
* All constants related to the Gluster REST server and client
*/
public class RESTConstants {
- // Volumes Resource
- public static final String RESOURCE_PATH_VOLUMES = "/cluster/volumes";
- public static final String SUBRESOURCE_DEFAULT_OPTIONS = "defaultoptions";
- public static final String SUBRESOURCE_OPTIONS = "options";
- public static final String SUBRESOURCE_LOGS = "logs";
- public static final String SUBRESOURCE_DOWNLOAD = "download";
- public static final String SUBRESOURCE_DISKS = "disks";
-
+ // REST Resource paths
+ public static final String RESOURCE_PATH_CLUSTERS = "/clusters";
+ public static final String RESOURCE_PATH_DISCOVERED_SERVERS = "/discoveredservers";
+ // REST Resource names
+ public static final String RESOURCE_VOLUMES = "volumes";
+ public static final String RESOURCE_DEFAULT_OPTIONS = "defaultoptions";
+ public static final String RESOURCE_OPTIONS = "options";
+ public static final String RESOURCE_LOGS = "logs";
+ public static final String RESOURCE_DOWNLOAD = "download";
+ public static final String RESOURCE_DISKS = "disks";
+ public static final String RESOURCE_RUNNING_TASKS = "runningtasks";
+ public static final String RESOURCE_ALERTS = "alerts";
+ public static final String RESOURCE_SERVERS = "servers";
+
+ public static final String FORM_PARAM_CLUSTER_NAME = "clusterName";
public static final String FORM_PARAM_DISKS = "disks";
public static final String FORM_PARAM_OPERATION = "operation";
public static final String FORM_PARAM_VALUE_START = "start";
@@ -46,7 +53,8 @@ public class RESTConstants {
public static final String FORM_PARAM_BRICKS = "bricks";
public static final String PATH_PARAM_VOLUME_NAME = "volumeName";
- public static final String FORM_PARAM_DELETE_OPTION = "value";
+ public static final String PATH_PARAM_CLUSTER_NAME = "clusterName";
+ public static final String PATH_PARAM_SERVER_NAME = "serverName";
public static final String QUERY_PARAM_DISK_NAME = "diskName";
public static final String QUERY_PARAM_DISKS = "disks";
@@ -59,9 +67,4 @@ public class RESTConstants {
public static final String QUERY_PARAM_TO_TIMESTAMP = "toTimestamp";
public static final String QUERY_PARAM_DOWNLOAD = "download";
public static final String QUERY_PARAM_SERVER_NAME = "serverName";
- public static final String QUERY_PARAM_KNOWN_SERVER = "knownServer";
-
- // Running tasks resource
- public static final String RESOURCE_PATH_RUNNING_TASKS = "/cluster/runningtasks";
- public static final String RESOURCE_PATH_ALERTS = "/cluster/alerts";
}
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/exceptions/ConnectionException.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/exceptions/ConnectionException.java
new file mode 100644
index 00000000..ec19ffd8
--- /dev/null
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/exceptions/ConnectionException.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Gluster, Inc. <http://www.gluster.com>
+ * This file is part of Gluster Management Console.
+ *
+ * Gluster Management Console is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Gluster Management Console is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *******************************************************************************/
+package com.gluster.storage.management.core.exceptions;
+
+/**
+ *
+ */
+public class ConnectionException extends GlusterRuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+
+ public ConnectionException(String message) {
+ super(message);
+ }
+
+ public ConnectionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/response/StringListResponse.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/response/StringListResponse.java
index f94884b9..785c6efb 100644
--- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/response/StringListResponse.java
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/response/StringListResponse.java
@@ -25,6 +25,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
+import com.gluster.storage.management.core.model.Status;
+
@XmlRootElement(name = "response")
public class StringListResponse extends AbstractResponse {
private List<String> data = new ArrayList<String>();
@@ -34,6 +36,7 @@ public class StringListResponse extends AbstractResponse {
public StringListResponse(List<String> data) {
this.data = data;
+ setStatus(Status.STATUS_SUCCESS);
}
@Override