use of org.openforis.collect.event.RecordTransaction in project collect by openforis.
the class DataService method publishRecordPromotedEvents.
private void publishRecordPromotedEvents(CollectRecord record, String userName) {
if (!eventQueue.isEnabled()) {
return;
}
List<RecordEvent> events = new EventProducer().produceFor(record, userName);
eventQueue.publish(new RecordTransaction(record.getSurvey().getName(), record.getId(), record.getStep().toRecordStep(), events));
}
use of org.openforis.collect.event.RecordTransaction in project collect by openforis.
the class RecordController method publishRecordPromotedEvents.
private void publishRecordPromotedEvents(CollectRecord record, String userName) {
if (!eventQueue.isEnabled()) {
return;
}
List<RecordEvent> events = new EventProducer().produceFor(record, userName);
eventQueue.publish(new RecordTransaction(record.getSurvey().getName(), record.getId(), record.getStep().toRecordStep(), events));
}
use of org.openforis.collect.event.RecordTransaction 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.RecordTransaction 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));
}
use of org.openforis.collect.event.RecordTransaction in project collect by openforis.
the class RecordEventBatchPublisher method process.
public void process(CollectRecord record) {
if (!eventQueue.isEnabled()) {
return;
}
if (!events.isEmpty()) {
initializeEvents(record);
String surveyName = record.getSurvey().getName();
eventQueue.publish(new RecordTransaction(surveyName, record.getId(), record.getStep().toRecordStep(), events));
events.clear();
}
}
Aggregations