Package org.forgerock.json.resource
Class AdviceWarning
- java.lang.Object
- 
- org.forgerock.json.resource.AdviceWarning
 
- 
 public final class AdviceWarning extends Object 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:
- http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intDISCONNECTED_OPERATION112 Disconnected operation SHOULD be included if the cache is intentionally disconnected from the rest of the network for a period of time.static intHEURISTIC_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.static intMISCELLANEOUS_PERSISTENT_WARNING299 Miscellaneous persistent warning The warning text MAY include arbitrary information to be presented to a human user, or logged.static intMISCELLANEOUS_WARNING199 Miscellaneous warning The warning text MAY include arbitrary information to be presented to a human user, or logged.static intNOT_PRESENT100 Indicates that there is data missing from the request.static intRESPONSE_STALE110 Response is stale MUST be included whenever the returned response is stale.static intREVALIDATION_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.static intTRANFORMATION_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.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AdviceWarninggetNotPresent(String agentName, String missingKey)Convenience method to quickly generate frequently-used error type: 100.static AdviceWarningnewAdviceWarning(String agentName, String fmt, Object... args)Generate a warning using the builder provided.StringtoString()
 
- 
- 
- 
Field Detail- 
NOT_PRESENTpublic static final int NOT_PRESENT 100 Indicates that there is data missing from the request. ForgeRock-Specific.- See Also:
- Constant Field Values
 
 - 
RESPONSE_STALEpublic static final int RESPONSE_STALE 110 Response is stale MUST be included whenever the returned response is stale.- See Also:
- Constant Field Values
 
 - 
REVALIDATION_FAILEDpublic static final int REVALIDATION_FAILED 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.- See Also:
- Constant Field Values
 
 - 
DISCONNECTED_OPERATIONpublic static final int DISCONNECTED_OPERATION 112 Disconnected operation SHOULD be included if the cache is intentionally disconnected from the rest of the network for a period of time.- See Also:
- Constant Field Values
 
 - 
HEURISTIC_EXPIRATIONpublic static final int HEURISTIC_EXPIRATION 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.- See Also:
- Constant Field Values
 
 - 
MISCELLANEOUS_WARNINGpublic static final int MISCELLANEOUS_WARNING 199 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:
- Constant Field Values
 
 - 
TRANFORMATION_APPLIEDpublic static final int TRANFORMATION_APPLIED 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.- See Also:
- Constant Field Values
 
 - 
MISCELLANEOUS_PERSISTENT_WARNINGpublic static final int MISCELLANEOUS_PERSISTENT_WARNING 299 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:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getNotPresentpublic static AdviceWarning getNotPresent(String agentName, String missingKey) 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.
 
 - 
newAdviceWarningpublic static AdviceWarning newAdviceWarning(String agentName, String fmt, Object... args) Generate a warning using the builder provided.- Parameters:
- agentName- the agent name
- 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 built WarningHeader object
 
 
- 
 
-