Package software.amazon.nio.spi.s3.util
Class TimeOutUtils
- java.lang.Object
-
- software.amazon.nio.spi.s3.util.TimeOutUtils
-
public class TimeOutUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static longTIMEOUT_TIME_LENGTH_1static longTIMEOUT_TIME_LENGTH_3static longTIMEOUT_TIME_LENGTH_5
-
Constructor Summary
Constructors Constructor Description TimeOutUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcreateAndLogTimeOutMessage(org.slf4j.Logger logger, java.lang.String operationName, long length, java.util.concurrent.TimeUnit unit)Creates a time-out message and logs the same to theloggerstatic java.lang.StringcreateTimeOutMessage(java.lang.String operationName, long length, java.util.concurrent.TimeUnit unit)Generate a time-out message string.static java.lang.RuntimeExceptionlogAndGenerateExceptionOnTimeOut(org.slf4j.Logger logger, java.lang.String operationName, long length, java.util.concurrent.TimeUnit unit)Generate a RuntimeException representing the time-out and log the message containerd in the exception
-
-
-
Field Detail
-
TIMEOUT_TIME_LENGTH_1
public static final long TIMEOUT_TIME_LENGTH_1
- See Also:
- Constant Field Values
-
TIMEOUT_TIME_LENGTH_3
public static long TIMEOUT_TIME_LENGTH_3
-
TIMEOUT_TIME_LENGTH_5
public static final long TIMEOUT_TIME_LENGTH_5
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTimeOutMessage
public static java.lang.String createTimeOutMessage(java.lang.String operationName, long length, java.util.concurrent.TimeUnit unit)Generate a time-out message string.- Parameters:
operationName- the name of the operation that timed outlength- the length of timeunit- the unit of time- Returns:
- the message
-
createAndLogTimeOutMessage
public static java.lang.String createAndLogTimeOutMessage(org.slf4j.Logger logger, java.lang.String operationName, long length, java.util.concurrent.TimeUnit unit)Creates a time-out message and logs the same to thelogger- Parameters:
logger- to which the message is loggedoperationName- the name of the operation that timed outlength- the length of timeunit- the unit of time- Returns:
- the message logged
-
logAndGenerateExceptionOnTimeOut
public static java.lang.RuntimeException logAndGenerateExceptionOnTimeOut(org.slf4j.Logger logger, java.lang.String operationName, long length, java.util.concurrent.TimeUnit unit)Generate a RuntimeException representing the time-out and log the message containerd in the exception- Parameters:
logger- to which the message is loggedoperationName- the name of the operation that timed outlength- the length of timeunit- the unit of time- Returns:
- the exception generated, ready to throw.
-
-