use of org.openforis.collect.event.RecordDeletedEvent in project collect by openforis.
the class DeleteRecordHandler method execute.
@Override
public RecordEvent execute(DeleteRecordCommand command) {
try {
CollectSurvey survey = surveyManager.getById(command.getSurveyId());
recordManager.delete(command.getRecordId());
return new RecordDeletedEvent(survey.getName(), command.getRecordId(), new Date(), command.getUsername());
} catch (RecordPersistenceException e) {
throw new RuntimeException(e);
}
}
use of org.openforis.collect.event.RecordDeletedEvent in project collect by openforis.
the class RecordController method publishRecordDeletedEvent.
private void publishRecordDeletedEvent(CollectRecord record, RecordStep recordStep, String userName) {
if (!eventQueue.isEnabled()) {
return;
}
List<RecordDeletedEvent> events = Arrays.asList(new RecordDeletedEvent(record.getSurvey().getName(), record.getId(), new Date(), userName));
String surveyName = record.getSurvey().getName();
eventQueue.publish(new RecordTransaction(surveyName, record.getId(), recordStep, events));
}
use of org.openforis.collect.event.RecordDeletedEvent in project collect by openforis.
the class DataService method publishRecordDeletedEvent.
private void publishRecordDeletedEvent(CollectRecord record, RecordStep recordStep, String userName) {
if (!eventQueue.isEnabled()) {
return;
}
List<RecordDeletedEvent> events = Arrays.asList(new RecordDeletedEvent(record.getSurvey().getName(), record.getId(), new Date(), userName));
String surveyName = record.getSurvey().getName();
eventQueue.publish(new RecordTransaction(surveyName, record.getId(), recordStep, events));
}
Aggregations