public String getSynchronizationStatistics() {
RequestContext context = onPrepareViewStarted();
try {
HrRecord record = getEditor().getRepository();
if (record.getRecentJobStatus() == RecentJobStatus.Running) {
Statistics stats = context.getApplicationContext().getHarvestingEngine().getStatistics(record.getUuid());
if (stats != null) {
String[] params = new String[]{
Long.toString(stats.getHarvestedCount()),
Long.toString(stats.getValidatedCount()),
Long.toString(stats.getPublishedCount()),
new TimePeriod(stats.getDuration()).toLocalizedString(extractMessageBroker()),
Double.toString(stats.getPerformance())
};
return extractMessageBroker().retrieveMessage("catalog.harvest.manage.edit.syncRunningStats", params);
}
}
return "";