// Handle a call to the query 'command'
protected boolean handleQuery(String targetID, String logID, String filter, ServletOutputStream output) throws IOException {
if ((targetID != null) && (logID != null)) {
// target and log id are specified, return only the range that matches these id's
LogDescriptor range = m_store.getDescriptor(targetID, Long.parseLong(logID));
output.print(range.toRepresentation());
return true;
}
else if ((targetID == null) && (logID == null)) {
// no target 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;
}