Class RFC9457Reporter<T,E extends Exception>
java.lang.Object
org.eclipse.aether.spi.connector.transport.http.RFC9457.RFC9457Reporter<T,E>
- Type Parameters:
T
- The type of the response.E
- The base exception type to throw if the response is not a RFC9457 message.
- Direct Known Subclasses:
ApacheRFC9457Reporter
,JdkRFC9457Reporter
,JettyRFC9457Reporter
A reporter for RFC 9457 messages.
RFC 9457 is a standard for reporting problems in HTTP responses as a JSON object.
There are members specified in the RFC but none of those appear to be required,
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
generateException
(T response, BiConsumerChecked<Integer, String, E> baseException) Generates aHttpRFC9457Exception
if the response type is a RFC 9457 message.protected abstract String
protected abstract String
getReasonPhrase
(T response) protected abstract int
getStatusCode
(T response) protected boolean
hasRFC9457ContentType
(String contentType) protected abstract boolean
isRFC9457Message
(T response)
-
Constructor Details
-
RFC9457Reporter
public RFC9457Reporter()
-
-
Method Details
-
isRFC9457Message
-
getStatusCode
-
getReasonPhrase
-
getBody
- Throws:
IOException
-
hasRFC9457ContentType
-
generateException
public void generateException(T response, BiConsumerChecked<Integer, String, throws E, HttpRFC9457ExceptionE> baseException) Generates aHttpRFC9457Exception
if the response type is a RFC 9457 message. Otherwise, it throws the base exception- Parameters:
response
- The response to check for RFC 9457 messages.baseException
- The base exception to throw if the response is not a RFC 9457 message.- Throws:
E
HttpRFC9457Exception
-