diff options
author | Michal Banka <michal.banka@nokia.com> | 2020-08-04 14:58:25 +0200 |
---|---|---|
committer | Edyta Krukowska <edyta.krukowska@nokia.com> | 2020-08-19 15:07:14 +0200 |
commit | a0ba464faeb2e979d20758bc1091143108355974 (patch) | |
tree | 944b0f588daace51449b50ae94816f33a6a3c62d /src/main/java/org/onap/dcae/ApplicationSettings.java | |
parent | f1ea637a60bace906db5619d71a914ad601e9478 (diff) |
Add implementation of stndDefined fields validation1.7.3
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 <edyta.krukowska@nokia.com>
Signed-off-by: Michal Banka <michal.banka@nokia.com>
Change-Id: Iedaa3622b1d527f6794822c8867b9dfd1860bb8f
Diffstat (limited to 'src/main/java/org/onap/dcae/ApplicationSettings.java')
-rw-r--r-- | src/main/java/org/onap/dcae/ApplicationSettings.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/main/java/org/onap/dcae/ApplicationSettings.java b/src/main/java/org/onap/dcae/ApplicationSettings.java index 33ad5bc7..7d5c7db2 100644 --- a/src/main/java/org/onap/dcae/ApplicationSettings.java +++ b/src/main/java/org/onap/dcae/ApplicationSettings.java @@ -55,6 +55,8 @@ public class ApplicationSettings { private static final Logger log = LoggerFactory.getLogger(ApplicationSettings.class); private static final String FALLBACK_VES_VERSION = "v5"; + private static final int DISABLED = -1; + private static final int ENABLED = 1; private final String appInvocationDir; private final String configurationFileLocation; private final PropertiesConfiguration properties = new PropertiesConfiguration(); @@ -96,7 +98,7 @@ public class ApplicationSettings { } public boolean eventSchemaValidationEnabled() { - return properties.getInt("collector.schema.checkflag", -1) > 0; + return properties.getInt("collector.schema.checkflag", DISABLED) > 0; } public JsonSchema jsonSchema(String version) { @@ -126,7 +128,7 @@ public class ApplicationSettings { } public boolean eventTransformingEnabled() { - return properties.getInt("event.transform.flag", 1) > 0; + return properties.getInt("event.transform.flag", ENABLED) > 0; } public String keystorePasswordFileLocation() { @@ -170,6 +172,26 @@ public class ApplicationSettings { } } + public boolean getExternalSchemaValidationCheckflag() { + return properties.getInt("collector.externalSchema.checkflag", DISABLED) > 0; + } + + public String getExternalSchemaSchemasLocation() { + return properties.getString("collector.externalSchema.schemasLocation", "./etc/externalRepo"); + } + + public String getExternalSchemaMappingFileLocation() { + return properties.getString("collector.externalSchema.mappingFileLocation", "./etc/externalRepo/schema-map.json"); + } + + public String getExternalSchemaSchemaRefPath() { + return properties.getString("event.externalSchema.schemaRefPath", "/event/stndDefinedFields/schemaReference"); + } + + public String getExternalSchemaStndDefinedDataPath() { + return properties.getString("event.externalSchema.stndDefinedDataPath", "/event/stndDefinedFields/data"); + } + public List<EventTransformation> getEventTransformations() { return eventTransformations; } |