Merge "sonar critical for errorhandling"
authorvarun gudisena <vg411h@att.com>
Mon, 9 Apr 2018 23:33:03 +0000 (23:33 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 9 Apr 2018 23:33:03 +0000 (23:33 +0000)
pom.xml
src/main/java/com/att/nsa/cambria/metrics/publisher/impl/DMaaPCambriaSimplerBatchPublisher.java
src/main/java/com/att/nsa/cambria/security/DMaaPAAFAuthenticatorImpl.java
src/main/java/com/att/nsa/cambria/security/DMaaPAuthenticatorImpl.java
src/main/java/com/att/nsa/cambria/service/impl/EventsServiceImpl.java
src/main/java/com/att/nsa/cambria/service/impl/TopicServiceImpl.java
version.properties

diff --git a/pom.xml b/pom.xml
index f405389..f5aa22a 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.onap.dmaap.messagerouter.msgrtr</groupId>
        <artifactId>msgrtr</artifactId>
-       <version>1.1.2-SNAPSHOT</version>
+       <version>1.1.3-SNAPSHOT</version>
        <packaging>jar</packaging>
        <name>dmaap-messagerouter-msgrtr</name>
        <description>Message Router - Restful interface built for kafka</description>
        </parent>
 
        <properties>
-               <spring.version>3.2.15.RELEASE</spring.version>
+               <spring.version>3.2.18.RELEASE</spring.version>
                <cxf.version>3.0.4</cxf.version>
                <jstl.version>1.2</jstl.version>
                <maven.compiler.target>1.7</maven.compiler.target>
                <maven.compiler.source>1.7</maven.compiler.source>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+               
 
                <!-- SONAR -->
                <jacoco.version>0.7.7.201606060606</jacoco.version>
        </developers>
 
        <dependencies>
+           <dependency>
+                       <groupId>org.apache.tomcat</groupId>
+                       <artifactId>tomcat-catalina</artifactId>
+                       <version>8.0.49</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.tomcat</groupId>
+                       <artifactId>tomcat-util</artifactId>
+                       <version>8.0.49</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.tomcat.embed</groupId>
+                       <artifactId>tomcat-embed-core</artifactId>
+                       <version>8.0.49</version>
+               </dependency>
                <dependency>
                        <groupId>commons-collections</groupId>
                        <artifactId>commons-collections</artifactId>
                <dependency>
                        <groupId>org.grails</groupId>
                        <artifactId>grails-web</artifactId>
-                       <version>2.4.4</version>
+                       <version>2.5.4</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>org.grails</groupId>
                 <dependency>
       <groupId>org.grails</groupId>
       <artifactId>grails-bootstrap</artifactId>
-      <version>2.5.3</version>
+      <version>2.5.4</version>
       <scope>compile</scope>
       <exclusions>
         <exclusion>
                <dependency>
                        <groupId>org.apache.zookeeper</groupId>
                        <artifactId>zookeeper</artifactId>
-                       <version>3.4.6</version>
+                       <version>3.4.10</version>
                </dependency>
 
                <!-- JSON libraries -->
index 052cc78..d7e6816 100644 (file)
@@ -190,7 +190,8 @@ public class DMaaPCambriaSimplerBatchPublisher extends CambriaBaseClient
                                                + "Consider using CambriaBatchingPublisher.close( long timeout, TimeUnit timeoutUnits ) to recapture unsent messages on close.");
                        }
                } catch (InterruptedException e) {
-                       getLog().warn("Possible message loss. " + e.getMessage(), e);
+                       getLog().info(" Interruption Exception is caught here : " + e.getMessage());
+                       Thread.currentThread().interrupt();
                } catch (IOException e) {
                        getLog().warn("Possible message loss. " + e.getMessage(), e);
                }
index 97ca1fd..6f4d9c9 100644 (file)
@@ -62,7 +62,7 @@ public class DMaaPAAFAuthenticatorImpl implements DMaaPAAFAuthenticator {
                
                String permission = "";
                String nameSpace ="";
-               if(topicName.contains(".") && (topicName.contains("com.att")||topicName.contains("org"))) {
+               if(topicName.contains(".") && (topicName.contains("com.onap")||topicName.contains("org"))) {
                        //String topic = topicName.substring(topicName.lastIndexOf(".")+1);
                        nameSpace = topicName.substring(0,topicName.lastIndexOf("."));
                }
@@ -70,7 +70,7 @@ public class DMaaPAAFAuthenticatorImpl implements DMaaPAAFAuthenticator {
                        nameSpace = null;
                         nameSpace= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"defaultNSforUEB");
                        
-                       if(null==nameSpace)nameSpace="com.att.dmaap.mr.ueb";
+                       if(null==nameSpace)nameSpace="com.onap.dmaap.mr.ueb";
                        
                        
                        /*ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_FORBIDDEN,
index 709d035..733daf7 100644 (file)
@@ -48,7 +48,7 @@ public class DMaaPAuthenticatorImpl<K extends NsaApiKey> implements DMaaPAuthent
        // Setting timeout to a large value for testing purpose.
        // private static final long kDefaultRequestTimeWindow = 1000 * 60 * 10; //
        // 10 minutes
-       private static final long kDefaultRequestTimeWindow = 1000 * 60 * 10 * 10 * 10 * 10 * 10;
+       private static final long kDefaultRequestTimeWindow = (long)1000 * 60 * 10 * 10 * 10 * 10 * 10;
 
        /**
         * Construct the security manager against an API key database
index 2d05d3d..bb2effd 100644 (file)
@@ -436,7 +436,7 @@ public class EventsServiceImpl implements EventsService {
                final long startMs = System.currentTimeMillis();
                long count = 0;
                
-               long maxEventBatch=1024 * 16;
+               long maxEventBatch=(long)1024 * 16;
                String batchlen = AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,BATCH_LENGTH);
                if(null!=batchlen)maxEventBatch=Long.parseLong(batchlen);
                
index a9c1882..f539199 100644 (file)
@@ -224,8 +224,7 @@ public class TopicServiceImpl implements TopicService {
                        throw new DMaaPAccessDeniedException(errRes);
                }*/
                
-               if (user == null &&  (null!=dmaapContext.getRequest().getHeader("Authorization") ||
-                                        null != dmaapContext.getRequest().getHeader("cookie"))) {
+               if (user == null &&  (null!=dmaapContext.getRequest().getHeader("Authorization"))) {
                        //if (user == null && (null!=dmaapContext.getRequest().getHeader("Authorization") || null != dmaapContext.getRequest().getHeader("cookie"))) {
                         // ACL authentication is not provided so we will use the aaf authentication
                        LOGGER.info("Authorization the topic");
index ac02ac5..05dc9e5 100644 (file)
@@ -27,7 +27,7 @@
 
 major=1
 minor=1
-patch=2
+patch=3
 
 base_version=${major}.${minor}.${patch}