Search in sources :

Example 1 with InitializeRDBEvent

use of org.openforis.collect.relational.event.InitializeRDBEvent in project collect by openforis.

the class RepositoryEventHandler method handleEvent.

private void handleEvent(SurveyEvent event, final KeepAlive keepAlive) {
    ProgressListener keepAliveListener = createProgressListener(keepAlive);
    String surveyName = event.getSurveyName();
    if (event instanceof RecordTransaction) {
        repositories.process((RecordTransaction) event);
    } else if (event instanceof SurveyCreatedEvent) {
        repositories.createRepositories(surveyName, null, keepAliveListener);
    } else if (event instanceof SurveyUpdatedEvent) {
        repositories.updateRepositories(surveyName, null, keepAliveListener);
    } else if (event instanceof SurveyDeletedEvent) {
        repositories.deleteRepositories(surveyName);
    } else if (event instanceof InitializeRDBEvent) {
        repositories.createRepository(surveyName, ((InitializeRDBEvent) event).getStep(), null, keepAliveListener);
    }
}
Also used : ProgressListener(org.openforis.concurrency.ProgressListener) InitializeRDBEvent(org.openforis.collect.relational.event.InitializeRDBEvent)

Aggregations

InitializeRDBEvent (org.openforis.collect.relational.event.InitializeRDBEvent)1 ProgressListener (org.openforis.concurrency.ProgressListener)1