ConfigurationEventHandler

public class ConfigurationEventHandler

Listens to notifications about configurations and performs actions when such event is received. If configuration is deleted, its applications current schemas are dropped. If configuration is created a call to CommcareHQ is made to fetch the latest schemas version. Once we parse the response, tasks are notified to update triggers.

Methods

configCreated

public synchronized void configCreated(MotechEvent event)

Responsible for handling CONFIG_CREATED event. This event is fired when user creates a new configuration. Handling this event will result in adding new configuration and downloading applications related with it.

Parameters:
  • event – the event to be handled

configDeleted

public synchronized void configDeleted(MotechEvent event)

Responsible for handling CONFIG_DELETED event. This event is fired when user deletes an existing configuration. Handling this event will result in removing the configuration itself and all related application stored in the database.

Parameters:
  • event – the event to be handled

configUpdated

public synchronized void configUpdated(MotechEvent event)

Responsible for handling CONFIG_UPDATED event. This event is fired when user updates an existing configuration. Handling this event will result in deleting all stored applications related with the updated configuration and downloading new ones from the CommCare server.

Parameters:
  • event – the event to be handled