From 052b66bed19c2ee0b7ef6c992ee709a1db90a73e Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Mon, 11 May 2020 16:09:38 -0400 Subject: [PATCH] Remove unused ArtifactsBusinessLogic::updateArtifactsFlowForInterfaceOperations This commit deletes the ArtifactsBusinessLogic::updateArtifactsFlowForInterfaceOperations function as it is no longer used anywhere. Signed-off-by: Francis Toth Change-Id: I1dd950930485fc83bb02c889dafc5461192accbc Issue-ID: SDC-2812 --- .../be/components/impl/ArtifactsBusinessLogic.java | 63 ---------------------- 1 file changed, 63 deletions(-) diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java index a0fd1f2475..43c5562d4a 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java @@ -2539,69 +2539,6 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return Either.left(artifactDefinition); } - private Either, ResponseFormat> updateArtifactsFlowForInterfaceOperations( - Component parent, String parentId, String artifactId, ArtifactDefinition artifactInfo, User user, - byte[] decodedPayload, ComponentTypeEnum componentType, AuditingActionEnum auditingAction, String interfaceType, - String operationUuid, DAOArtifactData artifactData, String prevArtifactId, String currArtifactId, - ArtifactDefinition artifactDefinition) { - StorageOperationStatus error; - Either, ResponseFormat> resultOp; - if (decodedPayload == null) { - if (!artifactDefinition.getMandatory() || artifactDefinition.getEsId() != null) { - Either artifactFromCassandra = artifactCassandraDao.getArtifact(artifactDefinition - .getEsId()); - if (artifactFromCassandra.isRight()) { - log.debug("Failed to get artifact data from ES for artifact id {}", artifactId); - error = DaoStatusConverter.convertCassandraStatusToStorageStatus(artifactFromCassandra.right() - .value()); - ResponseFormat responseFormat = componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(error)); - handleAuditing(auditingAction, parent, parentId, user, artifactInfo, prevArtifactId, currArtifactId, responseFormat, componentType, null); - resultOp = Either.right(responseFormat); - return resultOp; - } - // clone data to new artifact - artifactData.setData(artifactFromCassandra.left().value().getData()); - artifactData.setId(artifactFromCassandra.left().value().getId()); - } else { - // todo if not exist(first time) - } - - } else { - if (artifactDefinition.getEsId() == null) { - artifactDefinition.setEsId(artifactDefinition.getUniqueId()); - artifactData.setId(artifactDefinition.getUniqueId()); - } - } - NodeTypeEnum convertParentType = convertParentType(componentType); - // Set additional fields for artifact - artifactInfo.setArtifactLabel(artifactInfo.getArtifactName()); - artifactInfo.setArtifactDisplayName(artifactInfo.getArtifactName()); - - Either updateArtifactOnResourceEither = - artifactToscaOperation.updateArtifactOnResource(artifactInfo, parent, artifactId, convertParentType, parentId, true); - if(updateArtifactOnResourceEither.isRight()){ - log.debug("Failed to persist operation artifact {} in resource, error is {}",artifactInfo.getArtifactName(), updateArtifactOnResourceEither.right().value()); - ActionStatus convertedFromStorageResponse = componentsUtils.convertFromStorageResponse(updateArtifactOnResourceEither.right().value()); - return Either.right(componentsUtils.getResponseFormat(convertedFromStorageResponse)); - } - if (artifactData.getData() != null) { - CassandraOperationStatus cassandraOperationStatus = artifactCassandraDao.saveArtifact(artifactData); - if(cassandraOperationStatus != CassandraOperationStatus.OK){ - log.debug("Failed to persist operation artifact {}, error is {}",artifactInfo.getArtifactName(),cassandraOperationStatus); - StorageOperationStatus storageStatus = DaoStatusConverter.convertCassandraStatusToStorageStatus(cassandraOperationStatus); - ActionStatus convertedFromStorageResponse = componentsUtils.convertFromStorageResponse(storageStatus); - return Either.right(componentsUtils.getResponseFormat(convertedFromStorageResponse)); - } - } - - Either updateOprEither = updateOperationArtifact(parentId, interfaceType, operationUuid, updateArtifactOnResourceEither.left().value()); - if(updateOprEither.isRight()){ - return Either.right(updateOprEither.right().value()); - } - - return Either.left(Either.left(updateOprEither.left().value())); - } - private String updateGeneratedIdInHeatEnv(Component parent, String parentId, String artifactId, ArtifactDefinition artifactInfo, ArtifactDefinition artifactDefinition, NodeTypeEnum parentType) { if (NodeTypeEnum.Resource == parentType) { return updateGeneratedIdInHeatEnv(parent.getDeploymentArtifacts(), parent, parentId, artifactId, artifactInfo, artifactDefinition, parentType, false); -- 2.16.6