Provide backend support for timeout in interface operation implementation
Backend support for timeout in interface operation implementation is provided
Issue-ID: SDC-4580
Signed-off-by: Imam hussain <imam.hussain@est.tech>
Change-Id: I2166e7144e5e08339e6ab7e8037d6821c18380a2
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
index cce0ad1..f4624b1 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
@@ -321,6 +321,10 @@
if (isArtifactPresent(operationDataDefinition)) {
final String operationArtifactPath =
OperationArtifactUtil.createOperationArtifactPath(component, componentInstance, operationDataDefinition, isAssociatedComponent);
+ final ToscaInterfaceOperationImplementation toscaInterfaceOperationImplementation = new ToscaInterfaceOperationImplementation();
+ if (implementation.getTimeout() != null && implementation.getTimeout() > 0) {
+ toscaInterfaceOperationImplementation.setTimeout(implementation.getTimeout());
+ }
if (implementation.getArtifactType() != null) {
final ToscaArtifactDefinition toscaArtifactDefinition = new ToscaArtifactDefinition();
toscaArtifactDefinition.setFile(operationArtifactPath);
@@ -331,12 +335,18 @@
if (MapUtils.isNotEmpty(propertiesMap)) {
toscaArtifactDefinition.setProperties(propertiesMap);
}
- final ToscaInterfaceOperationImplementation toscaInterfaceOperationImplementation = new ToscaInterfaceOperationImplementation();
toscaInterfaceOperationImplementation.setPrimary(toscaArtifactDefinition);
toscaOperation.setImplementation(toscaInterfaceOperationImplementation);
} else {
- toscaOperation.setImplementation(
- StringUtils.isBlank(operationArtifactPath) || "null".equals(operationArtifactPath) ? null : operationArtifactPath);
+ if (toscaInterfaceOperationImplementation.getTimeout() != null) {
+ final ToscaArtifactDefinition toscaArtifactDefinition = new ToscaArtifactDefinition();
+ toscaArtifactDefinition.setFile(StringUtils.isBlank(operationArtifactPath) || "null".equals(operationArtifactPath) ? null : operationArtifactPath);
+ toscaInterfaceOperationImplementation.setPrimary(toscaArtifactDefinition);
+ toscaOperation.setImplementation(toscaInterfaceOperationImplementation);
+ } else {
+ toscaOperation.setImplementation(
+ StringUtils.isBlank(operationArtifactPath) || "null".equals(operationArtifactPath) ? null : operationArtifactPath);
+ }
}
}
}