Search in sources :

Example 1 with RecordTransaction

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));
}
Also used : EventProducer(org.openforis.collect.event.EventProducer) RecordEvent(org.openforis.collect.event.RecordEvent) RecordTransaction(org.openforis.collect.event.RecordTransaction)

Example 2 with RecordTransaction

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));
}
Also used : EventProducer(org.openforis.collect.event.EventProducer) RecordEvent(org.openforis.collect.event.RecordEvent) RecordTransaction(org.openforis.collect.event.RecordTransaction)

Example 3 with RecordTransaction

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));
}
Also used : RecordDeletedEvent(org.openforis.collect.event.RecordDeletedEvent) Date(java.util.Date) RecordTransaction(org.openforis.collect.event.RecordTransaction)

Example 4 with RecordTransaction

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));
}
Also used : RecordDeletedEvent(org.openforis.collect.event.RecordDeletedEvent) Date(java.util.Date) RecordTransaction(org.openforis.collect.event.RecordTransaction)

Example 5 with RecordTransaction

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();
    }
}
Also used : RecordTransaction(org.openforis.collect.event.RecordTransaction)

Aggregations

RecordTransaction (org.openforis.collect.event.RecordTransaction)5 Date (java.util.Date)2 EventProducer (org.openforis.collect.event.EventProducer)2 RecordDeletedEvent (org.openforis.collect.event.RecordDeletedEvent)2 RecordEvent (org.openforis.collect.event.RecordEvent)2