|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.jagzilla.BaseQuery
net.sf.jagzilla.BugQueryHibernateImpl
implements service interface with hibernate to acces database.
| Field Summary |
| Fields inherited from class net.sf.jagzilla.BaseQuery |
eventHandler, hibernateProperties, session, sessionFactory |
| Constructor Summary | |
BugQueryHibernateImpl()
constructs an hibernate implementation with default hibernate properties. |
|
BugQueryHibernateImpl(java.util.Properties p)
constructs an imeplementation with the hibernate properties received.See the other constructor to see hibernate properties used. |
|
| Method Summary | |
void |
addBug(Bug bug)
adds a new bug to the database. |
void |
addBugAttach(Attachment attachment)
Adds an attachment to a bug. |
void |
addBugComment(int bugId,
int userId,
java.lang.String comment)
adds a comment to the bug. |
void |
addBugWithComment(Bug bug,
java.lang.String comment)
adds a bug with comment as the first long description of the bug. |
void |
changeBugPriority(int profile,
int bugId,
java.lang.String pri,
java.lang.String comment)
changes the priority of a bug. |
void |
changeBugSeverity(int profile,
int bugId,
java.lang.String sev,
java.lang.String comment)
changes the severity of a bug. |
void |
changeBugStatus(int profile,
int bugId,
java.lang.String status,
int asignee)
changes the status of a bug. |
void |
finalize()
|
java.util.List |
getAllBugs()
gets a list of all bugs in database. |
Bug |
getBugById(int id)
gets the bug with the given id. |
int |
getBugCountForComponent(java.lang.String component)
gets the total ammount of bugs for the given component. |
int |
getBugCountQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo)
count bugs that match the specified criteria. |
int |
getBugCountQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo,
int reportedBy)
|
int |
getBugCountWithStatus(java.lang.String status)
return the ammount of bugs with given status. |
java.util.List |
getBugsAssignedTo(int userid)
gets all bugs that are assigned to the specified user |
java.util.List |
getBugsForComponent(Component component)
gets all bugs for the specified component |
java.util.List |
getBugsForMilestone(Milestone milestone)
gets all bugs for the specified milestone |
java.util.List |
getBugsForProduct(Product product)
gets all bugs for the specified product. |
java.util.List |
getBugsForVersion(Version version)
gets all bugs for the specified version |
java.util.List |
getBugsQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo)
|
java.util.List |
getBugsQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo,
int reportedBy)
gets all bugs that match the criteria. |
java.util.List |
getBugsReportedBy(int userid)
gets all bugs reported by the specified user. |
java.util.List |
getBugsSince(java.util.Date since)
gets a list of bugs created after since |
java.util.List |
getCcList(int bugId)
returns the cc list of a given bug. |
java.util.Properties |
getHibernateProperties()
|
java.util.List |
getLastBugs(int count)
gets the latest bugs. |
SystemQuery |
getSystemQuery()
gets an instance of SystemQuery with configuration of current implementation. |
int |
getTotalBugCount()
return the total ammount of bugs in database. |
void |
removeBug(Bug bug)
|
void |
removeBug(int id)
removes the bug with the given id |
void |
resolveBug(int profile,
int bugId,
java.lang.String resolution,
int dupeId)
resolves a bug. |
void |
updateBug(Bug bug)
updates the bug. |
| Methods inherited from class net.sf.jagzilla.BaseQuery |
bugExists, componentExists, continueIfProductExists, continueIfResolutionExists, continueIfStatusExists, continueIfUsersExists, getEventHandler, getFieldId, getNewSession, locateBug, locateComponent, locateProduct, locateProfile, milestoneExists, priorityExists, productExists, queryCountValue, resolutionExists, setHibernateProperties, severityExists, statusExists, userExists, versionExists |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BugQueryHibernateImpl()
throws HibernateException,
BadParameterException,
java.io.IOException
HibernateException
BadParameterException
java.io.IOException - if the event handler cfg file is not found
public BugQueryHibernateImpl(java.util.Properties p)
throws HibernateException,
BadParameterException,
java.io.IOException
properties received.
p - hibernate properties to use
HibernateException
BadParameterException
java.io.IOExceptionBugQueryHibernateImpl()| Method Detail |
public java.util.List getLastBugs(int count)
throws JagzillaException
BugQuery
getLastBugs in interface BugQuerycount - ammunt of bugs to be retrived.
JagzillaExceptionBug
public java.util.List getBugsAssignedTo(int userid)
throws JagzillaException
BugQuery
getBugsAssignedTo in interface BugQueryuserid - id of the user
JagzillaException - if an error occursBug
public int getTotalBugCount()
throws JagzillaException
BugQuery
getTotalBugCount in interface BugQueryJagzillaException
public int getBugCountWithStatus(java.lang.String status)
throws JagzillaException
BugQuerygetBugConuntQuery(null, status, null).
getBugCountWithStatus in interface BugQuerystatus - the status to search
JagzillaException - if an error occurs
public java.util.List getBugsQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo)
throws JagzillaException
JagzillaExceptionpublic void finalize()
public java.util.Properties getHibernateProperties()
public void addBug(Bug bug)
throws JagzillaException,
NoSuchProductException,
NoSuchComponentException,
NoSuchReporterException,
NoSuchAsigneeException,
ComponentNotUniqueException,
ProductComponentRelationException
BugQuery
addBug in interface BugQuerybug - the bug to add
ComponentNotUniqueException - if the product is null, and the component name specified appears more than once
NoSuchAsigneeException - if the asignee specified is not null and cannot be found
JagzillaException - if an error occurs
NoSuchComponentException - if the component specified is not null and cannot be found
NoSuchReporterException - if the reporter specified is not null and cannot be found
NoSuchProductException - if the product specified is not null and cannot be found
ProductComponentRelationException - if the component is not null and the product is not null and the component is not related to that product
public void removeBug(Bug bug)
throws JagzillaException,
NoSuchBugException
JagzillaException
NoSuchBugException
public void removeBug(int id)
throws JagzillaException,
NoSuchBugException
BugQuery
removeBug in interface BugQueryid - if of the bug to remove
NoSuchBugException - if the bug cannot be found
JagzillaException - if an error occurs
public int getBugCountForComponent(java.lang.String component)
throws JagzillaException
BugQuery
getBugCountForComponent in interface BugQuerycomponent -
JagzillaException
public int getBugCountQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo)
throws JagzillaException
BugQuery
getBugCountQuery in interface BugQueryproduct - component - version - milestone - creationFrom - creation date from which to search bugscreationTo - creation date to which to search bugspriority - severity - status - resolution - assignedTo -
JagzillaException
public void addBugComment(int bugId,
int userId,
java.lang.String comment)
throws JagzillaException,
NoSuchProfileException,
NoSuchBugException
BugQuery
addBugComment in interface BugQuerybugId - the bug id to which the comment will be added.userId - id of the profile requesting the operationcomment - comment to add
NoSuchProfileException - if the profileId cannot be found
JagzillaException - if an error occurs
NoSuchBugException - if the bugId did not retrive an existent bug
public void addBugAttach(Attachment attachment)
throws JagzillaException,
NoSuchBugException,
NoSuchProfileException
BugQuery
addBugAttach in interface BugQueryattachment - the attachment to add
NoSuchProfileException - if the userId did not retrive an existent profile
NoSuchBugException - if the bugId did not retrive an existent bug
JagzillaException - if an error occursAttachment
public Bug getBugById(int id)
throws JagzillaException,
NoSuchBugException
BugQuery
getBugById in interface BugQueryid - the id of the bug to search for
NoSuchBugException - if there is no bug with the given id
JagzillaException - if an error occursBug
public java.util.List getBugsSince(java.util.Date since)
throws JagzillaException,
DateInFutureException
BugQuerysince
getBugsSince in interface BugQuerysince - Date of creation bugs
Bug opened after since date
DateInFutureException - if the since parameter refences a future date
JagzillaException - if an error occurs
public java.util.List getBugsForProduct(Product product)
throws JagzillaException
BugQuery
getBugsForProduct in interface BugQueryproduct -
JagzillaException - if an error occurs
public java.util.List getBugsForComponent(Component component)
throws JagzillaException
BugQuery
getBugsForComponent in interface BugQuerycomponent -
JagzillaException - if an error occurs
public java.util.List getBugsForMilestone(Milestone milestone)
throws JagzillaException
BugQuery
getBugsForMilestone in interface BugQuerymilestone -
JagzillaException - if an error occurs
public java.util.List getBugsForVersion(Version version)
throws JagzillaException
BugQuery
getBugsForVersion in interface BugQueryversion -
JagzillaException - if an error occurs
public void addBugWithComment(Bug bug,
java.lang.String comment)
throws JagzillaException,
NoSuchProductException,
NoSuchComponentException
BugQuerycomment as the first long description of the bug.
The userid of the comment is taken from the reporter. This methos is equivalent to
call:
addBug(bug);
addBugComment(bug.getId(), bug.getReporter(), comment);
addBugWithComment in interface BugQuerybug - comment -
JagzillaException
NoSuchComponentException
NoSuchProductException
public void changeBugStatus(int profile,
int bugId,
java.lang.String status,
int asignee)
throws JagzillaException,
NoSuchBugException,
BadStatusException
BugQueryBug.STATUS_RESOLVED
the application should also call resolveBug in order to specify the
resolution the bug is assigned.
changeBugStatus in interface BugQueryprofile - id of the user requesting the actionbugId - id of the bug to changeasignee - id of the user the bug is assigned to only if the status is ASSIGNED, this value is ignored in other statuses.status - new value for the status fiedl, must be in Bug.STATUS_ARR
NoSuchBugException - if the bug cannot be found
JagzillaException - if an error occurs
BadStatusException - if the status is not a constant value in the Bug classBugQuery.resolveBug(int, int, String, int)
public void resolveBug(int profile,
int bugId,
java.lang.String resolution,
int dupeId)
throws JagzillaException,
NoSuchBugException,
BadResolutionException
BugQuerychangeBugStatus.
If the bug is not in Bug.STATUS_RESOLVED this method
will invoke changeBugStatus to make the bug status resolved.
Notice however, that this will not work in all cases, since when a bug is initially resolved
it can be changed the resolution many times and the record of resolution change will not
be added since bug.getStatus() will report
Bug.STATUS_RESOLVED.
resolveBug in interface BugQueryprofile - id of the user requesting the actionbugId - id of the bug to changeresolution - resolution to set. must be a constant value in BugdupeId - if of duplicate-of bug. This field is only meaningfull is resolutions is RESOLUTION_DUPLICATE. It's value is ignored on other cases.
JagzillaException - if an error occurs
BadResolutionException - if the resolution is not a constant of the Bug class
NoSuchBugException - if the bug cannot be found, or if resolution is duplicate and dupeId cannot be foundBugQuery.changeBugStatus(int, int, String, int)
public void changeBugPriority(int profile,
int bugId,
java.lang.String pri,
java.lang.String comment)
throws JagzillaException,
NoSuchBugException,
NoSuchProfileException,
BadPriorityException
BugQuery
changeBugPriority in interface BugQueryprofile - id of user requesting the operationbugId - if of bug to change prioritypri - new priority. must be defined in Bugcomment - optional comment to add. can be null
BadPriorityException - if priority is not a Bug constant
NoSuchProfileException - if the profile with given id cannot be found
JagzillaException - if an error occurs
NoSuchBugException - if the bug with given id cannot be foundBug
public void changeBugSeverity(int profile,
int bugId,
java.lang.String sev,
java.lang.String comment)
throws JagzillaException,
NoSuchBugException,
NoSuchProfileException,
BadSeverityException
BugQuery
changeBugSeverity in interface BugQueryprofile - id of user requesting the operationbugId - if of bug to change prioritysev - new severity. must be defined in Bugcomment - optional comment to add. can be null
NoSuchProfileException - if the profile with given id cannot be found
JagzillaException - if an error occurs
NoSuchBugException - if the bug with given id cannot be found
BadSeverityException - if severity is not a Bug constantBug
public java.util.List getBugsReportedBy(int userid)
throws JagzillaException,
NoSuchProfileException
BugQuery
getBugsReportedBy in interface BugQueryuserid - the user id
JagzillaException - if an error occurs
NoSuchProfileException - if the user cannot be found
public java.util.List getBugsQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo,
int reportedBy)
throws JagzillaException,
NoSuchProductException,
NoSuchComponentException,
NoSuchVersionException,
NoSuchMilestoneException,
NoSuchReporterException,
NoSuchAsigneeException,
BadStatusException,
BadPriorityException,
BadSeverityException,
DateInFutureException
BugQuery
getBugsQuery in interface BugQueryproduct - component - version - milestone - creationFrom - creationTo - priority - severity - status - resolution - assignedTo - reportedBy -
JagzillaException
BadStatusException
NoSuchVersionException
NoSuchComponentException
NoSuchProductException
NoSuchAsigneeException
DateInFutureException
NoSuchReporterException
BadPriorityException
BadSeverityException
NoSuchMilestoneException
public void updateBug(Bug bug)
throws JagzillaException,
NoSuchProductException,
NoSuchComponentException,
NoSuchReporterException,
NoSuchAsigneeException,
NoSuchVersionException,
NoSuchMilestoneException
BugQuery
updateBug in interface BugQuerybug - bug with new data
NoSuchVersionException - if the version specified is not null and cannot be found
NoSuchComponentException - if the component specified is not null and cannot be found
NoSuchMilestoneException - if the milestone specified is not null and cannot be found
NoSuchProductException - if the product specified is not null and cannot be found
NoSuchAsigneeException - if the asignee specified is not null and cannot be found
NoSuchReporterException - if the reporter specified is not null and cannot be found
JagzillaException - if an error occurs
public java.util.List getAllBugs()
throws JagzillaException
BugQuery
getAllBugs in interface BugQueryBug
JagzillaException - if an error occursBug
public java.util.List getCcList(int bugId)
throws JagzillaException,
NoSuchBugException
BugQuery
getCcList in interface BugQuerybugId - the id of the bug to search the cc list for.
List of Profile
NoSuchBugException - if the bug id cannot be found
JagzillaException - if an error occursProfile,
SystemQuery.addCc(int,int),
SystemQuery.removeCc(int,int)
public SystemQuery getSystemQuery()
throws JagzillaException
BugQuery
getSystemQuery in interface BugQueryJagzillaException - if an error occurs
public int getBugCountQuery(java.lang.String product,
java.lang.String component,
java.lang.String version,
java.lang.String milestone,
java.util.Date creationFrom,
java.util.Date creationTo,
java.lang.String priority,
java.lang.String severity,
java.lang.String status,
java.lang.String resolution,
int assignedTo,
int reportedBy)
throws JagzillaException
getBugCountQuery in interface BugQueryJagzillaException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||