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 Deprecated Methods Modifier and Type Method Description protected OutboundSyncRetryModelchangeForUnsuccessfulSyncAttempt(OutboundSyncRetryModel retry)Updates retry state and persists it.protected OutboundSyncRetryModelcreateNewRetry(OutboundItemDTOGroup outboundItemDTOGroup)Creates a new instance of the retry record but does not persist it.booleandetermineLastAttemptAndUpdateRetry(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()booleanhandleSyncFailure(OutboundItemDTOGroup dtoGroup)Handles an outbound synchronization failure for the specified DTO group.voidhandleSyncSuccess(OutboundItemDTOGroup outboundItemDTOGroup)Performs the necessary operations in the retry table to handle a successful synchronizationprotected voidincrementRetryAttempt(OutboundSyncRetryModel retry)Deprecated, for removal: This API element is subject to removal in a future version.since 1905.08-CEP the implementation always useschangeForUnsuccessfulSyncAttempt(OutboundSyncRetryModel)protected voidmarkRetryAsMaxRetriesReached(OutboundSyncRetryModel retry)Deprecated, for removal: This API element is subject to removal in a future version.since 1905.08-CEP the implementation always useschangeForUnsuccessfulSyncAttempt(OutboundSyncRetryModel)voidsetModelService(ModelService modelService)voidsetOutboundSyncConfiguration(OutboundSyncConfiguration outboundSyncConfiguration)voidsetRetrySearchService(RetrySearchService retrySearchService)protected voidupdateRetry(OutboundSyncRetryModel retry)Persists the givenOutboundSyncRetryModel
-
-
-
Method Detail
-
handleSyncFailure
public boolean handleSyncFailure(OutboundItemDTOGroup dtoGroup)
Description copied from interface:SyncRetryServiceHandles an outbound synchronization failure for the specified DTO group.- Specified by:
handleSyncFailurein interfaceSyncRetryService- Parameters:
dtoGroup- a group of related items, for which a single synchronization should have been done but failed.- Returns:
true, if it was last attempt and no more future synchrinizations should be attempted for the specified item group;false, if more synchronizations should be attempted.
-
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.
-
changeForUnsuccessfulSyncAttempt
protected OutboundSyncRetryModel changeForUnsuccessfulSyncAttempt(OutboundSyncRetryModel retry)
Updates retry state and persists it.- Parameters:
retry- a retry record for the failed synchronization attempt.- Returns:
- update retry model
-
incrementRetryAttempt
@Deprecated(since="1905.08-CEP", forRemoval=true) protected void incrementRetryAttempt(OutboundSyncRetryModel retry)Deprecated, for removal: This API element is subject to removal in a future version.since 1905.08-CEP the implementation always useschangeForUnsuccessfulSyncAttempt(OutboundSyncRetryModel)Increments the retry attempt count by 1, and persists the update- Parameters:
retry-OutboundSyncRetryModelto update
-
markRetryAsMaxRetriesReached
@Deprecated(since="1905.08-CEP", forRemoval=true) protected void markRetryAsMaxRetriesReached(OutboundSyncRetryModel retry)Deprecated, for removal: This API element is subject to removal in a future version.since 1905.08-CEP the implementation always useschangeForUnsuccessfulSyncAttempt(OutboundSyncRetryModel)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
-
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
-
createNewRetry
protected OutboundSyncRetryModel createNewRetry(OutboundItemDTOGroup outboundItemDTOGroup)
Creates a new instance of the retry record but does not persist it.- 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)
-
-