From eaa905031e1e0b9905060b213be8b6dc8b439168 Mon Sep 17 00:00:00 2001 From: AS00465059 Date: Mon, 23 Apr 2018 10:57:52 +0530 Subject: Sonar-Critical Bug Fixing File:RestfulUtil.java Line:L85 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:E2EServiceInstances.java Line:L263 L1059 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:OrchestrationRequests.java Line:L343 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:ASDCConfiguration.java Line:L286 L378 SonarLink: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:ResourceInput.java Line:L287 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:ResourceRecipeRequest.java Line:L136 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:ResourceRequestBuilder.java Line:L108 L214 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:CheckAaiForCorrelationIdDelegate.java Line:L70 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:AbstractSdncOperationTask.java Line:L359 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:DmaapClient.java Line:L62 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL File:HasAnnotationPropertyWithValueMatcher.java Line:L60 Sonar Link: https://sonar.onap.org/issues?assigned=false&projectUuids=AWHCr9eDWid2ybiDeORt&resolved=false&rules=squid%3AS1166&severities=BLOCKER%2CCRITICAL Change-Id: Ic168a118790c31850a9f32f98465be5d52b8c96f Issue-ID: SO-581 Signed-off-by: AS00465059 --- .../mso/bpmn/common/recipe/ResourceInput.java | 589 +++++++++++---------- .../bpmn/common/recipe/ResourceRecipeRequest.java | 6 +- .../common/resource/ResourceRequestBuilder.java | 3 +- 3 files changed, 303 insertions(+), 295 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main/java') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java index 00e4ae71d6..13b1666991 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java @@ -1,293 +1,296 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.openecomp.mso.bpmn.common.recipe; - -import org.openecomp.mso.bpmn.core.domain.ModelInfo; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonRootName; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -/** - * the inputs for the resource recipe - *
- *

- *

- * - * @author - * @version ONAP Beijing Release 2018-03-08 - */ -@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "serviceModelInfo","resourceModelInfo", "resourceInstancenUuid","resourceParameters","operationType"}) -@JsonRootName("variables") -public class ResourceInput { - - @JsonProperty("resourceInstanceName") - private String resourceInstanceName; - - @JsonProperty("resourceInstanceDes") - private String resourceInstanceDes; - - @JsonProperty("globalSubscriberId") - private String globalSubscriberId; - - @JsonProperty("serviceType") - private String serviceType; - - @JsonProperty("serviceInstanceId") - private String serviceInstanceId; - - @JsonProperty("operationId") - private String operationId; - - @JsonProperty("serviceModelInfo") - private ModelInfo serviceModelInfo; - - @JsonProperty("resourceModelInfo") - private ModelInfo resourceModelInfo; - - //for delete resource - @JsonProperty("resourceInstancenUuid") - private String resourceInstancenUuid; - - @JsonProperty("resourceParameters") - private String resourceParameters; - - @JsonProperty("operationType") - private String operationType; - - - /** - * @return Returns the resourceInstanceName. - */ - @JsonProperty("resourceInstanceName") - public String getResourceInstanceName() { - return resourceInstanceName; - } - - - /** - * @param resourceInstanceName The resourceInstanceName to set. - */ - @JsonProperty("resourceInstanceName") - public void setResourceInstanceName(String resourceInstanceName) { - this.resourceInstanceName = resourceInstanceName; - } - - - /** - * @return Returns the resourceInstanceDes. - */ - @JsonProperty("resourceInstanceDes") - public String getResourceInstanceDes() { - return resourceInstanceDes; - } - - - /** - * @param resourceInstanceDes The resourceInstanceDes to set. - */ - @JsonProperty("resourceInstanceDes") - public void setResourceInstanceDes(String resourceInstanceDes) { - this.resourceInstanceDes = resourceInstanceDes; - } - - - /** - * @return Returns the globalSubscriberId. - */ - @JsonProperty("globalSubscriberId") - public String getGlobalSubscriberId() { - return globalSubscriberId; - } - - - /** - * @param globalSubscriberId The globalSubscriberId to set. - */ - @JsonProperty("globalSubscriberId") - public void setGlobalSubscriberId(String globalSubscriberId) { - this.globalSubscriberId = globalSubscriberId; - } - - - /** - * @return Returns the serviceType. - */ - @JsonProperty("serviceType") - public String getServiceType() { - return serviceType; - } - - - /** - * @param serviceType The serviceType to set. - */ - @JsonProperty("serviceType") - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - - /** - * @return Returns the serviceId. - */ - @JsonProperty("serviceInstanceId") - public String getServiceInstanceId() { - return serviceInstanceId; - } - - - /** - * @param serviceId The serviceId to set. - */ - @JsonProperty("serviceInstanceId") - public void setServiceInstanceId(String serviceId) { - this.serviceInstanceId = serviceId; - } - - - /** - * @return Returns the operationId. - */ - @JsonProperty("operationId") - public String getOperationId() { - return operationId; - } - - - /** - * @param operationId The operationId to set. - */ - @JsonProperty("operationId") - public void setOperationId(String operationId) { - this.operationId = operationId; - } - - /** - * @return Returns the serviceModelInfo. - */ - @JsonProperty("serviceModelInfo") - public ModelInfo getServiceModelInfo() { - return serviceModelInfo; - } - - - - /** - * @param serviceModelInfo The serviceModelInfo to set. - */ - @JsonProperty("serviceModelInfo") - public void setServiceModelInfo(ModelInfo serviceModelInfo) { - this.serviceModelInfo = serviceModelInfo; - } - - - - /** - * @return Returns the resourceModelInfo. - */ - @JsonProperty("resourceModelInfo") - public ModelInfo getResourceModelInfo() { - return resourceModelInfo; - } - - - - /** - * @param resourceModelInfo The resourceModelInfo to set. - */ - @JsonProperty("resourceModelInfo") - public void setResourceModelInfo(ModelInfo resourceModelInfo) { - this.resourceModelInfo = resourceModelInfo; - } - - - /** - * @return Returns the resourceParameters. - */ - @JsonProperty("resourceParameters") - public String getResourceParameters() { - return resourceParameters; - } - - - /** - * @param resourceParameters The resourceParameters to set. - */ - @JsonProperty("resourceParameters") - public void setResourceParameters(String resourceParameters) { - this.resourceParameters = resourceParameters; - } - - - /** - * @return Returns the operationType. - */ - @JsonProperty("operationType") - public String getOperationType() { - return operationType; - } - - - /** - * @param operationType The operationType to set. - */ - @JsonProperty("operationType") - public void setOperationType(String operationType) { - this.operationType = operationType; - } - - - - /** - * @return Returns the resourceInstancenUuid. - */ - @JsonProperty("resourceInstancenUuid") - public String getResourceInstancenUuid() { - return resourceInstancenUuid; - } - - - - /** - * @param resourceInstancenUuid The resourceInstancenUuid to set. - */ - @JsonProperty("resourceInstancenUuid") - public void setResourceInstancenUuid(String resourceInstancenUuid) { - this.resourceInstancenUuid = resourceInstancenUuid; - } - - @Override - public String toString() { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); - String jsonStr = ""; - try { - jsonStr = mapper.writeValueAsString(this); - } catch(JsonProcessingException e) { - - e.printStackTrace(); - } - return jsonStr; - } -} +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.openecomp.mso.bpmn.common.recipe; + +import org.openecomp.mso.bpmn.core.domain.ModelInfo; +import org.openecomp.mso.logger.MsoLogger; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * the inputs for the resource recipe + *
+ *

+ *

+ * + * @author + * @version ONAP Beijing Release 2018-03-08 + */ +@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "serviceModelInfo","resourceModelInfo", "resourceInstancenUuid","resourceParameters","operationType"}) +@JsonRootName("variables") +public class ResourceInput { + + private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); + + @JsonProperty("resourceInstanceName") + private String resourceInstanceName; + + @JsonProperty("resourceInstanceDes") + private String resourceInstanceDes; + + @JsonProperty("globalSubscriberId") + private String globalSubscriberId; + + @JsonProperty("serviceType") + private String serviceType; + + @JsonProperty("serviceInstanceId") + private String serviceInstanceId; + + @JsonProperty("operationId") + private String operationId; + + @JsonProperty("serviceModelInfo") + private ModelInfo serviceModelInfo; + + @JsonProperty("resourceModelInfo") + private ModelInfo resourceModelInfo; + + //for delete resource + @JsonProperty("resourceInstancenUuid") + private String resourceInstancenUuid; + + @JsonProperty("resourceParameters") + private String resourceParameters; + + @JsonProperty("operationType") + private String operationType; + + + /** + * @return Returns the resourceInstanceName. + */ + @JsonProperty("resourceInstanceName") + public String getResourceInstanceName() { + return resourceInstanceName; + } + + + /** + * @param resourceInstanceName The resourceInstanceName to set. + */ + @JsonProperty("resourceInstanceName") + public void setResourceInstanceName(String resourceInstanceName) { + this.resourceInstanceName = resourceInstanceName; + } + + + /** + * @return Returns the resourceInstanceDes. + */ + @JsonProperty("resourceInstanceDes") + public String getResourceInstanceDes() { + return resourceInstanceDes; + } + + + /** + * @param resourceInstanceDes The resourceInstanceDes to set. + */ + @JsonProperty("resourceInstanceDes") + public void setResourceInstanceDes(String resourceInstanceDes) { + this.resourceInstanceDes = resourceInstanceDes; + } + + + /** + * @return Returns the globalSubscriberId. + */ + @JsonProperty("globalSubscriberId") + public String getGlobalSubscriberId() { + return globalSubscriberId; + } + + + /** + * @param globalSubscriberId The globalSubscriberId to set. + */ + @JsonProperty("globalSubscriberId") + public void setGlobalSubscriberId(String globalSubscriberId) { + this.globalSubscriberId = globalSubscriberId; + } + + + /** + * @return Returns the serviceType. + */ + @JsonProperty("serviceType") + public String getServiceType() { + return serviceType; + } + + + /** + * @param serviceType The serviceType to set. + */ + @JsonProperty("serviceType") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + + /** + * @return Returns the serviceId. + */ + @JsonProperty("serviceInstanceId") + public String getServiceInstanceId() { + return serviceInstanceId; + } + + + /** + * @param serviceId The serviceId to set. + */ + @JsonProperty("serviceInstanceId") + public void setServiceInstanceId(String serviceId) { + this.serviceInstanceId = serviceId; + } + + + /** + * @return Returns the operationId. + */ + @JsonProperty("operationId") + public String getOperationId() { + return operationId; + } + + + /** + * @param operationId The operationId to set. + */ + @JsonProperty("operationId") + public void setOperationId(String operationId) { + this.operationId = operationId; + } + + /** + * @return Returns the serviceModelInfo. + */ + @JsonProperty("serviceModelInfo") + public ModelInfo getServiceModelInfo() { + return serviceModelInfo; + } + + + + /** + * @param serviceModelInfo The serviceModelInfo to set. + */ + @JsonProperty("serviceModelInfo") + public void setServiceModelInfo(ModelInfo serviceModelInfo) { + this.serviceModelInfo = serviceModelInfo; + } + + + + /** + * @return Returns the resourceModelInfo. + */ + @JsonProperty("resourceModelInfo") + public ModelInfo getResourceModelInfo() { + return resourceModelInfo; + } + + + + /** + * @param resourceModelInfo The resourceModelInfo to set. + */ + @JsonProperty("resourceModelInfo") + public void setResourceModelInfo(ModelInfo resourceModelInfo) { + this.resourceModelInfo = resourceModelInfo; + } + + + /** + * @return Returns the resourceParameters. + */ + @JsonProperty("resourceParameters") + public String getResourceParameters() { + return resourceParameters; + } + + + /** + * @param resourceParameters The resourceParameters to set. + */ + @JsonProperty("resourceParameters") + public void setResourceParameters(String resourceParameters) { + this.resourceParameters = resourceParameters; + } + + + /** + * @return Returns the operationType. + */ + @JsonProperty("operationType") + public String getOperationType() { + return operationType; + } + + + /** + * @param operationType The operationType to set. + */ + @JsonProperty("operationType") + public void setOperationType(String operationType) { + this.operationType = operationType; + } + + + + /** + * @return Returns the resourceInstancenUuid. + */ + @JsonProperty("resourceInstancenUuid") + public String getResourceInstancenUuid() { + return resourceInstancenUuid; + } + + + + /** + * @param resourceInstancenUuid The resourceInstancenUuid to set. + */ + @JsonProperty("resourceInstancenUuid") + public void setResourceInstancenUuid(String resourceInstancenUuid) { + this.resourceInstancenUuid = resourceInstancenUuid; + } + + @Override + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); + String jsonStr = ""; + try { + jsonStr = mapper.writeValueAsString(this); + } catch(JsonProcessingException e) { + msoLogger.debug("JsonProcessingException", e); + e.printStackTrace(); + } + return jsonStr; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java index 194f7c43ec..a1809fe754 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java @@ -20,6 +20,8 @@ package org.openecomp.mso.bpmn.common.recipe; +import org.openecomp.mso.logger.MsoLogger; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonRootName; @@ -35,6 +37,8 @@ import com.fasterxml.jackson.databind.SerializationFeature; @JsonRootName("variables") public class ResourceRecipeRequest { + private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); + @JsonProperty("resourceInput") private BpmnParam resourceInput; @@ -147,7 +151,7 @@ public class ResourceRecipeRequest { try { jsonStr = mapper.writeValueAsString(this); } catch(JsonProcessingException e) { - + msoLogger.debug("JsonProcessingException", e); e.printStackTrace(); } return jsonStr; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java index 7c3ea37817..c88800273c 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java @@ -109,6 +109,7 @@ public class ResourceRequestBuilder { Map resourceInputsFromServiceDeclaredLevel = buildResouceRequest(serviceUuid, resourceCustomizationUuid, serviceInput); resourceInputsFromUuiMap.putAll(resourceInputsFromServiceDeclaredLevel); } catch(SdcToscaParserException e) { + LOGGER.debug("SdcToscaParserException", e); e.printStackTrace(); } String resourceInputsStr = getJsonString(resourceInputsFromUuiMap); @@ -216,7 +217,7 @@ public class ResourceRequestBuilder { try { jsonStr = mapper.writeValueAsString(srcObj); } catch(JsonProcessingException e) { - + LOGGER.debug("SdcToscaParserException", e); e.printStackTrace(); } return jsonStr; -- cgit 1.2.3-korg