Package org.forgerock.json.resource
Class AdviceWarning
java.lang.Object
org.forgerock.json.resource.AdviceWarning
WarningHeader implements RFC 2616 section 14.46 - Warning.
It implements Advice, which allows it to be used during the routing of CREST requests
such that it can be added into the response in an appropriate location.
- Since:
- 2.4.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
112 Disconnected operation SHOULD be included if the cache is intentionally disconnected from the rest of the network for a period of time.static final int
113 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 int
299 Miscellaneous persistent warning The warning text MAY include arbitrary information to be presented to a human user, or logged.static final int
199 Miscellaneous warning The warning text MAY include arbitrary information to be presented to a human user, or logged.static final int
100 Indicates that there is data missing from the request.static final int
110 Response is stale MUST be included whenever the returned response is stale.static final int
111 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 int
214 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. -
Method Summary
Modifier and TypeMethodDescriptionstatic AdviceWarning
getNotPresent
(String agentName, String missingKey) Convenience method to quickly generate frequently-used error type: 100.static AdviceWarning
newAdviceWarning
(String agentName, String fmt, Object... args) Generate a warning using the builder provided.toString()
-
Field Details
-
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:
-
-
Method Details
-
toString
-
getNotPresent
Convenience method to quickly generate frequently-used error type: 100.- Parameters:
agentName
- Name of the component responsible for issuing the warning.missingKey
- Name of the missing key which must be included.- Returns:
- a newly constructed AdviceWarning indicating the expected key was not found in the request.
-
newAdviceWarning
Generate a warning using the builder provided.- Parameters:
agentName
- the agent namefmt
- 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 built WarningHeader object
-