aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions')
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java45
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java49
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java48
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java66
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java27
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java53
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java35
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java35
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java80
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java35
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java44
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java32
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java43
13 files changed, 592 insertions, 0 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java
new file mode 100644
index 0000000000..454880cee1
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoAdapterException.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+
+/**
+ * General MSO Exception class for any non-specific errors.
+ *
+ *
+ */
+public class MsoAdapterException extends MsoException
+{
+ private static final long serialVersionUID = 1L;
+
+ // Constructor to create a new MsoException instance
+ public MsoAdapterException (String message) {
+ super(message);
+ super.category = MsoExceptionCategory.INTERNAL;
+ }
+
+ // Constructor to wrap a nested exception
+ public MsoAdapterException (String message, Throwable t) {
+ super(message, t);
+ super.category = MsoExceptionCategory.INTERNAL;
+ }
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java
new file mode 100644
index 0000000000..7e21d9d15a
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudIdentityNotFound.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+/**
+ * Signals that an attempt to find a specific mso cloud identity has failed.
+ */
+public class MsoCloudIdentityNotFound extends MsoException {
+
+ private static final long serialVersionUID = 2583769056266415665L;
+
+
+ /**
+ * Default constructor (needed for BPEL/JAXB)
+ */
+ public MsoCloudIdentityNotFound () {
+ super("Cloud Identity not found");
+ super.category=MsoExceptionCategory.USERDATA;
+ }
+
+ public MsoCloudIdentityNotFound (String cloudIdentity) {
+ // Set the detailed error as the Exception 'message'
+ super("Cloud Identity [" + cloudIdentity + "] not found");
+ super.category=MsoExceptionCategory.USERDATA;
+ }
+
+ @Override
+ public String toString () {
+ return getMessage();
+ }
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java
new file mode 100644
index 0000000000..7c6e98d55f
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFound.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+/**
+ * Signals that an attempt to find a specific mso cloud site has failed.
+ */
+public class MsoCloudSiteNotFound extends MsoException {
+
+ private static final long serialVersionUID = 2583769056266415664L;
+
+ /**
+ * Default constructor (needed for BPEL/JAXB)
+ */
+ public MsoCloudSiteNotFound () {
+ super("Cloud site not found");
+ super.category=MsoExceptionCategory.USERDATA;
+ }
+
+ public MsoCloudSiteNotFound (String cloudSite) {
+ // Set the detailed error as the Exception 'message'
+ super("Cloud Site [" + cloudSite + "] not found");
+ super.category=MsoExceptionCategory.USERDATA;
+ }
+
+ @Override
+ public String toString () {
+ return getMessage();
+ }
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java
new file mode 100644
index 0000000000..b8a7a5571c
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoException.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+
+public abstract class MsoException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+
+ protected MsoExceptionCategory category = MsoExceptionCategory.INTERNAL;
+ protected String context = null;
+
+ protected MsoException (String message) {
+ super(message);
+ }
+
+ protected MsoException (String message, Throwable t) {
+ super(message,t);
+ }
+
+ public MsoExceptionCategory getCategory() {
+ return category;
+ }
+ public void setCategory (MsoExceptionCategory category) {
+ this.category = category;
+ }
+
+ public String getContext () {
+ return context;
+ }
+ public void setContext (String context) {
+ this.context = context;
+ }
+ public void addContext (String ctx) {
+ if (this.context != null)
+ this.context = ctx + ":" + this.context;
+ else
+ this.context = ctx;
+ }
+
+ public String getContextMessage () {
+ if (this.context == null)
+ return getMessage();
+ else
+ return "[" + context + "] " + getMessage();
+ }
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java
new file mode 100644
index 0000000000..81a0edc2d3
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoExceptionCategory.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+
+public enum MsoExceptionCategory {
+ OPENSTACK, IO, INTERNAL, USERDATA
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java
new file mode 100644
index 0000000000..9c7f6fa91a
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+/**
+ * I/O exception
+ */
+public class MsoIOException extends MsoException
+{
+
+ /**
+ * Serialization id.
+ */
+ private static final long serialVersionUID = 6752445132721635760L;
+
+ /**
+ * Basic constructor with message
+ * @param message the error message
+ */
+ public MsoIOException (String message) {
+ super(message);
+ super.category = MsoExceptionCategory.IO;
+ }
+
+ /**
+ * Constructor to wrap a nested exception
+ * @param message the error message
+ * @param t the cause
+ */
+ public MsoIOException (String message, Throwable t) {
+ super (message, t);
+ super.category = MsoExceptionCategory.IO;
+ }
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java
new file mode 100644
index 0000000000..98b85394be
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExists.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+
+public class MsoNetworkAlreadyExists extends MsoOpenstackException {
+
+ private static final long serialVersionUID = 1L;
+
+ // Constructor to create a new MsoOpenstackException instance
+ public MsoNetworkAlreadyExists (String stack, String tenant, String cloud) {
+ // Set the detailed error as the Exception 'message'
+ super(409, "Conflict", "Stack " + stack + " already exists in Tenant + " + tenant + " in Cloud " + cloud);
+ }
+
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java
new file mode 100644
index 0000000000..5802aa1208
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFound.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+
+public class MsoNetworkNotFound extends MsoOpenstackException {
+
+ private static final long serialVersionUID = 1L;
+
+ // Constructor to create a new MsoOpenstackException instance
+ public MsoNetworkNotFound (String networkId, String tenant, String cloud) {
+ // Set the detailed error as the Exception 'message'
+ super(404, "Not Found", "Network " + networkId + " does not exist in Cloud/Tenant " + cloud + "/" + tenant);
+ }
+
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java
new file mode 100644
index 0000000000..eead8439d4
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+/**
+ * OpenStack exception.
+ */
+public class MsoOpenstackException extends MsoException
+{
+
+ /**
+ * Serialization id.
+ */
+ private static final long serialVersionUID = 3313636124141766495L;
+
+ private int statusCode;
+ private String statusMessage;
+ private String errorDetail;
+
+ /**
+ * Constructor to create a new MsoOpenstackException instance
+ * @param code the error code
+ * @param message the error message
+ * @param detail error details
+ */
+ public MsoOpenstackException (int code, String message, String detail) {
+ // Set the detailed error as the Exception 'message'
+ super(detail);
+ super.category = MsoExceptionCategory.OPENSTACK;
+
+ this.statusCode = code;
+ this.statusMessage = message;
+ this.errorDetail = detail;
+ }
+
+ /**
+ * Constructor to propagate the caught exception (mostly for stack trace)
+ * @param code the error code
+ * @param message the error message
+ * @param detail error details
+ * @param e the cause
+ */
+ public MsoOpenstackException (int code, String message, String detail, Exception e) {
+ // Set the detailed error as the Exception 'message'
+ super(detail, e);
+ super.category = MsoExceptionCategory.OPENSTACK;
+
+ this.statusCode = code;
+ this.statusMessage = message;
+ this.errorDetail = detail;
+ }
+
+ @Override
+ public String toString() {
+ return statusCode +
+ " " +
+ statusMessage +
+ ": " +
+ errorDetail;
+ }
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java
new file mode 100644
index 0000000000..2901b6b3a7
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExists.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+
+public class MsoStackAlreadyExists extends MsoOpenstackException {
+
+ private static final long serialVersionUID = 1L;
+
+ // Constructor to create a new MsoOpenstackException instance
+ public MsoStackAlreadyExists (String stack, String tenant, String cloud) {
+ // Set the detailed error as the Exception 'message'
+ super(409, "Conflict", "Stack " + stack + " already exists in Tenant + " + tenant + " in Cloud " + cloud);
+ }
+
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java
new file mode 100644
index 0000000000..21082a28c9
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFound.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+/**
+ * Thrown when HEAT stack is not found or deleted.
+ */
+public class MsoStackNotFound extends MsoOpenstackException {
+
+ /**
+ * Serialization id.
+ */
+ private static final long serialVersionUID = 7354069716354359246L;
+
+ /**
+ * Constructor to create a new MsoOpenstackException instance.
+ * @param stack the stack name
+ * @param tenant the tenant name
+ * @param cloud the cloud name
+ */
+ public MsoStackNotFound (String stack, String tenant, String cloud) {
+ // Set the detailed error as the Exception 'message'
+ super(404, "Not Found", "Stack " + stack + " does not exist in Cloud/Tenant " + cloud + "/" + tenant);
+ }
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java
new file mode 100644
index 0000000000..7a597d6f4d
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExists.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+public class MsoTenantAlreadyExists extends MsoOpenstackException {
+
+ private static final long serialVersionUID = 1L;
+
+ public MsoTenantAlreadyExists (String tenant, String cloud) {
+ // Set the detailed error as the Exception 'message'
+ super(409, "Conflict", "Tenant " + tenant + " already exists in Cloud " + cloud);
+ }
+
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java
new file mode 100644
index 0000000000..f26d6b6d49
--- /dev/null
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFound.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+
+/**
+ * Tenant not found exception.
+ */
+public class MsoTenantNotFound extends MsoOpenstackException {
+
+ /**
+ * Serialization id.
+ */
+ private static final long serialVersionUID = 5640069939645577063L;
+
+ /**
+ * Constructor to create the exception
+ * @param tenant the tenant id
+ * @param cloud the cloud id
+ */
+ public MsoTenantNotFound (String tenant, String cloud) {
+ // Set the detailed error as the Exception 'message'
+ super(404, "Not Found", "Tenant " + tenant + " does not exist in Cloud " + cloud);
+ }
+}