From a0ba464faeb2e979d20758bc1091143108355974 Mon Sep 17 00:00:00 2001 From: Michal Banka Date: Tue, 4 Aug 2020 14:58:25 +0200 Subject: Add implementation of stndDefined fields validation Added implementation of stndDefined fields from incoming events. Validation is performed using external-schema-manager tool from DCAE SDK. StndDefined fields schemas are stored in etc/externalRepo directory. Additional stndDefined related properties has been added to collector.properties. VES version has been set to 1.7.3. Issue-ID: DCAEGEN2-2254 Signed-off-by: Edyta Krukowska Signed-off-by: Michal Banka Change-Id: Iedaa3622b1d527f6794822c8867b9dfd1860bb8f --- src/main/java/org/onap/dcae/restapi/ApiException.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/onap/dcae/restapi/ApiException.java') diff --git a/src/main/java/org/onap/dcae/restapi/ApiException.java b/src/main/java/org/onap/dcae/restapi/ApiException.java index 9ea02076..dbd41a4d 100644 --- a/src/main/java/org/onap/dcae/restapi/ApiException.java +++ b/src/main/java/org/onap/dcae/restapi/ApiException.java @@ -37,7 +37,11 @@ public enum ApiException { INVALID_CUSTOM_HEADER(ExceptionType.SERVICE_EXCEPTION, "SVC0002", "Bad Parameter (Incorrect request api version)", 400), MISSING_NAMESPACE_PARAMETER(ExceptionType.SERVICE_EXCEPTION, "SVC2006", "Mandatory input %1 %2 is missing from request", List.of("attribute", "event.commonEventHeader.stndDefinedNamespace"), 400), EMPTY_NAMESPACE_PARAMETER(ExceptionType.SERVICE_EXCEPTION, "SVC2006", "Mandatory input %1 %2 is empty in request", List.of("attribute", "event.commonEventHeader.stndDefinedNamespace"), 400), - NO_SERVER_RESOURCES(ExceptionType.SERVICE_EXCEPTION, "SVC1000", "No server resources (internal processing queue full)", 503); + NO_SERVER_RESOURCES(ExceptionType.SERVICE_EXCEPTION, "SVC1000", "No server resources (internal processing queue full)", 503), + STND_DEFINED_VALIDATION_FAILED(ExceptionType.SERVICE_EXCEPTION, "SVC2000", "The following service error occurred: %1. Error code is %2", List.of("event.stndDefinedFields.data invalid against event.stndDefinedFields.schemaReference", "400"), 400), + NO_LOCAL_SCHEMA_REFERENCE(ExceptionType.SERVICE_EXCEPTION, "SVC2004", "Invalid input value for %1 %2: %3", List.of("attribute", "event.stndDefinedFields.schemaReference", "Referred external schema not present in schema repository"), 400), + INCORRECT_INTERNAL_FILE_REFERENCE(ExceptionType.SERVICE_EXCEPTION, "SVC2000", "The following service error occurred: %1. Error code is %2", List.of("event.stndDefinedFields.schemaReference value does not correspond to any external event schema file in externalSchema repo", "400"), 400); + public final int httpStatusCode; private final ExceptionType type; -- cgit 1.2.3-korg