aboutsummaryrefslogtreecommitdiffstats
path: root/common-be
diff options
context:
space:
mode:
Diffstat (limited to 'common-be')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java19
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java21
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java38
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java14
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java30
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java32
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java45
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java16
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java26
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java20
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java23
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java4
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java12
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java34
27 files changed, 555 insertions, 39 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java
index 24d801262c..5fecac429a 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ComponentMetadataDataDefinition.java
@@ -28,6 +28,8 @@ import java.util.Map;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinition implements Serializable {
@@ -35,7 +37,8 @@ public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinitio
*
*/
private static final long serialVersionUID = -9114770126086263552L;
-
+ private static final Logger log = LoggerFactory.getLogger(ComponentMetadataDataDefinition.class.getName());
+
private String uniqueId;
private String name; // archiveName
@@ -156,13 +159,13 @@ public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinitio
this.lastUpdateDate = other.getLastUpdateDate();
this.description = other.getDescription();
this.state = other.getState();
- this.tags = new ArrayList<String>(other.getTags());
+ this.tags = new ArrayList<>(other.getTags());
this.icon = other.getIcon();
this.contactId = other.getContactId();
this.UUID = other.getUUID();
this.normalizedName = other.getNormalizedName();
this.systemName = other.getSystemName();
- this.allVersions = new HashMap<String, String>(other.getAllVersions());
+ this.allVersions = new HashMap<>(other.getAllVersions());
this.isDeleted = other.isDeleted();
this.projectCode = other.getProjectCode();
this.csarUUID = other.getCsarUUID();
@@ -177,6 +180,8 @@ public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinitio
}
public void setUniqueId(String uniqueId) {
+ if ( this.uniqueId != null && !this.uniqueId.equals( uniqueId ) )
+ log.warn("uniqueId changed more then once -> OLD : {} , NEW: {} ", this.uniqueId ,uniqueId );
this.uniqueId = uniqueId;
}
@@ -264,8 +269,10 @@ public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinitio
return UUID;
}
- public void setUUID(String uUID) {
- UUID = uUID;
+ public void setUUID(String UUID) {
+ if ( this.UUID != null && !this.UUID.equals( UUID ) )
+ log.warn("UUID changed more then once -> OLD : {} , NEW: {} ", this.UUID, UUID );
+ this.UUID = UUID;
}
public String getNormalizedName() {
@@ -297,6 +304,8 @@ public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinitio
}
public void setInvariantUUID(String invariantUUID) {
+ if ( this.invariantUUID != null && !this.invariantUUID.equals( invariantUUID ) )
+ log.warn("InvariantUUID changed more then once -> OLD : {} , NEW: {} ", this.invariantUUID ,invariantUUID );
this.invariantUUID = invariantUUID;
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java
index 7b112ce129..9675cd37fb 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ResourceMetadataDataDefinition.java
@@ -34,6 +34,7 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit
private String vendorName;
private String vendorRelease;
+ private String resourceVendorModelNumber;
private ResourceTypeEnum resourceType = ResourceTypeEnum.VFC; // ResourceType.VFC
// is
// default
@@ -44,12 +45,14 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit
public ResourceMetadataDataDefinition() {
super();
+ resourceVendorModelNumber = "";
}
public ResourceMetadataDataDefinition(ResourceMetadataDataDefinition other) {
super(other);
this.vendorName = other.getVendorName();
this.vendorRelease = other.getVendorRelease();
+ this.resourceVendorModelNumber = other.getResourceVendorModelNumber();
this.isAbstract = other.isHighestVersion();
this.resourceType = other.getResourceType();
this.toscaResourceName = other.getToscaResourceName();
@@ -70,6 +73,15 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit
public void setVendorRelease(String vendorRelease) {
this.vendorRelease = vendorRelease;
}
+
+ public String getResourceVendorModelNumber() {
+ return resourceVendorModelNumber;
+ }
+
+ public void setResourceVendorModelNumber(String resourceVendorModelNumber) {
+ this.resourceVendorModelNumber = resourceVendorModelNumber;
+ }
+
public ResourceTypeEnum getResourceType() {
return resourceType;
@@ -114,7 +126,8 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit
@Override
public String toString() {
return "ResourceMetadataDataDefinition [vendorName=" + vendorName + ", vendorRelease=" + vendorRelease
- + ", resourceType=" + resourceType + ", isAbstract=" + isAbstract + super.toString() + "]";
+ + ", resourceVendorModelNumber=" + resourceVendorModelNumber + ", resourceType=" + resourceType +
+ ", isAbstract=" + isAbstract + super.toString() + "]";
}
@Override
@@ -127,6 +140,7 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit
result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode());
result = prime * result + ((vendorName == null) ? 0 : vendorName.hashCode());
result = prime * result + ((vendorRelease == null) ? 0 : vendorRelease.hashCode());
+ result = prime * result + ((resourceVendorModelNumber == null)? 0 : resourceVendorModelNumber.hashCode());
return result;
}
@@ -170,6 +184,11 @@ public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinit
return false;
} else if (!vendorRelease.equals(other.vendorRelease))
return false;
+ if (resourceVendorModelNumber == null) {
+ if (other.resourceVendorModelNumber != null)
+ return false;
+ } else if (!resourceVendorModelNumber.equals(other.resourceVendorModelNumber))
+ return false;
return super.equals(obj);
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java
index 4f3486e457..4a42436583 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinition.java
@@ -33,6 +33,8 @@ public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefiniti
public static final String EMPTY_STR = "";
private String distributionStatus;
+ private String serviceType;
+ private String serviceRole;
private Boolean ecompGeneratedNaming = true;
@@ -40,10 +42,14 @@ public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefiniti
public ServiceMetadataDataDefinition() {
super();
+ serviceType = "";
+ serviceRole = "";
}
public ServiceMetadataDataDefinition(ServiceMetadataDataDefinition other) {
super(other);
+ serviceType = other.getServiceType();
+ serviceRole = other.getServiceRole();
}
public String getDistributionStatus() {
@@ -53,6 +59,22 @@ public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefiniti
public void setDistributionStatus(String distributionStatus) {
this.distributionStatus = distributionStatus;
}
+
+ public String getServiceType(){
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType){
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole(){
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole){
+ this.serviceRole = serviceRole;
+ }
public Boolean isEcompGeneratedNaming() {
return ecompGeneratedNaming;
@@ -73,8 +95,8 @@ public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefiniti
@Override
public String toString() {
return "ServiceMetadataDataDefinition [ distributionStatus=" + distributionStatus
- + ", ecompGeneratedNaming=" + ecompGeneratedNaming + ", namingPolicy=" + namingPolicy
- + ", parent=" + super.toString() + "]";
+ + ", serviceType=" + serviceType + ", serviceRole=" + serviceRole + ", ecompGeneratedNaming="
+ + ecompGeneratedNaming + ", namingPolicy=" + namingPolicy + ", parent=" + super.toString() + "]";
}
@Override
@@ -84,6 +106,8 @@ public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefiniti
result = prime * result + ((distributionStatus == null) ? 0 : distributionStatus.hashCode());
result = prime * result + ((ecompGeneratedNaming == null) ? 0 : ecompGeneratedNaming.hashCode());
result = prime * result + ((namingPolicy == null) ? 0 : namingPolicy.hashCode());
+ result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
+ result = prime * result + ((serviceRole == null) ? 0 : serviceRole.hashCode());
return result;
}
@@ -117,6 +141,16 @@ public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefiniti
return false;
} else if (!namingPolicy.equals(other.namingPolicy))
return false;
+ if (serviceType == null){
+ if (other.serviceType != null)
+ return false;
+ } else if (!serviceType.equals(other.serviceType))
+ return false;
+ if (serviceRole == null){
+ if (other.serviceRole != null)
+ return false;
+ } else if (!serviceRole.equals(other.serviceRole))
+ return false;
return super.equals(obj);
}
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 0a98a2abda..8ec5a89c44 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
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.io.Serializable;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java
index e236fcb963..b9eb4e4c9f 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ComponentInstanceDataDefinition.java
@@ -24,6 +24,7 @@ import java.io.Serializable;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import org.openecomp.sdc.common.util.ValidationUtils;
public class ComponentInstanceDataDefinition extends ToscaDataDefinition implements Serializable {
@@ -60,6 +61,7 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition impleme
private String componentName;
private String componentVersion;
private String toscaComponentName;
+ private String invariantName;
public ComponentInstanceDataDefinition() {
super();
@@ -82,6 +84,7 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition impleme
this.componentName = dataDefinition.componentName;
this.componentVersion = dataDefinition.componentVersion;
this.toscaComponentName = dataDefinition.toscaComponentName;
+ this.invariantName = dataDefinition.invariantName;
}
public String getIcon() {
@@ -152,8 +155,19 @@ public class ComponentInstanceDataDefinition extends ToscaDataDefinition impleme
}
public void setName(String name) {
+ if(invariantName == null){
+ invariantName = ValidationUtils.normalizeComponentInstanceName(name);
+ }
this.name = name;
}
+
+ public String getInvariantName() {
+ return invariantName;
+ }
+
+ public void setInvariantName(String invariantName) {
+ this.invariantName = invariantName;
+ }
public Integer getPropertyValueCounter() {
return propertyValueCounter;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java
index 2ba460b9ab..853e7cf261 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.HashMap;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java
index fd69127ed3..3406d85c82 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/InputDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.Map;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java
index c986c0fe7e..57e1c2154f 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListCapabilityDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.List;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java
index c9bf851e17..6d11c51596 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.ArrayList;
@@ -5,6 +25,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.codehaus.jackson.annotate.JsonCreator;
@@ -61,11 +82,16 @@ public class ListDataDefinition<T extends ToscaDataDefinition> extends ToscaData
Map<String, T> mapByName = listToMapByName(listToscaDataDefinition);
List<T> otherList = ((ListDataDefinition)other).getListToscaDataDefinition();
for(T item : otherList){
- mapByName.merge(item.getName(), item, (thisItem, otherItem) -> thisItem.mergeFunction(otherItem, allowDefaultValueOverride));
+ mapByName.merge((String)item.getToscaPresentationValue(JsonPresentationFields.NAME), item, (thisItem, otherItem) -> thisItem.mergeFunction(otherItem, allowDefaultValueOverride));
}
((ListDataDefinition)other).listToscaDataDefinition = mapByName.values().stream().collect(Collectors.toList());
return other;
}
-
+
+ @Override
+ public boolean findUidMatch(String uid){
+ return listToscaDataDefinition.stream()
+ .anyMatch(p -> p.findUidMatch(uid));
+ }
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java
index e611666d3e..d0a1465096 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListMapPropertiesDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.List;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java
index fb1248d100..b601fb0988 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ListRequirementDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.List;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java
index 4c61dd2b81..db32d56c3a 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapArtifactDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.Map;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java
index 42d3f49a7d..6814d41914 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapCapabiltyProperty.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.Map;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java
index 69eecf45c4..741aa39230 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.HashMap;
@@ -56,5 +76,17 @@ public class MapDataDefinition <T extends ToscaDataDefinition> extends ToscaDa
mapToscaDataDefinition.entrySet().forEach(e -> e.getValue().setOwnerIdIfEmpty(ownerId));
}
}
+
+
+ public String findKeyByItemUidMatch(String uid){
+ if(null == mapToscaDataDefinition)
+ return null;
+ Map.Entry<String, T> entry = mapToscaDataDefinition.entrySet().stream().filter(e ->
+ e.getValue().findUidMatch(uid))
+ .findAny().orElse(null);
+ if(null == entry)
+ return null;
+ return entry.getKey();
+ }
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java
index acd1a182a6..983f1434c5 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapGroupsDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.Map;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java
index 3053f99ab2..37703df631 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListCapabiltyDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.HashMap;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java
index 80c2060333..2144dcac69 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapListRequirementDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.HashMap;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java
index e90fc916e8..a2a59ad778 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapPropertiesDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.util.Map;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
index 4c798521c5..0b8456bd5c 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
@@ -66,7 +66,9 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
private String inputPath;
private String status;
-
+ private String inputId;
+ private String instanceUniqueId;
+ private String propertyId;
/**
* The resource id which this property belongs to
*/
@@ -85,7 +87,6 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
}
public PropertyDataDefinition(PropertyDataDefinition p) {
-
super();
this.setUniqueId(p.getUniqueId());
this.setRequired(p.isRequired());
@@ -105,7 +106,9 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
this.setGetInputValues(p.getInputValues);
this.setInputPath(p.getInputPath());
this.setStatus(p.getStatus());
-
+ this.setInputId(p.getInputId());
+ this.setInstanceUniqueId(p.getInstanceUniqueId());
+ this.setPropertyId(p.getPropertyId());
}
public String getInputPath() {
@@ -247,9 +250,36 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
this.status = status;
}
+ public String getInputId() {
+ return inputId;
+ }
+
+ public void setInputId(String inputId) {
+ this.inputId = inputId;
+ }
+
+ public String getInstanceUniqueId() {
+ return instanceUniqueId;
+ }
+
+ public void setInstanceUniqueId(String instanceUniqueId) {
+ this.instanceUniqueId = instanceUniqueId;
+ }
+
+ public String getPropertyId() {
+ return propertyId;
+ }
+
+ public void setPropertyId(String propertyId) {
+ this.propertyId = propertyId;
+ }
+
+
@Override
public String toString() {
- return "PropertyDataDefinition [uniqueId=" + uniqueId + ", type=" + type + ", required=" + required + ", defaultValue=" + defaultValue + ", description=" + description + ", entrySchema=" + schema + ", parentUniqueId=" + parentUniqueId + ", password=" + password + "]";
+ return "PropertyDataDefinition [uniqueId=" + uniqueId + ", type=" + type + ", required=" + required + ", definition=" + definition + ", defaultValue=" + defaultValue + ", description=" + description + ", schema=" + schema + ", password="
+ + password + ", name=" + name + ", value=" + value + ", label=" + label + ", hidden=" + hidden + ", immutable=" + immutable + ", inputPath=" + inputPath + ", status=" + status + ", inputId=" + inputId + ", instanceUniqueId="
+ + instanceUniqueId + ", propertyId=" + propertyId + ", parentUniqueId=" + parentUniqueId + ", getInputValues=" + getInputValues + "]";
}
@Override
@@ -354,7 +384,7 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
@Override
public <T extends ToscaDataDefinition> T mergeFunction(T other, boolean allowDefaultValueOverride){
- if(this.getType().equals(other.getType()) && compareSchemaType(other)){
+ if(this.getType().equals(other.getToscaPresentationValue(JsonPresentationFields.TYPE)) && compareSchemaType(other)){
other.setOwnerId(getOwnerId());
if(allowDefaultValueOverride)
other.setToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE, getDefaultValue());
@@ -362,6 +392,11 @@ public class PropertyDataDefinition extends ToscaDataDefinition implements Seria
}
return null;
}
+
+ public void convertPropertyDataToInstancePropertyData(){
+ if(null != value)
+ defaultValue = value;
+ }
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
index de9127d08c..0017567031 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RelationshipInstDataDefinition.java
@@ -44,12 +44,12 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition implemen
this.setModificationTime(cdt.getModificationTime());
this.setCapabilityOwnerId(cdt.getCapabilityOwnerId());
this.setRequirementOwnerId(cdt.getRequirementOwnerId());
- this.setCapabiltyId(cdt.getCapabiltyId());
+ this.setCapabilityId(cdt.getCapabilityId());
this.setRequirementId(cdt.getRequirementId());
this.setFromId(cdt.getFromId());
this.setToId(cdt.getToId());
this.setRequirement(cdt.getRequirement());
- this.setCapability(cdt.getCapabilty());
+ this.setCapability(cdt.getCapability());
}
@@ -60,11 +60,11 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition implemen
public String getRequirement() {
return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT);
}
- public void setCapability(String capabilty) {
- setToscaPresentationValue(JsonPresentationFields.CAPAPILITY, capabilty);
+ public void setCapability(String capability) {
+ setToscaPresentationValue(JsonPresentationFields.CAPAPILITY, capability);
}
- public String getCapabilty() {
+ public String getCapability() {
return (String) getToscaPresentationValue(JsonPresentationFields.CAPAPILITY);
}
public void setToId(Object toId) {
@@ -87,15 +87,15 @@ public class RelationshipInstDataDefinition extends ToscaDataDefinition implemen
setToscaPresentationValue(JsonPresentationFields.REQUIREMENT_ID, requirementId);
}
- public void setCapabiltyId(Object capabiltyId) {
- setToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID, capabiltyId);
+ public void setCapabilityId(Object capabilityId) {
+ setToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID, capabilityId);
}
public String getRequirementId() {
return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT_ID);
}
- public String getCapabiltyId() {
+ public String getCapabilityId() {
return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID);
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
index 7defd1df3c..b32f65f9d3 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.elements;
import java.io.Serializable;
@@ -171,7 +191,7 @@ public class RequirementDataDefinition extends ToscaDataDefinition implements Se
public int hashCode() {
final int prime = 31;
int result = 1;
- String name = getUniqueId();
+ String name = getName();
String uniqueId = getUniqueId();
String capability = getCapability();
String node = getNode();
@@ -210,7 +230,7 @@ public class RequirementDataDefinition extends ToscaDataDefinition implements Se
return false;
RequirementDataDefinition other = (RequirementDataDefinition) obj;
- String name = getUniqueId();
+ String name = getName();
String uniqueId = getUniqueId();
String capability = getCapability();
String node = getNode();
@@ -288,7 +308,7 @@ public class RequirementDataDefinition extends ToscaDataDefinition implements Se
@Override
public String toString() {
- String name = getUniqueId();
+ String name = getName();
String uniqueId = getUniqueId();
String capability = getCapability();
String node = getNode();
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java
index 78261ff07a..9bef5ce887 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ComponentFieldsEnum.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.enums;
public enum ComponentFieldsEnum {
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java
index 5a7b2d40f3..276fbe24a7 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/GraphPropertyEnum.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.enums;
import java.util.ArrayList;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java
index f5cc2b661b..d5592995e6 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.enums;
import org.codehaus.jackson.annotate.JsonCreator;
@@ -28,6 +48,9 @@ public enum JsonPresentationFields {
DERIVED_FROM ("derivedFrom", null),
VENDOR_NAME ("vendorName", null),
VENDOR_RELEASE ("vendorRelease", null),
+ RESOURCE_VENDOR_MODEL_NUMBER ("reourceVendorModelNumber",null),
+ SERVICE_TYPE ("serviceType", null),
+ SERVICE_ROLE ("serviceRole", null),
CONFORMANCE_LEVEL ("conformanceLevel", null),
ICON ("icon", null),
TAGS ("tags", null),
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java
index 0d837762e2..36756e9225 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/OriginTypeEnum.java
@@ -27,7 +27,9 @@ public enum OriginTypeEnum {
VFC("VFC", "VFC (Virtual Function Component)", "resource instance", ComponentTypeEnum.RESOURCE),
CP("CP", "CP (Connection Point)", "resource instance", ComponentTypeEnum.RESOURCE),
VL("VL", "VL (Virtual Link)", "resource instance", ComponentTypeEnum.RESOURCE),
- VFCMT("VFCMT", "VFCMT (VFC Monitoring Template)", "resource instance", ComponentTypeEnum.RESOURCE);
+ VFCMT("VFCMT", "VFCMT (VFC Monitoring Template)", "resource instance", ComponentTypeEnum.RESOURCE),
+ CVFC("CVFC", "CVFC (Complex Virtual Function Component)", "resource instance", ComponentTypeEnum.RESOURCE),
+ PNF("PNF", "PNF (Physical Network Function)", "resource instance", ComponentTypeEnum.RESOURCE);
private String value;
private String displayValue;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java
index d3652c238f..182657e125 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/ResourceTypeEnum.java
@@ -27,8 +27,14 @@ package org.openecomp.sdc.be.datatypes.enums;
*/
public enum ResourceTypeEnum {
- VFC("VFC (Virtual Function Component)"), VF("VF"/* (Virtual Function)" */), CP("CP (Connection Point)"),
- VL( "VL (Virtual Link)"), VFCMT("VFCMT (VFC Monitoring Template)"), ABSTRACT("Abstract (Generic VFC/VF/Service Type)");
+ VFC("VFC (Virtual Function Component)"),
+ VF("VF"/* (Virtual Function)" */),
+ CP("CP (Connection Point)"),
+ PNF("PNF"/* (Physical Network Function)" */),
+ CVFC("CVFC"/*Complex Virtual Function Component*/),
+ VL( "VL (Virtual Link)"),
+ VFCMT("VFCMT (VFC Monitoring Template)"),
+ ABSTRACT("Abstract (Generic VFC/VF/PNF/Service Type)");
private String value;
@@ -85,7 +91,7 @@ public enum ResourceTypeEnum {
return false;
}
/**
- * Checks if enum exist with given type ignare case
+ * Checks if enum exist with given type ignore case
* @param type
* @return
*/
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java
index bf51ba4e28..df73adaa4a 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaDataDefinition.java
@@ -1,3 +1,23 @@
+/*-
+ * ============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.be.datatypes.tosca;
import java.util.HashMap;
@@ -55,14 +75,6 @@ public abstract class ToscaDataDefinition {
}
- public String getType(){
- return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
- }
-
- public String getName(){
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
//default merge function for merging data maps - implement where needed and use mergeDataMaps method where applicable instead of map1.putAll(map2)
public <T extends ToscaDataDefinition> T mergeFunction(T other, boolean allowDefaultValueOverride){
other.setOwnerId(getOwnerId());
@@ -86,6 +98,10 @@ public abstract class ToscaDataDefinition {
public static <T extends ToscaDataDefinition> Map<String, T> listToMapByName(List<T> dataList) {
return null == dataList? new HashMap<>() : dataList.stream()
- .collect(Collectors.toMap(p -> p.getName(), p -> p));
+ .collect(Collectors.toMap(p -> (String)p.getToscaPresentationValue(JsonPresentationFields.NAME), p -> p));
+ }
+
+ public boolean findUidMatch(String uid){
+ return uid.equals(getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID));
}
}