diff options
author | Patrick Brady <pb071s@att.com> | 2017-10-13 08:55:06 -0700 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2017-10-16 18:24:29 +0000 |
commit | 711778b2b2c543c1bd778087a89bab63e69eeadb (patch) | |
tree | 89d373867cfaf76615e062ada329fb4d3073e2d7 /appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main | |
parent | 7737b3a2836186c515a42a50146f15c204083b59 (diff) |
Add null checks to ServiceCatalogFactory
Change-Id: Ibee4af7ba6a7b7fcf1dafdc1e5b46b42608d98f0
Signed-off-by: Patrick Brady <pb071s@att.com>
Issue-id: APPC-274
Diffstat (limited to 'appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main')
-rw-r--r-- | appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java index 63d4a31f1..c6624e8b1 100644 --- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java +++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java @@ -26,7 +26,12 @@ package org.openecomp.appc.adapter.iaas.impl; import java.util.Properties;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
public class ServiceCatalogFactory {
+
+ private static EELFLogger logger= EELFManager.getInstance().getLogger(org.openecomp.appc.adapter.iaas.impl.ServiceCatalogFactory.class);
/**
* This method accepts a fully qualified identity service URL and uses that to determine which version of the
@@ -41,9 +46,17 @@ public class ServiceCatalogFactory { */
public static ServiceCatalog getServiceCatalog(String url, String projectIdentifier, String principal,
String credential, String domain, Properties properties) {
- String version = IdentityURL.parseURL(url).getVersion();
+ IdentityURL idUrl = IdentityURL.parseURL(url);
+ if(idUrl == null){
+ logger.error("Url " + url + " could not be parsed.");
+ return null;
+ }
+ String version = idUrl.getVersion();
+ if(version == null){
+ logger.error("Invalid Identity URL check configuration");
+ return null;
+ }
String prefix = version.split("\\.")[0];
-
if (prefix != null) {
switch (prefix) {
case "v2":
|