Skip navigation

Feeder and Provider module

Controller Servlet

Controller servlet allows to login to SensLog and to send further requests.

Field Details
URL /ControllerServlet
Method POST
Functionality Request provides users to login to the SensLog
Format KVP text/plain

Important notes:

  • Header: Content-Type: application/x-www-form-urlencoded
  • Example of payload: username=test&password=demo
  • Example of correct response: {"sessionid":"rv6pe5o30091","language":"en","audio":"false"}
  • Example of HTTP Header Cookie to be added to any further requests: Cookie: JSESSIONID=rv6pe5o30091; sessionid=rv6pe5o30091; language=en; audio=false

Feeder Servlet

Feeder Servlet allows to insert observations, units positions and alerts.

Field Details
URL /FeederServlet?Operation=<operationName>
Method GET
Functionality Provides insertion of main collected objects
Format URL encoded text/plain

InsertObservation

Field Details
URL /FeederServlet?Operation=InsertObservation
Method GET
Functionality Provides inserting of new observation for combination of sensor and unit into database. Return true if observation was successfully inserted, false in all other cases.
Format URL encoded text/plain
Parameter Format Role
value Double precision Measured value (mandatory)
date Time stamp (ISO 8601) Timestamp of measured value (e.g. 2015-07-15 12:00:00+0200) (mandatory)
unit_id Numerical value Identifier of unit (mandatory)
sensor_id Numerical value Identifier of sensor (mandatory)

InsertPosition

Field Details
URL /FeederServlet?Operation=InsertPosition
Method GET
Functionality Provides inserting of new unit position in the database, position can be inserted only as WGS-84 coordinates. Return true if position was inserted successfully, false in all other cases.
Format URL encoded text/plain
Formát dat URL encoded text/plain
Parameter Format Role
lat Double precision Latitude (mandatory)
lon Double precision Longitude (mandatory)
alt Double precision Altitude in meters (optional)
speed Double precision Speed of the unit (optional)
unit_id Numerical value Identifier of unit (mandatory)
date Timestamp (ISO 8601) Timestamp of measured value (e.g. 2015-07-15 12:00:00+0200) (mandatory)
dop Numerical value Dilution of precision (optional)

InsertAlertEvent

Field Details
URL /FeederServlet?Operation=InsertAlertEvent
Method GET
Functionality Provides inserting of new alert event that was detected in the sensor network into database. Return true if event was successfully inserted, false in all other cases.
Format URL encoded text/plain
Parameter Format Role
alert_id Numerical value Identifier of alert (mandatory)
unit_id Numerical value Identifier of unit (mandatory)
date Timestamp (ISO 8601) Timestamp of measured value (e.g. 2015-07-15 12:00:00+0200) (mandatory)

Data Service

Data Service provides information about units and positions of units

Field Details
URL /DataService?Operation=<operationName>
Method GET
Functionality Provides detailed information about sensor units
Format JSON

GetUnits

Field Details
URL /DataService?Operation=<operationName>
Method GET
Functionality Provides detailed information about sensor units
Format JSON

GetUnits

Field Details
URL /DataService?Operation=GetUnits
Method GET
Functionality Provides detailed information about each units connected to login user. Response contains connected sensors, first and last time stamp of entered observation, last positions of units.
Format JSON

GetUnitsList

Field Details
URL /DataService?Operation=GetUnitsList
Method GET
Functionality Provides basic information about each units connected to login user. Response contains identifier of each unit and its description.
Format JSON

GetPositions

Field Details
URL /DataService?Operation=GetPositions
Method GET
Functionality Request provides users specified number of last positions of all units in current group.
Format JSON
Parameter Format Role
user Text Identifier of user group
limit Numeric value Number of positions to receive

GetPositionsDay

URL Method Functionality Format
/DataService?Operation=GetPositionsDay GET Request provides list of positions of specified unit during given time range. Positions can be ordered by timestamp ascending or descending. This method is variable to GetTracks, but providing raw positions as Points rather than tracks as Polylines. JSON
Parameter Format Role
user Text Identifier of user group. (mandatory)
unit_id Numeric value Identifier of unit. (mandatory)
fromTime Date (ISO 8601) Beginning date of the time range. (optional)
toTime Date (ISO 8601) End date of the time range. (optional)
ordering Text Identifier of ordering way. Only values "ascending" and "descending" are allowed. (optional)

GetLastPositions

URL Method Functionality Format
/DataService?Operation=GetLastPositions GET Request provides user last positions of all units in user group. JSON

GetLastPositionsWithStatus

Field Details
URL /DataService?Operation=GetLastPositionsWithStatus
Method GET
Functionality Request provides user information about alert events and other attributes in addition to previous GetLastPositions request.
Format JSON

GetTracks

Field Details
URL /DataService?Operation=GetTracks
Method GET
Functionality Request returns entered number of trajectory geometries of all moving units in user group.
Format URL encoded text/plain
Parameter Format Role
limit Numerical value Number of tracks to receive

GetRecentTracks

Field Details
URL /DataService?Operation=GetRecentTracks
Method GET
Functionality Request returns trajectory geometries of all moving units in user group.
Format URL encoded text/plain

SensorService

Field Details
URL /SensorService?Operation=<operationName>
Method GET
Functionality Provides detailed information about sensors and provides methods to get sensor data.
Format JSON

Operation: GetSensors

Field Details
URL /SensorService?Operation=GetSensors
Method GET
Functionality Request returns list of sensors connected to entered unit.
Format JSON
Parameter Format Role
unit_id Numerical value Identifier of unit (mandatory)

Operation: GetObservations

Field Details
URL /SensorService?Operation=GetObservations
Method GET
Functionality Request provides access to measured or processed observations for entered unit-sensor pair and entered time range. If user doesn't enter time range, servlet returns all available observations for entered unit-sensor pair. Another optional parameter is trunc that executes average of values for entered epoch (hour, day, week,...).
Format JSON
Parameter Format Role
unit_id Numerical value Identifier of unit (mandatory)
sensor_id Numerical value Identifier of sensor (mandatory)
from Timestamp (ISO 8601) Time stamp of beginning time range (optional)
to Timestamp (ISO 8601) Time stamp of end time range (optional)
trunc Text Average epoch (optional)

Operation: GetLastObservations

Field Details
URL /SensorService?Operation=GetLastObservations
Method GET
Functionality Provides last observations of specified unit or group of units. Returns JSON with observations.
Format JSON
Parameter Format Role
group Textual value Name of group of units (optional), alone or with sensor_id
unit_id Numerical value Identifier of unit (optional), alone or with sensor_id
sensor_id Numerical value Identifier of sensor (optional)

Allowed combinations

  • &group=
  • &group=&sensor_id=
  • &unit_id=
  • &unit_id=&sensor_id=

AlertService

AlertService provides information about alerts events that arrived in sensor network. Methods allow user to get description of potential alerts connected to specific unit and list of arrived alert events including solving state.

Field Details
URL /AlertService?Operation=<operationName>
Method GET
Functionality Provides information about alerts events that arrived in sensor network.
Format JSON

Operation: GetAlerts

Field Details
URL /AlertService?Operation=GetAlerts
Method GET
Functionality Request provides list of potential alerts for entered unit.
Format JSON
Parameter Format Role
unit_id Numerical value Identifier of unit (mandatory)

Operation: GetAlertEventsByTime

Field Details
URL /AlertService?Operation=GetAlertEventsByTime
Method GET
Functionality Request provides list of arrived alert events for specified unit and specified time range.
Format JSON
Parameter Format Role
unit_id Numerical value Identifier of unit (mandatory)
from Timestamp (ISO 8601) Time stamp of beginning time range (optional)
to Timestamp (ISO 8601) Time stamp of end time range (optional)

ManagementService

ManagementService allows user to register unit with sensors. This service is especially suitable for scenario "collecting data by smartphones", it enables register new smartphone before starting of collecting data.

Field Details
URL /ManagementService?Operation=<operationName>
Method POST
Functionality Provides registration of new components of sensor network
Format JSON

Operation: InsertUnit

Field Details
URL /ManagementService?Operation=InsertUnit
Method POST
Functionality Provides insertion of new unit with sensors into database. Returns JSON description of the unit with IDs of unit, sensors and phenomenons.
Format JSON

Example of InsertUnit payload

{

"unit": {

"description": "test insert unit"

},

"sensors": [

{

"sensor_name": "test sensor1",

"sensor_type": "testing sensor",

"phenomenon": {

"phenomenon_name": "testing phenomenon 1",

"uom": "rounds"

}

},

{

"sensor_name": "test sensor 2",

"sensor_type": "testing sensor",

"phenomenon": {

"phenomenon_name": "testing phenomenon 2",

"uom": "points"

}

}

]

}