Interface MonitoredRequestErrorParser<T extends MonitoredRequestErrorModel>
-
- All Known Implementing Classes:
AbstractErrorParser,DefaultExceptionOutboundRequestErrorParser,DefaultFallbackOutboundRequestErrorParser,DefaultHttp404OutboundRequestErrorParser,JsonMonitoredRequestErrorParser,XmlMonitoredRequestErrorParser
public interface MonitoredRequestErrorParser<T extends MonitoredRequestErrorModel>A parser which extracts anMonitoredRequestErrorout of an Response.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisApplicable(java.lang.String contentType, int statusCode)Indicates whether this MonitoredRequestErrorParser is applicable to the given ResponseTparseErrorFrom(java.lang.Class<T> error, int statusCode, java.lang.String responseBody)Gets theMonitoredRequestErrorvalue from the Response
-
-
-
Method Detail
-
isApplicable
boolean isApplicable(java.lang.String contentType, int statusCode)Indicates whether this MonitoredRequestErrorParser is applicable to the given Response- Parameters:
contentType- Response content typestatusCode- response status code- Returns:
- true if can parse, otherwise false
-
parseErrorFrom
T parseErrorFrom(java.lang.Class<T> error, int statusCode, java.lang.String responseBody)
Gets theMonitoredRequestErrorvalue from the Response- Parameters:
error- class to be instantiated as errorstatusCode- response status coderesponseBody- Response body to extract the error from- Returns:
- the error to persist as part of the
MonitoredRequestErrorParser
-
-