Class WebhookEventAggregator
java.lang.Object
de.hybris.platform.webhookservices.service.impl.WebhookEventAggregator
An aggregator to aggregate
WebhookEvents related to an item having WebhookConfiguration linked to it-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates theWebhookEventAggregatorwith the webhook services configuration -
Method Summary
Modifier and TypeMethodDescriptionaggregate(Collection<WebhookEvent> webhookEvents) Aggregates the provided webhook events for an item to unique events only.
-
Constructor Details
-
WebhookEventAggregator
Instantiates theWebhookEventAggregatorwith the webhook services configuration- Parameters:
config-WebhookServicesConfigurationwith access methods to configurations related to the webhookservices module
-
-
Method Details
-
aggregate
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
ItemUpdatedEventinto theItemCreatedEventwhen the latter is present.project.properties#webhookservices.aggregating.group.timeoutspecifies 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. Ifproject.properties#webhookservices.event.consolidation.enabledistrue, ItemUpdatedEvent will be squashed into the ItemCreatedEvent, to return ItemCreatedEvent only.ItemDeletedEventis 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
-