DefaultDbToLogConverter¶
-
public class
DefaultDbToLogConverter
implements EventToLogConverter<EventLog>¶ Implementaton of the
EventToLogConverter
interface. This class is responsible for convertingMotechEvent
s 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. UsesDbLoggableEvent
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: - org.motechproject.commons.api.MotechException – if the passed LoggableEvent is not an instance of DbLoggableEvent
Returns: EventLog object that is used to log the event to the database