Class DefaultSQLRecoveryStrategy
- java.lang.Object
-
- de.hybris.platform.jdbcwrapper.interceptor.recover.DefaultSQLRecoveryStrategy
-
- All Implemented Interfaces:
SQLRecoveryStrategy
public class DefaultSQLRecoveryStrategy extends java.lang.Object implements SQLRecoveryStrategy
-
-
Constructor Summary
Constructors Constructor Description DefaultSQLRecoveryStrategy(ConfigIntf config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.DurationcalculateBackoffDuration(int numberOfIterations)booleancanRecover(JDBCInterceptorContext ctx)protected doublegetBackoffIncreaseFactor()protected Config.DatabaseNamegetDataBaseType()protected intgetInitialBackoffSeconds()protected intgetMaxBackoffSeconds()booleanisRecoverable(java.sql.SQLException e)protected static java.util.Map<Config.DatabaseName,java.util.Set<java.lang.Integer>>mergeDBSpecificWithCommonErrorCodes(ConfigIntf config, java.util.function.Function<Config.DatabaseName,java.lang.String> errorCodesKeyForDB)protected static java.lang.StringnonRecoverableErrorCodesKey(Config.DatabaseName name)protected static java.lang.StringrecoverableErrorCodesKey(Config.DatabaseName name)protected static java.util.Set<java.lang.Integer>toSetOfInts(java.lang.String intsToSplit)
-
-
-
Constructor Detail
-
DefaultSQLRecoveryStrategy
public DefaultSQLRecoveryStrategy(ConfigIntf config)
-
-
Method Detail
-
calculateBackoffDuration
public java.time.Duration calculateBackoffDuration(int numberOfIterations)
- Specified by:
calculateBackoffDurationin interfaceSQLRecoveryStrategy
-
isRecoverable
public boolean isRecoverable(java.sql.SQLException e)
- Specified by:
isRecoverablein interfaceSQLRecoveryStrategy
-
canRecover
public boolean canRecover(JDBCInterceptorContext ctx)
- Specified by:
canRecoverin interfaceSQLRecoveryStrategy
-
getInitialBackoffSeconds
protected int getInitialBackoffSeconds()
-
getBackoffIncreaseFactor
protected double getBackoffIncreaseFactor()
-
getMaxBackoffSeconds
protected int getMaxBackoffSeconds()
-
getDataBaseType
protected Config.DatabaseName getDataBaseType()
-
mergeDBSpecificWithCommonErrorCodes
protected static java.util.Map<Config.DatabaseName,java.util.Set<java.lang.Integer>> mergeDBSpecificWithCommonErrorCodes(ConfigIntf config, java.util.function.Function<Config.DatabaseName,java.lang.String> errorCodesKeyForDB)
-
recoverableErrorCodesKey
protected static final java.lang.String recoverableErrorCodesKey(Config.DatabaseName name)
-
nonRecoverableErrorCodesKey
protected static final java.lang.String nonRecoverableErrorCodesKey(Config.DatabaseName name)
-
toSetOfInts
protected static java.util.Set<java.lang.Integer> toSetOfInts(java.lang.String intsToSplit)
-
-