public class DefaultValidationReportHandler extends Object implements ValidationReportHandler
ValidationReportHandler. It logs request/response
validation findings to project logger. In case of:
InvalidRequestException for request
or InvalidResponseException for response and write messages
to log.errorValidationReportFormat and inject it to constructor.| Constructor and Description |
|---|
DefaultValidationReportHandler() |
DefaultValidationReportHandler(ValidationReportFormat validationReportFormat) |
| Modifier and Type | Method and Description |
|---|---|
protected RuntimeException |
createValidationException(ValidationReport validationReport,
ValidationReport.MessageContext.Location location) |
void |
handleRequestReport(String loggingKey,
ValidationReport validationReport)
Method which gives you way how to override logging of request validation issues.
|
void |
handleResponseReport(String loggingKey,
ValidationReport validationReport)
Method which gives you way how to override logging of response validation issues.
|
protected void |
logApiValidation(BiConsumer<String,String[]> logConsumer,
ValidationReport.MessageContext.Location location,
String loggingKey,
Set<ValidationReport.Level> validationLevels,
String message) |
protected void |
processApiValidationReport(ValidationReport.MessageContext.Location location,
String loggingKey,
ValidationReport validationReport) |
public DefaultValidationReportHandler()
public DefaultValidationReportHandler(@Nonnull ValidationReportFormat validationReportFormat)
public void handleRequestReport(String loggingKey, ValidationReport validationReport)
ValidationReportHandlerhandleRequestReport in interface ValidationReportHandlerloggingKey - request identifier - method and request pathvalidationReport - result of validationpublic void handleResponseReport(String loggingKey, ValidationReport validationReport)
ValidationReportHandlerhandleResponseReport in interface ValidationReportHandlerloggingKey - request identifier - method and request pathvalidationReport - result of validationprotected void processApiValidationReport(ValidationReport.MessageContext.Location location, String loggingKey, ValidationReport validationReport)
protected void logApiValidation(BiConsumer<String,String[]> logConsumer, ValidationReport.MessageContext.Location location, String loggingKey, Set<ValidationReport.Level> validationLevels, String message)
protected RuntimeException createValidationException(ValidationReport validationReport, ValidationReport.MessageContext.Location location)
Copyright © 2016–2019 Atlassian. All rights reserved.