FileDocCategorySizeDatePackage
QSListHandler.javaAPI DocApache Axis 1.43713Sat Apr 22 18:57:26 BST 2006org.apache.axis.transport.http

QSListHandler

public class QSListHandler extends AbstractQueryStringHandler
The QSListHandler class is a handler which lists the AXIS Server's configuration when the query string "list" is encountered in an AXIS servlet invocation.
author
Curtiss Howard (code mostly from AxisServlet class)
author
Doug Davis (dug@us.ibm.com)
author
Steve Loughran

Fields Summary
Constructors Summary
Methods Summary
public voidinvoke(org.apache.axis.MessageContext msgContext)
Performs the action associated with this particular query string handler.

param
msgContext a MessageContext object containing message context information for this query string handler.
throws
AxisFault if an error occurs.

          // Obtain objects relevant to the task at hand from the provided
          // MessageContext's bag.
          
          boolean enableList = ((Boolean) msgContext.getProperty
               (HTTPConstants.PLUGIN_ENABLE_LIST)).booleanValue();
          AxisServer engine = (AxisServer) msgContext.getProperty
               (HTTPConstants.PLUGIN_ENGINE);
          PrintWriter writer = (PrintWriter) msgContext.getProperty
               (HTTPConstants.PLUGIN_WRITER);
          HttpServletResponse response = (HttpServletResponse)
               msgContext.getProperty (HTTPConstants.MC_HTTP_SERVLETRESPONSE);
          
          if (enableList) {
               Document doc = Admin.listConfig (engine);
               
               if (doc != null) {
                    response.setContentType ("text/xml");
                    XMLUtils.DocumentToWriter (doc, writer);
               }
               
               else {
                    //error code is 404
                    
                    response.setStatus (HttpURLConnection.HTTP_NOT_FOUND);
                    response.setContentType ("text/html");
                    
                    writer.println ("<h2>" + Messages.getMessage ("error00") +
                         "</h2>");
                    writer.println ("<p>" + Messages.getMessage ("noDeploy00") +
                         "</p>");
               }
          }
          
          else {
               // list not enable, return error
               //error code is, what, 401
               
               response.setStatus (HttpURLConnection.HTTP_FORBIDDEN);
               response.setContentType ("text/html");
               
               writer.println ("<h2>" + Messages.getMessage ("error00") +
                    "</h2>");
               writer.println ("<p><i>?list</i> " +
                    Messages.getMessage ("disabled00") + "</p>");
          }