All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.ing.baker.recipe.javadsl.InteractionFailureStrategy.scala Maven / Gradle / Ivy
package com.ing.baker.recipe.javadsl
import com.ing.baker.recipe.common
import com.ing.baker.recipe.common.InteractionFailureStrategy.{BlockInteraction, FireEventAfterFailure, RetryWithIncrementalBackoff}
import scala.concurrent.duration
import scala.concurrent.duration.Duration
object InteractionFailureStrategy {
def RetryWithIncrementalBackoff(initialDelay: java.time.Duration,
deadline: java.time.Duration,
maxTimeBetweenRetries: java.time.Duration): RetryWithIncrementalBackoff = {
val initialDelayDuration = Duration(initialDelay.toMillis, duration.MILLISECONDS)
val deadlineDuration = Duration(deadline.toMillis, duration.MILLISECONDS)
common.InteractionFailureStrategy.RetryWithIncrementalBackoff(
initialDelayDuration,
deadlineDuration,
Some(Duration(maxTimeBetweenRetries.toMillis, duration.MILLISECONDS)),
None)
}
def RetryWithIncrementalBackoff(initialDelay: java.time.Duration,
deadline: java.time.Duration): RetryWithIncrementalBackoff = {
val initialDelayDuration = Duration(initialDelay.toMillis, duration.MILLISECONDS)
val deadlineDuration = Duration(deadline.toMillis, duration.MILLISECONDS)
common.InteractionFailureStrategy.RetryWithIncrementalBackoff(
initialDelayDuration,
deadlineDuration,
None,
None)
}
def RetryWithIncrementalBackoff(initialDelay: java.time.Duration,
deadline: java.time.Duration,
maxTimeBetweenRetries: java.time.Duration,
exhaustedEvent: Class[_]): RetryWithIncrementalBackoff = {
val initialDelayDuration = Duration(initialDelay.toMillis, duration.MILLISECONDS)
val deadlineDuration = Duration(deadline.toMillis, duration.MILLISECONDS)
common.InteractionFailureStrategy.RetryWithIncrementalBackoff(
initialDelayDuration,
deadlineDuration,
Some(Duration(maxTimeBetweenRetries.toMillis, duration.MILLISECONDS)),
Some(eventClassToCommonEvent(exhaustedEvent, None)))
}
def FireEvent(eventClass: Class[_]): common.InteractionFailureStrategy.FireEventAfterFailure = {
FireEventAfterFailure(eventClassToCommonEvent(eventClass, None))
}
def RetryWithIncrementalBackoff(initialDelay: java.time.Duration,
deadline: java.time.Duration,
exhaustedEvent: Class[_]): RetryWithIncrementalBackoff = {
val initialDelayDuration = Duration(initialDelay.toMillis, duration.MILLISECONDS)
val deadlineDuration = Duration(deadline.toMillis, duration.MILLISECONDS)
common.InteractionFailureStrategy.RetryWithIncrementalBackoff(
initialDelayDuration,
deadlineDuration,
None,
Some(eventClassToCommonEvent(exhaustedEvent, None)))
}
def BlockInteraction(): BlockInteraction = common.InteractionFailureStrategy.BlockInteraction()
}