|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openfuture.bugbase.domain.Persistency
Persistency Layer implementing the database access.
Created: Tue Feb 08 06:04:19 2000
Constructor Summary | |
Persistency(java.lang.String dbServerClass,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Creates a new Persistency instance. |
Method Summary | |
void |
addAttachment(java.lang.Integer reportID,
java.lang.String attachmentPath)
add an attachment to an existing bug report |
java.lang.Integer |
addBugReport(BugReport report)
Add a new bug report for the given project |
User |
adminLogin(Login login)
Login into the bug database as administrator. |
boolean |
changePassword(Login login,
java.lang.String newPassword)
Change the current users password. |
void |
createTable(java.lang.String tableName,
java.util.LinkedList columns,
java.util.LinkedList dataTypes,
java.util.LinkedList constraints)
Creates a database table. |
User |
doctorLogin(Login login)
Login into the bug database as doctor. |
java.util.LinkedList |
executeQuery(java.lang.String command)
Execute a SQL query. |
BugReport |
getBugReport(java.lang.Integer id,
java.util.LinkedList groups)
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,
java.util.LinkedList groups)
Get the list of bug reports for the given project selecting only those which match the given filters. |
java.util.LinkedList |
getDoctors()
Extract those users belonging to the group 'doctors'. |
java.util.LinkedList |
getGroups()
Retrieves the list of all group IDs |
Version |
getObjectVersion(java.lang.String name)
Get the version of a persinstency object. |
java.util.LinkedList |
getPackages(java.lang.String project)
Get the value of packages. |
Version |
getPersistencyVersion()
Get the persistency version. |
java.util.LinkedList |
getProjects()
Get the value of projects. |
DBServer |
getSqlServer()
Get the value of sqlServer. |
User |
getUser(java.lang.String userid)
Retrieve the user with the given user ID. |
java.util.LinkedList |
getUserData()
Retrieves user data from the database |
void |
init()
Initialize the database |
User |
login(Login login)
Login into the bug database. |
void |
saveUserData(java.util.LinkedList users,
java.util.LinkedList deleted)
Save user data. |
void |
setObjectVersion(java.lang.String name,
Version version)
Set the version of a persinstency object. |
void |
setPackages(java.lang.String project,
java.util.LinkedList v)
Set the value of packages. |
void |
setPersistencyVersion(Version version)
Set persistency version. |
void |
setProjects(java.util.LinkedList v)
Retrieve the list of all projects available. |
void |
setSqlServer(DBServer v)
Set the value of sqlServer. |
protected java.lang.String |
sqlToString(java.lang.String s)
Convert an SQL string into its Java representation. |
static java.lang.String |
stringToSql(java.lang.Object o)
Convert an object into a SQL compatible string. |
protected boolean |
tableExists(java.lang.String name,
java.sql.Connection con)
Check, if the given table exists. |
void |
updateBugReport(BugReport report)
Update an existing bug report. |
void |
updateBugReports(java.util.LinkedList reports)
Update existing bug reports. |
boolean |
validAdminUser(User user)
Check, if the user belongs to the group 'admin'. |
boolean |
validDoctorUser(User user)
Check, if the user belongs to the group 'doctors'. |
boolean |
validUser(Login login)
Check, if the given login is valid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Persistency(java.lang.String dbServerClass, java.lang.String url, java.lang.String user, java.lang.String password) throws I18NException
Persistency
instance.dbServerClass
- class name of the
database server
url
- URL of the database connectionuser
- user name, for which a connection is establishedpassword
- user's paswordI18NException
- if an error occursMethod Detail |
public boolean changePassword(Login login, java.lang.String newPassword) throws I18NException
login
- a user login objectnewPassword
- new passwordI18NException
- if an error occurspublic BugReport getBugReport(java.lang.Integer id, java.util.LinkedList groups) throws I18NException
id
- ID of the bug report.groups
- a LinkedList
valueI18NException
- if an error occurspublic 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, java.util.LinkedList groups) throws I18NException
project
- project namefilterReported
- filter state = reportedfilterStarted
- filter state = startedfilterFixed
- filter state = fixedfilterRejected
- filter state = rejectedsearchString
- string that should occur either in the
title or in the descriptionreporterId
- user ID of the bug reporterdoctorId
- user ID of the bug doctorgroups
- list of groups the report may belong tobug reports
I18NException
- if an error occurspublic java.lang.Integer addBugReport(BugReport report) throws I18NException
report
- new Bug ReportI18NException
- if an error occurspublic void updateBugReports(java.util.LinkedList reports) throws I18NException
reports
- existing bug reportsI18NException
- if an error occurspublic void updateBugReport(BugReport report) throws I18NException
report
- existing bug reportI18NException
- if an error occurspublic java.util.LinkedList getProjects() throws I18NException
I18NException
- if an error occurspublic void setProjects(java.util.LinkedList v) throws I18NException
v
- Value to assign to projects.I18NException
- if an error occurspublic java.util.LinkedList getDoctors() throws I18NException
I18NException
- if an error occursUser
public java.util.LinkedList getPackages(java.lang.String project) throws I18NException
project
- project nameI18NException
- if an error occurspublic void setPackages(java.lang.String project, java.util.LinkedList v) throws I18NException
project
- project namev
- Value to assign to packages.I18NException
- if an error occurspublic Version getPersistencyVersion() throws I18NException
I18NException
- if an error occurspublic void setPersistencyVersion(Version version) throws I18NException
version
- persistency versionI18NException
- if an error occurspublic Version getObjectVersion(java.lang.String name) throws I18NException
name
- name of the objectI18NException
- if an error occurspublic void setObjectVersion(java.lang.String name, Version version) throws I18NException
name
- name of the objectversion
- of the objectI18NException
- if an error occurspublic java.util.LinkedList getUserData() throws I18NException
I18NException
- if an error occursUser
public User getUser(java.lang.String userid) throws I18NException
userid
- user ID of the userI18NException
- if an error occurspublic boolean validUser(Login login) throws I18NException
login
- user loginI18NException
- if an error occurspublic boolean validAdminUser(User user) throws I18NException
user
- user dataI18NException
- if an error occurspublic boolean validDoctorUser(User user) throws I18NException
user
- user dataI18NException
- if an error occurspublic User login(Login login) throws I18NException
login
- Login objectI18NException
- if an error occurspublic User adminLogin(Login login) throws I18NException
login
- a Login
valueI18NException
- if an error occurspublic User doctorLogin(Login login) throws I18NException
login
- a Login
valueI18NException
- if an error occurspublic java.util.LinkedList getGroups() throws I18NException
I18NException
- if an error occurspublic void saveUserData(java.util.LinkedList users, java.util.LinkedList deleted) throws I18NException
users
- list of users to be updateddeleted
- list of users to be deletedI18NException
- if an error occursUser
public void addAttachment(java.lang.Integer reportID, java.lang.String attachmentPath) throws I18NException
reportID
- bug report IDattachmentPath
- relative path to the attachmentI18NException
- if an error occurspublic void init() throws I18NException
I18NException
- if an error occurspublic void createTable(java.lang.String tableName, java.util.LinkedList columns, java.util.LinkedList dataTypes, java.util.LinkedList constraints) throws I18NException
tableName
- name of the tablecolumns
- list of strings of column namesdataTypes
- list of datatypes of the columnsconstraints
- list of constraintsI18NException
- if an error occurspublic java.util.LinkedList executeQuery(java.lang.String command)
command
- SQL commandpublic DBServer getSqlServer()
public void setSqlServer(DBServer v)
v
- Value to assign to sqlServer.protected boolean tableExists(java.lang.String name, java.sql.Connection con)
name
- table namecon
- the current database connectionpublic static java.lang.String stringToSql(java.lang.Object o)
o
- object to be converted into a stringStringUtility.escapeChar(String,char,char)
,
StringUtility.dateToTimestamp(java.util.Date)
protected java.lang.String sqlToString(java.lang.String s)
s
- SQL string
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |