org.hackystat.dailyprojectdata.resource.issue
Class IssueDataParser

java.lang.Object
  extended by org.hackystat.dailyprojectdata.resource.issue.IssueDataParser

public class IssueDataParser
extends java.lang.Object

Parser for the issue sensordata to IssueData.

Author:
Shaoxuan Zhang

Field Summary
protected static java.lang.String ID_PROPERTY_KEY
          property key of ID.
protected static java.lang.String MILESTONE_PROPERTY_KEY
          property key of MILESTONE.
protected static java.lang.String OWNER_PROPERTY_KEY
          property key of OWNER.
protected static java.lang.String PRIORITY_PROPERTY_KEY
          property key of PRIORITY.
protected static java.lang.String STATUS_PROPERTY_KEY
          property key of STATUS.
protected static java.lang.String TIMESTAMP_SEPARATOR
          timestamp separator in property value.
protected static java.lang.String TYPE_PROPERTY_KEY
          property key of TYPE.
 
Constructor Summary
IssueDataParser(java.util.logging.Logger logger)
           
 
Method Summary
 IssueData getIssueDpd(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData issueSensorData, javax.xml.datatype.XMLGregorianCalendar timestamp)
          Get the state of the issue on the given time.
 java.lang.String getValueWithKeyWhen(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData issueSensorData, java.lang.String key, javax.xml.datatype.XMLGregorianCalendar timestamp)
          Return the value with the given key in the given time within the given sensordata.
 boolean isOpenStatus(java.lang.String statusValue)
          Determine if the status value means open.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_PROPERTY_KEY

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

See Also:
Constant Field Values

TYPE_PROPERTY_KEY

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

See Also:
Constant Field Values

STATUS_PROPERTY_KEY

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

See Also:
Constant Field Values

PRIORITY_PROPERTY_KEY

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

See Also:
Constant Field Values

MILESTONE_PROPERTY_KEY

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

See Also:
Constant Field Values

OWNER_PROPERTY_KEY

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

See Also:
Constant Field Values

TIMESTAMP_SEPARATOR

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

See Also:
Constant Field Values
Constructor Detail

IssueDataParser

public IssueDataParser(java.util.logging.Logger logger)
Parameters:
logger - the logger.
Method Detail

isOpenStatus

public boolean isOpenStatus(java.lang.String statusValue)
Determine if the status value means open.

Parameters:
statusValue - the status value.
Returns:
true if it is open.

getIssueDpd

public IssueData getIssueDpd(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData issueSensorData,
                             javax.xml.datatype.XMLGregorianCalendar timestamp)
Get the state of the issue on the given time.

Parameters:
issueSensorData - the given sensordata.
timestamp - the time.
Returns:
the IssueData.

getValueWithKeyWhen

public java.lang.String getValueWithKeyWhen(org.hackystat.sensorbase.resource.sensordata.jaxb.SensorData issueSensorData,
                                            java.lang.String key,
                                            javax.xml.datatype.XMLGregorianCalendar timestamp)
Return the value with the given key in the given time within the given sensordata.

Parameters:
issueSensorData - the sensordata.
key - the property key
timestamp - the time.
Returns:
the latest value, null if not found.