Skip navigation

Feeder and Provider module

Controller Servlet

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

Parametr Specifikace
URL /ControllerServlet
Metoda POST
Funkcionalita Přihlášení uživatele do systému SensLog
Formát dat KVP (text/plain / x-www-form-urlencoded)
Povinný Header Content-Type: application/x-www-form-urlencoded

Feeder Servlet

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

Parametr Specifikace
URL /FeederServlet?Operation=<operationName>
Metoda GET
Funkcionalita Zajišťuje vkládání hlavních sbíraných objektů
Formát dat URL encoded text/plain

InsertObservation

Parametr Specifikace
URL /FeederServlet?Operation=InsertObservation
Metoda GET
Funkcionalita Vloží nové měření pro kombinaci senzoru a jednotky do databáze.
Návratová hodnota true (úspěch) / false (v ostatních případech)
Formát dat URL encoded text/plain
Parametr Formát Význam
value Double precision Naměřená hodnota (např. 23.5).
date ISO 8601 Časové razítko (např. 2015-07-15 12:00:00+0200).
unit_id Numerické ID Identifikátor jednotky.
sensor_id Numerické ID Identifikátor senzoru.

InsertPosition

Parametr Specifikace
URL /FeederServlet?Operation=InsertPosition
Metoda GET
Funkcionalita Vloží novou polohu jednotky do databáze (souřadnice WGS-84).
Návratová hodnota true (úspěch) / false (chyba)
Formát dat URL encoded text/plain
Parametr Formát Povinnost Význam
lat Double Ano Zeměpisná šířka (Latitude).
lon Double Ano Zeměpisná délka (Longitude).
unit_id Numerické ID Ano Identifikátor jednotky.
date ISO 8601 Ano Časové razítko (např. 2015-07-15 12:00:00+0200).
alt Double Ne Nadmořská výška v metrech.
speed Double Ne Rychlost jednotky.
dop Numerické Ne Přesnost polohy (Dilution of Precision).

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

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/DataService?Operation=GetLastPositionsWithStatus</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Request provides user information about alert events and other attributes in addition to previous GetLastPositions request.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

GetTracks

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/DataService?Operation=GetTracks</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Request returns entered number of trajectory geometries of all moving units in user group.</td>

<td>URL encoded text/plain</td>

</tr>

</tbody>

</table>

<table>

<tbody>

<tr>

<th>Parameter</th>

<th>Format</th>

<th>Role</th>

</tr>

<tr>

<td>limit</td>

<td>Numerical value</td>

<td>Number of tracks to receive</td>

</tr>

</tbody>

</table>

GetRecentTracks

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/DataService?Operation=GetRecentTracks</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Request returns trajectory geometries of all moving units in user group.</td>

<td>URL encoded text/plain</td>

</tr>

</tbody>

</table>

Sensor Service

SensorService provides information about sensors and enables to get measured or processed data.

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/SensorService?Operation=&lt;var&gt;operationName&lt;/var&gt;</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Provides detailed information about sensors and provides methods to get sensor data.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

GetSensors

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/SensorService?Operation=GetSensors</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Request returns list of sensors connected to entered unit.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

<table>

<tbody>

<tr>

<th>Parameter</th>

<th>Format</th>

<th>Role</th>

</tr>

<tr>

<td>unit_id</td>

<td>Numerical value</td>

<td>Identifier of unit (mandatory)</td>

</tr>

</tbody>

</table>

GetObservations

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/SensorService?Operation=GetObservations</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>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,...).</td>

<td>JSON</td>

</tr>

</tbody>

</table>

<table>

<tbody>

<tr>

<th>Parameter</th>

<th>Format</th>

<th>Role</th>

</tr>

<tr>

<td>unit_id</td>

<td>Numerical value</td>

<td>Identifier of unit (mandatory)</td>

</tr>

<tr>

<td>sensor_id</td>

<td>Numerical value</td>

<td>Identifier of sensor (mandatory)</td>

</tr>

<tr>

<td>from</td>

<td>Timestamp (ISO 8601)</td>

<td>Time stamp of beginning time range (optional)</td>

</tr>

<tr>

<td>to</td>

<td>Timestamp (ISO 8601)</td>

<td>Time stamp of end time range (optional)</td>

</tr>

<tr>

<td>trunc</td>

<td>Text</td>

<td>Average epoch (optional)</td>

</tr>

</tbody>

</table>

GetLastObservations

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/SensorService?Operation=GetLastObservations</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Provides last observations of specified unit or group of units. Returns JSON with observations.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

<table>

<tbody>

<tr>

<th>Parameter</th>

<th>Format</th>

<th>Role</th>

</tr>

<tr>

<td>group</td>

<td>Textual value</td>

<td>Name of group of units (optional), alone or with sensor_id</td>

</tr>

<tr>

<td>unit_id</td>

<td>Numerical value</td>

<td>Identifier of unit (optional), alone or with sensor_id</td>

</tr>

<tr>

<td>sensor_id</td>

<td>Numerical value</td>

<td>Identifier of sensor (optional)</td>

</tr>

</tbody>

</table>

GetLastObservations - 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.

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/AlertService?Operation=&lt;var&gt;operationName&lt;/var&gt;</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Provides information about alerts events that arrived in sensor network.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

GetAlerts

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/AlertService?Operation=GetAlerts</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Request provides list of potential alerts for entered unit.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

<table>

<tbody>

<tr>

<th>Parameter</th>

<th>Format</th>

<th>Role</th>

</tr>

<tr>

<td>unit_id</td>

<td>Numerical value</td>

<td>Identifier of unit (mandatory)</td>

</tr>

</tbody>

</table>

GetAlertEventsByTime

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/AlertService?Operation=GetAlertEventsByTime</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>GET</td>

<td>Request provides list of arrived alert events for specified unit and specified time range.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

<table>

<tbody>

<tr>

<th>Parameter</th>

<th>Format</th>

<th>Role</th>

</tr>

<tr>

<td>unit_id</td>

<td>Numerical value</td>

<td>Identifier of unit (mandatory)</td>

</tr>

<tr>

<td>from</td>

<td>Timestamp (ISO 8601)</td>

<td>Time stamp of beginning time range (optional)</td>

</tr>

<tr>

<td>to</td>

<td>Timestamp (ISO 8601)</td>

<td>Time stamp of end time range (optional)</td>

</tr>

</tbody>

</table>

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.

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/ManagementService?Operation=&lt;var&gt;operationName&lt;/var&gt;</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>POST</td>

<td>Provides registration of new components of sensor network</td>

<td>JSON</td>

</tr>

</tbody>

</table>

InsertUnit

<table>

<tbody>

<tr>

<th colspan="3">URL</th>

</tr>

<tr>

<td colspan="3">/ManagementService?Operation=InsertUnit</td>

</tr>

<tr>

<th>Method</th>

<th>Functionality</th>

<th>Format</th>

</tr>

<tr>

<td>POST</td>

<td>Provides insertion of new unit with sensors into database. Returns JSON description of the unit with IDs of unit, sensors and phenomenons.</td>

<td>JSON</td>

</tr>

</tbody>

</table>

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"

}

}

]

}