public class DefaultChangeDetectionService extends java.lang.Object implements ChangeDetectionService
| Constructor and Description |
|---|
DefaultChangeDetectionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
collectChangesForType(ComposedTypeModel composedType,
StreamConfiguration configuration,
ChangesCollector collector)
Detects all kind of changes (NEW, MODIFIED, DELETED) on items for the given composed type.
|
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.
|
void |
consumeChanges(java.util.List<ItemChangeDTO> allChanges)
Consumes all given changes.
|
protected java.util.concurrent.Callable<java.lang.Integer> |
createConsumeBatchCallable(java.lang.String streamId,
java.util.List<ItemChangeDTO> changes,
int maxRetries) |
void |
deleteItemVersionMarkersForStream(java.lang.String streamId)
Deletes all item version markers belonging to the stream
|
ItemChangeDTO |
getChangeForExistingItem(ItemModel item,
java.lang.String streamId)
Detects change for a given existing item and stream.
|
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.
|
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.
|
protected java.util.List<java.util.concurrent.Callable<java.lang.Integer>> |
prepareBatchExecutionCallables(java.util.List<ItemChangeDTO> allChanges) |
void |
resetStream(java.lang.String streamId)
Resets the stream.
|
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService) |
void |
setModelService(ModelService modelService) |
void |
setTypeService(TypeService typeService) |
public ItemChangeDTO getChangeForExistingItem(ItemModel item, java.lang.String streamId)
ChangeDetectionServicegetChangeForExistingItem in interface ChangeDetectionServiceitem - the item to be checkedstreamId - the streamId for which the changes should be detectItemChangeDTO Object containing all the information about the changepublic ItemChangeDTO getChangeForRemovedItem(PK pk, java.lang.String streamId)
ChangeDetectionServicegetChangeForRemovedItem in interface ChangeDetectionServicepk - the pk of the item to be checkedstreamId - the streamId for which the change should be detectItemChangeDTO Object containing all the information about the changepublic java.util.List<ItemChangeDTO> getChangesForRemovedItems(java.lang.String streamId)
ChangeDetectionServicegetChangesForRemovedItems in interface ChangeDetectionServicestreamId - the streamId for which the change should be detectItemChangeDTO Objects containing all the information about the changespublic void collectChangesForType(ComposedTypeModel composedType, java.lang.String streamId, ChangesCollector collector)
ChangeDetectionServicecollectChangesForType in interface ChangeDetectionServicecomposedType - 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.public void collectChangesForType(ComposedTypeModel composedType, StreamConfiguration configuration, ChangesCollector collector)
ChangeDetectionServicecollectChangesForType in interface ChangeDetectionServicecomposedType - 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.StreamConfigurationpublic void consumeChanges(java.util.List<ItemChangeDTO> allChanges)
ChangeDetectionServiceItemChangeDTO objectsconsumeChanges in interface ChangeDetectionServiceallChanges - list of the changes to be consumed.protected java.util.List<java.util.concurrent.Callable<java.lang.Integer>> prepareBatchExecutionCallables(java.util.List<ItemChangeDTO> allChanges)
protected java.util.concurrent.Callable<java.lang.Integer> createConsumeBatchCallable(java.lang.String streamId,
java.util.List<ItemChangeDTO> changes,
int maxRetries)
public void deleteItemVersionMarkersForStream(java.lang.String streamId)
ChangeDetectionServicedeleteItemVersionMarkersForStream in interface ChangeDetectionServicestreamId - stream id for which item version markers should be deletedpublic void resetStream(java.lang.String streamId)
ChangeDetectionServiceresetStream in interface ChangeDetectionServicestreamId - stream id for which item version markers should be resetpublic void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
public void setModelService(ModelService modelService)
public void setTypeService(TypeService typeService)
Copyright © 2018 SAP SE. All Rights Reserved.