getDataFromSensor
@Transactional
public SensorDataEntity getDataFromSensor(java.lang.String sensorIp)
throws com.fasterxml.jackson.core.JsonProcessingException
For the input sensorEntity, get current data from the sensor, map the data
to a SensorDataEntity
object. If a data cannot be acquired, store
Integer.MAX_VALUE for it.
This is just a dummy implementation, generate random data for each sensor IP.
Each type of data has a probability of 0.2 to be Integer.MAX_VALUE.
- Specified by:
getDataFromSensor
in class AbstractAccessSensorService
- Parameters:
sensorIp
- The IPv6 address of the sensor you want to fetch from.
- Returns:
- A
SensorDataEntity
object contains the data.
- Throws:
java.lang.NullPointerException
- If the input sensor IP does not exist in the database.
java.lang.RuntimeException
- if dataTypeList.size() == 0
.
com.fasterxml.jackson.core.JsonProcessingException