diff options
author | Michael Lando <ml636r@att.com> | 2017-06-19 19:51:24 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-06-19 19:54:06 +0300 |
commit | 6e60006d2e22665b491d176ca9e91b74326bfabc (patch) | |
tree | 47e30ee9661e172e73f0e35bf198d5b3c70db8dd /catalog-model | |
parent | 4d97d5fac309ce0d66938e5ccd0349e2660d4e23 (diff) |
[sdc] update to the current code base
and support http
Change-Id: I2fb35494b40126a8395b1e309a180db4127754b7
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-model')
4 files changed, 19 insertions, 62 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java index 985870b5e3..8718f72f8a 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java @@ -2,11 +2,8 @@ package org.openecomp.sdc.be.model.jsontitan.operations; import fj.data.Either; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.ImmutableTriple; import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; -import org.openecomp.sdc.be.dao.graph.datatype.GraphNode; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; @@ -15,40 +12,20 @@ import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition; import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; import org.openecomp.sdc.be.datatypes.elements.ListCapabilityDataDefinition; -import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition; import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition; -import org.openecomp.sdc.be.datatypes.elements.MapCapabiltyProperty; import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; -import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.DerivedNodeTypeResolver; import org.openecomp.sdc.be.model.LifecycleStateEnum; import org.openecomp.sdc.be.model.jsontitan.datamodel.NodeType; -import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement; import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElementTypeEnum; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter; import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder; -import org.openecomp.sdc.be.resources.data.AttributeData; -import org.openecomp.sdc.be.resources.data.AttributeValueData; -import org.openecomp.sdc.be.resources.data.CapabilityData; -import org.openecomp.sdc.be.resources.data.CapabilityTypeData; -import org.openecomp.sdc.be.resources.data.DataTypeData; -import org.openecomp.sdc.be.resources.data.GroupData; -import org.openecomp.sdc.be.resources.data.GroupTypeData; -import org.openecomp.sdc.be.resources.data.InputValueData; -import org.openecomp.sdc.be.resources.data.InputsData; -import org.openecomp.sdc.be.resources.data.PolicyTypeData; -import org.openecomp.sdc.be.resources.data.PropertyData; -import org.openecomp.sdc.be.resources.data.PropertyValueData; -import org.openecomp.sdc.be.resources.data.RelationshipInstData; -import org.openecomp.sdc.be.resources.data.RelationshipTypeData; -import org.openecomp.sdc.be.resources.data.RequirementData; -import org.openecomp.sdc.be.resources.data.ResourceMetadataData; import org.openecomp.sdc.common.jsongraph.util.CommonUtility; import org.openecomp.sdc.common.jsongraph.util.CommonUtility.LogLevelEnum; import org.slf4j.Logger; @@ -57,11 +34,10 @@ import org.springframework.beans.factory.annotation.Qualifier; import java.util.ArrayList; import java.util.Collection; +import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.function.Function; import java.util.regex.Pattern; @org.springframework.stereotype.Component("node-type-operation") @@ -748,34 +724,17 @@ public class NodeTypeOperation extends ToscaElementOperation { } - private StorageOperationStatus updateDataFromNewDerived(List<GraphVertex> newDerived, GraphVertex nodeTypeV, NodeType nodeToUpdate) { - - StorageOperationStatus status = updateDataByType(newDerived, nodeTypeV, EdgeLabelEnum.CAPABILITIES, nodeToUpdate); - if (status != StorageOperationStatus.OK) { - return status; - } - - status = updateDataByType(newDerived, nodeTypeV, EdgeLabelEnum.REQUIREMENTS, nodeToUpdate); - if (status != StorageOperationStatus.OK) { - return status; - } - - status = updateDataByType(newDerived, nodeTypeV, EdgeLabelEnum.PROPERTIES, nodeToUpdate); - if (status != StorageOperationStatus.OK) { - return status; - } - - status = updateDataByType(newDerived, nodeTypeV, EdgeLabelEnum.ATTRIBUTES, nodeToUpdate); - if (status != StorageOperationStatus.OK) { - return status; - } - - status = updateDataByType(newDerived, nodeTypeV,EdgeLabelEnum.CAPABILITIES_PROPERTIES, nodeToUpdate); - if (status != StorageOperationStatus.OK) { - return status; + private StorageOperationStatus updateDataFromNewDerived(List<GraphVertex> newDerived, GraphVertex nodeTypeV, NodeType nodeToUpdate) { + EnumSet<EdgeLabelEnum> edgeLabels = EnumSet.of(EdgeLabelEnum.CAPABILITIES, EdgeLabelEnum.REQUIREMENTS, EdgeLabelEnum.PROPERTIES, EdgeLabelEnum.ATTRIBUTES, EdgeLabelEnum.CAPABILITIES_PROPERTIES, EdgeLabelEnum.ADDITIONAL_INFORMATION); + StorageOperationStatus status = null; + for (EdgeLabelEnum edge : edgeLabels){ + status = updateDataByType(newDerived, nodeTypeV, edge, nodeToUpdate); + if (status != StorageOperationStatus.OK) { + break; + } } - status = updateDataByType(newDerived, nodeTypeV, EdgeLabelEnum.ADDITIONAL_INFORMATION, nodeToUpdate); return status; + } private <T extends ToscaDataDefinition> StorageOperationStatus updateDataByType(List<GraphVertex> newDerivedList, GraphVertex nodeTypeV, EdgeLabelEnum label, NodeType nodeElement) { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementLifecycleOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementLifecycleOperation.java index 1397e81f9c..ca0a51cbbc 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementLifecycleOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementLifecycleOperation.java @@ -992,6 +992,11 @@ public class ToscaElementLifecycleOperation extends BaseOperation { } return result; } + + //TODO remove after jsonModelMigration + public void resolveToscaComponentName(ComponentInstanceDataDefinition vfInst, Map<String, ToscaElement> origCompMap) { + fixToscaComponentName(vfInst, origCompMap); + } private boolean fixToscaComponentName(ComponentInstanceDataDefinition vfInst, Map<String, ToscaElement> origCompMap) { if (vfInst.getToscaComponentName() == null || vfInst.getToscaComponentName().isEmpty()) { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/migration/MigrationMalformedDataLogger.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/migration/MigrationMalformedDataLogger.java index 2d4ca635e7..2e5e520af0 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/migration/MigrationMalformedDataLogger.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/migration/MigrationMalformedDataLogger.java @@ -35,7 +35,10 @@ public class MigrationMalformedDataLogger { Set<String> serviceInstances = componentInstances.stream().map(ComponentInstance::getComponentUid).collect(Collectors.toSet()); serviceInstances.retainAll(malformedVFs); if (!serviceInstances.isEmpty()) { - log.error(String.format("Service %s is using malformed VFs: %s", service.getUniqueId(), StringUtils.join(serviceInstances, ','))); + log.error(String.format("Service %s with id %s and version %s is using malformed VFs: %s", service.getName(), + service.getVersion(), + service.getUniqueId(), + StringUtils.join(serviceInstances, ','))); } } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java index b68704eeea..96671766eb 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/ui/model/UiServiceMetadata.java @@ -10,16 +10,6 @@ public class UiServiceMetadata extends UiComponentMetadata { private String distributionStatus; private Boolean ecompGeneratedNaming; private String namingPolicy; - private UiServiceMetadata metadata; - - - public UiServiceMetadata getMetadata() { - return metadata; - } - - public void setMetadata(UiServiceMetadata metadata) { - this.metadata = metadata; - } public UiServiceMetadata(List<CategoryDefinition> categories, ServiceMetadataDataDefinition metadata) { super(categories, metadata); |