Package com.google.gerrit.server
Class DeadlineChecker
- java.lang.Object
-
- com.google.gerrit.server.DeadlineChecker
-
- All Implemented Interfaces:
com.google.gerrit.server.cancellation.RequestStateProvider
public class DeadlineChecker extends Object implements com.google.gerrit.server.cancellation.RequestStateProvider
RequestStateProvider
that checks whether a client provided deadline is exceeded.Should be registered at most once per request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DeadlineChecker.Factory
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkIfCancelled(com.google.gerrit.server.cancellation.RequestStateProvider.OnCancelled onCancelled)
static Function<Long,String>
getTimeoutFormatter(String timeoutName)
Creates a formatter that formats a timeout as<TIMEOUT_NAME>=<TIMEOUT><TIME_UNIT>
.
-
-
-
Method Detail
-
getTimeoutFormatter
public static Function<Long,String> getTimeoutFormatter(String timeoutName)
Creates a formatter that formats a timeout as<TIMEOUT_NAME>=<TIMEOUT><TIME_UNIT>
.If the timeout is 1 minute or greater, minutes is used as a time unit. Otherwise milliseconds is just as a time unit.
- Parameters:
timeoutName
- the name of the timeout
-
checkIfCancelled
public void checkIfCancelled(com.google.gerrit.server.cancellation.RequestStateProvider.OnCancelled onCancelled)
- Specified by:
checkIfCancelled
in interfacecom.google.gerrit.server.cancellation.RequestStateProvider
-
-