use of org.openforis.collect.reporting.ReportingRepositoryInfo in project collect by openforis.
the class SaikuController method getInfo.
@RequestMapping(value = "datasources/{surveyName}/info", method = GET)
@ResponseBody
public Response getInfo(@PathVariable String surveyName) {
ReportingRepositoryInfo info = reportingRepositories.getInfo(surveyName);
Response response = new Response();
response.setObject(info);
return response;
}
use of org.openforis.collect.reporting.ReportingRepositoryInfo in project collect by openforis.
the class RDBReportingRepositories method getInfo.
@Override
public ReportingRepositoryInfo getInfo(String surveyName) {
Date rdbFileDate = localRDBStorageManager.getRDBFileDate(surveyName, RecordStep.ENTRY);
if (rdbFileDate == null) {
return null;
} else {
ReportingRepositoryInfo info = new ReportingRepositoryInfo();
info.setLastUpdate(rdbFileDate);
RecordFilter filter = new RecordFilter(surveyManager.get(surveyName));
filter.setModifiedSince(rdbFileDate);
info.setUpdatedRecordsSinceLastUpdate(recordManager.countRecords(filter));
return info;
}
}
Aggregations