DefaultDbToLogConverter

public class DefaultDbToLogConverter implements EventToLogConverter<EventLog>

Implementaton of the EventToLogConverter interface. This class is responsible for converting MotechEvents to the class persistable in the database.

Methods

configuredConvertEventToDbLog

public EventLog configuredConvertEventToDbLog(MotechEvent eventToLog, LoggableEvent loggableEvent)

Converts an event to a EventLog object, which represents a single logged event in database. Uses DbLoggableEvent implementation of LoggableEvent to configure the returned object.

Parameters:
  • eventToLog – the incoming motech event to be converted to a database event log
  • loggableEvent – contains data about an event to log, used to configure returned log instance
Throws:
Returns:

EventLog object that is used to log the event to the database

convertToLog

public EventLog convertToLog(MotechEvent eventToLog)