org.hackystat.projectbrowser.page.trajectory
Class TrajectorySession

java.lang.Object
  extended by org.hackystat.projectbrowser.page.trajectory.TrajectorySession
All Implemented Interfaces:
java.io.Serializable

public class TrajectorySession
extends java.lang.Object
implements java.io.Serializable

Session to hold state for trajectory.

Author:
Pavel Senin, Shaoxuan Zhang
See Also:
Serialized Form

Field Summary
static java.lang.String END_DATE1_KEY
          The parameter key of end dateof project 1.
static java.lang.String END_DATE2_KEY
          The parameter key of end dateof project 1.
static java.lang.String GRANULARITY_KEY
          The parameter key of granularity.
static java.lang.String PARAMETER_VALUE_SEPARATOR
          The separator for parameter values.
static java.lang.String PROJECT_NAME_OWNER_SEPARATR
          The separator between project name and its onwer.
static java.lang.String SELECTED_PROJECT1_KEY
          The parameter key of selectedProject1.
static java.lang.String SELECTED_PROJECT2_KEY
          The parameter key of selectedProject1.
static java.lang.String START_DATE1_KEY
          The parameter key of start date of project 1.
static java.lang.String START_DATE2_KEY
          The parameter key of start date of project 1.
static java.lang.String TELEMETRY_KEY
          The parameter key of telemetry.
static java.lang.String TELEMETRY_PARAMERTERS_KEY
          The parameter key of telemetry parameters.
 
Constructor Summary
TrajectorySession()
          Constructor - create the session instance.
 
Method Summary
 void cancelDataUpdate()
          Cancel data model's update.
 void clearParamErrorMessage()
          Clears the paramErrorMessage.
 java.util.List<java.lang.String> getAvailableDTWSteps()
          Reports a list of available DTW steps in this implementation.
 java.util.List<java.lang.String> getAvailableOpenEndTypes()
          Returns the list of available DTW open-end alignment implementations.
 java.util.List<java.lang.String> getAvailableWindowTypes()
          Get the list of available implementations of DTW constraints.
 java.util.List<org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryChartDefinition> getChartDescriptions()
           
 TrajectoryChartDataModel getDataModel()
          Get the data model.
 java.lang.String getDTWStep()
          Get the set step function.
 java.lang.String getFeedback()
           
 java.lang.String getFormattedProject1EndDateString()
          Returns the string that represents endDate in standard formatted.
 java.lang.String getFormattedProject1StartDateString()
          Returns the string that represents startDate in standard formatted.
 java.lang.String getFormattedProject2EndDateString()
          Returns the string that represents endDate in standard formatted.
 java.lang.String getFormattedProject2StartDateString()
          Returns the string that represents startDate in standard formatted.
 java.lang.String getGranularity()
           
 java.util.List<java.lang.String> getGranularityList()
           
 java.lang.String getOpenEndType()
          Get the open-end alignment set for DTW analysis.
 org.apache.wicket.PageParameters getPageParameters()
          Returns a PageParameters instance that represents the content of the input form.
 java.lang.String getParamErrorMessage()
           
 java.util.List<org.hackystat.telemetry.service.resource.chart.jaxb.ParameterDefinition> getParameterList()
          Return the list of ParameterDefinition under telemetry type in this session.
 java.util.List<org.apache.wicket.model.IModel> getParameters()
           
 java.lang.String getParametersAsString()
          Returns the list of the parameters in a single String, separated by comma.
 org.hackystat.sensorbase.resource.projects.jaxb.Project getProject(java.lang.String projectName, java.lang.String projectOwner)
          Returns a Project instance that is available to current user and is matched to the given project name and project owner.
 java.util.Date getProject1EndDate()
           
 java.lang.Integer getProject1Indent()
          Get the project1 indent.
 java.util.Date getProject1StartDate()
           
 java.util.Date getProject2EndDate()
           
 java.lang.Integer getProject2Indent()
          Get the project2 indent.
 java.util.Date getProject2StartDate()
           
 java.util.List<ProjectRecord> getProjectList()
          Returns the list of Projects associated with this user.
 ProjectRecord getSelectedProject1()
          Set the project1.
 java.lang.String getSelectedProject1AsString()
          Returns the list of the selected projects in a single String, separated by comma.
 ProjectRecord getSelectedProject2()
          Set the project2.
 java.lang.String getSelectedProject2AsString()
          Returns the list of the selected projects in a single String, separated by comma.
 java.util.List<java.lang.String> getTelemetryList()
          Return the TelemetryList.
 java.lang.String getTelemetryName()
           
 java.util.Map<java.lang.String,org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryChartDefinition> getTelemetrys()
           
 java.lang.Integer getWindowSize()
          Get the window (band) size for constraint function.
 java.lang.String getWindowType()
          Get the set constraint function for the DTW analysis.
 boolean loadPageParameters(org.apache.wicket.PageParameters parameters)
          Load data from URL parameters into this session.
 void setDataModel(TrajectoryChartDataModel dataModel)
          Set the data model.
 void setDTWStep(java.lang.String step)
          Set particular DTW step to use in the analysis.
 void setFeedback(java.lang.String feedback)
           
 void setGranularity(java.lang.String granularity)
           
 void setOpenEndType(java.lang.String openEnd)
          Set the specific opend-end alignment implementation.
 void setProject1EndDate(java.util.Date endDate)
           
 void setProject1Indent(java.lang.Integer project1Indent)
          Set the project1 indent.
 void setProject1StartDate(java.util.Date startDate)
           
 void setProject2EndDate(java.util.Date endDate)
           
 void setProject2Indent(java.lang.Integer project2Indent)
          Set the project2 indent.
 void setProject2StartDate(java.util.Date startDate)
           
 void setSelectedProject1(ProjectRecord rec)
          Set the project1.
 void setSelectedProject2(ProjectRecord rec)
          Set the project2.
 void setTelemetryName(java.lang.String telemetryName)
           
 void setWindowSize(java.lang.Integer size)
          Set the window (band) size for the constraint function.
 void setWindowType(java.lang.String constraint)
          Set the specific constraint function.
 java.lang.String toString()
          
 void updateDataModel()
          Update the data model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SELECTED_PROJECT1_KEY

public static final java.lang.String SELECTED_PROJECT1_KEY
The parameter key of selectedProject1.

See Also:
Constant Field Values

START_DATE1_KEY

public static final java.lang.String START_DATE1_KEY
The parameter key of start date of project 1.

See Also:
Constant Field Values

END_DATE1_KEY

public static final java.lang.String END_DATE1_KEY
The parameter key of end dateof project 1.

See Also:
Constant Field Values

SELECTED_PROJECT2_KEY

public static final java.lang.String SELECTED_PROJECT2_KEY
The parameter key of selectedProject1.

See Also:
Constant Field Values

START_DATE2_KEY

public static final java.lang.String START_DATE2_KEY
The parameter key of start date of project 1.

See Also:
Constant Field Values

END_DATE2_KEY

public static final java.lang.String END_DATE2_KEY
The parameter key of end dateof project 1.

See Also:
Constant Field Values

TELEMETRY_KEY

public static final java.lang.String TELEMETRY_KEY
The parameter key of telemetry.

See Also:
Constant Field Values

GRANULARITY_KEY

public static final java.lang.String GRANULARITY_KEY
The parameter key of granularity.

See Also:
Constant Field Values

TELEMETRY_PARAMERTERS_KEY

public static final java.lang.String TELEMETRY_PARAMERTERS_KEY
The parameter key of telemetry parameters.

See Also:
Constant Field Values

PARAMETER_VALUE_SEPARATOR

public static final java.lang.String PARAMETER_VALUE_SEPARATOR
The separator for parameter values.

See Also:
Constant Field Values

PROJECT_NAME_OWNER_SEPARATR

public static final java.lang.String PROJECT_NAME_OWNER_SEPARATR
The separator between project name and its onwer.

See Also:
Constant Field Values
Constructor Detail

TrajectorySession

public TrajectorySession()
Constructor - create the session instance.

Method Detail

getProjectList

public java.util.List<ProjectRecord> getProjectList()
Returns the list of Projects associated with this user.

Returns:
The list of Projects.

getParameters

public java.util.List<org.apache.wicket.model.IModel> getParameters()
Returns:
the parameters

getParametersAsString

public java.lang.String getParametersAsString()
Returns the list of the parameters in a single String, separated by comma.

Returns:
a String.

setFeedback

public void setFeedback(java.lang.String feedback)
Parameters:
feedback - the feedback to set

getFeedback

public java.lang.String getFeedback()
Returns:
the feedback

setTelemetryName

public void setTelemetryName(java.lang.String telemetryName)
Parameters:
telemetryName - the telemetry to set

getTelemetryName

public java.lang.String getTelemetryName()
Returns:
the telemetry

getTelemetryList

public java.util.List<java.lang.String> getTelemetryList()
Return the TelemetryList. Returns empty list if no telemetry streams data collected.

Returns:
the telemetryList

getParameterList

public java.util.List<org.hackystat.telemetry.service.resource.chart.jaxb.ParameterDefinition> getParameterList()
Return the list of ParameterDefinition under telemetry type in this session.

Returns:
list of ParameterDefinition.

setProject1StartDate

public void setProject1StartDate(java.util.Date startDate)
Parameters:
startDate - the startDate to set

getProject1StartDate

public java.util.Date getProject1StartDate()
Returns:
the startDate

setProject1EndDate

public void setProject1EndDate(java.util.Date endDate)
Parameters:
endDate - the endDate to set

getProject1EndDate

public java.util.Date getProject1EndDate()
Returns:
the endDate

setProject2StartDate

public void setProject2StartDate(java.util.Date startDate)
Parameters:
startDate - the startDate to set

getProject2StartDate

public java.util.Date getProject2StartDate()
Returns:
the startDate

setProject2EndDate

public void setProject2EndDate(java.util.Date endDate)
Parameters:
endDate - the endDate to set

getProject2EndDate

public java.util.Date getProject2EndDate()
Returns:
the endDate

getFormattedProject1StartDateString

public java.lang.String getFormattedProject1StartDateString()
Returns the string that represents startDate in standard formatted. e.g. 2008-08-08T08:08:08+08:00, the +08:00 in the end means the time zone of this time stamp is +08:00

Returns:
a String

getFormattedProject1EndDateString

public java.lang.String getFormattedProject1EndDateString()
Returns the string that represents endDate in standard formatted. e.g. 2008-08-08T08:08:08+08:00, the +08:00 in the end means the time zone of this time stamp is +08:00

Returns:
a String

getFormattedProject2StartDateString

public java.lang.String getFormattedProject2StartDateString()
Returns the string that represents startDate in standard formatted. e.g. 2008-08-08T08:08:08+08:00, the +08:00 in the end means the time zone of this time stamp is +08:00

Returns:
a String

getFormattedProject2EndDateString

public java.lang.String getFormattedProject2EndDateString()
Returns the string that represents endDate in standard formatted. e.g. 2008-08-08T08:08:08+08:00, the +08:00 in the end means the time zone of this time stamp is +08:00

Returns:
a String

setProject1Indent

public void setProject1Indent(java.lang.Integer project1Indent)
Set the project1 indent.

Parameters:
project1Indent - The indent to set.

getProject1Indent

public java.lang.Integer getProject1Indent()
Get the project1 indent.

Returns:
The project1 indent.

setProject2Indent

public void setProject2Indent(java.lang.Integer project2Indent)
Set the project2 indent.

Parameters:
project2Indent - The indent to set.

getProject2Indent

public java.lang.Integer getProject2Indent()
Get the project2 indent.

Returns:
The project2 indent.

setGranularity

public void setGranularity(java.lang.String granularity)
Parameters:
granularity - the granularity to set

getGranularity

public java.lang.String getGranularity()
Returns:
the granularity

getGranularityList

public java.util.List<java.lang.String> getGranularityList()
Returns:
the granularityList

updateDataModel

public void updateDataModel()
Update the data model.


cancelDataUpdate

public void cancelDataUpdate()
Cancel data model's update.


setDataModel

public void setDataModel(TrajectoryChartDataModel dataModel)
Set the data model.

Parameters:
dataModel - the dataModel to set

getDataModel

public TrajectoryChartDataModel getDataModel()
Get the data model.

Returns:
the dataModel

setSelectedProject1

public void setSelectedProject1(ProjectRecord rec)
Set the project1.

Parameters:
rec - the selectedProjects to set

getSelectedProject1

public ProjectRecord getSelectedProject1()
Set the project1.

Returns:
the project1.

setSelectedProject2

public void setSelectedProject2(ProjectRecord rec)
Set the project2.

Parameters:
rec - the selectedProjects to set

getSelectedProject2

public ProjectRecord getSelectedProject2()
Set the project2.

Returns:
the project2.

getSelectedProject1AsString

public java.lang.String getSelectedProject1AsString()
Returns the list of the selected projects in a single String, separated by comma.

Returns:
a String.

getSelectedProject2AsString

public java.lang.String getSelectedProject2AsString()
Returns the list of the selected projects in a single String, separated by comma.

Returns:
a String.

getTelemetrys

public java.util.Map<java.lang.String,org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryChartDefinition> getTelemetrys()
Returns:
the telemetrys

getChartDescriptions

public java.util.List<org.hackystat.telemetry.service.resource.chart.jaxb.TelemetryChartDefinition> getChartDescriptions()
Returns:
the list of TelemetryChartDefinition.

getProject

public org.hackystat.sensorbase.resource.projects.jaxb.Project getProject(java.lang.String projectName,
                                                                          java.lang.String projectOwner)
Returns a Project instance that is available to current user and is matched to the given project name and project owner.

Parameters:
projectName - the given project name.
projectOwner - the given project owner.
Returns:
the Project instance. null if no matching project is found, which may means either the project name or project owner is null or there is no Project for this user with the same project name and owner as the given ones.

getAvailableDTWSteps

public java.util.List<java.lang.String> getAvailableDTWSteps()
Reports a list of available DTW steps in this implementation.

Returns:
the list of steps to use in the display menu.

setDTWStep

public void setDTWStep(java.lang.String step)
Set particular DTW step to use in the analysis.

Parameters:
step - the step to set.

getDTWStep

public java.lang.String getDTWStep()
Get the set step function.

Returns:
the step function set for analysis.

getAvailableWindowTypes

public java.util.List<java.lang.String> getAvailableWindowTypes()
Get the list of available implementations of DTW constraints.

Returns:
the list of available DTW constraints functions to use in the form menu.

setWindowType

public void setWindowType(java.lang.String constraint)
Set the specific constraint function.

Parameters:
constraint - the constraint function to set.

getWindowType

public java.lang.String getWindowType()
Get the set constraint function for the DTW analysis.

Returns:
the set function.

setWindowSize

public void setWindowSize(java.lang.Integer size)
Set the window (band) size for the constraint function.

Parameters:
size - the window (band) size.

getWindowSize

public java.lang.Integer getWindowSize()
Get the window (band) size for constraint function.

Returns:
the window size.

getAvailableOpenEndTypes

public java.util.List<java.lang.String> getAvailableOpenEndTypes()
Returns the list of available DTW open-end alignment implementations.

Returns:
the list of available alignment implementations to use in the form menu.

setOpenEndType

public void setOpenEndType(java.lang.String openEnd)
Set the specific opend-end alignment implementation.

Parameters:
openEnd - the open-end alignment implementation.

getOpenEndType

public java.lang.String getOpenEndType()
Get the open-end alignment set for DTW analysis.

Returns:
the open-end alignment implementation.

loadPageParameters

public boolean loadPageParameters(org.apache.wicket.PageParameters parameters)
Load data from URL parameters into this session.

Parameters:
parameters - the URL parameters
Returns:
true if all parameters are loaded correctly

getPageParameters

public org.apache.wicket.PageParameters getPageParameters()
Returns a PageParameters instance that represents the content of the input form.

Returns:
a PageParameters instance.

getParamErrorMessage

public java.lang.String getParamErrorMessage()
Returns:
the paramErrorMessage

clearParamErrorMessage

public void clearParamErrorMessage()
Clears the paramErrorMessage.


toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object