@ThreadSafe public final class ClockSkew extends Object
Modifier and Type | Method and 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.
|
public static boolean isClockSkewed(Instant clientTime, Instant serverTime)
public static Duration getClockSkew(Instant clientTime, Instant serverTime)
HttpClientDependencies.timeOffset()
. Positive values imply the client clock is "fast" and negative values imply
the client clock is "slow".public static Optional<Instant> getServerTime(SdkHttpResponse serviceResponse)
Copyright © 2020. All rights reserved.