Class WebhookEventAggregator

java.lang.Object
de.hybris.platform.webhookservices.service.impl.WebhookEventAggregator

public class WebhookEventAggregator extends Object
An aggregator to aggregate WebhookEvents related to an item having WebhookConfiguration linked to it
  • Constructor Details

  • Method Details

    • aggregate

      public Set<WebhookEvent> aggregate(Collection<WebhookEvent> webhookEvents)
      Aggregates the provided webhook events for an item to unique events only. Events created by nested items are removed when an event that is not created by any nested item is present. If webhook event consolidation is enabled, updated events will be consolidated into the created events.

      Event consolidation is squashing or merging of ItemUpdatedEvent into the ItemCreatedEvent when the latter is present. project.properties#webhookservices.aggregating.group.timeout specifies the time frame for which events will be collected to consolidate. For example, when an item is created and then updated in different request but before the aggregation times out, ItemCreatedEvent and ItemUpdatedEvent are created for the item. If project.properties#webhookservices.event.consolidation.enabled is true, ItemUpdatedEvent will be squashed into the ItemCreatedEvent, to return ItemCreatedEvent only.

      ItemDeletedEvent is not considered for removing nested events, and consolidation.

      Parameters:
      webhookEvents - a collection of webhook events to be aggregated
      Returns:
      a set of unique webhook events after aggregation