openfuture.bugbase.servlet
Class BugBaseServletClient

java.lang.Object
  |
  +--openfuture.bugbase.servlet.BugBaseServletClient

public class BugBaseServletClient
extends java.lang.Object

This class is the proxy to BugBaseServlet. It communicates with serialized objects via HTTP with the servlet.

Created: Sun Feb 06 16:58:12 2000

Version:
$Revision: 1.10 $
Author:
Wolfgang Reissenberger

Constructor Summary
BugBaseServletClient(java.lang.String newUrl)
          Creates a new BugBaseServletClient instance.
 
Method Summary
 void addAttachment(java.lang.Integer reportID, java.lang.String attachmentPath)
          Add an attachment to a given bug report
 java.lang.Integer addBugReport(java.lang.String project, BugReport report)
          Add a new bug report.
 java.lang.Integer addBugReport(java.lang.String project, BugReport report, java.lang.Integer sessionID)
          Add a new bug report.
 User adminLogin(Login login)
          Tries to establish a new connection to the database as administrator.
 void changePassword(Login login, java.lang.String newPassword)
          Change the current users password.
 User doctorLogin(Login login)
          Tries to establish a new connection to the database as doctor.
 java.util.LinkedList executeQuery(java.lang.String command)
          Execute a database query.
 java.util.LinkedList getAvailableUpdates()
          Retrieve the list of available updates.
 BugReport getBugReport(java.lang.Integer id)
          Retrieve a single bug report.
 java.util.LinkedList getBugReportList(java.lang.String project, java.lang.Boolean filterReported, java.lang.Boolean filterStarted, java.lang.Boolean filterFixed, java.lang.Boolean filterRejected, java.lang.String searchString, java.lang.String reporterId, java.lang.String doctorId)
          Retrieve the list of bug reports matching the given criteria.
 java.util.LinkedList getDoctors()
          Retrieve the list of users belonging to the 'doctors' group
 java.util.LinkedList getGroups()
          Retrieve the list of all group IDs
 QueryResultMasterData getMasterData(java.lang.String project)
          Retrieve the list of doctors and project packages
 java.util.LinkedList getPackages(java.lang.String project)
          Retrieve the list of packages for a given project.
 java.util.LinkedList getPackages(java.lang.String project, java.lang.Integer sessionID)
          Retrieves the list of packages for a certain project.
 java.util.LinkedList getProjects()
          Retrieve the list of projects registered at Bug Base.
 java.lang.Integer getSessionID()
          Get the value of sessionID.
 java.util.Hashtable getStatus()
          Retrieve the status information from the BugBaseServlet.
 java.util.LinkedList getUserData()
          Retrieve the list of user data.
 java.util.LinkedList getUserList()
          Retrieve the list of user data except for their passwords.
 QueryResultVersions getVersions()
          Retrieve the versions of the BugBaseServlet, persistency and the available versions from the version manager.
 User login(Login login)
          Tries to establish a new connection to the database.
 void registerUser(User user)
          Save user data.
 void saveUserData(java.util.LinkedList users, java.util.LinkedList deleted)
          Save user data.
 void setPackages(java.lang.String project, java.util.LinkedList packages)
          Set the list of packages for a given project
 void setProjects(java.util.LinkedList projects)
          Set the list of projects registered in Bug Base
 void setSessionID(java.lang.Integer v)
          Set the value of sessionID, if either the current session ID is null or the given value is not null.
 java.lang.String test(java.lang.String question)
          Test the connection using a question to the BugBaseServlet.
 void updateBugReport(User user, BugReport report)
          Update the given bug report.
 void updateBugReports(User user, java.util.LinkedList reports, java.lang.Boolean sendEmail)
          Update the given bug report. if sendEmail is true, the bug reporter will be notified via email about the changes.
 TransactionResult updatePersistency(Version version)
          Update the persistency to a given version.
 boolean validDoctorUser(User user)
          Check, if the user belongs to the group 'doctors'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BugBaseServletClient

public BugBaseServletClient(java.lang.String newUrl)
                     throws java.net.MalformedURLException
Creates a new BugBaseServletClient instance.
Parameters:
newUrl - URL of BugBaseServlet
Throws:
java.net.MalformedURLException - if an error occurs
Method Detail

getBugReportList

public java.util.LinkedList getBugReportList(java.lang.String project,
                                             java.lang.Boolean filterReported,
                                             java.lang.Boolean filterStarted,
                                             java.lang.Boolean filterFixed,
                                             java.lang.Boolean filterRejected,
                                             java.lang.String searchString,
                                             java.lang.String reporterId,
                                             java.lang.String doctorId)
                                      throws I18NException
Retrieve the list of bug reports matching the given criteria.
Parameters:
project - project name
filterReported - state at least reported?
filterStarted - state at least started?
filterFixed - state at least fixed?
filterRejected - state at least rejected?
searchString - string that should occur either in the title or in the description
reporterId - user ID of the bug reporter
doctorId - user ID of the bug doctor
Returns:
list of bug reports.
Throws:
I18NException - if an error occurs

getBugReport

public BugReport getBugReport(java.lang.Integer id)
                       throws I18NException
Retrieve a single bug report.
Parameters:
id - ID of the bug report.
Returns:
bug report matching the given ID
Throws:
I18NException - if an error occurs

addBugReport

public java.lang.Integer addBugReport(java.lang.String project,
                                      BugReport report)
                               throws I18NException
Add a new bug report. The number of the report is returned.
Parameters:
project - project name
report - the bug report
Returns:
number of the report
Throws:
I18NException - if an error occurs

addBugReport

public java.lang.Integer addBugReport(java.lang.String project,
                                      BugReport report,
                                      java.lang.Integer sessionID)
                               throws I18NException
Add a new bug report. The number of the report is returned.
Parameters:
project - project name.
report - new bug report.
sessionID - session ID.
Returns:
number of the report
Throws:
I18NException - if an error occurs

getProjects

public java.util.LinkedList getProjects()
                                 throws I18NException
Retrieve the list of projects registered at Bug Base.
Returns:
list of projects
Throws:
I18NException - if an error occurs

setProjects

public void setProjects(java.util.LinkedList projects)
                 throws I18NException
Set the list of projects registered in Bug Base
Parameters:
projects - list of projects
Throws:
I18NException - if an error occurs

getPackages

public java.util.LinkedList getPackages(java.lang.String project)
                                 throws I18NException
Retrieve the list of packages for a given project.
Parameters:
project - project name
Returns:
list of packages
Throws:
I18NException - if an error occurs

getPackages

public java.util.LinkedList getPackages(java.lang.String project,
                                        java.lang.Integer sessionID)
                                 throws I18NException
Retrieves the list of packages for a certain project.
Parameters:
project - project name
sessionID - session ID
Returns:
list of package names
Throws:
I18NException - if an error occurs

setPackages

public void setPackages(java.lang.String project,
                        java.util.LinkedList packages)
                 throws I18NException
Set the list of packages for a given project
Parameters:
project - project name
packages - list of package names
Throws:
I18NException - if an error occurs

getDoctors

public java.util.LinkedList getDoctors()
                                throws I18NException
Retrieve the list of users belonging to the 'doctors' group
Returns:
list of users belonging to the 'doctors' group
Throws:
I18NException - if an error occurs

updateBugReports

public void updateBugReports(User user,
                             java.util.LinkedList reports,
                             java.lang.Boolean sendEmail)
                      throws I18NException
Update the given bug report. if sendEmail is true, the bug reporter will be notified via email about the changes.
Parameters:
user - user modifying the bug reports
reports - list of bug reports to be updated
sendEmail - should an email be sent?
Throws:
I18NException - if an error occurs

updateBugReport

public void updateBugReport(User user,
                            BugReport report)
                     throws I18NException
Update the given bug report.
Parameters:
user - user modifying the bug reports
report - bug report to be updated
Throws:
I18NException - if an error occurs

executeQuery

public java.util.LinkedList executeQuery(java.lang.String command)
                                  throws I18NException
Execute a database query.
Parameters:
command - SQL command
Returns:
result set returned by the SQL query
Throws:
I18NException - if an error occurs

getVersions

public QueryResultVersions getVersions()
                                throws I18NException
Retrieve the versions of the BugBaseServlet, persistency and the available versions from the version manager.
Returns:
version informations
Throws:
I18NException - if an error occurs

getAvailableUpdates

public java.util.LinkedList getAvailableUpdates()
                                         throws I18NException
Retrieve the list of available updates.
Returns:
list of available updates
Throws:
I18NException - if an error occurs

updatePersistency

public TransactionResult updatePersistency(Version version)
                                    throws I18NException
Update the persistency to a given version.
Parameters:
version - new persistency version
Returns:
result of this transaction
Throws:
I18NException - if an error occurs

getUserData

public java.util.LinkedList getUserData()
                                 throws I18NException
Retrieve the list of user data. This method may only be used by admin users.
Returns:
the list of user data
Throws:
I18NException - if an error occurs

getUserList

public java.util.LinkedList getUserList()
                                 throws I18NException
Retrieve the list of user data except for their passwords. This method may be executed by ordinary users.
Returns:
the list of user data
Throws:
I18NException - if an error occurs

getGroups

public java.util.LinkedList getGroups()
                               throws I18NException
Retrieve the list of all group IDs
Returns:
the list of all group IDs
Throws:
I18NException - if an error occurs

saveUserData

public void saveUserData(java.util.LinkedList users,
                         java.util.LinkedList deleted)
                  throws I18NException
Save user data. Update only dirty users. The users from deleted are deleted.
Parameters:
users - list of users to be updated
deleted - list of users to be deleted
Throws:
I18NException - if an error occurs
See Also:
User

registerUser

public void registerUser(User user)
                  throws I18NException
Save user data. Update only dirty users. The users from deleted are deleted.
Parameters:
users - list of users to be updated
deleted - list of users to be deleted
Throws:
I18NException - if an error occurs
See Also:
User

test

public java.lang.String test(java.lang.String question)
                      throws I18NException
Test the connection using a question to the BugBaseServlet.
Parameters:
question - the question to be posed
Returns:
the answer
Throws:
I18NException - if an error occurs

getMasterData

public QueryResultMasterData getMasterData(java.lang.String project)
                                    throws I18NException
Retrieve the list of doctors and project packages
Parameters:
project - project name
Returns:
masterdata for the given project
Throws:
I18NException - if an error occurs

login

public User login(Login login)
           throws I18NException
Tries to establish a new connection to the database.
Parameters:
login - user data
Returns:
user data, if succeeded, null otherwise.
Throws:
I18NException - if an error occurs

adminLogin

public User adminLogin(Login login)
                throws I18NException
Tries to establish a new connection to the database as administrator.
Parameters:
login - user data
Returns:
user data, if succeeded, null otherwise.
Throws:
I18NException - if an error occurs

doctorLogin

public User doctorLogin(Login login)
                 throws I18NException
Tries to establish a new connection to the database as doctor.
Parameters:
login - user data
Returns:
user data, if succeeded, null otherwise.
Throws:
I18NException - if an error occurs

validDoctorUser

public boolean validDoctorUser(User user)
Check, if the user belongs to the group 'doctors'.
Parameters:
user - user data
Returns:
true, if the user is an bugbase doctor

changePassword

public void changePassword(Login login,
                           java.lang.String newPassword)
                    throws I18NException
Change the current users password.
Parameters:
login - current login information
newPassword - new password
Throws:
I18NException - if an error occurs

addAttachment

public void addAttachment(java.lang.Integer reportID,
                          java.lang.String attachmentPath)
                   throws I18NException
Add an attachment to a given bug report
Parameters:
reportID - the ID of the bug report
attachmentPath - relative path where the attachment file is located.
Throws:
I18NException - if an error occurs

getStatus

public java.util.Hashtable getStatus()
                              throws I18NException
Retrieve the status information from the BugBaseServlet.
Returns:
a Hashtable holding the information as key/value pair.
Throws:
I18NException - if an error occurs

getSessionID

public java.lang.Integer getSessionID()
Get the value of sessionID.
Returns:
Value of sessionID.

setSessionID

public void setSessionID(java.lang.Integer v)
Set the value of sessionID, if either the current session ID is null or the given value is not null.
Parameters:
v - Value to assign to sessionID.


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