Class ClockSkew
- java.lang.Object
-
- software.amazon.awssdk.core.retry.ClockSkew
-
@ThreadSafe public final class ClockSkew extends Object
Utility methods for checking and reacting to the current client-side clock being different from the service-side clock.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Duration
getClockSkew(Instant clientTime, Instant serverTime)
Calculate the time skew between a client and server date.static Optional<Instant>
getServerTime(SdkHttpResponse serviceResponse)
Get the server time from the service response, or empty if the time could not be determined.static boolean
isClockSkewed(Instant clientTime, Instant serverTime)
Determine whether the request-level client time was sufficiently skewed from the server time as to possibly cause a clock skew error.
-
-
-
Method Detail
-
isClockSkewed
public static boolean isClockSkewed(Instant clientTime, Instant serverTime)
Determine whether the request-level client time was sufficiently skewed from the server time as to possibly cause a clock skew error.
-
getClockSkew
public static Duration getClockSkew(Instant clientTime, Instant serverTime)
Calculate the time skew between a client and server date. This value has the same semantics ofHttpClientDependencies.timeOffset()
. Positive values imply the client clock is "fast" and negative values imply the client clock is "slow".
-
getServerTime
public static Optional<Instant> getServerTime(SdkHttpResponse serviceResponse)
Get the server time from the service response, or empty if the time could not be determined.
-
-