@Header(value="Retry-After") public class RetryAfter extends BasicDateHeader
If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date.
Retry-After: 120 Retry-After: Fri, 07 Nov 2014 23:59:59 GMT
Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds )
Two examples of its use are
Retry-After: Fri, 31 Dec 1999 23:59:59 GMT Retry-After: 120
In the latter example, the delay is 2 minutes.
Constructor and Description |
---|
RetryAfter(Object value)
Constructor.
|
RetryAfter(String value)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
asInt()
Returns this header value as an integer.
|
String |
getValue() |
static RetryAfter |
of(Object value)
Convenience creator.
|
static RetryAfter |
of(Supplier<?> value)
Convenience creator using supplier.
|
asCalendar, asDate, assertZonedDateTime, asZonedDateTime, of, of
assertName, assertValue, canCast, cast, eqIC, equals, getElements, getName, getRawValue, hashCode, isSupplier, of, ofPair, toString, unwrap
public RetryAfter(Object value)
value
- The header value.
String
ZonedDateTime
Calendar
Number
Supplier
of anything on this list.
public RetryAfter(String value)
value
- The header value.public static RetryAfter of(Object value)
value
- The header value.
String
RetryAfter
object.public static RetryAfter of(Supplier<?> value)
Header value is re-evaluated on each call to getValue()
.
value
- The header value supplier.
String
RetryAfter
object.public String getValue()
getValue
in interface NameValuePair
getValue
in class BasicDateHeader
public int asInt()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.