aboutsummaryrefslogtreecommitdiffstats
path: root/common-be/src/main/java
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-05-05 15:31:04 +0100
committerChristophe Closset <christophe.closset@intl.att.com>2021-05-15 06:21:13 +0000
commit2152a9a43767cdd486fd8c93894f66a05083f53c (patch)
treecbb64fc5680ba724bc317e27f6a20802d5b38502 /common-be/src/main/java
parente3de4c9d214983d38a7d66e89dae5d4bba170ca3 (diff)
Support for selection of capabilities
Change-Id: Ib1a3e3e1a59fc84c62620932c408e231acf77024 Issue-ID: SDC-3580 Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'common-be/src/main/java')
-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);
+ }
+}