org.hackystat.sensor.ant.issue
Class IssueEntry

java.lang.Object
  extended by org.hackystat.sensor.ant.issue.IssueEntry

public class IssueEntry
extends java.lang.Object

An IssueEntry represent an issue in issue tracking system, always reflect the most current state.

Author:
Shaoxuan Zhang

Field Summary
static java.lang.String ID_PROPERTY_KEY
          property key of ID.
static java.lang.String MILESTONE_PROPERTY_KEY
          property key of MILESTONE.
static java.lang.String OWNER_PROPERTY_KEY
          property key of OWNER.
static java.lang.String PRIORITY_PROPERTY_KEY
          property key of PRIORITY.
static java.lang.String STATUS_PROPERTY_KEY
          property key of STATUS.
static java.lang.String TIMESTAMP_SEPARATOR
          timestamp separator in property value.
static java.lang.String TYPE_PROPERTY_KEY
          property key of TYPE.
 
Constructor Summary
IssueEntry(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
           
 
Method Summary
 javax.xml.datatype.XMLGregorianCalendar getClosedTime()
           
 int getIssueId()
           
static int getIssueId(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
          Return the issue id of the issue sensordata.
 javax.xml.datatype.XMLGregorianCalendar getLastUpdateTime()
          Get the last update time of this issue sensor data.
static java.lang.String getLatestValueWithKey(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData sensorData, java.lang.String key)
          Return the latest value with the given key from the SensorData.
 java.lang.String getMilestone()
           
 javax.xml.datatype.XMLGregorianCalendar getModifiedTime()
           
 javax.xml.datatype.XMLGregorianCalendar getOpenedTime()
           
 java.lang.String getOwner()
           
 java.lang.String getPriority()
           
 org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData getSensorData()
           
 java.lang.String getStatus()
           
 java.lang.String getType()
           
protected  void setClosedTime(javax.xml.datatype.XMLGregorianCalendar closedTime)
           
protected  void setIssueId(int id)
           
 void setMilestone(java.lang.String milestone)
           
protected  void setModifiedTime(javax.xml.datatype.XMLGregorianCalendar modifiedTime)
           
 void setOpenedTime(javax.xml.datatype.XMLGregorianCalendar openedTime)
           
 void setOwner(java.lang.String owner)
           
 void setPriority(java.lang.String priority)
           
protected  void setSensorData(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData sensorData)
           
 void setStatus(java.lang.String status)
           
 void setType(java.lang.String type)
           
 boolean upToDate(java.lang.String[] line, javax.xml.datatype.XMLGregorianCalendar runTimestamp, boolean isVerbose)
          Update this IssueEntry as well as the associated sensordata to the given issue table column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_PROPERTY_KEY

public static final java.lang.String ID_PROPERTY_KEY
property key of ID.

See Also:
Constant Field Values

TYPE_PROPERTY_KEY

public static final java.lang.String TYPE_PROPERTY_KEY
property key of TYPE.

See Also:
Constant Field Values

STATUS_PROPERTY_KEY

public static final java.lang.String STATUS_PROPERTY_KEY
property key of STATUS.

See Also:
Constant Field Values

PRIORITY_PROPERTY_KEY

public static final java.lang.String PRIORITY_PROPERTY_KEY
property key of PRIORITY.

See Also:
Constant Field Values

MILESTONE_PROPERTY_KEY

public static final java.lang.String MILESTONE_PROPERTY_KEY
property key of MILESTONE.

See Also:
Constant Field Values

OWNER_PROPERTY_KEY

public static final java.lang.String OWNER_PROPERTY_KEY
property key of OWNER.

See Also:
Constant Field Values

TIMESTAMP_SEPARATOR

public static final java.lang.String TIMESTAMP_SEPARATOR
timestamp separator in property value.

See Also:
Constant Field Values
Constructor Detail

IssueEntry

public IssueEntry(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
           throws java.lang.Exception
Parameters:
data - The associated SensorData
Throws:
java.lang.Exception - if error
Method Detail

upToDate

public boolean upToDate(java.lang.String[] line,
                        javax.xml.datatype.XMLGregorianCalendar runTimestamp,
                        boolean isVerbose)
Update this IssueEntry as well as the associated sensordata to the given issue table column.

Parameters:
line - the content of the issue table column.
runTimestamp - the run time.
isVerbose - if do the update verbosely.
Returns:
true if the sensordata is modified.

getIssueId

public static int getIssueId(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData data)
Return the issue id of the issue sensordata.

Parameters:
data - the issue sensordata.
Returns:
the issue id. -1 if there is no property with key = IssueId.

getLastUpdateTime

public javax.xml.datatype.XMLGregorianCalendar getLastUpdateTime()
Get the last update time of this issue sensor data. If LastModification time is available, it will be return. Otherwise, it will process through properties to find the lastest timestamp in properties' timestamp.

Returns:
the timestamp of last udpate. NULL if no relative information found.

getLatestValueWithKey

public static final java.lang.String getLatestValueWithKey(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData sensorData,
                                                           java.lang.String key)
                                                    throws java.lang.Exception
Return the latest value with the given key from the SensorData.

Parameters:
sensorData - the SensorData.
key - the property key
Returns:
the latest value, null if not found.
Throws:
java.lang.Exception - if error when parsing property values.

setIssueId

protected void setIssueId(int id)
Parameters:
id - the issueId to set

getIssueId

public int getIssueId()
Returns:
the issueId

setType

public void setType(java.lang.String type)
Parameters:
type - the type to set

getType

public java.lang.String getType()
Returns:
the type

setStatus

public void setStatus(java.lang.String status)
Parameters:
status - the status to set

getStatus

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

setPriority

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

getPriority

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

setMilestone

public void setMilestone(java.lang.String milestone)
Parameters:
milestone - the milestone to set

getMilestone

public java.lang.String getMilestone()
Returns:
the milestone

setOwner

public void setOwner(java.lang.String owner)
Parameters:
owner - the owner to set

getOwner

public java.lang.String getOwner()
Returns:
the owner

setOpenedTime

public void setOpenedTime(javax.xml.datatype.XMLGregorianCalendar openedTime)
Parameters:
openedTime - the openedTime to set

getOpenedTime

public javax.xml.datatype.XMLGregorianCalendar getOpenedTime()
Returns:
the openedTime

setClosedTime

protected void setClosedTime(javax.xml.datatype.XMLGregorianCalendar closedTime)
Parameters:
closedTime - the closedTime to set

getClosedTime

public javax.xml.datatype.XMLGregorianCalendar getClosedTime()
Returns:
the closedTime

setSensorData

protected void setSensorData(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData sensorData)
Parameters:
sensorData - the sensorData to set

getSensorData

public org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData getSensorData()
Returns:
the sensorData

setModifiedTime

protected void setModifiedTime(javax.xml.datatype.XMLGregorianCalendar modifiedTime)
Parameters:
modifiedTime - the modifiedTime to set

getModifiedTime

public javax.xml.datatype.XMLGregorianCalendar getModifiedTime()
Returns:
the modifiedTime