aboutsummaryrefslogtreecommitdiff
path: root/spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java
diff options
context:
space:
mode:
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java')
-rw-r--r--spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java120
1 files changed, 0 insertions, 120 deletions
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java b/spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java
deleted file mode 100644
index 7783ed3f6..000000000
--- a/spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java
+++ /dev/null
@@ -1,120 +0,0 @@
-package at.gv.egovernment.moa.spss.server.service;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import at.gv.egovernment.moa.logging.LogMsg;
-import at.gv.egovernment.moa.logging.Logger;
-import at.gv.egovernment.moa.logging.LoggingContext;
-import at.gv.egovernment.moa.logging.LoggingContextManager;
-
-import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
-import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator;
-import at.gv.egovernment.moa.spss.server.init.*;
-import at.gv.egovernment.moa.spss.util.MessageProvider;
-
-/**
- * A servlet to initialize and update the MOA configuration.
- *
- * @author Fatemeh Philippi
- * @author Patrick Peck
- * @version $Id$
- */
-public class ConfigurationServlet extends HttpServlet {
- /** The document type of the HTML to generate. */
- private static final String DOC_TYPE =
- "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
-
- /**
- * Handle a HTTP GET request, used to indicated that the MOA
- * configuration needs to be updated (reloaded).
- *
- * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse)
- */
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- MessageProvider msg = MessageProvider.getInstance();
- PrintWriter out;
-
- // set up a logging context for logging the reconfiguration
- LoggingContextManager.getInstance().setLoggingContext(
- new LoggingContext("configuration update"));
-
- response.setContentType("text/html");
- out = response.getWriter();
- out.println(DOC_TYPE);
- out.println("<head><title>MOA configuration update</title></head>");
- out.println("<body bgcolor=\"#FFFFFF\">");
- try {
- // reconfigure the system
- ConfigurationProvider config = ConfigurationProvider.reload();
- IaikConfigurator iaikConfigurator = new IaikConfigurator();
-
- iaikConfigurator.configure(config);
-
- // print a status message
- out.println("<p><b>" + msg.getMessage("config.06", null) + "</b></p>");
- Logger.info(new LogMsg(msg.getMessage("config.06", null)));
-
- if (!config.getWarnings().isEmpty()) {
- // print the warnings
- List allWarnings = new ArrayList();
- Iterator iter;
-
- allWarnings.addAll(config.getWarnings());
- allWarnings.addAll(iaikConfigurator.getWarnings());
-
- out.println("<p><b>" + msg.getMessage("config.29", null) + "</b></p>");
- for (iter = allWarnings.iterator(); iter.hasNext();) {
- out.println(iter.next() + "<br />");
- }
- out.println("<p><b>" + msg.getMessage("config.28", null) + "</b></p>");
- }
-
- } catch (Throwable t) {
- out.println("<p><b>" + msg.getMessage("config.20", null) + "</b></p>");
- out.println("<p><b>" + msg.getMessage("config.28", null) + "</b></p>");
- Logger.warn(new LogMsg(msg.getMessage("config.20", null)), t);
- }
- out.println("</body>");
-
- out.flush();
- out.close();
-
- // tear down the logging context
- LoggingContextManager.getInstance().setLoggingContext(null);
- }
-
- /**
- * Do the same as <code>doGet</code>.
- *
- * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse)
- */
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- doGet(request, response);
- }
-
- /**
- * Perform some initial initialization tasks for the MOA web services
- * application.
- *
- * Does an initial load of the MOA configuration to test if a working web
- * service can be provided.
- *
- * @see javax.servlet.GenericServlet#init()
- */
- public void init() throws ServletException {
- SystemInitializer.init();
- }
-
-} \ No newline at end of file