Class MaxForwards
- All Implemented Interfaces:
- Serializable,- Cloneable,- Header,- NameValuePair
Limit the number of times the message can be forwarded through proxies or gateways.
Example
Max-Forwards: 10
RFC2616 Specification
The Max-Forwards request-header field provides a mechanism with the TRACE (section 9.8) and OPTIONS (section 9.2) methods to limit the number of proxies or gateways that can forward the request to the next inbound server. This can be useful when the client is attempting to trace a request chain which appears to be failing or looping in mid-chain.Max-Forwards = "Max-Forwards" ":" 1*DIGIT
The Max-Forwards value is a decimal integer indicating the remaining number of times this request message may be forwarded.
Each proxy or gateway recipient of a TRACE or OPTIONS request containing a Max-Forwards header field MUST check and update its value prior to forwarding the request. If the received value is zero (0), the recipient MUST NOT forward the request; instead, it MUST respond as the final recipient. If the received Max-Forwards value is greater than zero, then the forwarded message MUST contain an updated Max-Forwards field with a value decremented by one (1).
The Max-Forwards header field MAY be ignored for all other methods defined by this specification and for any extension methods for which it is not explicitly referred to as part of that method definition.
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionMaxForwards(Integer value) Constructor.MaxForwards(String value) Constructor.MaxForwards(Supplier<Integer> value) Constructor with delayed value.
- 
Method SummaryModifier and TypeMethodDescriptionstatic MaxForwardsStatic creator.static MaxForwardsStatic creator.static MaxForwardsStatic creator with delayed value.Methods inherited from class org.apache.juneau.http.header.BasicIntegerHeaderasInteger, assertInteger, getValue, of, of, of, orElse, toIntegerMethods inherited from class org.apache.juneau.http.header.BasicHeaderassertName, assertStringValue, asString, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, of, orElse, toString
- 
Constructor Details- 
MaxForwardsConstructor.- Parameters:
- value- The header value.
 Must be parsable using- Integer.parseInt(String).
 Can be- null .
 
- 
MaxForwardsConstructor.- Parameters:
- value- The header value.
 Can be- null .
 
- 
MaxForwardsConstructor with delayed value.Header value is re-evaluated on each call to BasicIntegerHeader.getValue().- Parameters:
- value- The supplier of the header value.
 Can be- null .
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- value- The header value.
 Must be parsable using- Integer.parseInt(String).
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
 
- 
ofStatic creator.- Parameters:
- value- The header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
 
- 
ofStatic creator with delayed value.Header value is re-evaluated on each call to BasicIntegerHeader.getValue().- Parameters:
- value- The supplier of the header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
 
 
-