summaryrefslogtreecommitdiffstats
path: root/common-app-api/src/main/java/org/openecomp/sdc/exception
diff options
context:
space:
mode:
Diffstat (limited to 'common-app-api/src/main/java/org/openecomp/sdc/exception')
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/AbstractSdncException.java116
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/AlreadyExistException.java41
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteLastApplicationEnvironmentException.java34
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteReferencedObjectException.java35
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/FunctionalException.java41
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/IndexingServiceException.java39
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/InvalidArgumentException.java33
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/NotFoundException.java35
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/OkResponseInfo.java28
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/PolicyException.java31
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/ResponseFormat.java191
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/ServiceException.java32
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/TechnicalException.java40
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/exception/VersionConflictException.java33
14 files changed, 729 insertions, 0 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/AbstractSdncException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/AbstractSdncException.java
new file mode 100644
index 0000000000..83e8321ea6
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/AbstractSdncException.java
@@ -0,0 +1,116 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+import java.util.Arrays;
+import java.util.Formatter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractSdncException {
+
+ private String messageId;
+
+ private String text;
+
+ private String[] variables;
+
+ private static Logger log = LoggerFactory.getLogger(AbstractSdncException.class.getName());
+
+ private final static Pattern ERROR_PARAM_PATTERN = Pattern.compile("%\\d");
+
+ public AbstractSdncException() {
+ }
+
+ public AbstractSdncException(String messageId, String text, String[] variables) {
+ super();
+ this.messageId = messageId;
+ this.text = text;
+ this.variables = validateParameters(messageId, text, variables);
+ }
+
+ private String[] validateParameters(String messageId, String text, String[] variables) {
+ String[] res = null;
+ Matcher m = ERROR_PARAM_PATTERN.matcher(text);
+ int expectedParamsNum = 0;
+ while (m.find()) {
+ expectedParamsNum += 1;
+ }
+ int actualParamsNum = (variables != null) ? variables.length : 0;
+ if (actualParamsNum < expectedParamsNum) {
+ log.warn(
+ "Received less parameters than expected for error with messageId {}, expected: {}, actual: {}. Missing parameters are padded with null values.",
+ messageId, expectedParamsNum, actualParamsNum);
+ } else if (actualParamsNum > expectedParamsNum) {
+ log.warn(
+ "Received more parameters than expected for error with messageId {}, expected: {}, actual: {}. Extra parameters are ignored.",
+ messageId, expectedParamsNum, actualParamsNum);
+ }
+ if (variables != null) {
+ res = Arrays.copyOf(variables, expectedParamsNum);
+ }
+
+ return res;
+ }
+
+ public String getMessageId() {
+ return this.messageId;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public String[] getVariables() {
+ return variables;
+ }
+
+ public void setMessageId(String messageId) {
+ this.messageId = messageId;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public void setVariables(String[] variables) {
+ this.variables = variables;
+ }
+
+ public String getFormattedErrorMessage() {
+ String res;
+ if (variables != null && variables.length > 0) {
+ Formatter formatter = new Formatter();
+ try {
+ res = formatter.format(this.text.replaceAll("%\\d", "%s"), (Object[]) this.variables).toString();
+ } finally {
+ formatter.close();
+ }
+ } else {
+ res = this.text;
+ }
+ return res;
+ }
+
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/AlreadyExistException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/AlreadyExistException.java
new file mode 100644
index 0000000000..3baec2067e
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/AlreadyExistException.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+/**
+ * Exception to be thrown when trying to insert an existing an element that
+ * already exists.
+ *
+ * @author luc boutier
+ */
+public class AlreadyExistException extends TechnicalException {
+ private static final long serialVersionUID = -6151150122897145634L;
+
+ /**
+ * Create a new {@link AlreadyExistException} with the cause.
+ *
+ * @param message
+ * Message.
+ */
+ public AlreadyExistException(String message) {
+ super(message);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteLastApplicationEnvironmentException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteLastApplicationEnvironmentException.java
new file mode 100644
index 0000000000..ec33b69d82
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteLastApplicationEnvironmentException.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+public class DeleteLastApplicationEnvironmentException extends TechnicalException {
+
+ private static final long serialVersionUID = -5192834855057177252L;
+
+ public DeleteLastApplicationEnvironmentException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public DeleteLastApplicationEnvironmentException(String message) {
+ super(message);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteReferencedObjectException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteReferencedObjectException.java
new file mode 100644
index 0000000000..6957e960c3
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/DeleteReferencedObjectException.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+/**
+ * This exception should be thrown when attempting to delete an object in Alien
+ * which is still referenced (used) by other object
+ *
+ * @author Minh Khang VU
+ */
+public class DeleteReferencedObjectException extends TechnicalException {
+ private static final long serialVersionUID = 1L;
+
+ public DeleteReferencedObjectException(String message) {
+ super(message);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/FunctionalException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/FunctionalException.java
new file mode 100644
index 0000000000..5bf67484d5
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/FunctionalException.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+/**
+ * All functional exception which is related to user input must go here. It's a
+ * checked exception to force error handling and checking.
+ *
+ * @author mkv
+ *
+ */
+public class FunctionalException extends Exception {
+
+ private static final long serialVersionUID = 6712845685798792493L;
+
+ public FunctionalException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public FunctionalException(String message) {
+ super(message);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/IndexingServiceException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/IndexingServiceException.java
new file mode 100644
index 0000000000..d8b8518919
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/IndexingServiceException.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+/**
+ * All errors happened while trying to access to index service
+ *
+ * @author mkv
+ */
+public class IndexingServiceException extends TechnicalException {
+
+ private static final long serialVersionUID = 8644422735660389058L;
+
+ public IndexingServiceException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public IndexingServiceException(String message) {
+ super(message);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/InvalidArgumentException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/InvalidArgumentException.java
new file mode 100644
index 0000000000..ef6cd659e4
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/InvalidArgumentException.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+public class InvalidArgumentException extends TechnicalException {
+ private static final long serialVersionUID = 931646037604062840L;
+
+ public InvalidArgumentException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InvalidArgumentException(String message) {
+ super(message);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/NotFoundException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/NotFoundException.java
new file mode 100644
index 0000000000..988325ff3e
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/NotFoundException.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+public class NotFoundException extends TechnicalException {
+
+ private static final long serialVersionUID = -5838741067731786413L;
+
+ public NotFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public NotFoundException(String message) {
+ super(message);
+ }
+
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/OkResponseInfo.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/OkResponseInfo.java
new file mode 100644
index 0000000000..78405e0eb1
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/OkResponseInfo.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+public class OkResponseInfo extends AbstractSdncException {
+
+ public OkResponseInfo(String messageId, String text, String[] variables) {
+ super(messageId, text, variables);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/PolicyException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/PolicyException.java
new file mode 100644
index 0000000000..8c5c8609b6
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/PolicyException.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+public class PolicyException extends AbstractSdncException {
+
+ public PolicyException(String messageId, String text, String[] variables) {
+ super(messageId, text, variables);
+ }
+
+ public PolicyException() {
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/ResponseFormat.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/ResponseFormat.java
new file mode 100644
index 0000000000..5ccbc25d0e
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/ResponseFormat.java
@@ -0,0 +1,191 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+/**
+ * Nested POJOs to express required JSON format of the error
+ *
+ * { "requestError": { "serviceException": { "messageId": "", "text": "",
+ * "variables": [] } } }
+ *
+ *
+ * @author paharoni
+ *
+ */
+
+public class ResponseFormat {
+
+ private int status;
+ private RequestErrorWrapper requestErrorWrapper;
+
+ public ResponseFormat() {
+ super();
+ }
+
+ public ResponseFormat(int status) {
+ super();
+ this.status = status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public RequestErrorWrapper getRequestError() {
+ return requestErrorWrapper;
+ }
+
+ public void setRequestError(RequestErrorWrapper requestErrorWrapper) {
+ this.requestErrorWrapper = requestErrorWrapper;
+ }
+
+ public void setPolicyException(PolicyException policyException) {
+ this.requestErrorWrapper = new RequestErrorWrapper(new RequestError());
+ requestErrorWrapper.setPolicyException(policyException);
+ }
+
+ public void setServiceException(ServiceException serviceException) {
+ this.requestErrorWrapper = new RequestErrorWrapper(new RequestError());
+ requestErrorWrapper.setServiceException(serviceException);
+ }
+
+ public void setOkResponseInfo(OkResponseInfo okResponseInfo) {
+ this.requestErrorWrapper = new RequestErrorWrapper(new RequestError());
+ requestErrorWrapper.setOkResponseInfo(okResponseInfo);
+ }
+
+ public String getFormattedMessage() {
+ if (this.requestErrorWrapper.requestError.okResponseInfo != null) {
+ return this.requestErrorWrapper.requestError.okResponseInfo.getFormattedErrorMessage();
+ }
+ if (this.requestErrorWrapper.requestError.serviceException != null) {
+ return this.requestErrorWrapper.requestError.serviceException.getFormattedErrorMessage();
+ }
+ return this.requestErrorWrapper.requestError.policyException.getFormattedErrorMessage();
+ }
+
+ public String getText() {
+ if (this.requestErrorWrapper.requestError.okResponseInfo != null) {
+ return this.requestErrorWrapper.requestError.okResponseInfo.getText();
+ }
+ if (this.requestErrorWrapper.requestError.serviceException != null) {
+ return this.requestErrorWrapper.requestError.serviceException.getText();
+ }
+ return this.requestErrorWrapper.requestError.policyException.getText();
+ }
+
+ public String[] getVariables() {
+ if (this.requestErrorWrapper.requestError.okResponseInfo != null) {
+ return this.requestErrorWrapper.requestError.okResponseInfo.getVariables();
+ }
+ if (this.requestErrorWrapper.requestError.serviceException != null) {
+ return this.requestErrorWrapper.requestError.serviceException.getVariables();
+ }
+ return this.requestErrorWrapper.requestError.policyException.getVariables();
+ }
+
+ public String getMessageId() {
+ if (this.requestErrorWrapper.requestError.okResponseInfo != null) {
+ return this.requestErrorWrapper.requestError.okResponseInfo.getMessageId();
+ }
+ if (this.requestErrorWrapper.requestError.serviceException != null) {
+ return this.requestErrorWrapper.requestError.serviceException.getMessageId();
+ }
+ return this.requestErrorWrapper.requestError.policyException.getMessageId();
+ }
+
+ public class RequestErrorWrapper {
+ private RequestError requestError;
+
+ public RequestErrorWrapper() {
+ this.requestError = new RequestError();
+ }
+
+ public RequestErrorWrapper(RequestError requestError) {
+ this.requestError = requestError;
+ }
+
+ public RequestError getRequestError() {
+ return requestError;
+ }
+
+ public void setRequestError(RequestError requestError) {
+ this.requestError = requestError;
+ }
+
+ public void setPolicyException(PolicyException policyException) {
+ requestError.setPolicyException(policyException);
+ }
+
+ public void setServiceException(ServiceException serviceException) {
+ requestError.setServiceException(serviceException);
+ }
+
+ public void setOkResponseInfo(OkResponseInfo okResponseInfo) {
+ requestError.setOkResponseInfo(okResponseInfo);
+ }
+ }
+
+ public class RequestError {
+ @SuppressWarnings("unused")
+ private PolicyException policyException;
+ @SuppressWarnings("unused")
+ private ServiceException serviceException;
+ @SuppressWarnings("unused")
+ private OkResponseInfo okResponseInfo;
+
+ public RequestError() {
+ }
+
+ public PolicyException getPolicyException() {
+ return policyException;
+ }
+
+ public ServiceException getServiceException() {
+ return serviceException;
+ }
+
+ public OkResponseInfo getOkResponseInfo() {
+ return okResponseInfo;
+ }
+
+ public void setPolicyException(PolicyException policyException) {
+ this.policyException = policyException;
+ }
+
+ public void setServiceException(ServiceException serviceException) {
+ this.serviceException = serviceException;
+ }
+
+ public void setOkResponseInfo(OkResponseInfo okResponseInfo) {
+ this.okResponseInfo = okResponseInfo;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "ResponseFormat[" + "status=" + status + ", requestErrorWrapper=" + requestErrorWrapper + ']';
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/ServiceException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/ServiceException.java
new file mode 100644
index 0000000000..3aae180517
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/ServiceException.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+public class ServiceException extends AbstractSdncException {
+
+ public ServiceException(String messageId, String text, String[] variables) {
+ super(messageId, text, variables);
+ }
+
+ public ServiceException() {
+ }
+
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/TechnicalException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/TechnicalException.java
new file mode 100644
index 0000000000..96ef2f3159
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/TechnicalException.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+/**
+ * Base class for all Alien technical exception
+ *
+ * @author mkv
+ *
+ */
+public abstract class TechnicalException extends RuntimeException {
+
+ private static final long serialVersionUID = -9152473183025390161L;
+
+ public TechnicalException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public TechnicalException(String message) {
+ super(message);
+ }
+}
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/exception/VersionConflictException.java b/common-app-api/src/main/java/org/openecomp/sdc/exception/VersionConflictException.java
new file mode 100644
index 0000000000..a998d6393e
--- /dev/null
+++ b/common-app-api/src/main/java/org/openecomp/sdc/exception/VersionConflictException.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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.sdc.exception;
+
+/**
+ * Exception happens when a4c cannot resolve version conflicts in a transparent
+ * manner for users
+ */
+public class VersionConflictException extends TechnicalException {
+ private static final long serialVersionUID = 1L;
+
+ public VersionConflictException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}