Package de.dlr.proseo.logging.http
Klasse ProseoHttp
java.lang.Object
de.dlr.proseo.logging.http.ProseoHttp
A utility class for creating and parsing HTTP error headers.
- Autor:
- Katharina Bassler
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateMessageFromHeaders
(org.springframework.http.HttpStatus httpStatus, org.springframework.http.HttpHeaders httpHeaders) Checks whether the error message from the "Warning" header is prosEO-compliant; if so, returns the error message from the header, otherwise generates a generic error messageorg.springframework.http.HttpHeaders
errorHeaders
(String loggedMessage) Create an HTTP "Warning" header with the given text messageextractProseoMessage
(String warningHeader) Extracts the prosEO-compliant message from the "Warning" header, if any
-
Konstruktordetails
-
ProseoHttp
- Parameter:
logger
- The calling class's loggerprefix
- A prefix indicatimg the service
-
-
Methodendetails
-
errorHeaders
Create an HTTP "Warning" header with the given text message- Parameter:
loggedMessage
- the message text- Gibt zurück:
- an HttpHeaders object with a warning message
-
extractProseoMessage
Extracts the prosEO-compliant message from the "Warning" header, if any- Parameter:
warningHeader
- the warning header to check (may be null)- Gibt zurück:
- the prosEO-compliant message, if there is one, or null otherwise
-
createMessageFromHeaders
public String createMessageFromHeaders(org.springframework.http.HttpStatus httpStatus, org.springframework.http.HttpHeaders httpHeaders) Checks whether the error message from the "Warning" header is prosEO-compliant; if so, returns the error message from the header, otherwise generates a generic error message- Parameter:
httpStatus
- the HTTP status returned by the REST callhttpHeaders
- the HTTP headers returned by the REST call- Gibt zurück:
- a formatted error message
-