Merge "Catch IllegalArgumentException for error message"
authorSteven Blimkie <Steven.Blimkie@amdocs.com>
Wed, 28 Mar 2018 14:14:51 +0000 (14:14 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 28 Mar 2018 14:14:51 +0000 (14:14 +0000)
1  2 
champ-lib/pom.xml
champ-service/pom.xml
champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java

diff --combined champ-lib/pom.xml
@@@ -1,23 -1,3 +1,23 @@@
 +<!--
 +============LICENSE_START=======================================================
 +org.onap.aai
 +================================================================================
 +Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
 +Copyright © 2017-2018 Amdocs
 +================================================================================
 +Licensed under the Apache License, Version 2.0 (the "License");
 +you may not use this file except in compliance with the License.
 +You may obtain a copy of the License at
 +
 +      http://www.apache.org/licenses/LICENSE-2.0
 +
 +Unless required by applicable law or agreed to in writing, software
 +distributed under the License is distributed on an "AS IS" BASIS,
 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +See the License for the specific language governing permissions and
 +limitations under the License.
 +============LICENSE_END=========================================================
 +-->
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <packaging>pom</packaging>
      <version>1.2.0-SNAPSHOT</version>
  
 +    <parent>
 +        <groupId>org.onap.aai</groupId>
 +        <artifactId>champ</artifactId>
 +        <version>1.2.0-SNAPSHOT</version>
 +    </parent>
 +
      <modules>
          <module>champ-core</module>
          <module>champ-titan</module>
@@@ -41,7 -15,7 +41,7 @@@
  
      <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-         <event.client.version>1.2.0</event.client.version>
+         <event.client.version>1.2.1</event.client.version>
  
          <!--<absoluteDistFilesRoot>/appl/${project.artifactId}</absoluteDistFilesRoot>-->
  
  
      <dependencyManagement>
          <dependencies>
 -        <dependency>
 -            <groupId>org.onap.aai.event-client</groupId>
 -            <artifactId>event-client-api</artifactId>
 -            <version>${event.client.version}</version>
 -        </dependency>
 -        <dependency>
 -            <groupId>org.onap.aai.event-client</groupId>
 -            <artifactId>event-client-dmaap</artifactId>
 -            <version>${event.client.version}</version>
 -        </dependency>
 -        <dependency>
 -            <groupId>org.onap.aai.event-client</groupId>
 -            <artifactId>event-client-kafka</artifactId>
 -            <version>${event.client.version}</version>
 -        </dependency>
 +            <dependency>
 +                <groupId>org.onap.aai.event-client</groupId>
 +                <artifactId>event-client-api</artifactId>
 +                <version>${event.client.version}</version>
 +            </dependency>
 +            <dependency>
 +                <groupId>org.onap.aai.event-client</groupId>
 +                <artifactId>event-client-dmaap</artifactId>
 +                <version>${event.client.version}</version>
 +            </dependency>
 +            <dependency>
 +                <groupId>org.onap.aai.event-client</groupId>
 +                <artifactId>event-client-kafka</artifactId>
 +                <version>${event.client.version}</version>
 +            </dependency>
          </dependencies>
      </dependencyManagement>
  
                      </systemPropertyVariables>
                  </configuration>
              </plugin>
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-deploy-plugin</artifactId>
 +                <configuration>
 +                    <skip>true</skip>
 +                </configuration>
 +            </plugin>
 +            <!--
              <plugin>
                  <groupId>com.mycila</groupId>
                  <artifactId>license-maven-plugin</artifactId>
                      </execution>
                  </executions>
              </plugin>
 +            -->
          </plugins>
      </build>
  </project>
diff --combined champ-service/pom.xml
@@@ -1,23 -1,4 +1,23 @@@
 -<?xml version="1.0" encoding="UTF-8"?>
 +<!--
 +============LICENSE_START=======================================================
 +org.onap.aai
 +================================================================================
 +Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
 +Copyright © 2017-2018 Amdocs
 +================================================================================
 +Licensed under the Apache License, Version 2.0 (the "License");
 +you may not use this file except in compliance with the License.
 +You may obtain a copy of the License at
 +
 +      http://www.apache.org/licenses/LICENSE-2.0
 +
 +Unless required by applicable law or agreed to in writing, software
 +distributed under the License is distributed on an "AS IS" BASIS,
 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +See the License for the specific language governing permissions and
 +limitations under the License.
 +============LICENSE_END=========================================================
 +-->
  <project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@@ -32,7 -13,6 +32,7 @@@
      <groupId>org.onap.aai</groupId>
      <artifactId>champ-service</artifactId>
      <version>1.2.0-SNAPSHOT</version>
 +    <name>champ</name>
  
      <properties>
          <runAjscHome>${basedir}/target/swm/package/nix/dist_files${distFilesRoot}</runAjscHome>
          <distFilesRoot>/appl/${project.artifactId}/${project.version}</distFilesRoot>
  
          <common.logging.groupid>org.onap.aai.logging-service</common.logging.groupid>
-         <common.logging.version>1.2.0</common.logging.version>
+         <common.logging.version>1.2.2</common.logging.version>
          <org.apache.httpcomponents.httpclient.version>4.5.2</org.apache.httpcomponents.httpclient.version>
 +
 +        <docker.location>${basedir}/target</docker.location>
 +        <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
      </properties>
  
      <dependencies>
              <version>1.18.6</version>
          </dependency>
  
 -        <!-- AJSC Dependencies -->
          <dependency>
              <groupId>dom4j</groupId>
              <artifactId>dom4j</artifactId>
              <version>1.6.1</version>
              <scope>provided</scope>
          </dependency>
 +
          <dependency>
              <groupId>com.att.aft</groupId>
              <artifactId>dme2</artifactId>
@@@ -76,6 -53,7 +76,6 @@@
              <scope>provided</scope>
          </dependency>
  
 -        <!--Adding this dependency explicit.-->
          <dependency>
              <groupId>org.json</groupId>
              <artifactId>json</artifactId>
              <version>${org.apache.httpcomponents.httpclient.version}</version>
          </dependency>
  
 -        <!-- Champ graph database library. -->
          <dependency>
              <groupId>org.onap.aai</groupId>
              <artifactId>champ-core</artifactId>
          </dependency>
      </dependencies>
  
 +    <distributionManagement>
 +        <repository>
 +            <id>ecomp-releases</id>
 +            <name>ECOMP Release Repository</name>
 +            <url>${onap.nexus.url}/content/repositories/releases/</url>
 +        </repository>
 +        <snapshotRepository>
 +            <id>ecomp-snapshots</id>
 +            <name>ECOMP Snapshot Repository</name>
 +            <url>${onap.nexus.url}/content/repositories/snapshots/</url>
 +        </snapshotRepository>
 +    </distributionManagement>
 +
      <build>
          <finalName>${project.artifactId}</finalName>
          <plugins>
                                  <resource>
                                      <directory>${basedir}/src/main/bin/</directory>
                                  </resource>
 +                                <resource>
 +                                    <directory>../champ-service-deps-janus/target/</directory>
 +                                </resource>
 +                                <resource>
 +                                    <directory>../champ-service-deps-titan/target/</directory>
 +                                </resource>
                              </resources>
                          </configuration>
                      </execution>
                  </executions>
              </plugin>
 -
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-deploy-plugin</artifactId>
 +                <configuration>
 +                    <skip>true</skip>
 +                </configuration>
 +            </plugin>
 +            <!--
              <plugin>
                  <groupId>com.mycila</groupId>
                  <artifactId>license-maven-plugin</artifactId>
                      </execution>
                  </executions>
              </plugin>
 -
 +            -->
              <plugin>
                  <groupId>com.spotify</groupId>
                  <artifactId>docker-maven-plugin</artifactId>
                  <configuration>
                      <verbose>true</verbose>
                      <serverId>docker-hub</serverId>
 -                    <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
 +                    <imageName>${docker.push.registry}/onap/${project.name}</imageName>
                      <dockerDirectory>${docker.location}</dockerDirectory>
                      <imageTags>
                          <imageTag>latest</imageTag>
                      <forceTags>true</forceTags>
                  </configuration>
              </plugin>
 -
              <plugin>
                  <groupId>org.jacoco</groupId>
                  <artifactId>jacoco-maven-plugin</artifactId>
@@@ -2,14 -2,14 +2,14 @@@
   * ============LICENSE_START==========================================
   * org.onap.aai
   * ===================================================================
 - * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
 - * Copyright © 2017 Amdocs
 + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
 + * Copyright © 2017-2018 Amdocs
   * ===================================================================
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
 - *        http://www.apache.org/licenses/LICENSE-2.0
 + *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
@@@ -17,6 -17,7 +17,6 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * ============LICENSE_END============================================
 - * ECOMP is a trademark and service mark of AT&T Intellectual Property.
   */
  package org.onap.champ;
  
@@@ -204,6 -205,8 +204,8 @@@ public class ChampRESTAPI 
        response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build();
      } catch (ChampServiceException ce) {
        response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build();
+     } catch (IllegalArgumentException e) {
+       response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
      } catch (Exception e) {
        response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
        LoggingUtil.logInternalError(logger, e);
        response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build();
      } catch (ChampServiceException ce) {
        response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build();
+     } catch (IllegalArgumentException e) {
+       response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
      } catch (Exception e) {
        response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
        LoggingUtil.logInternalError(logger, e);
        response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build();
      } catch (ChampServiceException ce) {
        response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build();
+     } catch (IllegalArgumentException e) {
+       response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
      } catch (Exception e) {
        response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
        LoggingUtil.logInternalError(logger, e);
        response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build();
      } catch (ChampServiceException ce) {
        response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build();
+     } catch (IllegalArgumentException e) {
+       response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build();
      } catch (Exception e) {
        response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
        LoggingUtil.logInternalError(logger, e);