summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java50
-rw-r--r--src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java71
2 files changed, 0 insertions, 121 deletions
diff --git a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java b/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java
deleted file mode 100644
index 4e379199..00000000
--- a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * 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.server.resources;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-//Sets the path to base URL + /hello
-@Path("/hello")
-public class Hello {
- // This method is called if TEXT_PLAIN is request
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public String sayPlainTextHello() {
- return "Hello Jersey";
- }
-
- // This method is called if XMLis request
- @GET
- @Produces(MediaType.TEXT_XML)
- public String sayXMLHello() {
- return "<?xml version=\"1.0\"?>" + "<hello> Hello Jersey" + "</hello>";
- }
-
- // This method is called if HTML is request
- @GET
- @Produces(MediaType.TEXT_HTML)
- public String sayHtmlHello() {
- return "<html> " + "<title>" + "Hello Jersey" + "</title>"
- + "<body><h1>" + "Hello Jersey" + "</body></h1>" + "</html> ";
- }
-}
diff --git a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java b/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java
deleted file mode 100644
index 08e8c9a6..00000000
--- a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * 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.server.resources;
-
-import java.io.File;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import com.gluster.storage.management.core.utils.FileUtil;
-import com.gluster.storage.management.core.utils.ProcessResult;
-import com.gluster.storage.management.core.utils.ProcessUtil;
-
-@Path("/server")
-public class ServerResource {
- // TODO: xml should be read from a "work" directory under the tomcat server.
- // Use relative path - do not hard code the absolute path.
- public static final String DISCOVERED_SERVERS_XML = "/GLUSTER/discovered-servers.xml";
-
- /**
- * Discover newly available servers
- *
- * @return list of discovered servers
- */
- private String GetDiscoveredServers() {
- File discoveredServersFile = new File(DISCOVERED_SERVERS_XML);
- String serverNames = new FileUtil().readFileAsString(discoveredServersFile);
- return serverNames;
- }
-
- @Path("/discover")
- @GET
- @Produces(MediaType.TEXT_XML)
- public String discoveredServers() {
- return GetDiscoveredServers();
- }
-
- private String GetDetails() {
- ProcessResult result = new ProcessUtil().executeCommand("get-server-details.py");
- if (!result.isSuccess()) {
- //TODO:Generate error message and return
- }
- return result.getOutput();
- }
-
- @Path("/details")
- @GET
- @Produces(MediaType.TEXT_XML)
- public String serverDetails() {
- return GetDetails();
- }
-
-}