net.sf.jagzilla.hibernate
Class Bug

java.lang.Object
  extended bynet.sf.jagzilla.hibernate.XmlObjectImpl
      extended bynet.sf.jagzilla.hibernate.Bug
All Implemented Interfaces:
java.io.Serializable, XmlObject

public class Bug
extends XmlObjectImpl
implements java.io.Serializable

represents a record in the table bugs. A bug can be added to jagzilla in this way: Bug b = new Bug(); b.setSummary("bug summary"); b.setReporter(1); bugQuery.addBug(b); A summary should always be included, but is not mandatory. The reporter is needs to be a valid bugzilla user. All other attributes are deducted or guessed.

Author:
mgriffa
See Also:
Serialized Form

Field Summary
static java.lang.String[] PRIORITIES_ARR
          Comment for PRIORITIES_ARR
static java.lang.String PRIORITY_P1
          Comment for PRIORITY_P1
static java.lang.String PRIORITY_P2
          Comment for PRIORITY_P2
static java.lang.String PRIORITY_P3
          Comment for PRIORITY_P3
static java.lang.String PRIORITY_P4
          Comment for PRIORITY_P4
static java.lang.String PRIORITY_P5
          Comment for PRIORITY_P5
static java.lang.String RESOLUTION_DUPLICATE
          Constant to hold the value that indicates a bug has been resolved DUPLICATE.
static java.lang.String RESOLUTION_FIXED
          Constant to hold the value that indicates a bug has been resolved FIXED.
static java.lang.String RESOLUTION_INVALID
          Constant to hold the value that indicates a bug has been resolved INVALID.
static java.lang.String RESOLUTION_LATER
          Constant to hold the value that indicates a bug has been resolved LATER.
static java.lang.String RESOLUTION_MOVED
          Constant to hold the value that indicates a bug has been resolved MOVED.
static java.lang.String RESOLUTION_NONE
          Constant indicating no resolution assigned to a bug (also initial value).
static java.lang.String RESOLUTION_REMIND
          Constant to hold the value that indicates a bug has been resolved REMIND.
static java.lang.String RESOLUTION_WONTFIX
          Constant to hold the value that indicates a bug has been resolved WON'T FIX.
static java.lang.String RESOLUTION_WORKSFORME
          Constant to hold the value that indicates a bug has been resolved WORKS FOR ME.
static java.lang.String[] RESOLUTIONS_ARR
          Array containing all posible resolutions.
static java.lang.String[] SEVERITY_ARR
          Comment for SEVERITY_ARR
static java.lang.String SEVERITY_BLOCKER
          Comment for SEVERITY_BLOCKER
static java.lang.String SEVERITY_CRITICAL
          Comment for SEVERITY_CRITICAL
static java.lang.String SEVERITY_ENHANCEMENT
          Comment for SEVERITY_ENHANCEMENT
static java.lang.String SEVERITY_MAYOR
          Comment for SEVERITY_MAYOR
static java.lang.String SEVERITY_MINOR
          Comment for SEVERITY_MINOR
static java.lang.String SEVERITY_NORMAL
          Comment for SEVERITY_NORMAL
static java.lang.String SEVERITY_TRIVIAL
          Comment for SEVERITY_TRIVIAL
static java.lang.String[] STATUS_ARR
          Comment for STATUS_ARR
static java.lang.String STATUS_ASSIGNED
          Comment for STATUS_ASSIGNED
static java.lang.String STATUS_CLOSED
          Comment for STATUS_CLOSED
static java.lang.String STATUS_NEW
          Comment for STATUS_NEW
static java.lang.String STATUS_REOPENED
          Comment for STATUS_REOPENED
static java.lang.String STATUS_RESOLVED
          Comment for STATUS_RESOLVED
static java.lang.String STATUS_UNCONFIRMED
          Comment for STATUS_UNCONFIRMED
static java.lang.String STATUS_VERIFIED
          Comment for STATUS_VERIFIED
 
Constructor Summary
Bug()
          this constructor sets defaults for all required fields that can have a wired default.
 
Method Summary
 int getAssignedTo()
           
 java.lang.String getBugFileLoc()
           
 short getCcListAccessible()
           
 java.util.Set getComments()
           
 java.lang.String getComponent()
           
 java.util.Date getCreation()
           
 java.util.Date getDelta()
           
 short getEverConfirmed()
           
 int getGroupset()
           
 int getId()
           
 java.lang.String getKeywords()
           
 java.util.Date getLastDiffed()
           
 java.lang.String getOperatingSystem()
           
 java.lang.String getPriority()
           
static int getPriorityIndex(java.lang.String s)
          returns the index of the priority in the priorities array.
 java.lang.String getProduct()
           
 int getQaContact()
           
 int getReporter()
           
 int getReporterAccessible()
           
 java.lang.String getReportPlatform()
           
 java.lang.String getResolution()
           
static int getResolutionIndex(java.lang.String s)
          returns the index of the status in the resolutions array.
 java.lang.String getSeverity()
           
static int getSeverityIndex(java.lang.String s)
          returns the index of the severity in the priorities array.
 java.lang.String getStatus()
           
static int getStatusIndex(java.lang.String s)
          returns the index of the status in the priorities array.
 java.lang.String getStatusWhiteboard()
           
 java.lang.String getSummary()
           
 java.lang.String getTargetMilestone()
           
 java.lang.String getVersion()
           
 int getVotes()
           
static boolean isValidPriority(java.lang.String pri)
          is pri a valid priority?
static boolean isValidResolution(java.lang.String res)
          is res a valid resolution?
static boolean isValidSeverity(java.lang.String sev)
          is sev a valid severity?
static boolean isValidStatus(java.lang.String stat)
          is stat a valid status?
 void loadFromXml(java.io.Reader reader)
          load the object data from xml.
 void setAssignedTo(int assignedTo)
           
 void setBugFileLoc(java.lang.String bugFileLoc)
           
 void setCcListAccessible(short ccListAccesible)
           
 void setComments(java.util.Set comments)
           
 void setComponent(java.lang.String component)
           
 void setCreation(java.util.Date creation)
           
 void setDelta(java.util.Date delta)
           
 void setEverConfirmed(short everConfirmed)
           
 void setGroupset(int groupset)
           
 void setId(int id)
           
 void setKeywords(java.lang.String keywords)
           
 void setLastDiffed(java.util.Date lastDiffied)
           
 void setOperatingSystem(java.lang.String operatingSystem)
           
 void setPriority(java.lang.String priority)
           
 void setProduct(java.lang.String product)
           
 void setQaContact(int qaContact)
           
 void setReporter(int reporter)
           
 void setReporterAccessible(int reporterAccesible)
           
 void setReportPlatform(java.lang.String reportPlatform)
           
 void setResolution(java.lang.String resolution)
           
 void setSeverity(java.lang.String severity)
           
 void setStatus(java.lang.String bugStatus)
           
 void setStatusWhiteboard(java.lang.String statusWhiteboard)
           
 void setSummary(java.lang.String summary)
           
 void setTargetMilestone(java.lang.String targetMilestone)
           
 void setVersion(java.lang.String version)
           
 void setVotes(int votes)
           
 java.lang.String toString()
           
 
Methods inherited from class net.sf.jagzilla.hibernate.XmlObjectImpl
equals, getXmlString, loadObjectFromXml, setXmlString, toXml
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOLUTION_NONE

public static final java.lang.String RESOLUTION_NONE
Constant indicating no resolution assigned to a bug (also initial value).

See Also:
Constant Field Values

RESOLUTION_FIXED

public static final java.lang.String RESOLUTION_FIXED
Constant to hold the value that indicates a bug has been resolved FIXED.

See Also:
Constant Field Values

RESOLUTION_INVALID

public static final java.lang.String RESOLUTION_INVALID
Constant to hold the value that indicates a bug has been resolved INVALID.

See Also:
Constant Field Values

RESOLUTION_WONTFIX

public static final java.lang.String RESOLUTION_WONTFIX
Constant to hold the value that indicates a bug has been resolved WON'T FIX.

See Also:
Constant Field Values

RESOLUTION_LATER

public static final java.lang.String RESOLUTION_LATER
Constant to hold the value that indicates a bug has been resolved LATER.

See Also:
Constant Field Values

RESOLUTION_REMIND

public static final java.lang.String RESOLUTION_REMIND
Constant to hold the value that indicates a bug has been resolved REMIND.

See Also:
Constant Field Values

RESOLUTION_DUPLICATE

public static final java.lang.String RESOLUTION_DUPLICATE
Constant to hold the value that indicates a bug has been resolved DUPLICATE.

See Also:
Duplicate, Constant Field Values

RESOLUTION_WORKSFORME

public static final java.lang.String RESOLUTION_WORKSFORME
Constant to hold the value that indicates a bug has been resolved WORKS FOR ME.

See Also:
Constant Field Values

RESOLUTION_MOVED

public static final java.lang.String RESOLUTION_MOVED
Constant to hold the value that indicates a bug has been resolved MOVED.

See Also:
Constant Field Values

RESOLUTIONS_ARR

public static final java.lang.String[] RESOLUTIONS_ARR
Array containing all posible resolutions. The order in the array is suitable for ordering.


PRIORITY_P1

public static final java.lang.String PRIORITY_P1
Comment for PRIORITY_P1

See Also:
Constant Field Values

PRIORITY_P2

public static final java.lang.String PRIORITY_P2
Comment for PRIORITY_P2

See Also:
Constant Field Values

PRIORITY_P3

public static final java.lang.String PRIORITY_P3
Comment for PRIORITY_P3

See Also:
Constant Field Values

PRIORITY_P4

public static final java.lang.String PRIORITY_P4
Comment for PRIORITY_P4

See Also:
Constant Field Values

PRIORITY_P5

public static final java.lang.String PRIORITY_P5
Comment for PRIORITY_P5

See Also:
Constant Field Values

PRIORITIES_ARR

public static final java.lang.String[] PRIORITIES_ARR
Comment for PRIORITIES_ARR


SEVERITY_BLOCKER

public static final java.lang.String SEVERITY_BLOCKER
Comment for SEVERITY_BLOCKER

See Also:
Constant Field Values

SEVERITY_CRITICAL

public static final java.lang.String SEVERITY_CRITICAL
Comment for SEVERITY_CRITICAL

See Also:
Constant Field Values

SEVERITY_MAYOR

public static final java.lang.String SEVERITY_MAYOR
Comment for SEVERITY_MAYOR

See Also:
Constant Field Values

SEVERITY_NORMAL

public static final java.lang.String SEVERITY_NORMAL
Comment for SEVERITY_NORMAL

See Also:
Constant Field Values

SEVERITY_MINOR

public static final java.lang.String SEVERITY_MINOR
Comment for SEVERITY_MINOR

See Also:
Constant Field Values

SEVERITY_TRIVIAL

public static final java.lang.String SEVERITY_TRIVIAL
Comment for SEVERITY_TRIVIAL

See Also:
Constant Field Values

SEVERITY_ENHANCEMENT

public static final java.lang.String SEVERITY_ENHANCEMENT
Comment for SEVERITY_ENHANCEMENT

See Also:
Constant Field Values

SEVERITY_ARR

public static final java.lang.String[] SEVERITY_ARR
Comment for SEVERITY_ARR


STATUS_UNCONFIRMED

public static final java.lang.String STATUS_UNCONFIRMED
Comment for STATUS_UNCONFIRMED

See Also:
Constant Field Values

STATUS_NEW

public static final java.lang.String STATUS_NEW
Comment for STATUS_NEW

See Also:
Constant Field Values

STATUS_ASSIGNED

public static final java.lang.String STATUS_ASSIGNED
Comment for STATUS_ASSIGNED

See Also:
Constant Field Values

STATUS_REOPENED

public static final java.lang.String STATUS_REOPENED
Comment for STATUS_REOPENED

See Also:
Constant Field Values

STATUS_RESOLVED

public static final java.lang.String STATUS_RESOLVED
Comment for STATUS_RESOLVED

See Also:
Constant Field Values

STATUS_VERIFIED

public static final java.lang.String STATUS_VERIFIED
Comment for STATUS_VERIFIED

See Also:
Constant Field Values

STATUS_CLOSED

public static final java.lang.String STATUS_CLOSED
Comment for STATUS_CLOSED

See Also:
Constant Field Values

STATUS_ARR

public static final java.lang.String[] STATUS_ARR
Comment for STATUS_ARR

Constructor Detail

Bug

public Bug()
this constructor sets defaults for all required fields that can have a wired default. In future implementations these defaults sould be customizable.

Method Detail

getAssignedTo

public int getAssignedTo()
Returns:

setAssignedTo

public void setAssignedTo(int assignedTo)
Parameters:
assignedTo -

getProduct

public java.lang.String getProduct()
Returns:

setProduct

public void setProduct(java.lang.String product)
Parameters:
product -

getSummary

public java.lang.String getSummary()
Returns:
Returns the summary.

setSummary

public void setSummary(java.lang.String summary)
Parameters:
summary - The summary to set.

getId

public int getId()
Returns:
Returns the id.

setId

public void setId(int id)

toString

public java.lang.String toString()

getBugFileLoc

public java.lang.String getBugFileLoc()
Returns:
Returns the bugFileLoc.

setBugFileLoc

public void setBugFileLoc(java.lang.String bugFileLoc)
Parameters:
bugFileLoc - The bugFileLoc to set.

getStatus

public java.lang.String getStatus()
Returns:
Returns the bugStatus.

setStatus

public void setStatus(java.lang.String bugStatus)
Parameters:
bugStatus - The bugStatus to set.

getCcListAccessible

public short getCcListAccessible()
Returns:
Returns the ccListAccesible.

setCcListAccessible

public void setCcListAccessible(short ccListAccesible)
Parameters:
ccListAccesible - The ccListAccesible to set.

getComponent

public java.lang.String getComponent()
Returns:
Returns the component.

setComponent

public void setComponent(java.lang.String component)
Parameters:
component - The component to set.

getCreation

public java.util.Date getCreation()
Returns:
Returns the creation.

setCreation

public void setCreation(java.util.Date creation)
Parameters:
creation - The creation to set.

getDelta

public java.util.Date getDelta()
Returns:
Returns the delta.

setDelta

public void setDelta(java.util.Date delta)
Parameters:
delta - The delta to set.

getEverConfirmed

public short getEverConfirmed()
Returns:
Returns the everConfirmed.

setEverConfirmed

public void setEverConfirmed(short everConfirmed)
Parameters:
everConfirmed - The everConfirmed to set.

getGroupset

public int getGroupset()
Returns:
Returns the groupset.

setGroupset

public void setGroupset(int groupset)
Parameters:
groupset - The groupset to set.

getKeywords

public java.lang.String getKeywords()
Returns:
Returns the keywords.

setKeywords

public void setKeywords(java.lang.String keywords)
Parameters:
keywords - The keywords to set.

getLastDiffed

public java.util.Date getLastDiffed()
Returns:
Returns the lastDiffied.

setLastDiffed

public void setLastDiffed(java.util.Date lastDiffied)
Parameters:
lastDiffied - The lastDiffied to set.

getOperatingSystem

public java.lang.String getOperatingSystem()
Returns:
Returns the operatingSystem.

setOperatingSystem

public void setOperatingSystem(java.lang.String operatingSystem)
Parameters:
operatingSystem - The operatingSystem to set.

getPriority

public java.lang.String getPriority()
Returns:
Returns the priority.

setPriority

public void setPriority(java.lang.String priority)
Parameters:
priority - The priority to set.

getQaContact

public int getQaContact()
Returns:
Returns the qaContact.

setQaContact

public void setQaContact(int qaContact)
Parameters:
qaContact - The qaContact to set.

getReporter

public int getReporter()
Returns:
Returns the reporter.

setReporter

public void setReporter(int reporter)
Parameters:
reporter - The reporter to set.

getReporterAccessible

public int getReporterAccessible()
Returns:
Returns the reporterAccesible.

setReporterAccessible

public void setReporterAccessible(int reporterAccesible)
Parameters:
reporterAccesible - The reporterAccesible to set.

getReportPlatform

public java.lang.String getReportPlatform()
Returns:
Returns the reportPlatform.

setReportPlatform

public void setReportPlatform(java.lang.String reportPlatform)
Parameters:
reportPlatform - The reportPlatform to set.

getResolution

public java.lang.String getResolution()
Returns:
Returns the resolution.

setResolution

public void setResolution(java.lang.String resolution)
Parameters:
resolution - The resolution to set.

getStatusWhiteboard

public java.lang.String getStatusWhiteboard()
Returns:
Returns the statusWhiteboard.

setStatusWhiteboard

public void setStatusWhiteboard(java.lang.String statusWhiteboard)
Parameters:
statusWhiteboard - The statusWhiteboard to set.

getTargetMilestone

public java.lang.String getTargetMilestone()
Returns:
Returns the targetMilestone.

setTargetMilestone

public void setTargetMilestone(java.lang.String targetMilestone)
Parameters:
targetMilestone - The targetMilestone to set.

getVersion

public java.lang.String getVersion()
Returns:
Returns the version.

setVersion

public void setVersion(java.lang.String version)
Parameters:
version - The version to set.

getVotes

public int getVotes()
Returns:
Returns the votes.

setVotes

public void setVotes(int votes)
Parameters:
votes - The votes to set.

getSeverity

public java.lang.String getSeverity()
Returns:
Returns the severity.

setSeverity

public void setSeverity(java.lang.String severity)
Parameters:
severity - The severity to set.

getComments

public java.util.Set getComments()
Returns:
Returns a list of LongDesc
See Also:
LongDesc

setComments

public void setComments(java.util.Set comments)
Parameters:
comments - The comments to set.

getPriorityIndex

public static int getPriorityIndex(java.lang.String s)
returns the index of the priority in the priorities array. suitable for ordering.

Parameters:
s - the string to search the index for
Returns:
an integer greater or equal to zero or a negative value if the string is not found

getSeverityIndex

public static int getSeverityIndex(java.lang.String s)
returns the index of the severity in the priorities array. suitable for ordering.

Parameters:
s - the string to search the index for
Returns:
an integer greater or equal to zero or a negative value if the string is not found

getStatusIndex

public static int getStatusIndex(java.lang.String s)
returns the index of the status in the priorities array. suitable for ordering.

Parameters:
s - the string to search the index for
Returns:
an integer greater or equal to zero or a negative value if the string is not found

getResolutionIndex

public static int getResolutionIndex(java.lang.String s)
returns the index of the status in the resolutions array. suitable for ordering.

Parameters:
s - the string to search the index for
Returns:
an integer greater or equal to zero or a negative value if the string is not found

isValidResolution

public static boolean isValidResolution(java.lang.String res)
is res a valid resolution?

Parameters:
res - the resolution to validate
Returns:
true if the resolution index equals or is greater than zero.

isValidPriority

public static boolean isValidPriority(java.lang.String pri)
is pri a valid priority?

Parameters:
pri - the priority to validate
Returns:
true if the priority index equals or is greater than zero.

isValidSeverity

public static boolean isValidSeverity(java.lang.String sev)
is sev a valid severity?

Parameters:
sev - the severity to validate
Returns:
true if the severity index equals or is greater than zero.

isValidStatus

public static boolean isValidStatus(java.lang.String stat)
is stat a valid status?

Parameters:
stat - the status to validate
Returns:
true if the status index equals or is greater than zero.

loadFromXml

public void loadFromXml(java.io.Reader reader)
                 throws java.io.IOException,
                        MappingException,
                        MarshalException,
                        ValidationException
Description copied from interface: XmlObject
load the object data from xml. This method internally uses castor to unmarshall the object form XML.

Specified by:
loadFromXml in interface XmlObject
Parameters:
reader - a reader containing a parseable xml
Throws:
java.io.IOException
MappingException
MarshalException
ValidationException


Distributed under the GPL. By Miguel Griffa. See the Jagzilla project page for more info.