1. Add skip-deploy plugin config.
2. Define an application exception and use it.
Issue: CCSDK-61
Change-Id: I9ad527ff2169619edbb0a1f27576ae47413b9ee4
Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
<?xml version="1.0"?>
-<!--
- =============LICENSE_START=========================================================
-
- =================================================================================
- Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- 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=========================================================
-
- ECOMP is a trademark and service mark of AT&T Intellectual Property.
- -->
+<!-- =============LICENSE_START=========================================================
+ =================================================================================
+ Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. ================================================================================
+ 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=========================================================
+ ECOMP is a trademark and service mark of AT&T Intellectual Property. -->
<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">
</executions>
</plugin>
+ <!-- no deployment needed -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.onap.oom.dashboard.exception.OOMDashboardException;
import org.onap.oom.dashboard.model.CloudifyBlueprint;
import org.onap.oom.dashboard.model.CloudifyBlueprintUpload;
import org.onap.oom.dashboard.model.CloudifyDeployment;
* @param pageSize
* Number of items per browser page
* @return JSON block as String, see above.
- * @throws Exception
+ * @throws OOMDashboardException
* On any error; e.g., Network failure.
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
Collections.sort(itemList, deploymentComparator);
break;
default:
- throw new Exception("getItemListForPage failed: unimplemented case: " + option.name());
+ throw new OOMDashboardException("getItemListForPage failed: unimplemented case: " + option.name());
}
// Shrink if needed
try {
User appUser = UserUtils.getUserSession(request);
if (appUser == null || appUser.getLoginId() == null || appUser.getLoginId().length() == 0)
- throw new Exception("getItemListForPageWrapper: Failed to get application user");
+ throw new OOMDashboardException("getItemListForPageWrapper: Failed to get application user");
int pageNum = getRequestPageNumber(request);
int pageSize = getRequestPageSize(request);
outboundJson = getItemListForPage(appUser.getId(), option, pageNum, pageSize);
import javax.servlet.http.HttpServletRequest;
+import org.onap.oom.dashboard.exception.OOMDashboardException;
import org.onap.oom.dashboard.model.ConsulHealthServiceRegistration;
import org.onap.oom.dashboard.model.ConsulNodeInfo;
import org.onap.oom.dashboard.model.ConsulServiceHealth;
itemList = restClient.getDatacenters();
break;
default:
- throw new Exception("getItemListForPage failed: unimplemented case: " + option.name());
+ throw new OOMDashboardException("getItemListForPage failed: unimplemented case: " + option.name());
}
// Shrink if needed
try {
User appUser = UserUtils.getUserSession(request);
if (appUser == null || appUser.getLoginId() == null || appUser.getLoginId().length() == 0)
- throw new Exception("getItemListForPageWrapper: Failed to get application user");
+ throw new OOMDashboardException("getItemListForPageWrapper: Failed to get application user");
int pageNum = getRequestPageNumber(request);
int pageSize = getRequestPageSize(request);
outboundJson = getItemListForPage(appUser.getId(), option, pageNum, pageSize);
import javax.servlet.http.HttpServletRequest;
import org.onap.oom.dashboard.domain.ControllerEndpoint;
+import org.onap.oom.dashboard.exception.OOMDashboardException;
import org.onap.oom.dashboard.model.ControllerEndpointCredentials;
import org.onap.oom.dashboard.model.ControllerEndpointTransport;
import org.onap.oom.dashboard.model.RestResponseError;
try {
User appUser = UserUtils.getUserSession(request);
if (appUser == null || appUser.getLoginId() == null || appUser.getLoginId().length() == 0)
- throw new Exception("getControllers: Failed to get application user");
+ throw new OOMDashboardException("getControllers: Failed to get application user");
ControllerEndpointCredentials selectedInDb = getOrSetControllerEndpointSelection(appUser.getId());
// Built result from properties
ArrayList<ControllerEndpointTransport> list = new ArrayList<>();
String outboundJson = null;
User appUser = UserUtils.getUserSession(request);
if (appUser == null || appUser.getLoginId() == null || appUser.getLoginId().length() == 0)
- throw new Exception("setControllerSelection: Failed to get application user");
+ throw new OOMDashboardException("setControllerSelection: Failed to get application user");
ControllerEndpoint dbEntry = new ControllerEndpoint(appUser.getId(), endpoint.getName(), endpoint.getUrl());
controllerEndpointService.updateControllerEndpointSelection(dbEntry);
RestResponseSuccess success = new RestResponseSuccess("Updated selection to " + endpoint.getName());
import javax.servlet.http.HttpServletRequest;
import org.onap.oom.dashboard.domain.ControllerEndpoint;
+import org.onap.oom.dashboard.exception.OOMDashboardException;
import org.onap.oom.dashboard.model.ControllerEndpointCredentials;
import org.onap.oom.dashboard.rest.ControllerRestClientImpl;
import org.onap.oom.dashboard.rest.ControllerRestClientMockImpl;
protected IControllerRestClient getControllerRestClient(HttpServletRequest request) throws Exception {
User appUser = UserUtils.getUserSession(request);
if (appUser == null || appUser.getLoginId() == null || appUser.getLoginId().length() == 0)
- throw new Exception("getControllerRestClient: Failed to get application user");
+ throw new OOMDashboardException("getControllerRestClient: Failed to get application user");
return getControllerRestClient(appUser.getId());
}
--- /dev/null
+package org.onap.oom.dashboard.exception;
+
+/**
+ * A little something to placate the Sonar code-analysis tool.
+ */
+public class OOMDashboardException extends Exception {
+
+ private static final long serialVersionUID = -1373841666122351816L;
+
+ public OOMDashboardException() {
+ super();
+ }
+
+ public OOMDashboardException(String message) {
+ super(message);
+ }
+
+ public OOMDashboardException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public OOMDashboardException(Throwable cause) {
+ super(cause);
+ }
+
+}
import java.util.Map;
import java.util.Scanner;
+import org.onap.oom.dashboard.exception.OOMDashboardException;
import org.onap.oom.dashboard.model.CloudifyBlueprintContent;
import org.onap.oom.dashboard.model.CloudifyBlueprintList;
import org.onap.oom.dashboard.model.CloudifyBlueprintUpload;
try {
InputStream is = getClass().getResourceAsStream(path);
if (is == null)
- throw new Exception("Failed to find resource at path " + path);
+ throw new OOMDashboardException("Failed to find resource at path " + path);
Scanner scanner = new Scanner(is, "UTF-8");
result = scanner.useDelimiter("\\A").next();
scanner.close();
List<ConsulServiceHealthHistory> list9 = client.getServiceHealthHistory("mock", Instant.now(), Instant.now());
if (list1 == null || list2 == null || list3 == null || list4 == null || list5 == null || list6 == null
|| list7 == null || list8 == null || list9 == null)
- throw new Exception("Failed");
+ throw new OOMDashboardException("Failed");
System.out.println("Pass.");
}
</overlays>
</configuration>
</plugin>
+ <!-- no deployment needed -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
+++ /dev/null
-###############################################################################
-# =============LICENSE_START=========================================================
-#
-# =================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# 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=========================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-###############################################################################
-# OS system.properties
-
-app_display_name = OOM Dashboard
-
-# Postgres
-db.driver=org.postgresql.Driver
-db.connectionURL=jdbc:postgresql://vm-ep-dev3.client.research.att.com:5432/ec_dash?searchpath=ecd_os_1707
-db.userName=ec_dash_user
-db.password=ec_dash_pass
-db.hib.dialect=org.hibernate.dialect.PostgreSQLDialect
-hb.dialect=org.hibernate.dialect.PostgreSQLDialect
-
-# Hibernate
-db.min_pool_size = 5
-db.max_pool_size = 10
-hb.show_sql = false
-hb.db_reconnect = true
-hb.idle_connection_test_period = 3600
-
-# Directory with the Quantum.lic file
-files_path = /tmp
-
-application_user_id = 30000
-post_default_role_id = 16
-clustered = true
-
-#Enable Fusion Mobile capabilities for the application
-mobile_enable = false
-
-# Cache config file is needed on the classpath
-cache_config_file_path = /WEB-INF/classes/cache.ccf
-cache_switch = 199
-cache_load_on_startup = false
-
-user_name = fullName
-decryption_key = AGLDdG4D04BKm2IxIWEr8o==
-
-contact_us_link = https://www.onap.org/
-
-# An Unique 128-bit value defined to identify a specific version
-# of an application deployed on a specific virtual machine.
-# This value must be generated and updated by the application
-# which is using the ECOMP SDK at the time of its deployment.
-# Online Unique UUID generator - https://www.uuidgenerator.net/
-# ID generated for DBC to supply to EELF
-# A bogus value is cached in SCM: 12345678-..
-instance_uuid = 12345678-90ab-cdef-1234-567890abcdef
-
-# Application base URL is a proper prefix of the on-boarded URL.
-app_base_url = http://www.oom.onap.org:8080/ecd-app-os/
<?xml version="1.0"?>
-<!--
- =============LICENSE_START=========================================================
-
- =================================================================================
- Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- 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=========================================================
-
- ECOMP is a trademark and service mark of AT&T Intellectual Property.
- -->
+<!-- =============LICENSE_START=========================================================
+ =================================================================================
+ Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. ================================================================================
+ 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=========================================================
+ ECOMP is a trademark and service mark of AT&T Intellectual Property. -->
<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">
<target>1.8</target>
</configuration>
</plugin>
+ <!-- no deployment needed -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- =============LICENSE_START=========================================================
-
- =================================================================================
- Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- 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=========================================================
-
- ECOMP is a trademark and service mark of AT&T Intellectual Property.
- -->
+<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>
-<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>
-
- <!-- Maven parent project for convenience of building and cleaning -->
- <groupId>org.openecomp.controller.dashboard</groupId>
- <artifactId>ecd-app-parent</artifactId>
- <version>0</version>
- <packaging>pom</packaging>
- <name>ONAP Operations Manager Dashboard project</name>
-
- <modules>
- <module>ecd-app-common</module>
- <module>ecd-app-overlay</module>
- <module>ecd-app-os</module>
- </modules>
+ <!-- Maven parent project for convenience of building and cleaning -->
+ <groupId>org.openecomp.controller.dashboard</groupId>
+ <artifactId>ecd-app-parent</artifactId>
+ <version>0</version>
+ <packaging>pom</packaging>
+ <name>ONAP Operations Manager Dashboard project</name>
+
+ <modules>
+ <module>ecd-app-common</module>
+ <module>ecd-app-overlay</module>
+ <module>ecd-app-os</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>