diff options
Diffstat (limited to 'src/main/java')
3 files changed, 12 insertions, 24 deletions
diff --git a/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java b/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java index e8ef9e3..d4a53a4 100644 --- a/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java +++ b/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationResource.java @@ -43,12 +43,7 @@ public class ServiceSpecificationResource extends ResourceManagement { @RequestParam MultiValueMap<String, String> params) { Map response = serviceSpecificationService.get(serviceSpecId); JsonRepresentation filter = new JsonRepresentation(params); - if (response.get("serviceSpecCharacteristic") != null) { - return this.getResponse(response, filter); - } else { - return this.getPartialResponse(response, filter); - - } + return this.getResponse(response, filter); } @GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE) diff --git a/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationService.java b/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationService.java index bec7575..3094f7b 100644 --- a/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationService.java +++ b/src/main/java/org/onap/nbi/apis/servicecatalog/ServiceSpecificationService.java @@ -22,8 +22,7 @@ import java.util.Map; import org.apache.commons.collections.CollectionUtils; import org.onap.nbi.apis.servicecatalog.jolt.FindServiceSpecJsonTransformer; import org.onap.nbi.apis.servicecatalog.jolt.GetServiceSpecJsonTransformer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.onap.nbi.apis.serviceorder.ServiceCatalogUrl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.MultiValueMap; @@ -43,20 +42,16 @@ public class ServiceSpecificationService { @Autowired ToscaInfosProcessor toscaInfosProcessor; - private static final Logger LOGGER = LoggerFactory.getLogger(ServiceSpecificationService.class); + @Autowired + private ServiceCatalogUrl serviceCatalogUrl; + + private static final String SERVICE_SPEC_INPUT_SCHEMA = "serviceSpecInputSchema"; public Map get(String serviceSpecId) { Map sdcResponse = sdcClient.callGet(serviceSpecId); - LinkedHashMap serviceCatalogResponse = (LinkedHashMap) getServiceSpecJsonTransformer.transform(sdcResponse); - Map toscaInfosTopologyTemplate = toscaInfosProcessor.getToscaInfos(serviceCatalogResponse); - if (toscaInfosTopologyTemplate != null) { - LOGGER.debug("tosca file found, retrieving informations"); - toscaInfosProcessor.buildResponseWithToscaInfos(toscaInfosTopologyTemplate, serviceCatalogResponse); - } else { - LOGGER.debug("no tosca file found, partial response"); - } - return serviceCatalogResponse; + sdcResponse.put(SERVICE_SPEC_INPUT_SCHEMA,serviceCatalogUrl.getServiceCatalogUrl()+serviceSpecId+"/"+SERVICE_SPEC_INPUT_SCHEMA); + return (LinkedHashMap) getServiceSpecJsonTransformer.transform(sdcResponse); } diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/MultiCriteriaRequestBuilder.java b/src/main/java/org/onap/nbi/apis/serviceorder/MultiCriteriaRequestBuilder.java index 74ee6a6..7ea2fd4 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/MultiCriteriaRequestBuilder.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/MultiCriteriaRequestBuilder.java @@ -15,8 +15,10 @@ */ package org.onap.nbi.apis.serviceorder; -import java.util.Locale; -import java.util.TimeZone; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; import org.onap.nbi.apis.serviceorder.model.StateType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,10 +29,6 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.MultiValueMap; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; @Service public class MultiCriteriaRequestBuilder { |