Package de.hybris.deltadetection
Interface ChangeDetectionService
- All Known Implementing Classes:
DefaultChangeDetectionService
public interface ChangeDetectionService
API for detecting and consuming changes for specified Item or type.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcollectChangesForType(ComposedTypeModel composedType, StreamConfiguration configuration, ChangesCollector collector) Detects all kind of changes (NEW, MODIFIED, DELETED) on items for the given composed type.voidcollectChangesForType(ComposedTypeModel composedType, String streamId, ChangesCollector collector) Detects all kind of changes (NEW, MODIFIED, DELETED) on items for the given composed type.voidconsumeChanges(List<ItemChangeDTO> changes) Consumes all given changes.voiddeleteItemVersionMarkersForStream(String streamId) Deletes all item version markers belonging to the streamgetChangeForExistingItem(ItemModel item, String streamId) Detects change for a given existing item and stream.getChangeForRemovedItem(PK pk, String streamId) Detects potential change for a an not existing item - (change type 'DELETED'), stored under ItemVersionMarker referencing given item pk.getChangesForRemovedItems(String streamId) Detects changes for all items, which doesn't exist anymore (change type 'DELETED'), stored under ItemVersionMarker referencing the not existing item pks.voidresetStream(String streamId) Resets the stream.
-
Method Details
-
getChangeForExistingItem
Detects change for a given existing item and stream. Finds changes of change type 'NEW' or "MODIFIED'.- Parameters:
item- the item to be checkedstreamId- the streamId for which the changes should be detect- Returns:
ItemChangeDTOObject containing all the information about the change
-
getChangeForRemovedItem
Detects potential change for a an not existing item - (change type 'DELETED'), stored under ItemVersionMarker referencing given item pk.- Parameters:
pk- the pk of the item to be checkedstreamId- the streamId for which the change should be detect- Returns:
ItemChangeDTOObject containing all the information about the change
-
getChangesForRemovedItems
Detects changes for all items, which doesn't exist anymore (change type 'DELETED'), stored under ItemVersionMarker referencing the not existing item pks.- Parameters:
streamId- the streamId for which the change should be detect- Returns:
- List of
ItemChangeDTOObjects containing all the information about the changes
-
collectChangesForType
void collectChangesForType(ComposedTypeModel composedType, String streamId, ChangesCollector collector) Detects all kind of changes (NEW, MODIFIED, DELETED) on items for the given composed type.- Parameters:
composedType- the type for which the change detection should be executed (including subtypes)streamId- the streamId for which the change should be detectcollector- responsible for collecting the changes in specified way, e.g. store them in memory or generate csv file.
-
collectChangesForType
void collectChangesForType(ComposedTypeModel composedType, StreamConfiguration configuration, ChangesCollector collector) Detects all kind of changes (NEW, MODIFIED, DELETED) on items for the given composed type.- Parameters:
composedType- the type for which the change detection should be executed (including subtypes)configuration- the stream configuration defining which item should be included into the stream.collector- responsible for collecting the changes in specified way, e.g. store them in memory or generate csv file.- See Also:
-
consumeChanges
Consumes all given changes. it Means, for the changes of change type NEW - a new ItemVersionMarker is created, in case of change type MODIFIED - the item version marker is updated properly and in case of change type DELETED - the ItemVersionMarker is removed. The stream for which the changes will be consumed is defined inside the givenItemChangeDTOobjects- Parameters:
changes- list of the changes to be consumed.
-
deleteItemVersionMarkersForStream
Deletes all item version markers belonging to the stream- Parameters:
streamId- stream id for which item version markers should be deleted
-
resetStream
Resets the stream. It means that all ItemVersionMarkers with status DELETED will change their status to ACTIVE and all the ItemVersionMarkers with status ACTIVE will have their versionTS set to the beginning of Unix Epoch time (1 January 1970).- Parameters:
streamId- stream id for which item version markers should be reset
-