@Component
public class PhoneHeartBeatCheckRest
extends java.lang.Object
| Constructor and Description |
|---|
PhoneHeartBeatCheckRest() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
POSTHeartBeatResponse(java.lang.String keyAsString,
java.sql.Timestamp timeOfPhone,
java.lang.String phoneTimeZone,
CouponHeartBeatDetails couponHeartBeatDetails)
This Restful Web Service takes three query parameters - keyAsString,timeOfPhone,phoneTimeZone and one body object
*) CouponHeartBeatDetails body object contains
i)answerCountOfUnsentAnswers - int
ii)answerCountOfSkippedAnswers - int
iii)noOfUploadAttempts - int
iv)noOfUploadAlarmTriggered - int
v)phoneStatus - String
vi)HashMap
|
public java.lang.String POSTHeartBeatResponse(java.lang.String keyAsString,
java.sql.Timestamp timeOfPhone,
java.lang.String phoneTimeZone,
CouponHeartBeatDetails couponHeartBeatDetails)
This Restful Web Service takes three query parameters - keyAsString,timeOfPhone,phoneTimeZone and one body object
*) CouponHeartBeatDetails body object contains
i)answerCountOfUnsentAnswers - int
ii)answerCountOfSkippedAnswers - int
iii)noOfUploadAttempts - int
iv)noOfUploadAlarmTriggered - int
v)phoneStatus - String
vi)HashMap where ServiceHeartBeatDeatils object contains (String heartBeatTime,int heartBeatCount,String appStartTime, int lastHeartBeatCount)
This endpoint is used by the phone to post the heart beat data
RestFul End Point URI: http://host:port/PhoneAppService/rest/phoneHeartBeatCheckRest/POSTHeartBeatResponse
REQUEST TYPE: POST
keyAsString - - sessionkey sent to phone by server when the user registered to studytimeOfPhone - - time of phonephoneTimeZone - - time zone of phoneCouponHeartBeatDetails - - body object
i) If keyAsString is invalid, then returns json object with fields (404,"error")
ii) If consent is not agreed, then returns json object with fields (600,"consent not agreed")
iii)If study is completed, then returns json object with fields (600,"study is completed")
iv)If study not exists, then returns json object with fields (700,"study not exists")
v)If heart beat data successfully stored to coupon table, then returns json object with fields (200,"ok")
vi) If any exception occurs or if the consent is withdrawn then returns json object with fields (code=500, message="error")
vii)If the given service is not available in the study, then returns json object with fields (code=500,message: "UnexpectedServices : List Of unExpectedServices")