Interface ServiceWarning
- All Known Implementing Classes:
ContentWarning,IgnoredFieldsWarning,QueryParameterWarning
public interface ServiceWarning
Common contract for all structured
X-Warning entries emitted by the
resource-registry service.
Two families of warnings implement this interface:
QueryParameterWarning— produced by the HTTP/PEP layer when a request query parameter is unrecognised, inapplicable, or has been clamped to a valid range.ContentWarning— produced by the Management/backend layer when the content of the response could not be fully served as requested (e.g. a field is unavailable, a value was altered by business rules, or a collection was truncated).
The REST layer emits each warning as a separate X-Warning response header
using toHeaderValue(). Diagnostic logging uses toLogMessage().
- Author:
- Luca Frosini (ISTI - CNR)
-
Method Summary
Modifier and TypeMethodDescriptionReturns the formatted value to emit as anX-Warningresponse header.Returns a human-readable diagnostic message suitable for log output.
-
Method Details
-
toHeaderValue
String toHeaderValue()Returns the formatted value to emit as anX-Warningresponse header. The value follows the normative format defined in the API reference:<warn-code> <warn-agent> "<warn-text>".- Returns:
- the header value string, never
null
-
toLogMessage
String toLogMessage()Returns a human-readable diagnostic message suitable for log output.- Returns:
- the log message string, never
null
-