From 4db8e80971cba267628c6b642aed902eabbde5d8 Mon Sep 17 00:00:00 2001 From: VENKATESH KUMAR Date: Wed, 28 Feb 2018 14:12:50 -0500 Subject: fix CLM issue + logging updates Change-Id: I73a1fdd0dc0624332fc799761e8681af7f19dd3c Signed-off-by: VENKATESH KUMAR Issue-ID: DCAEGEN2-360 --- pom.xml | 59 +++++++++++++++------- .../onap/dcae/commonFunction/CommonStartup.java | 9 ++-- .../onap/dcae/restapi/endpoints/EventReceipt.java | 5 +- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index a65f0f80..7d5746b7 100644 --- a/pom.xml +++ b/pom.xml @@ -22,10 +22,10 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. 4.0.0 - org.onap.oparent - oparent - 0.1.1 - + org.onap.oparent + oparent + 0.1.1 + org.onap.dcaegen2.collectors.ves VESCollector @@ -81,10 +81,16 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. 1.1.1 + + com.google.guava + guava + 18.0 + + com.github.fge json-schema-validator - 2.0.1 + 2.2.6 @@ -122,6 +128,9 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. 20160810 + + + commons-configuration commons-configuration @@ -273,7 +282,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. maven-jar-plugin - + org.apache.maven.plugins maven-source-plugin @@ -308,18 +317,18 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. - install script - install - - exec - - - - __ - install - - - + install script + install + + exec + + + + __ + install + + + @@ -364,5 +373,19 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. + + + + com.github.fge + json-schema-core + 1.2.5 + + + javax.mail + mail + 1.4.7 + + + diff --git a/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java b/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java index 6b5502f7..83c81722 100644 --- a/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java +++ b/src/main/java/org/onap/dcae/commonFunction/CommonStartup.java @@ -34,12 +34,13 @@ import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException; import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonNode; -import com.github.fge.jsonschema.exceptions.ProcessingException; +import com.github.fge.jackson.JsonLoader; +import com.github.fge.jsonschema.core.exceptions.ProcessingException; +import com.github.fge.jsonschema.core.report.ProcessingMessage; +import com.github.fge.jsonschema.core.report.ProcessingReport; import com.github.fge.jsonschema.main.JsonSchema; import com.github.fge.jsonschema.main.JsonSchemaFactory; -import com.github.fge.jsonschema.report.ProcessingMessage; -import com.github.fge.jsonschema.report.ProcessingReport; -import com.github.fge.jsonschema.util.JsonLoader; + import org.apache.catalina.LifecycleException; import org.json.JSONArray; import org.json.JSONException; diff --git a/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java b/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java index 204e5058..f5a5e6d8 100644 --- a/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java +++ b/src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java @@ -113,7 +113,8 @@ public class EventReceipt extends NsaBaseEndpoint { retkey = NsaBaseEndpoint.getAuthenticatedUser(ctx); } } catch (NullPointerException x) { - log.info("Invalid user request " + userId + ctx.request().getContentType() + MESSAGE + jsonObject); + //log.info("Invalid user request :" + userId + " FROM " + ctx.request().getRemoteAddress() + " " + ctx.request().getContentType() + MESSAGE + jsonObject); + log.info(String.format("Unauthorized request %s FROM %s %s %s %s", getUser(ctx), ctx.request().getRemoteAddress(), ctx.request().getContentType(), MESSAGE, jsonObject)); CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: Unauthorized user" + userId + x); respondWithCustomMsginJson(ctx, HttpStatusCodes.k401_unauthorized, "Invalid user"); return; @@ -232,7 +233,7 @@ public class EventReceipt extends NsaBaseEndpoint { CommonStartup.handleEvents(jsonArrayMod); } else { - log.info(String.format("Unauthorized request %s%s%s%s", getUser(ctx), ctx.request().getContentType(), MESSAGE, + log.info(String.format("Unauthorized request %s FROM %s %s %s %s", getUser(ctx), ctx.request().getRemoteAddress(), ctx.request().getContentType(), MESSAGE, jsonObject)); respondWithCustomMsginJson(ctx, HttpStatusCodes.k401_unauthorized, "Unauthorized user"); ErrorStatus=true; -- cgit 1.2.3-korg