@Component
public class SensorsRest
extends java.lang.Object
Constructor and Description |
---|
SensorsRest() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getSensors(java.lang.String keyAsString)
This Restful Web Service takes one parameter keyAsString
This is used to get all the sensors from the sensors tables for the particular study
RestFul End Point URI: http://host:port/ResearcherService/rest/Sensors/getSensors
REQUEST TYPE: GET
|
java.lang.String |
insertSensorsData(java.lang.String keyAsString,
java.sql.Timestamp timeOfPhone,
java.lang.String phoneTimeZone,
SensorsDataList sensorsData)
This Restful Web Service takes three query parameters keyAsString,timeOfPhone,phoneTimeZone and one body object sensorsDataList
This is used to insert all the sensors data into the corresponding sensors tables for the particular study
RestFul End Point URI: http://host:port/ResearcherService/rest/Sensors/insertSensorsData
REQUEST TYPE: GET
|
public java.lang.String getSensors(java.lang.String keyAsString)
This Restful Web Service takes one parameter keyAsString This is used to get all the sensors from the sensors tables for the particular study RestFul End Point URI: http://host:port/ResearcherService/rest/Sensors/getSensors REQUEST TYPE: GET
keyAsString
- - phone session keyIf session key is invalid, returns json object with fields("code":404,"message":"error") If study is completed, returns json object with fields("code":600,"message":"study is completed") If consent not agreed, returns json object with fields("code":600,"message":"consent not agreed") If study not exists, returns json object with fields ("code":700,message":"study not exists") If session key is valid returns json object with list of sensors ("jsonResult":,"code":200,"message":"ok") If any exception occurs then returns json object with fields (code=500,message="error")
public java.lang.String insertSensorsData(java.lang.String keyAsString, java.sql.Timestamp timeOfPhone, java.lang.String phoneTimeZone, SensorsDataList sensorsData)
This Restful Web Service takes three query parameters keyAsString,timeOfPhone,phoneTimeZone and one body object sensorsDataList This is used to insert all the sensors data into the corresponding sensors tables for the particular study RestFul End Point URI: http://host:port/ResearcherService/rest/Sensors/insertSensorsData REQUEST TYPE: GET
keyAsString
- - phone session keytimeOfPhone
- - time of phone sensors data pushphoneTimeZone
- - time zone of phonesensorsDataList
- (ListIf session key is invalid, returns json object with fields("code":404,"message":"error") If study is completed, returns json object with fields("code":600,"message":"study is completed") If consent not agreed, returns json object with fields("code":600,"message":"consent not agreed") If study not exists, returns json object with fields ("code":700,message":"study not exists") If session key is valid -If data inserted successfully then returns json object with fields ("jsonResult":HashMap>,"code":200,"message":"ok") -If sensor id already exists in sensor table, then returns json object with fields ("jsonResult":HashMap >,"code":200,"message":"ok") -If sensor not exits, then returns json object with fields ("jsonResult":HashMap >,"code":200,"message":"ok") -else returns json object with fields ("code":500,"message":"error")