Class DBEventProcessorStateService

java.lang.Object
org.graylog.events.processor.DBEventProcessorStateService

public class DBEventProcessorStateService extends Object
Manages database state for EventProcessors.
  • Constructor Details

  • Method Details

    • findByEventDefinitionsAndMaxTimestamp

      public com.google.common.collect.ImmutableSet<EventProcessorStateDto> findByEventDefinitionsAndMaxTimestamp(Set<String> eventDefinitionIds, org.joda.time.DateTime maxTimestamp)
      Returns a set of event processor state objects where the event definition ID matches one of the ones in the given set of IDs and the maximum processed timestamp is greater or equals the given timestamp.
      Parameters:
      eventDefinitionIds - set of event definition IDs
      maxTimestamp - the threshold for the maximum processed timestamp
      Returns:
      set of state objects or empty set when no object matches
    • setState

      Creates a new or updates an existing event processor state record for the values in the given DTO.
      Parameters:
      dto - state DTO
      Returns:
      the created or updated record
    • setState

      public Optional<EventProcessorStateDto> setState(String eventDefinitionId, org.joda.time.DateTime minProcessedTimestamp, org.joda.time.DateTime maxProcessedTimestamp)
      Creates a new or updates an existing event processor state record for the given values.
      Parameters:
      eventDefinitionId - the related event definition ID
      maxProcessedTimestamp - the maximum processed timestamp
      Returns:
      the created or updated record
    • deleteByEventDefinitionId

      public int deleteByEventDefinitionId(String id)
      Delete state objects for the given event definition ID.
      Parameters:
      id - the object ID to delete
      Returns:
      the number of objects that have been deleted