aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnIntegerParam.java48
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java589
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java21
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java19
5 files changed, 378 insertions, 305 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnIntegerParam.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnIntegerParam.java
new file mode 100644
index 0000000000..033c6876bd
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnIntegerParam.java
@@ -0,0 +1,48 @@
+/*-
+ * ============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 com.fasterxml.jackson.annotation.JsonProperty;
+
+public class BpmnIntegerParam {
+
+ @JsonProperty("value")
+ private int value;
+ @JsonProperty("type")
+ private final String type = "Integer";
+
+ public BpmnIntegerParam() {
+ }
+
+ @JsonProperty("value")
+ public int getValue() {
+ return value;
+ }
+
+ @JsonProperty("type")
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return "CamundaInput [value=" + Integer.toString(value) + ", type=" + type + "]";
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
index 016afa8537..1dc0451213 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
@@ -115,9 +115,6 @@ public class BpmnRestClient {
HttpPost post = new HttpPost(recipeUri);
MsoJavaProperties props = loadMsoProperties();
- RequestConfig requestConfig =
- RequestConfig.custom().setSocketTimeout(recipeTimeout).setConnectTimeout(recipeTimeout).setConnectionRequestTimeout(recipeTimeout).build();
- post.setConfig(requestConfig);
msoLogger.debug("call the bpmn, url:" + recipeUri);
String jsonReq = wrapResourceRequest(requestId, recipeTimeout, requestAction, serviceInstanceId, serviceType, requestDetails, recipeParamXsd);
@@ -177,6 +174,8 @@ public class BpmnRestClient {
BpmnParam serviceInstanceIdInput = new BpmnParam();
BpmnParam serviceTypeInput = new BpmnParam();
BpmnParam recipeParamsInput = new BpmnParam();
+ BpmnIntegerParam recipeTimeoutInput = new BpmnIntegerParam();
+ recipeTimeoutInput.setValue(recipeTimeout);
// host.setValue(parseURL());
requestIdInput.setValue(requestId);
requestActionInput.setValue(requestAction);
@@ -191,6 +190,7 @@ public class BpmnRestClient {
recipeRequest.setServiceType(serviceTypeInput);
recipeRequest.setRecipeParams(recipeParamsInput);
recipeRequest.setResourceInput(resourceInput);
+ recipeRequest.setRecipeTimeout(recipeTimeoutInput);
jsonReq = recipeRequest.toString();
msoLogger.debug("request body is " + jsonReq);
} catch(Exception e) {
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
- * <br>
- * <p>
- * </p>
- *
- * @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
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @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 5bf5a02a38..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;
@@ -56,6 +60,9 @@ public class ResourceRecipeRequest {
@JsonProperty("recipeParams")
private BpmnParam recipeParams;
+ @JsonProperty("recipeTimeout")
+ private BpmnIntegerParam recipeTimeout;
+
@JsonProperty("resourceInput")
public BpmnParam getResourceInput() {
return resourceInput;
@@ -126,7 +133,17 @@ public class ResourceRecipeRequest {
this.recipeParams = recipeParams;
}
- @Override
+ @JsonProperty("recipeTimeout")
+ public BpmnIntegerParam getRecipeTimeout() {
+ return recipeTimeout;
+ }
+
+ @JsonProperty("recipeTimeout")
+ public void setRecipeTimeout(BpmnIntegerParam recipeTimeout) {
+ this.recipeTimeout = recipeTimeout;
+ }
+
+ @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
@@ -134,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 9aa17930c0..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
@@ -22,6 +22,7 @@ package org.openecomp.mso.bpmn.common.resource;
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
@@ -34,9 +35,6 @@ import org.camunda.bpm.engine.runtime.Execution;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
-import org.openecomp.mso.bpmn.core.json.JsonUtils;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
@@ -44,6 +42,10 @@ import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.Property;
import org.onap.sdc.toscaparser.api.functions.GetInput;
import org.onap.sdc.toscaparser.api.parameters.Input;
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.openecomp.mso.bpmn.core.json.JsonUtils;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -55,10 +57,11 @@ public class ResourceRequestBuilder {
public static String CUSTOMIZATION_UUID = "customizationUUID";
- public static String SERVICE_URL_TOSCA_CSAR = "http://mso:8080/ecomp/mso/catalog/v3/serviceToscaCsar?serviceModelUuid=";
+ public static String SERVICE_URL_TOSCA_CSAR = "/v3/serviceToscaCsar?serviceModelUuid=";
private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
static JsonUtils jsonUtil = new JsonUtils();
/**
@@ -106,6 +109,7 @@ public class ResourceRequestBuilder {
Map<String, Object> resourceInputsFromServiceDeclaredLevel = buildResouceRequest(serviceUuid, resourceCustomizationUuid, serviceInput);
resourceInputsFromUuiMap.putAll(resourceInputsFromServiceDeclaredLevel);
} catch(SdcToscaParserException e) {
+ LOGGER.debug("SdcToscaParserException", e);
e.printStackTrace();
}
String resourceInputsStr = getJsonString(resourceInputsFromUuiMap);
@@ -120,7 +124,6 @@ public class ResourceRequestBuilder {
throws SdcToscaParserException {
Map<String, Object> resouceRequest = new HashMap<>();
-
String csarpath = null;
try {
csarpath = getCsarFromUuid(serviceUuid);
@@ -179,7 +182,9 @@ public class ResourceRequestBuilder {
private static String getCsarFromUuid(String uuid) throws Exception {
ResteasyClient client = new ResteasyClientBuilder().build();
- ResteasyWebTarget target = client.target(SERVICE_URL_TOSCA_CSAR + uuid);
+ Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+ String catalogEndPoint = properties.get("mso.catalog.db.endpoint");
+ ResteasyWebTarget target = client.target(catalogEndPoint + SERVICE_URL_TOSCA_CSAR + uuid);
Response response = target.request().get();
String value = response.readEntity(String.class);
@@ -212,7 +217,7 @@ public class ResourceRequestBuilder {
try {
jsonStr = mapper.writeValueAsString(srcObj);
} catch(JsonProcessingException e) {
-
+ LOGGER.debug("SdcToscaParserException", e);
e.printStackTrace();
}
return jsonStr;