aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2021-07-15 15:29:02 +0100
committerMichael Morris <michael.morris@est.tech>2021-07-28 13:04:26 +0000
commitdd2e1700187449a017b75589aeb0c2dfb989dec7 (patch)
tree278eea3690a5cf47e6c50188412727d226840b7f /catalog-be/src
parent938548c5c6c1935f426b6f9e671d969e15371389 (diff)
Consider component model when retrieving capability types
Issue-ID: SDC-3642 Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech> Change-Id: Ie09b5f8d64b95fc2db14f19d3857a9935075b2fe
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CapabilitiesBusinessLogic.java4
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java5
2 files changed, 5 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CapabilitiesBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CapabilitiesBusinessLogic.java
index be9b519e18..c070d89fd4 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CapabilitiesBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CapabilitiesBusinessLogic.java
@@ -566,9 +566,9 @@ public class CapabilitiesBusinessLogic extends BaseBusinessLogic {
.equals(capabilityDefinition.getUniqueId()));
}
- public Either<Map<String, CapabilityTypeDefinition>, ResponseFormat> getAllCapabilityTypes() {
+ public Either<Map<String, CapabilityTypeDefinition>, ResponseFormat> getAllCapabilityTypes(String modelName) {
Either<Map<String, CapabilityTypeDefinition>, JanusGraphOperationStatus> capabilityTypeCacheAll = capabilityTypeOperation
- .getAllCapabilityTypes();
+ .getAllCapabilityTypes(modelName);
if (capabilityTypeCacheAll.isRight()) {
JanusGraphOperationStatus operationStatus = capabilityTypeCacheAll.right().value();
if (JanusGraphOperationStatus.NOT_FOUND == operationStatus) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
index cafcbfd211..c3c42e27f5 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
@@ -184,7 +184,8 @@ public class TypesFetchServlet extends AbstractValidationsServlet {
@ApiResponse(responseCode = "404", description = "Capability types not found")})
@PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
public Response getAllCapabilityTypesServlet(@Context final HttpServletRequest request,
- @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
+ @HeaderParam(value = Constants.USER_ID_HEADER) String userId,
+ @Parameter(description = "model", required = false) @QueryParam("model") String modelName) {
Wrapper<Response> responseWrapper = new Wrapper<>();
Wrapper<User> userWrapper = new Wrapper<>();
try {
@@ -193,7 +194,7 @@ public class TypesFetchServlet extends AbstractValidationsServlet {
if (responseWrapper.isEmpty()) {
String url = request.getMethod() + " " + request.getRequestURI();
log.debug("Start handle request of {} | modifier id is {}", url, userId);
- Either<Map<String, CapabilityTypeDefinition>, ResponseFormat> allDataTypes = capabilitiesBusinessLogic.getAllCapabilityTypes();
+ Either<Map<String, CapabilityTypeDefinition>, ResponseFormat> allDataTypes = capabilitiesBusinessLogic.getAllCapabilityTypes(modelName);
if (allDataTypes.isRight()) {
log.info("Failed to get all capability types. Reason - {}", allDataTypes.right().value());
Response errorResponse = buildErrorResponse(allDataTypes.right().value());