Package org.kiwiproject.consul.option
Class ConsistencyMode
java.lang.Object
org.kiwiproject.consul.option.ConsistencyMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConsistencyModestatic final ConsistencyModestatic final ConsistencyMode -
Method Summary
Modifier and TypeMethodDescriptionstatic ConsistencyModecreateCachedConsistencyWithMaxAgeAndStale(Optional<Long> maxAgeInSeconds, Optional<Long> maxStaleInSeconds) Creates a cached Consistency.Get the Additional HTTP headers to add to request.final Stringname()ConsistencyMode used t be an enum, implement it.intordinal()toParam()final StringtoString()static ConsistencyMode[]values()
-
Field Details
-
DEFAULT
-
STALE
-
CONSISTENT
-
-
Method Details
-
toParam
-
getAdditionalHeaders
Get the Additional HTTP headers to add to request.- Returns:
- a not null but possibly empty map
-
createCachedConsistencyWithMaxAgeAndStale
public static ConsistencyMode createCachedConsistencyWithMaxAgeAndStale(Optional<Long> maxAgeInSeconds, Optional<Long> maxStaleInSeconds) Creates a cached Consistency.- Parameters:
maxAgeInSeconds- Optional duration in seconds after which data is considered too oldmaxStaleInSeconds- Optional duration for which data can be late compared to Consul Server leader.- Returns:
- a not null ConsistencyMode
- See Also:
-
name
ConsistencyMode used t be an enum, implement it.- Returns:
- the old enum name
-
toString
-
ordinal
public int ordinal() -
values
-