com.kakawait.spring.response.warning.WarnCode Maven / Gradle / Ivy
package com.kakawait.spring.response.warning;
/**
* Warn codes define by iana
*
* @author Thibaud Leprêtre
*/
public enum WarnCode {
/**
*
* A cache SHOULD generate this whenever the sent response is stale
*
*
*
* RFC7234 - Warning: 110 - "Response is Stale"
*
*
*/
RESPONSE_IS_STALE(110),
/**
*
* A cache SHOULD generate this when sending a stale response because an attempt to validate the response failed,
* due to an inability to reach the server.
*
*
*
* RFC7234 - Warning: 111 - "Revalidation Failed"
*
*
*/
REVALIDATION_FAILED(111),
/**
*
* A cache SHOULD generate this if it is intentionally disconnected from the rest of the network
* for a period of time.
*
*
*
* RFC7234 - Warning: 112 - "Disconnected Operation"
*
*
*/
DISCONNECTED_OPERATION(112),
/**
*
* A cache SHOULD generate this if it heuristically chose a freshness lifetime greater than 24 hours
* and the response's age is greater than 24 hours.
*
*
*
* RFC7234 - Warning: 113 - "Heuristic Expiration"
*
*
*/
HEURISTIC_EXPIRATION(113),
/**
*
* The warning text can 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.
*
*
*
* RFC7234 - Warning: 199 - "Miscellaneous Warning"
*
*
*/
MISCELLANEOUS_WARNING(199),
/**
*
* This Warning code MUST be added by a proxy if it applies any transformation to the representation,
* such as changing the content-coding, media-type, or modifying the representation data,
* unless this Warning code already appears in the response.
*
*
*
* RFC7234 - Warning: 214 - "Transformation Applied"
*
*
*/
TRANSFORMATION_APPLIED(214),
/**
*
* The warning text can include arbitrary information to be presented to a human user or logged.
* A system receiving this warning MUST NOT take any automated action.
*
*
*
* RFC7234 - Warning: 299 - "Miscellaneous Persistent Warning"
*
*
*/
MISCELLANEOUS_PERSISTENT_WARNING(299);
private final int code;
WarnCode(int code) {
this.code = code;
}
public int getCode() {
return code;
}
public int getFamily() {
return code / 100;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy