Package de.hybris.deltadetection
Interface ChangeDetectionService
-
- All Known Implementing Classes:
DefaultChangeDetectionService
public interface ChangeDetectionServiceAPI for detecting and consuming changes for specified Item or type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcollectChangesForType(ComposedTypeModel composedType, StreamConfiguration configuration, ChangesCollector collector)Detects all kind of changes (NEW, MODIFIED, DELETED) on items for the given composed type.voidcollectChangesForType(ComposedTypeModel composedType, java.lang.String streamId, ChangesCollector collector)Detects all kind of changes (NEW, MODIFIED, DELETED) on items for the given composed type.voidconsumeChanges(java.util.List<ItemChangeDTO> changes)Consumes all given changes.voiddeleteItemVersionMarkersForStream(java.lang.String streamId)Deletes all item version markers belonging to the streamItemChangeDTOgetChangeForExistingItem(ItemModel item, java.lang.String streamId)Detects change for a given existing item and stream.ItemChangeDTOgetChangeForRemovedItem(PK pk, java.lang.String streamId)Detects potential change for a an not existing item - (change type 'DELETED'), stored under ItemVersionMarker referencing given item pk.java.util.List<ItemChangeDTO>getChangesForRemovedItems(java.lang.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(java.lang.String streamId)Resets the stream.
-
-
-
Method Detail
-
getChangeForExistingItem
ItemChangeDTO getChangeForExistingItem(ItemModel item, java.lang.String streamId)
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
ItemChangeDTO getChangeForRemovedItem(PK pk, java.lang.String streamId)
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
java.util.List<ItemChangeDTO> getChangesForRemovedItems(java.lang.String streamId)
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, java.lang.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:
StreamConfiguration
-
consumeChanges
void consumeChanges(java.util.List<ItemChangeDTO> changes)
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
void deleteItemVersionMarkersForStream(java.lang.String streamId)
Deletes all item version markers belonging to the stream- Parameters:
streamId- stream id for which item version markers should be deleted
-
resetStream
void resetStream(java.lang.String streamId)
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
-
-