|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectmmServerCommunication.MMServerComm
public class MMServerComm
Nested Class Summary | |
---|---|
static class |
MMServerComm.ClientType
|
class |
MMServerComm.MMGetProjectListCallback
|
Field Summary | |
---|---|
java.lang.String |
paramListName
|
int |
pollRate
|
java.lang.String |
time
|
java.lang.Long |
timeInt
|
long |
timeOffsetLocalSendTime
|
Constructor Summary | |
---|---|
MMServerComm(MMAbstractRestAPI restAPI_,
MMRestApiUtilAbstract apiUtil,
MMStatsAbstract statsParser,
MMServerComm.ClientType ct,
MMClient c)
|
Method Summary | |
---|---|
void |
addData(java.lang.String userId,
int parameterId,
int paramType,
java.util.HashMap<java.lang.String,java.lang.Object> data)
Post/set a bunch of parameters to the server. |
void |
addParameter(java.lang.String paramName,
int paramType)
Add a new parameter in the current project, with an auto-generated unique parameter ID. |
void |
askForServerTimeOffset()
|
MMClient |
getClient()
|
void |
getCurrentParamListName()
Get the last ParamList table name on server and reuse it |
void |
getMostRecentTime()
This method gets the time of the most recent data in the ParamList, and sets the time variable Call this method once before polling with the getParameters method. |
MMParam |
getParameterConfig(int paramId)
For convenience of getting the current project's parameters/configurations with specified id. |
void |
getParameters(int paramId,
java.lang.Long time)
Returns a list of parameter objects records with time after the specific time. |
java.util.List<MMParam> |
getParamsOfCurrentProject()
For convenience of getting the current project's parameters/configurations. |
MMProject |
getProject()
Get the current project. |
int |
getProjectId()
Get the ID of the current project. |
java.lang.String |
getProjectInfo()
|
void |
getProjectList(MMServerComm.MMGetProjectListCallback callback)
Return a list of projects/configurations in the Parse account. |
double |
getServerTimeOffset()
|
void |
getStats(int paramId,
int paramType,
int window)
Calls cloud code function to obtain statistics for the given paramId and paramType This function makes a SYNCHRONOUS request so that the next poll will only happen after the previous poll has returned. |
void |
newProject(java.lang.String projectName)
Create a new project on the server. |
void |
pollRaw(int paramId,
int pollSwitch,
int window)
Retrieve the raw data for a particular parameter, in a period of history time |
void |
pollStats(int paramId,
int pollSwitch,
int window)
Call the server function to obtain statistics for the given paramId and paramType |
void |
removeParameter(int paramId)
Remove a specified parameter from the current project. |
void |
setClient(MMClient c)
Set the client instance reference of the communication. |
void |
setCurrentProject(int projectId,
boolean notifyClientWhenDone)
User enters the project/event, and load the project's properties. |
void |
setParameter(java.lang.String userId,
int parameterId,
int paramType,
java.util.HashMap<java.lang.String,java.lang.Object> data)
Post/set a new parameter setting to the server. |
void |
setPollParams(int paramId,
int paramType,
java.lang.String dataType)
Sets the proper parameters to poll for the correct data |
void |
setPollRate(int pollRate)
Set the polling rate of the polling timer thread. |
void |
setProjectInfo(java.lang.String info)
Set the information text (introduction) of the current active project |
void |
startAskingTimeOffset()
Start a backgroud Timer to periodically get the server time, in purpose of sync the time between client and server. |
void |
startNewParamList()
Create a new ParamList table in the server dedicated to the current performance session |
void |
startPolling()
Start the polling process. |
void |
stopPolling()
Stop the polling process. |
void |
updateProject()
Commit all local project configuration changes/modifications to the server. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String paramListName
public java.lang.String time
public java.lang.Long timeInt
public int pollRate
public long timeOffsetLocalSendTime
Constructor Detail |
---|
public MMServerComm(MMAbstractRestAPI restAPI_, MMRestApiUtilAbstract apiUtil, MMStatsAbstract statsParser, MMServerComm.ClientType ct, MMClient c)
Method Detail |
---|
public void getProjectList(MMServerComm.MMGetProjectListCallback callback)
public void setParameter(java.lang.String userId, int parameterId, int paramType, java.util.HashMap<java.lang.String,java.lang.Object> data)
newParam
- A parameter of identical properties with one of the parameters in the project,
except for some changes in valuespublic void addData(java.lang.String userId, int parameterId, int paramType, java.util.HashMap<java.lang.String,java.lang.Object> data)
userId
- paramId
- paramType
- h
- public void setPollParams(int paramId, int paramType, java.lang.String dataType)
currentParamId
- currentParamType
- dataToGet
- public void setPollRate(int pollRate)
pollRate
- public void pollStats(int paramId, int pollSwitch, int window)
paramId
- pollSwitch
- turn on/off the pollingwindow
- how long time to look back to, in secondspublic void pollRaw(int paramId, int pollSwitch, int window)
paramId
- pollSwitch
- turn on/off the pollingwindow
- how long time to look back to, in secondspublic void startPolling()
public void stopPolling()
public void newProject(java.lang.String projectName)
projectName
- The name of the project
MMException
public void setProjectInfo(java.lang.String info)
info
- public void setCurrentProject(int projectId, boolean notifyClientWhenDone)
public java.lang.String getProjectInfo()
public java.util.List<MMParam> getParamsOfCurrentProject()
public MMParam getParameterConfig(int paramId)
public MMProject getProject()
public void getMostRecentTime()
public void startAskingTimeOffset()
public void askForServerTimeOffset()
public double getServerTimeOffset()
public int getProjectId()
public void getParameters(int paramId, java.lang.Long time)
paramId
- The index of the parameter.time
- The time from which to retrieve results, in ISO format.public void getStats(int paramId, int paramType, int window)
paramId
- paramType
- window
- (in seconds)public void addParameter(java.lang.String paramName, int paramType)
paramName
- The parameter name of the new parameterparamType
- The parameter type of the new parameterpublic void removeParameter(int paramId)
paramId
- The parameter ID of the parameter to be removedpublic void updateProject()
public void getCurrentParamListName()
public void startNewParamList()
public void setClient(MMClient c)
c
- The client instance to be referenced in the communicationpublic MMClient getClient()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |