List of usage examples for com.amazonaws.services.dynamodbv2.document QueryFilter QueryFilter
public QueryFilter(String attr)
From source file:com.envirover.spl.stream.MAVLinkMessagesTable.java
License:Open Source License
@Override public Iterable<MAVLinkRecord> query(String deviceId, Date startTime, Date endTime, Integer msgId) throws IOException { RangeKeyCondition timeInterval;//from w w w .j a v a 2 s .co m if (startTime == null && endTime == null) { timeInterval = null; } else if (startTime == null && endTime != null) { timeInterval = new RangeKeyCondition(ATTR_TIME).le(endTime.getTime()); } else if (startTime != null && endTime == null) { timeInterval = new RangeKeyCondition(ATTR_TIME).ge(startTime.getTime()); } else { timeInterval = new RangeKeyCondition(ATTR_TIME).between(startTime.getTime(), endTime.getTime()); } QueryFilter filter = new QueryFilter(ATTR_MSG_ID).eq(msgId); return new MAVLinkRecordIterable(table.query(ATTR_DEVICE_ID, deviceId, timeInterval, filter).iterator()); }