Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

openfuture.bugbase.servlet
Class BugBaseServlet  view BugBaseServlet download BugBaseServlet.java

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byopenfuture.bugbase.servlet.BugBaseServlet
All Implemented Interfaces:
openfuture.bugbase.model.JspConstants, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class BugBaseServlet
extends javax.servlet.http.HttpServlet
implements openfuture.bugbase.model.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 55 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.7 $

Field Summary
private  java.lang.String dbServer
           
private  java.lang.String dbURL
           
private  java.lang.String mailServer
           
private  openfuture.bugbase.domain.Persistency persistency
           
private static java.lang.String USER
           
private  BugBaseServletVersion version
           
private  openfuture.bugbase.domain.VersionManager versionManager
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
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_ID
 
Constructor Summary
BugBaseServlet()
           
 
Method Summary
static void checkGroup(openfuture.bugbase.model.Session session, java.lang.String group)
          Check, if the user of the session belongs to the given group.
protected  java.io.Serializable handleMessage(openfuture.bugbase.xobjects.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 service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
          Reads the query object from the HTTP stream and calls handleMessage(BugBaseQuery) 55 .
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
 

Field Detail

USER

private static java.lang.String USER

persistency

private openfuture.bugbase.domain.Persistency persistency

version

private BugBaseServletVersion version

versionManager

private openfuture.bugbase.domain.VersionManager versionManager

dbURL

private java.lang.String dbURL

dbServer

private java.lang.String dbServer

mailServer

private java.lang.String mailServer
Constructor Detail

BugBaseServlet

public BugBaseServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
Initializes the servlet. The following initialization parameters are recognized:
  • db.url: Database URL to the of BugBaseServlet.
    [Default: http://localhost:8080/bugbase/servlet/HypersonicDBServlet]
  • db.server: Class name of the database server.
    [Default: openfuture.util.database.HyperSQLServer]
  • db.user: User for the connection to the database.
    [Default: sa]
  • db.password: Password for the connection to the database.
    [Default: <empty string>]
  • openfuture.bugbase.mail.server: Mail server for delivering emails to bug report authors.
    [Default: attachments]

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

Specified by:
init in interface javax.servlet.Servlet

service

public void service(javax.servlet.ServletRequest req,
                    javax.servlet.ServletResponse res)
Reads the query object from the HTTP stream and calls handleMessage(BugBaseQuery) 55 . The result is serialized and returned to the HTTP stream.

Specified by:
service in interface javax.servlet.Servlet

handleMessage

protected java.io.Serializable handleMessage(openfuture.bugbase.xobjects.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.


checkGroup

public static void checkGroup(openfuture.bugbase.model.Session session,
                              java.lang.String group)
                       throws openfuture.bugbase.error.BugBaseException
Check, if the user of the session belongs to the given group.


logException

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


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.