fix CLM issue + logging updates 57/33457/1
authorVENKATESH KUMAR <vv770d@att.com>
Wed, 28 Feb 2018 19:12:50 +0000 (14:12 -0500)
committerVENKATESH KUMAR <vv770d@att.com>
Wed, 28 Feb 2018 19:13:14 +0000 (14:13 -0500)
Change-Id: I73a1fdd0dc0624332fc799761e8681af7f19dd3c
Signed-off-by: VENKATESH KUMAR <vv770d@att.com>
Issue-ID: DCAEGEN2-360

pom.xml
src/main/java/org/onap/dcae/commonFunction/CommonStartup.java
src/main/java/org/onap/dcae/restapi/endpoints/EventReceipt.java

diff --git a/pom.xml b/pom.xml
index a65f0f8..7d5746b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -22,10 +22,10 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
 
        <modelVersion>4.0.0</modelVersion>
        <parent>
-               <groupId>org.onap.oparent</groupId>
-               <artifactId>oparent</artifactId>
-               <version>0.1.1</version>
-               <relativePath/>
+               <groupId>org.onap.oparent</groupId>
+               <artifactId>oparent</artifactId>
+               <version>0.1.1</version>
+               <relativePath />
        </parent>
        <groupId>org.onap.dcaegen2.collectors.ves</groupId>
        <artifactId>VESCollector</artifactId>
@@ -81,10 +81,16 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
                        <version>1.1.1</version>
                </dependency>
 
+               <dependency>
+                       <groupId>com.google.guava</groupId>
+                       <artifactId>guava</artifactId>
+                       <version>18.0</version>
+               </dependency>
+
                <dependency>
                        <groupId>com.github.fge</groupId>
                        <artifactId>json-schema-validator</artifactId>
-                       <version>2.0.1</version>
+                       <version>2.2.6</version>
                </dependency>
 
                <dependency>
@@ -122,6 +128,9 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
                        <version>20160810</version>
                </dependency>
 
+       <!-- https://mvnrepository.com/artifact/com.github.fge/jackson-coreutils -->
+
+
                <dependency>
                        <groupId>commons-configuration</groupId>
                        <artifactId>commons-configuration</artifactId>
@@ -273,7 +282,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
                                <artifactId>maven-jar-plugin</artifactId>
                        </plugin>
 
-               
+
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-source-plugin</artifactId>
@@ -308,18 +317,18 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
                                                </configuration>
                                        </execution>
                                        <execution>
-                                                <id>install script</id>
-                                                <phase>install</phase>
-                                                <goals>
-                                                        <goal>exec</goal>
-                                                </goals>
-                                                <configuration>
-                                                        <arguments>
-                                                                <argument>__</argument>
-                                                                <argument>install</argument>
-                                                        </arguments>
-                                                </configuration>
-                                        </execution>
+                                               <id>install script</id>
+                                               <phase>install</phase>
+                                               <goals>
+                                                       <goal>exec</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <arguments>
+                                                               <argument>__</argument>
+                                                               <argument>install</argument>
+                                                       </arguments>
+                                               </configuration>
+                                       </execution>
                                </executions>
                        </plugin>
 
@@ -364,5 +373,19 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
        </reporting>
 
 
+       <dependencyManagement>
+               <dependencies>
+                       <dependency>
+                               <groupId>com.github.fge</groupId>
+                               <artifactId>json-schema-core</artifactId>
+                               <version>1.2.5</version>
+                       </dependency>
+                       <dependency>
+                               <groupId>javax.mail</groupId>
+                               <artifactId>mail</artifactId>
+                               <version>1.4.7</version>
+                       </dependency>
+               </dependencies>
+       </dependencyManagement>
 </project>
 
index 6b5502f..83c8172 100644 (file)
@@ -34,12 +34,13 @@ import com.att.nsa.drumlin.till.nv.rrNvReadable.loadException;
 import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting;\r
 import com.fasterxml.jackson.core.JsonParseException;\r
 import com.fasterxml.jackson.databind.JsonNode;\r
-import com.github.fge.jsonschema.exceptions.ProcessingException;\r
+import com.github.fge.jackson.JsonLoader;\r
+import com.github.fge.jsonschema.core.exceptions.ProcessingException;\r
+import com.github.fge.jsonschema.core.report.ProcessingMessage;\r
+import com.github.fge.jsonschema.core.report.ProcessingReport;\r
 import com.github.fge.jsonschema.main.JsonSchema;\r
 import com.github.fge.jsonschema.main.JsonSchemaFactory;\r
-import com.github.fge.jsonschema.report.ProcessingMessage;\r
-import com.github.fge.jsonschema.report.ProcessingReport;\r
-import com.github.fge.jsonschema.util.JsonLoader;\r
+\r
 import org.apache.catalina.LifecycleException;\r
 import org.json.JSONArray;\r
 import org.json.JSONException;\r
index 204e505..f5a5e6d 100644 (file)
@@ -113,7 +113,8 @@ public class EventReceipt extends NsaBaseEndpoint {
                                        retkey = NsaBaseEndpoint.getAuthenticatedUser(ctx);\r
                                }\r
                        } catch (NullPointerException x) {\r
-                               log.info("Invalid user request " + userId + ctx.request().getContentType() + MESSAGE + jsonObject);\r
+                               //log.info("Invalid user request :" + userId + " FROM " + ctx.request().getRemoteAddress() + " " +  ctx.request().getContentType() + MESSAGE + jsonObject);\r
+                               log.info(String.format("Unauthorized request %s FROM %s %s %s %s", getUser(ctx), ctx.request().getRemoteAddress(), ctx.request().getContentType(), MESSAGE,     jsonObject));\r
                                CommonStartup.eplog.info("EVENT_RECEIPT_FAILURE: Unauthorized user" + userId +  x);\r
                                respondWithCustomMsginJson(ctx, HttpStatusCodes.k401_unauthorized, "Invalid user");\r
                                return;\r
@@ -232,7 +233,7 @@ public class EventReceipt extends NsaBaseEndpoint {
 \r
                        CommonStartup.handleEvents(jsonArrayMod);\r
                } else {\r
-                       log.info(String.format("Unauthorized request %s%s%s%s", getUser(ctx), ctx.request().getContentType(), MESSAGE,\r
+                       log.info(String.format("Unauthorized request %s FROM %s %s %s %s", getUser(ctx), ctx.request().getRemoteAddress(), ctx.request().getContentType(), MESSAGE,\r
                                        jsonObject));\r
                        respondWithCustomMsginJson(ctx, HttpStatusCodes.k401_unauthorized, "Unauthorized user");\r
                        ErrorStatus=true;\r