diff options
author | imamSidero <imam.hussain@est.tech> | 2023-07-21 16:05:17 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2023-07-26 18:19:47 +0000 |
commit | 47317bba3db6c7426a5461aa6c20716bf7db8c96 (patch) | |
tree | 6180636318496ddb731177a7262a910c4a7026bb /catalog-be/src/main | |
parent | 778d5b0650f4a3b7c6760ee1d4d67cee653c8664 (diff) |
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
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java | 16 |
1 files changed, 13 insertions, 3 deletions
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 cce0ad19a3..f4624b1649 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 @@ public class InterfacesOperationsConverter { 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 @@ public class InterfacesOperationsConverter { 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); + } } } } |