NodeTypeEnum.getByNameIgnoreCase(storedComponent.getComponentType().getValue()),
true);
if(removeArifactFromComponent.isRight()){
- titanDao.rollback();
+ janusGraphDao.rollback();
ResponseFormat responseFormatByArtifactId = componentsUtils.getResponseFormatByArtifactId(
componentsUtils.convertFromStorageResponse(removeArifactFromComponent.right().value()),
storedOperation.getImplementation().getArtifactDisplayName());
CassandraOperationStatus cassandraStatus = artifactCassandraDao.deleteArtifact(artifactUniqueId);
if (cassandraStatus != CassandraOperationStatus.OK) {
- titanDao.rollback();
+ janusGraphDao.rollback();
ResponseFormat responseFormatByArtifactId = componentsUtils.getResponseFormatByArtifactId(
componentsUtils.convertFromStorageResponse(
componentsUtils.convertToStorageOperationStatus(cassandraStatus)),
interfaceOperation.updateInterfaces(storedComponent.getUniqueId(),
Collections.singletonList(interfaceDefinition));
if (deleteOperationEither.isRight()) {
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
deleteOperationEither.right().value(), storedComponent.getComponentType())));
}
Either<String, StorageOperationStatus> deleteInterfaceEither = interfaceOperation.deleteInterface(
storedComponent.getUniqueId(), interfaceDefinition.getUniqueId());
if (deleteInterfaceEither.isRight()) {
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
deleteInterfaceEither.right().value(), storedComponent.getComponentType())));
}
}
- titanDao.commit();
+ janusGraphDao.commit();
interfaceDefinition.getOperations().putAll(operationsCollection);
interfaceDefinition.getOperations().keySet().removeIf(key -> !(operationsToDelete.contains(key)));
return Either.left(Collections.singletonList(interfaceDefinition));
} catch (Exception e) {
LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "delete", e);
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_DELETED));
} finally {
if (lockResult.isLeft() && lockResult.left().value()) {
if (lock) {
Either<Boolean, ResponseFormat> lockResult = lockComponent(component.getUniqueId(), component, action);
if (lockResult.isRight()) {
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(lockResult.right().value());
}
}
}
}
- titanDao.commit();
+ janusGraphDao.commit();
interfaceDefinition.getOperations().keySet().removeIf(key -> !(operationsToGet.contains(key)));
return Either.left(Collections.singletonList(interfaceDefinition));
} catch (Exception e) {
LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "get", e);
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(
componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND, componentId));
} finally {
getOperationFromInterfaceDefinition(interfaceDef,
operation.getUniqueId());
if (!optionalOperation.isPresent()) {
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(componentsUtils
.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND,
storedComponent.getUniqueId()));
NodeTypeEnum.getByNameIgnoreCase(storedComponent.getComponentType().getValue()),
true);
if(removeArifactFromComponent.isRight()){
- titanDao.rollback();
+ janusGraphDao.rollback();
ResponseFormat responseFormatByArtifactId = componentsUtils.getResponseFormatByArtifactId(
componentsUtils.convertFromStorageResponse(removeArifactFromComponent.right().value()),
storedOperation.getImplementation().getArtifactDisplayName());
CassandraOperationStatus cassandraStatus = artifactCassandraDao.deleteArtifact(artifactUniqueId);
if (cassandraStatus != CassandraOperationStatus.OK) {
- titanDao.rollback();
+ janusGraphDao.rollback();
ResponseFormat responseFormatByArtifactId =
componentsUtils.getResponseFormatByArtifactId(
componentsUtils.convertFromStorageResponse(
Either<List<InterfaceDefinition>, StorageOperationStatus> addCreateOperationEither =
interfaceOperation.updateInterfaces(storedComponent.getUniqueId(), interfacesCollection);
if (addCreateOperationEither.isRight()) {
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
addCreateOperationEither.right().value(), storedComponent.getComponentType())));
}
- titanDao.commit();
+ janusGraphDao.commit();
interfacesCollection.forEach(interfaceDefinition -> interfaceDefinition.getOperations().entrySet().removeIf(
entry -> !operationsCollection.values().stream().map(OperationDataDefinition::getName)
.collect(Collectors.toList()).contains(entry.getValue().getName())));
return Either.left(interfacesCollection);
} catch (Exception e) {
- titanDao.rollback();
+ janusGraphDao.rollback();
LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "addOrUpdate", e);
return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
} finally {
interfaceOperation.addInterfaces(component.getUniqueId(),
Collections.singletonList(interfaceDefinition));
if (interfaceCreateEither.isRight()) {
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
interfaceCreateEither.right().value(), component.getComponentType())));
}
}
catch (Exception e) {
LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "get", e);
- titanDao.rollback();
+ janusGraphDao.rollback();
return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND));
}
finally {