Package io.milton.http
Class LockTimeout
java.lang.Object
io.milton.http.LockTimeout
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LockTimeout.DateAndSecondsaddSeconds(Long l) getLockedUntil(Long defaultSeconds, Long maxSeconds) Returns a current object which holds the expected end date/time, based on defaultSeconds and maxSeconds, as well as the actual seconds used in that calculation.Long[]static LockTimeoutparseTimeout(Request request) static LockTimeouttoString()
-
Constructor Details
-
LockTimeout
- Parameters:
timeout- - duration that the lock will live for, in seconds
-
-
Method Details
-
parseTimeout
-
parseTimeout
-
getSeconds
- Returns:
- - the preferred timeout. Infinite is represents as Long.MAX_VALUE. Maybe null if no timeout provided
-
getOtherSeconds
- Returns:
- - an array of less preferred timeouts
-
toString
-
getLockedUntil
Returns a current object which holds the expected end date/time, based on defaultSeconds and maxSeconds, as well as the actual seconds used in that calculation. This is handy for locking because we generally want to lock a resource until a specific date/time, but we also want to report back the timeout actually locked in terms of seconds- Returns:
- - the current time + getSeconds()
-
addSeconds
-