no.feide.moria.servlet
Class StatusServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by no.feide.moria.servlet.MoriaServlet
              extended by no.feide.moria.servlet.StatusServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class StatusServlet
extends MoriaServlet

The StatusServlet shows the status of Moria.

Version:
$Revision: 1.17 $
See Also:
Serialized Form

Field Summary
private  java.util.HashMap backendDataUsers
          A hash map containing the attributes for a test-user.
private  no.feide.moria.log.MessageLogger log
          Used for logging.
private static java.lang.String[] REQUIRED_PARAMETERS
          List of parameters required by StatusServlet.
private static java.lang.String STATUS_ATTRIBUTE
          The organization the test user comes from.
private static java.lang.String STATUS_PRINCIPAL
          The name of the service.
private  FileMonitor statusFileMonitor
          Monitor for the status xml file.
 
Constructor Summary
StatusServlet()
           
 
Method Summary
 java.util.Vector checkBackend(java.util.ResourceBundle bundle)
           
private  java.util.Vector checkConfigStatus(java.util.ResourceBundle bundle)
          Checks the config
private  java.util.Vector checkModules(java.util.ResourceBundle bundle)
          Checks the modules
private  java.util.Vector checkSoap(java.util.ResourceBundle bundle)
          Checks the SOAP page.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles the GET requests.
 java.util.HashMap getBackendStatusData()
          Implements a simple xml parser that parses the status.xml file into a HashMap with BackendStatusUser instances.
private  java.util.Properties getConfig()
          Get this servlet's configuration from the web module, given by RequestUtil.PROP_CONFIG.
static java.lang.String[] getRequiredParameters()
           
private  void printTable()
           
 
Methods inherited from class no.feide.moria.servlet.MoriaServlet
getServletConfig
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final no.feide.moria.log.MessageLogger log
Used for logging.


REQUIRED_PARAMETERS

private static final java.lang.String[] REQUIRED_PARAMETERS
List of parameters required by StatusServlet.

Current required parameters are:

See Also:
RequestUtil.PROP_BACKENDSTATUS_STATUS_XML

backendDataUsers

private java.util.HashMap backendDataUsers
A hash map containing the attributes for a test-user. Each item in the hashmap maps from a user name to an backendStatusUser class instance


statusFileMonitor

private FileMonitor statusFileMonitor
Monitor for the status xml file.


STATUS_ATTRIBUTE

private static final java.lang.String STATUS_ATTRIBUTE
The organization the test user comes from.

See Also:
Constant Field Values

STATUS_PRINCIPAL

private static final java.lang.String STATUS_PRINCIPAL
The name of the service.

See Also:
Constant Field Values
Constructor Detail

StatusServlet

public StatusServlet()
Method Detail

getRequiredParameters

public static java.lang.String[] getRequiredParameters()
Returns:
the required parameters for this servlet.

getBackendStatusData

public final java.util.HashMap getBackendStatusData()
Implements a simple xml parser that parses the status.xml file into a HashMap with BackendStatusUser instances.

See Also:
BackendStatusHandler, BackendStatusUser

printTable

private void printTable()

checkConfigStatus

private java.util.Vector checkConfigStatus(java.util.ResourceBundle bundle)
Checks the config

Parameters:
bundle -
Returns:

checkModules

private java.util.Vector checkModules(java.util.ResourceBundle bundle)
Checks the modules

Parameters:
bundle -
Returns:

checkSoap

private java.util.Vector checkSoap(java.util.ResourceBundle bundle)
Checks the SOAP page.

Parameters:
bundle -
Returns:

checkBackend

public java.util.Vector checkBackend(java.util.ResourceBundle bundle)

doGet

public final void doGet(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws java.io.IOException,
                        javax.servlet.ServletException
Handles the GET requests.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP request object.
response - The HTTP response object.
Throws:
java.io.IOException - If an input or output error is detected when the servlet handles the GET request.
javax.servlet.ServletException - If the request for the GET could not be handled.
See Also:
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

getConfig

private java.util.Properties getConfig()
Get this servlet's configuration from the web module, given by RequestUtil.PROP_CONFIG.

Returns:
The last valid configuration.
Throws:
java.lang.IllegalStateException - If unable to read the current configuration from the servlet context, and there is no previous configuration. Also thrown if any of the required parameters (given by REQUIRED_PARAMETERS) are not set.
See Also:
REQUIRED_PARAMETERS, RequestUtil.PROP_CONFIG


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.