Class DefaultSyncRetryService
- java.lang.Object
-
- de.hybris.platform.outboundsync.retry.impl.DefaultSyncRetryService
-
- All Implemented Interfaces:
SyncRetryService
public class DefaultSyncRetryService extends java.lang.Object implements SyncRetryService
Default implementation for updating the persisted retries based on the results of the synchronization process
-
-
Constructor Summary
Constructors Constructor Description DefaultSyncRetryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateNewRetry(OutboundItemDTOGroup outboundItemDTOGroup)Creates a new retry record in the databasebooleandetermineLastAttemptAndUpdateRetry(OutboundItemDTOGroup outboundItemDTOGroup)Performs the necessary operations in the retry table to handle a synchronization errorOutboundItemDTOGroupand determines if it's the last attempt based on the configurationprotected OutboundSyncRetryModelfindRetry(OutboundItemDTOGroup outboundItemDTOGroup)Searches the database for aOutboundSyncRetryModelthat contains the information in theOutboundItemprotected ModelServicegetModelService()protected OutboundSyncConfigurationgetOutboundSyncConfiguration()protected RetrySearchServicegetRetrySearchService()voidhandleSyncSuccess(OutboundItemDTOGroup outboundItemDTOGroup)Performs the necessary operations in the retry table to handle a successful synchronizationprotected voidincrementRetryAttempt(OutboundSyncRetryModel retry)Increments the retry attempt count by 1, and persists the updateprotected voidmarkRetryAsMaxRetriesReached(OutboundSyncRetryModel retry)Sets theOutboundSyncRetryModel.setReachedMaxRetries(Boolean)to true, and persists the update.voidsetModelService(ModelService modelService)voidsetOutboundSyncConfiguration(OutboundSyncConfiguration outboundSyncConfiguration)voidsetRetrySearchService(RetrySearchService retrySearchService)protected voidupdateRetry(OutboundSyncRetryModel retry)Persists the givenOutboundSyncRetryModel
-
-
-
Method Detail
-
determineLastAttemptAndUpdateRetry
public boolean determineLastAttemptAndUpdateRetry(OutboundItemDTOGroup outboundItemDTOGroup)
Description copied from interface:SyncRetryServicePerforms the necessary operations in the retry table to handle a synchronization errorOutboundItemDTOGroupand determines if it's the last attempt based on the configuration- Specified by:
determineLastAttemptAndUpdateRetryin interfaceSyncRetryService- Parameters:
outboundItemDTOGroup- with the information required for the search- Returns:
- true if it's the last attempt, false if it is not.
-
handleSyncSuccess
public void handleSyncSuccess(OutboundItemDTOGroup outboundItemDTOGroup)
Description copied from interface:SyncRetryServicePerforms the necessary operations in the retry table to handle a successful synchronization- Specified by:
handleSyncSuccessin interfaceSyncRetryService- Parameters:
outboundItemDTOGroup- of typeOutboundItemDTOGroupwith information about the successful synchronization
-
incrementRetryAttempt
protected void incrementRetryAttempt(OutboundSyncRetryModel retry)
Increments the retry attempt count by 1, and persists the update- Parameters:
retry-OutboundSyncRetryModelto update
-
markRetryAsMaxRetriesReached
protected void markRetryAsMaxRetriesReached(OutboundSyncRetryModel retry)
Sets theOutboundSyncRetryModel.setReachedMaxRetries(Boolean)to true, and persists the update.- Parameters:
retry-OutboundSyncRetryModelto update
-
updateRetry
protected void updateRetry(OutboundSyncRetryModel retry)
Persists the givenOutboundSyncRetryModel- Parameters:
retry-OutboundSyncRetryModelto save
-
createNewRetry
protected void createNewRetry(OutboundItemDTOGroup outboundItemDTOGroup)
Creates a new retry record in the database- Parameters:
outboundItemDTOGroup-OutboundItemDTOGroupconsists the information for creating theOutboundSyncRetryModel
-
findRetry
protected OutboundSyncRetryModel findRetry(OutboundItemDTOGroup outboundItemDTOGroup)
Searches the database for aOutboundSyncRetryModelthat contains the information in theOutboundItem- Parameters:
outboundItemDTOGroup-OutboundItemDTOGroupconsists the information for the search- Returns:
- An OutboundSyncRetryModel if found
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getOutboundSyncConfiguration
protected OutboundSyncConfiguration getOutboundSyncConfiguration()
-
setOutboundSyncConfiguration
public void setOutboundSyncConfiguration(OutboundSyncConfiguration outboundSyncConfiguration)
-
getRetrySearchService
protected RetrySearchService getRetrySearchService()
-
setRetrySearchService
public void setRetrySearchService(RetrySearchService retrySearchService)
-
-