summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main/java
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2021-07-14 14:21:47 +0100
committerMichael Morris <michael.morris@est.tech>2021-07-21 14:13:29 +0000
commit0514ec6635a08cdbaac5d664c3a4f13bcb0cbf51 (patch)
tree8ece729ff236e5011b705c3c79536eb482a44a7c /catalog-model/src/main/java
parenta3da4a7625f75f719a0ef1ffe1c2bef87828d2f3 (diff)
Consider component model when retrieving relationship types
Issue-ID: SDC-3640 Signed-off-by: MichaelMorris <michael.morris@est.tech> Change-Id: Ic06a9085b8aa2f44b8d33d7de12eadf691106131 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Diffstat (limited to 'catalog-model/src/main/java')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java
index f02fc2da7d..1b3fee97c1 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java
@@ -20,8 +20,6 @@
package org.openecomp.sdc.be.model.operations.impl;
import static org.openecomp.sdc.common.log.enums.EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR;
-
-import fj.data.Either;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -47,6 +45,7 @@ import org.openecomp.sdc.be.resources.data.UniqueIdData;
import org.openecomp.sdc.common.log.wrappers.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import fj.data.Either;
@Component("relationship-type-operation")
public class RelationshipTypeOperation extends AbstractOperation {
@@ -72,7 +71,7 @@ public class RelationshipTypeOperation extends AbstractOperation {
return getRelationshipTypeDefinition(relationshipTypesRes.left().value());
}
- public Either<RelationshipTypeDefinition, JanusGraphOperationStatus> getRelationshipTypeDefinition(final RelationshipTypeData relationshipTypeData) {
+ private Either<RelationshipTypeDefinition, JanusGraphOperationStatus> getRelationshipTypeDefinition(final RelationshipTypeData relationshipTypeData) {
RelationshipTypeDefinition relationshipTypeDefinition = new RelationshipTypeDefinition(
relationshipTypeData.getRelationshipTypeDataDefinition());
Either<Map<String, PropertyDefinition>, JanusGraphOperationStatus> propertiesStatus = OperationUtils
@@ -364,11 +363,11 @@ public class RelationshipTypeOperation extends AbstractOperation {
DaoStatusConverter::convertJanusGraphStatusToStorageStatus);
}
- public Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> getAllRelationshipTypes() {
+ public Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> getAllRelationshipTypes(final String model) {
Map<String, RelationshipTypeDefinition> relationshipTypeDefinitionMap = new HashMap<>();
Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> result = Either.left(relationshipTypeDefinitionMap);
Either<List<RelationshipTypeData>, JanusGraphOperationStatus> getAllRelationshipTypes = janusGraphGenericDao
- .getByCriteria(NodeTypeEnum.RelationshipType, null, RelationshipTypeData.class);
+ .getByCriteriaForModel(NodeTypeEnum.RelationshipType, null, model, RelationshipTypeData.class);
if (getAllRelationshipTypes.isRight()) {
JanusGraphOperationStatus status = getAllRelationshipTypes.right().value();
if (status != JanusGraphOperationStatus.NOT_FOUND) {