Package io.camunda.client.impl
Class CamundaClientCredentials
java.lang.Object
io.camunda.client.impl.CamundaClientCredentials
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DurationSmall safety margin subtracted from the actual token expiry when deciding whether the token is still usable. -
Constructor Summary
ConstructorsConstructorDescriptionCamundaClientCredentials(String accessToken, ZonedDateTime expiry, String tokenType) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanisValid()voidsetExpiresIn(String expiresIn) voidbooleanshouldRefreshProactively(Duration proactiveTokenRefreshThreshold) Returns true if the token has entered the proactive refresh window (i.e. it will expire withinproactiveTokenRefreshThreshold) and a background refresh should be triggered.
-
Field Details
-
EXPIRY_GRACE_PERIOD
Small safety margin subtracted from the actual token expiry when deciding whether the token is still usable. Guards against clock skew and in-flight latency between this check and the server validating the token; it is not a policy knob for refresh timing.
-
-
Constructor Details
-
CamundaClientCredentials
public CamundaClientCredentials() -
CamundaClientCredentials
-
-
Method Details
-
getAccessToken
-
getTokenType
-
setExpiresIn
-
getExpiry
-
setExpiry
-
isValid
public boolean isValid() -
shouldRefreshProactively
Returns true if the token has entered the proactive refresh window (i.e. it will expire withinproactiveTokenRefreshThreshold) and a background refresh should be triggered. This is independent ofisValid(): callers should compose the two, usingisValid()to decide whether the token can still be served and this method to decide whether to kick off an eager refresh alongside. This avoids the cliff edge where all threads discover the token is invalid at the same time. -
hashCode
public int hashCode() -
equals
-