Package org.forgerock.http.header
Class WarningHeader
java.lang.Object
org.forgerock.http.protocol.Header
org.forgerock.http.header.WarningHeader
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int112 Disconnected operation SHOULD be included if the cache is intentionally disconnected from the rest of the network for a period of time.static final int113 Heuristic expiration MUST be included if the cache heuristically chose a freshness lifetime greater than 24 hours and the response's age is greater than 24 hours.static final int299 Miscellaneous persistent warning The warning text MAY include arbitrary information to be presented to a human user, or logged.static final int199 Miscellaneous warning The warning text MAY include arbitrary information to be presented to a human user, or logged.static final StringThe name of this header.static final int100 Indicates that there is data missing from the request.static final int110 Response is stale MUST be included whenever the returned response is stale.static final int111 Revalidation failed MUST be included if a cache returns a stale response because an attempt to revalidate the response failed, due to an inability to reach the server.static final int214 Transformation applied MUST be added by an intermediate cache or proxy if it applies any transformation changing the content-coding (as specified in the Content-Encoding header) or media-type (as specified in the Content-Type header) of the response, or the entity-body of the response, unless this Warning code already appears in the response. -
Constructor Summary
ConstructorsConstructorDescriptionWarningHeader(List<Warning> warnings) Constructor for multipleWarnings.WarningHeader(Warning warning) Constructor for singleWarning. -
Method Summary
Modifier and TypeMethodDescriptionConstructs a new header with the warnings defined in thisWarningHeaderin addition to the provided warning.Constructs a new header with the warnings defined in thisWarningHeaderin addition to the provided warning.Constructs a new header with the warnings defined in thisWarningHeaderin addition to the provided warning.booleangetName()Returns the name of the header, as it would canonically appear within an HTTP message.Returns the header as a list of strings.Gets allWarnings.inthashCode()static WarningHeadernewWarning(String agentName, String fmt, Object... args) Constructs a new warning header with the frequently-used error type: 100.toWarnings(List<String> headers) Matches warning-headers from aListof header-values.static WarningHeaderConstructs a new header, initialized from the specified string value.static WarningHeaderConstructs a new header, initialized from the specified message.Methods inherited from class org.forgerock.http.protocol.Header
getFirstValue, toString
-
Field Details
-
NAME
The name of this header.- See Also:
-
NOT_PRESENT
public static final int NOT_PRESENT100 Indicates that there is data missing from the request.ForgeRock-Specific.
- See Also:
-
RESPONSE_STALE
public static final int RESPONSE_STALE110 Response is stale MUST be included whenever the returned response is stale.- See Also:
-
REVALIDATION_FAILED
public static final int REVALIDATION_FAILED111 Revalidation failed MUST be included if a cache returns a stale response because an attempt to revalidate the response failed, due to an inability to reach the server.- See Also:
-
DISCONNECTED_OPERATION
public static final int DISCONNECTED_OPERATION112 Disconnected operation SHOULD be included if the cache is intentionally disconnected from the rest of the network for a period of time.- See Also:
-
HEURISTIC_EXPIRATION
public static final int HEURISTIC_EXPIRATION113 Heuristic expiration MUST be included if the cache heuristically chose a freshness lifetime greater than 24 hours and the response's age is greater than 24 hours.- See Also:
-
MISCELLANEOUS_WARNING
public static final int MISCELLANEOUS_WARNING199 Miscellaneous warning The warning text MAY include arbitrary information to be presented to a human user, or logged. A system receiving this warning MUST NOT take any automated action, besides presenting the warning to the user.- See Also:
-
TRANFORMATION_APPLIED
public static final int TRANFORMATION_APPLIED214 Transformation applied MUST be added by an intermediate cache or proxy if it applies any transformation changing the content-coding (as specified in the Content-Encoding header) or media-type (as specified in the Content-Type header) of the response, or the entity-body of the response, unless this Warning code already appears in the response.- See Also:
-
MISCELLANEOUS_PERSISTENT_WARNING
public static final int MISCELLANEOUS_PERSISTENT_WARNING299 Miscellaneous persistent warning The warning text MAY include arbitrary information to be presented to a human user, or logged. A system receiving this warning MUST NOT take any automated action.- See Also:
-
-
Constructor Details
-
Method Details
-
valueOf
Constructs a new header, initialized from the specified message.- Parameters:
message- The message to initialize the header from.- Returns:
- The parsed header.
-
valueOf
Constructs a new header, initialized from the specified string value.- Parameters:
header- The value to initialize the header from.- Returns:
- The parsed header.
-
toWarnings
Matches warning-headers from aListof header-values.- Parameters:
headers- Array of header values- Returns:
- All items in
headersthat are a valid warning-header
-
newWarning
Constructs a new warning header with the frequently-used error type: 100.- Parameters:
agentName- Name of the component responsible for issuing the warning.fmt- The format, which may include embedded %s, etc.args- Zero or more args, passed into String.format to generate the warning text.- Returns:
- A newly constructed
WarningHeaderindicating the expected key was not found in the request.
-
getName
Description copied from class:HeaderReturns the name of the header, as it would canonically appear within an HTTP message. -
add
Constructs a new header with the warnings defined in thisWarningHeaderin addition to the provided warning.- Parameters:
code- The warning code.agent- Name of the component responsible for issuing the warning.text- The warning text.- Returns:
- A new
WarningHeaderinstance.
-
add
Constructs a new header with the warnings defined in thisWarningHeaderin addition to the provided warning.- Parameters:
code- The warning code.agent- Name of the component responsible for issuing the warning.text- The warning text.date- The warning date ornull.- Returns:
- A new
WarningHeaderinstance.
-
add
Constructs a new header with the warnings defined in thisWarningHeaderin addition to the provided warning.- Parameters:
warning- The warning.- Returns:
- A new
WarningHeaderinstance.
-
getWarnings
Gets allWarnings.- Returns:
- All
Warnings
-
getValues
Description copied from class:HeaderReturns the header as a list of strings. If the header has no values then it must return an empty list, never null. EachStringshould represent the value component of the key-value pair that makes up the HTTP header - as such, for someHeaderimplementations each String in thisListmay contain multiple token-separated values.The
Listreturned from this method should not be expected to be mutable. However, some subclasses ofHeadermay choose to implement it as such. -
equals
-
hashCode
public int hashCode()
-