HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2015-08-07 c533e750611dc9eeacba2a1242a511c676d39934
xmlrpcservlet does not accept additional init params
4 files modified
51 ■■■■■ changed files
hsarback/conf/WEB-INF/prod-web.xml 16 ●●●● patch | view | raw | blame | history
hsarback/conf/WEB-INF/test-web.xml 16 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/qserv/QueueStatusReceiverServlet.java 6 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/remote/HSXmlRpcServlet.java 13 ●●●●● patch | view | raw | blame | history
hsarback/conf/WEB-INF/prod-web.xml
@@ -11,6 +11,14 @@
    <servlet>
        <servlet-name>Queue Status Servlet</servlet-name>
        <servlet-class>de.hsadmin.core.qserv.QueueStatusReceiverServlet</servlet-class>
          <init-param>
              <param-name>proxyValidateUrl</param-name>
              <param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
          </init-param>
          <init-param>
              <param-name>proxyServiceUrl</param-name>
              <param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
          </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
@@ -21,14 +29,6 @@
            <param-name>enabledForExtensions</param-name>
            <param-value>true</param-value>
        </init-param>
          <init-param>
              <param-name>proxyValidateUrl</param-name>
              <param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
          </init-param>
          <init-param>
              <param-name>proxyServiceUrl</param-name>
              <param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
          </init-param>
    </servlet>
    <servlet-mapping>
hsarback/conf/WEB-INF/test-web.xml
@@ -11,6 +11,14 @@
    <servlet>
        <servlet-name>Queue Status Servlet</servlet-name>
        <servlet-class>de.hsadmin.core.qserv.QueueStatusReceiverServlet</servlet-class>
          <init-param>
              <param-name>proxyValidateUrl</param-name>
              <param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
          </init-param>
          <init-param>
              <param-name>proxyServiceUrl</param-name>
              <param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
          </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
@@ -21,14 +29,6 @@
          <param-name>enabledForExtensions</param-name>
          <param-value>true</param-value>
        </init-param>
          <init-param>
              <param-name>proxyValidateUrl</param-name>
              <param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
          </init-param>
          <init-param>
              <param-name>proxyServiceUrl</param-name>
              <param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
          </init-param>
    </servlet>
    <servlet-mapping>
hsarback/src/de/hsadmin/core/qserv/QueueStatusReceiverServlet.java
@@ -18,12 +18,14 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import de.hsadmin.core.model.TechnicalException;
import de.hsadmin.core.model.TicketValidator;
import de.hsadmin.core.model.Transaction;
import de.hsadmin.core.util.Config;
@@ -43,6 +45,10 @@
    @Override
    public void init() throws ServletException {
        final ServletConfig cfg = getServletConfig();
        final String validateURL = cfg.getInitParameter("proxyValidateUrl");
        final String serviceURL = cfg.getInitParameter("proxyServiceUrl");
        TicketValidator.getInstance().initialize(validateURL, serviceURL);
        isConnected = false;
        messageCount = 0;
        errorCount = 0;
hsarback/src/de/hsadmin/remote/HSXmlRpcServlet.java
@@ -1,28 +1,15 @@
package de.hsadmin.remote;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.metadata.XmlRpcSystemImpl;
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
import org.apache.xmlrpc.webserver.XmlRpcServlet;
import de.hsadmin.core.model.TicketValidator;
public class HSXmlRpcServlet extends XmlRpcServlet {
    private static final long serialVersionUID = 1L;
    @Override
    public void init() throws ServletException {
        super.init();
        final ServletConfig cfg = getServletConfig();
        final String validateURL = cfg.getInitParameter("proxyValidateUrl");
        final String serviceURL = cfg.getInitParameter("proxyServiceUrl");
        TicketValidator.getInstance().initialize(validateURL, serviceURL);    }
    @Override
    protected XmlRpcHandlerMapping newXmlRpcHandlerMapping()
            throws XmlRpcException {