// Handle a call to the query 'command'
protected boolean handleQuery(String gatewayID, String logID, String filter, ServletOutputStream output) throws IOException {
if ((gatewayID != null) && (logID != null)) {
// gateway and log id are specified, return only the range that matches these id's
LogDescriptor range = m_store.getDescriptor(gatewayID, Long.parseLong(logID));
output.print(range.toRepresentation());
return true;
}
else if ((gatewayID == null) && (logID == null)) {
// no gateway or log id has been specified, return all ranges
List<LogDescriptor> ranges = m_store.getDescriptors();
for (LogDescriptor range : ranges) {
output.print(range.toRepresentation() + "\n");
}
return true;
}
return false;
}