@Repository
public class SensorDataRepository
extends java.lang.Object
SensorDataEntity
Modifier and Type | Field | Description |
---|---|---|
private static org.apache.log4j.Logger |
logger |
|
private org.hibernate.SessionFactory |
sessionFactory |
Constructor | Description |
---|---|
SensorDataRepository() |
Modifier and Type | Method | Description |
---|---|---|
int |
clear() |
Delete all entries in sensorData table.
|
java.util.List<SensorDataEntity> |
getAll() |
Fetch all entries in sensorData table.
|
java.util.List<SensorDataEntity> |
getAll(java.lang.String sensorIp) |
Fetch all entries of sensor data for the input sensor IP.
|
java.util.List<SensorDataEntity> |
getAllLaterThan(java.lang.String sensorIp,
java.util.Date timeStamp) |
Get all entries of sensor data that were created later than the input timeStamp
for the input sensor IP.
|
java.util.List<SensorDataEntity> |
getAllLaterThan(java.util.Date timeStamp) |
Get all entries of sensor data that were created later than the input timeStamp.
|
java.lang.String |
save(SensorDataEntity sensorDataEntity) |
Save the input sensor data entity in database.
|
long |
size() |
Get the total number of sensor data entries in database.
|
@Autowired private org.hibernate.SessionFactory sessionFactory
private static final org.apache.log4j.Logger logger
public long size()
public java.lang.String save(SensorDataEntity sensorDataEntity)
NullPointerException
when the input
sensorDataEntity
is null;sensorDataEntity
- An instance of SensorDataEntity
of the
sensor data you want to save.public int clear()
public java.util.List<SensorDataEntity> getAll()
SensorDataEntity
.public java.util.List<SensorDataEntity> getAll(java.lang.String sensorIp)
sensorIp
doesn't exist in the
database or there is no data entry for the input sensor IP.sensorIp
- The IPv6 address of the sensor from which the data you want
to fetch generated.SensorDataEntity
.public java.util.List<SensorDataEntity> getAllLaterThan(java.util.Date timeStamp)
NullPointerException
if the input timeStamp
is null;timeStamp
- The time stamp you want to querySensorDataEntity
public java.util.List<SensorDataEntity> getAllLaterThan(java.lang.String sensorIp, java.util.Date timeStamp)
sensorIp
doesn't exist.
Throws NullPointerException
if the input timeStamp
is null;timeStamp
- The time stamp you want to query.SensorDataEntity