Class EventLogWriterImpl

    • Constructor Detail

      • EventLogWriterImpl

        public EventLogWriterImpl​(EventLogRepository eventLogRepository,
                                  com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                  FlowIdComponent flowIdComponent)
    • Method Detail

      • fireCreateEvent

        public void fireCreateEvent​(String eventType,
                                    String dataType,
                                    Object data)
        Description copied from interface: EventLogWriter
        Fires a data change event about a creation of some resource (object).
        Specified by:
        fireCreateEvent in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event.
        data - some POJO that can be serialized into JSON (required parameter). This is meant to be a representation of the resource which was created. It will be used as content of the data field of the Nakadi event.
      • fireCreateEvents

        public void fireCreateEvents​(String eventType,
                                     String dataType,
                                     Collection<?> data)
        Description copied from interface: EventLogWriter
        Fires data change events about the creation of some resources (objects), see fireCreateEvent for more details.
        Specified by:
        fireCreateEvents in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event
        data - some POJOs that can be serialized into JSON (required parameter). This is meant to be a representation of the current state of the resource. It will be used as content of the data field of the Nakadi event.
      • fireUpdateEvent

        public void fireUpdateEvent​(String eventType,
                                    String dataType,
                                    Object data)
        Description copied from interface: EventLogWriter
        Fires a data change event about an update of some resource (object).
        Specified by:
        fireUpdateEvent in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event.
        data - some POJO that can be serialized into JSON (required parameter). This is meant to be a representation of the new state of the resource which was updated. It will be used as content of the data field of the Nakadi event.
      • fireUpdateEvents

        public void fireUpdateEvents​(String eventType,
                                     String dataType,
                                     Collection<?> data)
        Description copied from interface: EventLogWriter
        Fires data change events about the update of some resources (objects), see fireUpdateEvent for more details.
        Specified by:
        fireUpdateEvents in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event
        data - some POJOs that can be serialized into JSON (required parameter). This is meant to be a representation of the current state of the resource. It will be used as content of the data field of the Nakadi event.
      • fireDeleteEvent

        public void fireDeleteEvent​(String eventType,
                                    String dataType,
                                    Object data)
        Description copied from interface: EventLogWriter
        Fires a data change event about the deletion of some resource (object).
        Specified by:
        fireDeleteEvent in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event.
        data - some POJO that can be serialized into JSON (required parameter). This is meant to be a representation of the last state (before the deletion) of the resource which was deleted. It will be used as content of the data field of the Nakadi event.
      • fireDeleteEvents

        public void fireDeleteEvents​(String eventType,
                                     String dataType,
                                     Collection<?> data)
        Description copied from interface: EventLogWriter
        Fires data change events about the deletion of some resources (objects), see fireDeleteEvent for more details.
        Specified by:
        fireDeleteEvents in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event
        data - some POJOs that can be serialized into JSON (required parameter). This is meant to be a representation of the current state of the resource. It will be used as content of the data field of the Nakadi event.
      • fireSnapshotEvent

        public void fireSnapshotEvent​(String eventType,
                                      String dataType,
                                      Object data)
        Description copied from interface: EventLogWriter
        Fires a data change event with a snapshot of some resource (object).

        This notifies your consumers about the current state of a resource, even if nothing changed. Typical use cases include initial replication to new consumers or hotfixes of data inconsistencies between producer and consumer.

        Normally applications don't have to call this themselves, instead they should implement the SnapshotEventGenerator interface to add support for snapshot creation via the actuator endpoint.

        Specified by:
        fireSnapshotEvent in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event.
        data - some POJO that can be serialized into JSON (required parameter). This is meant to be a representation of the current state of the resource. It will be used as content of the data field of the Nakadi event.
      • fireSnapshotEvents

        public void fireSnapshotEvents​(String eventType,
                                       String dataType,
                                       Collection<?> data)
        Description copied from interface: EventLogWriter
        Fires data change events, see fireSnapshotEvent for more details.
        Specified by:
        fireSnapshotEvents in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        dataType - the content of the data_type field of the Nakadi event
        data - some POJOs that can be serialized into JSON (required parameter). This is meant to be a representation of the current state of the resource. It will be used as content of the data field of the Nakadi event.
      • fireBusinessEvent

        public void fireBusinessEvent​(String eventType,
                                      Object payload)
        Description copied from interface: EventLogWriter
        Fires a business event, i.e. an event communicating the fact that some business process step happened. The payload object will be used as the main event content (just metadata will be added). Same as for data change events, you should call this method in the same transaction as you are storing related changes into your database.
        Specified by:
        fireBusinessEvent in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        payload - some POJO that can be serialized into JSON (required parameter)
      • fireBusinessEvents

        public void fireBusinessEvents​(String eventType,
                                       Collection<Object> payload)
        Description copied from interface: EventLogWriter
        Fires business events, see fireBusinessEvent for more details
        Specified by:
        fireBusinessEvents in interface EventLogWriter
        Parameters:
        eventType - the Nakadi event type of the event. This is roughly equivalent to an event channel or topic.
        payload - some POJOs that can be serialized into JSON (required parameter)