summaryrefslogtreecommitdiffstats
path: root/common-be/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'common-be/src/main/java/org')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java21
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/exception/BusinessException.java34
2 files changed, 48 insertions, 7 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
index 78bfe50d5c..3345c95946 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java
@@ -21,6 +21,8 @@
package org.openecomp.sdc.be.datatypes.elements;
import com.google.common.collect.Lists;
+import lombok.Getter;
+import lombok.Setter;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
@@ -35,6 +37,10 @@ public class CapabilityDataDefinition extends ToscaDataDefinition {
public static final String MIN_OCCURRENCES = "0";
public static final String MAX_OCCURRENCES = "UNBOUNDED";
+ @Getter
+ @Setter
+ private boolean external = false;
+
/**
* The default constructor initializing limits of the occurrences
*/
@@ -45,11 +51,11 @@ public class CapabilityDataDefinition extends ToscaDataDefinition {
}
/**
- * Deep copy constructor
+ * Deep copy constructor.
*
- * @param other
+ * @param other the capability data definition to copy
*/
- public CapabilityDataDefinition(CapabilityDataDefinition other) {
+ public CapabilityDataDefinition(final CapabilityDataDefinition other) {
this.setUniqueId(other.getUniqueId());
this.setType(other.getType());
this.setDescription(other.getDescription());
@@ -84,6 +90,7 @@ public class CapabilityDataDefinition extends ToscaDataDefinition {
this.setSource(other.getSource());
this.setOwnerType(other.getOwnerType());
+ this.setExternal(other.isExternal());
}
public CapabilityDataDefinition(CapabilityTypeDataDefinition other) {
@@ -422,11 +429,11 @@ public class CapabilityDataDefinition extends ToscaDataDefinition {
String maxOccurrences = this.getMaxOccurrences();
String source = this.getSource();
-
return "CapabilityDefinition [uniqueId=" + uniqueId + ", description=" + description + ", name=" + name
- + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", capabilitySources="
- + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + ownerName
- + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path + ", source=" + source + "]";
+ + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", capabilitySources="
+ + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + ownerName
+ + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path + ", source=" + source
+ + ", external=" + external + "]";
}
public enum OwnerType {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/exception/BusinessException.java b/common-be/src/main/java/org/openecomp/sdc/be/exception/BusinessException.java
new file mode 100644
index 0000000000..69fb00f3b5
--- /dev/null
+++ b/common-be/src/main/java/org/openecomp/sdc/be/exception/BusinessException.java
@@ -0,0 +1,34 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 Nordix Foundation
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.be.exception;
+
+public abstract class BusinessException extends RuntimeException {
+
+ protected BusinessException() {
+ }
+
+ protected BusinessException(final String message) {
+ super(message);
+ }
+
+ protected BusinessException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+}