openfuture.bugbase.servlet
Class BugBaseServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--openfuture.bugbase.servlet.BugBaseServlet
All Implemented Interfaces:
JspConstants, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class BugBaseServlet
extends javax.servlet.http.HttpServlet
implements JspConstants

Main servlet handling the access to the Bug Base Database. It should not be used directly but only with the corresponding proxy.

This servlet expects a openfuture.bugbase.xobjects.BugBaseQuery serialized request object in the HTTP request. Depending upon the query type is the behaviour of the servlet. It executes the desired query and returns the result wrapped into a query result object.

Created: Sun Feb 06 22:45:01 2000

Version:
$Revision: 1.12 $
Author:
Wolfgang Reissenberger
See Also:
Serialized Form

Fields inherited from interface openfuture.bugbase.model.JspConstants
ATTACHMENT_DIR, ATTACHMENT_URL, BUG_REPORT, BUGBASE_SERVLET, LOCALES, LOGIN_MANAGER, MAILSERVER, MD_PROVIDER, NEXT_PAGE, PACKAGES, PROJECT, QUERY, QUERYSTRING, REPORTS, RESULT, SENDMAIL, SERVLET_CLIENT, SERVLETPATH, USER, USER_ID
 
Constructor Summary
BugBaseServlet()
           
 
Method Summary
static void checkGroup(Session session, java.lang.String group)
          Check, if the user of the session belongs to the given group.
 java.util.ResourceBundle getResourceBundle()
          Get the value of resourceBundle.
static User getUser(Session session)
          Retrieve the user object from the current session.
protected  java.io.Serializable handleMessage(BugBaseQuery query)
          This is the central dispatcher.
 void init(javax.servlet.ServletConfig config)
          Initializes the servlet.
 void logException(java.lang.Exception e)
          Write an exception to the log file of the servlet container.
 void logException(I18NException e)
          Write an exception to the log file of the servlet container.
 void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
          Reads the query object from the HTTP stream and calls handleMessage(BugBaseQuery).
 void setResourceBundle(java.util.ResourceBundle v)
          Set the value of resourceBundle.
protected  java.lang.String testNotNull(java.lang.Object o, java.lang.String resultOK)
          Test, if the object o is not null.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BugBaseServlet

public BugBaseServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
Initializes the servlet. The following initialization parameters are recognized:

If the initialization failed, please visit the servlet container log file.

Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - a ServletConfig value

service

public void service(javax.servlet.ServletRequest req,
                    javax.servlet.ServletResponse res)
Reads the query object from the HTTP stream and calls handleMessage(BugBaseQuery). The result is serialized and returned to the HTTP stream.
Overrides:
service in class javax.servlet.http.HttpServlet
Parameters:
req - HTTP request
res - HTTP response

handleMessage

protected java.io.Serializable handleMessage(BugBaseQuery query)
This is the central dispatcher. Depending upon the query type is the behaviour of the servlet. It executes the desired query and returns the result wrapped into a result object.
Parameters:
query - query object
Returns:
serializable result of the query

checkGroup

public static void checkGroup(Session session,
                              java.lang.String group)
                       throws I18NException
Check, if the user of the session belongs to the given group.
Parameters:
session - current session
group - group ID
Throws:
I18NException - if the user does not belong to the given group.

getUser

public static User getUser(Session session)
                    throws I18NException
Retrieve the user object from the current session.
Parameters:
session - the session
Returns:
the session's user object
Throws:
I18NException - if session is null or the session's user attribute is null.

logException

public void logException(I18NException e)
Write an exception to the log file of the servlet container.
Parameters:
e - exception to be logged

logException

public void logException(java.lang.Exception e)
Write an exception to the log file of the servlet container.
Parameters:
e - exception to be logged

testNotNull

protected java.lang.String testNotNull(java.lang.Object o,
                                       java.lang.String resultOK)
Test, if the object o is not null. In this case, resultOK is returned, otherwise the warning message: null.
Parameters:
o - object to be tested
resultOK - result string
Returns:
test result

getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Get the value of resourceBundle.
Returns:
value of resourceBundle.

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle v)
Set the value of resourceBundle.
Parameters:
v - Value to assign to resourceBundle.


Copyright 2000 -- 2003 openfuture.de. All Rights Reserved.