diff options
Diffstat (limited to 'catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OperationUtils.java')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OperationUtils.java | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OperationUtils.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OperationUtils.java index a06d342d26..2266acf88f 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OperationUtils.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/OperationUtils.java @@ -1,8 +1,8 @@ package org.openecomp.sdc.be.model.operations.impl; import fj.data.Either; -import org.openecomp.sdc.be.dao.jsongraph.TitanDao; -import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; +import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.operations.StorageException; @@ -14,32 +14,33 @@ import java.util.Map; @Component public class OperationUtils { - private final TitanDao titanDao; + private final JanusGraphDao janusGraphDao; private static final Logger logger = Logger.getLogger(OperationUtils.class.getName()); - public OperationUtils(TitanDao titanDao) { - this.titanDao = titanDao; + public OperationUtils(JanusGraphDao janusGraphDao) { + this.janusGraphDao = janusGraphDao; } - public <T> T onTitanOperationFailure(TitanOperationStatus status) { - titanDao.rollback(); + public <T> T onJanusGraphOperationFailure(JanusGraphOperationStatus status) { + janusGraphDao.rollback(); throw new StorageException(status); } - static Either<Map<String, PropertyDefinition>, TitanOperationStatus> fillProperties(String uniqueId, - PropertyOperation propertyOperation, - NodeTypeEnum nodeTypeEnum) { + static Either<Map<String, PropertyDefinition>, JanusGraphOperationStatus> fillProperties(String uniqueId, + PropertyOperation propertyOperation, + NodeTypeEnum nodeTypeEnum) { - Either<Map<String, PropertyDefinition>, TitanOperationStatus> findPropertiesOfNode = + Either<Map<String, PropertyDefinition>, JanusGraphOperationStatus> findPropertiesOfNode = propertyOperation.findPropertiesOfNode(nodeTypeEnum, uniqueId); if (findPropertiesOfNode.isRight()) { - TitanOperationStatus titanOperationStatus = findPropertiesOfNode.right().value(); - logger.debug("After looking for properties of vertex {}. status is {}", uniqueId, titanOperationStatus); - if (TitanOperationStatus.NOT_FOUND.equals(titanOperationStatus)) { - return Either.right(TitanOperationStatus.OK); + JanusGraphOperationStatus janusGraphOperationStatus = findPropertiesOfNode.right().value(); + logger.debug("After looking for properties of vertex {}. status is {}", uniqueId, + janusGraphOperationStatus); + if (JanusGraphOperationStatus.NOT_FOUND.equals(janusGraphOperationStatus)) { + return Either.right(JanusGraphOperationStatus.OK); } else { - return Either.right(titanOperationStatus); + return Either.right(janusGraphOperationStatus); } } else { return Either.left(findPropertiesOfNode.left().value()); |