2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 package org.openecomp.sdc.be.components.impl;
20 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.createMappedInputPropertyDefaultValue;
21 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.createMappedOutputDefaultValue;
22 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.getInterfaceDefinitionFromComponentByInterfaceId;
23 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.getInterfaceDefinitionFromComponentByInterfaceType;
24 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.getOperationFromInterfaceDefinition;
25 import static org.openecomp.sdc.be.components.utils.InterfaceOperationUtils.isOperationInputMappedToComponentInput;
26 import static org.openecomp.sdc.be.tosca.utils.InterfacesOperationsToscaUtil.SELF;
28 import com.google.gson.Gson;
30 import java.util.ArrayList;
31 import java.util.Collection;
32 import java.util.Collections;
33 import java.util.HashMap;
34 import java.util.List;
36 import java.util.Objects;
37 import java.util.Optional;
38 import java.util.UUID;
39 import java.util.stream.Collectors;
41 import fj.data.Either;
42 import org.apache.commons.collections4.CollectionUtils;
43 import org.apache.commons.collections4.MapUtils;
44 import org.openecomp.sdc.be.components.validation.InterfaceOperationValidation;
45 import org.openecomp.sdc.be.dao.api.ActionStatus;
46 import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao;
47 import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
48 import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
49 import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
50 import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
51 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
52 import org.openecomp.sdc.be.model.ArtifactDefinition;
53 import org.openecomp.sdc.be.model.ComponentInstanceInterface;
54 import org.openecomp.sdc.be.model.InputDefinition;
55 import org.openecomp.sdc.be.model.InterfaceDefinition;
56 import org.openecomp.sdc.be.model.Operation;
57 import org.openecomp.sdc.be.model.User;
58 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
59 import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
60 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
61 import org.openecomp.sdc.exception.ResponseFormat;
62 import org.slf4j.Logger;
63 import org.slf4j.LoggerFactory;
64 import org.springframework.beans.factory.annotation.Autowired;
65 import org.springframework.stereotype.Component;
67 @Component("interfaceOperationBusinessLogic")
68 public class InterfaceOperationBusinessLogic extends BaseBusinessLogic {
70 private static final Logger LOGGER = LoggerFactory.getLogger(InterfaceOperationBusinessLogic.class);
71 private static final String EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION =
72 "Exception occurred during {}. Response is {}";
73 private static final String DELETE_INTERFACE_OPERATION = "deleteInterfaceOperation";
74 private static final String GET_INTERFACE_OPERATION = "getInterfaceOperation";
75 private static final String CREATE_INTERFACE_OPERATION = "createInterfaceOperation";
76 private static final String UPDATE_INTERFACE_OPERATION = "updateInterfaceOperation";
79 private ArtifactCassandraDao artifactCassandraDao;
82 private InterfaceOperationValidation interfaceOperationValidation;
84 public Either<List<InterfaceDefinition>, ResponseFormat> deleteInterfaceOperation(String componentId,
85 String interfaceId, List<String> operationsToDelete, User user, boolean lock) {
86 validateUserExists(user.getUserId(), DELETE_INTERFACE_OPERATION, true);
88 Either<org.openecomp.sdc.be.model.Component, ResponseFormat> componentEither = getComponentDetails(componentId);
89 if (componentEither.isRight()) {
90 return Either.right(componentEither.right().value());
92 org.openecomp.sdc.be.model.Component storedComponent = componentEither.left().value();
94 Either<Boolean, ResponseFormat> lockResult =
95 lockComponentResult(lock, storedComponent, DELETE_INTERFACE_OPERATION);
96 if (lockResult.isRight()) {
97 return Either.right(lockResult.right().value());
101 Optional<InterfaceDefinition> optionalInterface = getInterfaceDefinitionFromComponentByInterfaceId(
102 storedComponent, interfaceId);
103 if (!optionalInterface.isPresent()) {
105 componentsUtils.getResponseFormat(ActionStatus.INTERFACE_NOT_FOUND_IN_COMPONENT, interfaceId));
107 InterfaceDefinition interfaceDefinition = optionalInterface.get();
109 Map<String, Operation> operationsCollection = new HashMap<>();
110 for (String operationId : operationsToDelete) {
111 Optional<Map.Entry<String, Operation>> optionalOperation =
112 getOperationFromInterfaceDefinition(interfaceDefinition, operationId);
113 if (!optionalOperation.isPresent()) {
114 return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND,
115 storedComponent.getUniqueId()));
118 Operation storedOperation = optionalOperation.get().getValue();
119 Either<Boolean, ResponseFormat> validateDeleteOperationContainsNoMappedOutputResponse =
120 interfaceOperationValidation.validateDeleteOperationContainsNoMappedOutput(storedOperation,
121 storedComponent, interfaceDefinition);
122 if (validateDeleteOperationContainsNoMappedOutputResponse.isRight()) {
123 return Either.right(validateDeleteOperationContainsNoMappedOutputResponse.right().value());
125 String artifactUuId = storedOperation.getImplementation().getArtifactUUID();
126 CassandraOperationStatus cassandraStatus = artifactCassandraDao.deleteArtifact(artifactUuId);
127 if (cassandraStatus != CassandraOperationStatus.OK) {
128 ResponseFormat responseFormatByArtifactId = componentsUtils.getResponseFormatByArtifactId(
129 componentsUtils.convertFromStorageResponse(
130 componentsUtils.convertToStorageOperationStatus(cassandraStatus)),
131 storedOperation.getImplementation().getArtifactDisplayName());
132 return Either.right(responseFormatByArtifactId);
135 operationsCollection.put(operationId, interfaceDefinition.getOperationsMap().get(operationId));
136 interfaceDefinition.getOperations().remove(operationId);
139 Either<List<InterfaceDefinition>, StorageOperationStatus> deleteOperationEither =
140 interfaceOperation.updateInterfaces(storedComponent.getUniqueId(),
141 Collections.singletonList(interfaceDefinition));
142 if (deleteOperationEither.isRight()) {
144 return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
145 deleteOperationEither.right().value(), storedComponent.getComponentType())));
148 if (interfaceDefinition.getOperations().isEmpty()) {
149 Either<String, StorageOperationStatus> deleteInterfaceEither = interfaceOperation.deleteInterface(
150 storedComponent.getUniqueId(), interfaceDefinition.getUniqueId());
151 if (deleteInterfaceEither.isRight()) {
153 return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
154 deleteInterfaceEither.right().value(), storedComponent.getComponentType())));
159 interfaceDefinition.getOperations().putAll(operationsCollection);
160 interfaceDefinition.getOperations().keySet().removeIf(key -> !(operationsToDelete.contains(key)));
161 return Either.left(Collections.singletonList(interfaceDefinition));
162 } catch (Exception e) {
163 LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "delete", e);
165 return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_DELETED));
167 if (lockResult.isLeft() && lockResult.left().value()) {
168 graphLockOperation.unlockComponent(storedComponent.getUniqueId(),
169 NodeTypeEnum.getByNameIgnoreCase(storedComponent.getComponentType().getValue()));
174 private Either<org.openecomp.sdc.be.model.Component, ResponseFormat> getComponentDetails(String componentId) {
175 Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> componentStorageOperationStatusEither =
176 toscaOperationFacade.getToscaElement(componentId);
177 if (componentStorageOperationStatusEither.isRight()) {
178 return Either.right(componentsUtils.getResponseFormat(
179 componentsUtils.convertFromStorageResponse(componentStorageOperationStatusEither.right().value())));
181 return Either.left(componentStorageOperationStatusEither.left().value());
184 private Either<Boolean, ResponseFormat> lockComponentResult(boolean lock,
185 org.openecomp.sdc.be.model.Component component, String action) {
187 Either<Boolean, ResponseFormat> lockResult = lockComponent(component.getUniqueId(), component, action);
188 if (lockResult.isRight()) {
190 return Either.right(lockResult.right().value());
193 return Either.left(true);
196 public Either<List<InterfaceDefinition>, ResponseFormat> getInterfaceOperation(String componentId,
197 String interfaceId, List<String> operationsToGet, User user, boolean lock) {
198 validateUserExists(user.getUserId(), GET_INTERFACE_OPERATION, true);
200 Either<org.openecomp.sdc.be.model.Component, ResponseFormat> componentEither = getComponentDetails(componentId);
201 if (componentEither.isRight()) {
202 return Either.right(componentEither.right().value());
204 org.openecomp.sdc.be.model.Component storedComponent = componentEither.left().value();
206 Either<Boolean, ResponseFormat> lockResult =
207 lockComponentResult(lock, storedComponent, GET_INTERFACE_OPERATION);
208 if (lockResult.isRight()) {
209 return Either.right(lockResult.right().value());
213 Optional<InterfaceDefinition> optionalInterface = getInterfaceDefinitionFromComponentByInterfaceId(
214 storedComponent, interfaceId);
215 if (!optionalInterface.isPresent()) {
217 componentsUtils.getResponseFormat(ActionStatus.INTERFACE_NOT_FOUND_IN_COMPONENT, interfaceId));
219 InterfaceDefinition interfaceDefinition = optionalInterface.get();
221 for (String operationId : operationsToGet) {
222 Optional<Map.Entry<String, Operation>> optionalOperation =
223 getOperationFromInterfaceDefinition(interfaceDefinition, operationId);
224 if (!optionalOperation.isPresent()) {
225 return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND,
226 storedComponent.getUniqueId()));
231 interfaceDefinition.getOperations().keySet().removeIf(key -> !(operationsToGet.contains(key)));
232 return Either.left(Collections.singletonList(interfaceDefinition));
233 } catch (Exception e) {
234 LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "get", e);
237 componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND, componentId));
239 if (lockResult.isLeft() && lockResult.left().value()) {
240 graphLockOperation.unlockComponent(storedComponent.getUniqueId(),
241 NodeTypeEnum.getByNameIgnoreCase(storedComponent.getComponentType().getValue()));
246 public Either<List<InterfaceDefinition>, ResponseFormat> createInterfaceOperation(String componentId,
247 List<InterfaceDefinition> interfaceDefinitions, User user, boolean lock) {
248 return createOrUpdateInterfaceOperation(componentId, interfaceDefinitions, user, false,
249 CREATE_INTERFACE_OPERATION, lock);
252 private Either<List<InterfaceDefinition>, ResponseFormat> createOrUpdateInterfaceOperation(String componentId,
253 List<InterfaceDefinition> interfaceDefinitions, User user, boolean isUpdate, String errorContext,
255 validateUserExists(user.getUserId(), errorContext, true);
257 Either<org.openecomp.sdc.be.model.Component, ResponseFormat> componentEither = getComponentDetails(componentId);
258 if (componentEither.isRight()) {
259 return Either.right(componentEither.right().value());
261 org.openecomp.sdc.be.model.Component storedComponent = componentEither.left().value();
263 Either<Boolean, ResponseFormat> lockResult = lockComponentResult(lock, storedComponent, errorContext);
264 if (lockResult.isRight()) {
265 return Either.right(lockResult.right().value());
268 Either<Map<String, InterfaceDefinition>, ResponseFormat> interfaceLifecycleTypes =
269 getAllInterfaceLifecycleTypes();
270 if (interfaceLifecycleTypes.isRight()) {
271 return Either.right(interfaceLifecycleTypes.right().value());
275 List<InterfaceDefinition> interfacesCollection = new ArrayList<>();
276 Map<String, Operation> operationsCollection = new HashMap<>();
277 for (InterfaceDefinition inputInterfaceDefinition : interfaceDefinitions) {
278 Optional<InterfaceDefinition> optionalInterface =
279 getInterfaceDefinitionFromComponentByInterfaceType(
280 storedComponent, inputInterfaceDefinition.getType());
281 Either<Boolean, ResponseFormat> interfaceOperationValidationResponseEither =
282 interfaceOperationValidation
283 .validateInterfaceOperations(inputInterfaceDefinition, storedComponent,
284 optionalInterface.orElse(null), interfaceLifecycleTypes.left().value(),
286 if (interfaceOperationValidationResponseEither.isRight()) {
287 return Either.right(interfaceOperationValidationResponseEither.right().value());
290 Map<String, Operation> operationsToAddOrUpdate = inputInterfaceDefinition.getOperationsMap();
291 operationsCollection.putAll(operationsToAddOrUpdate);
292 inputInterfaceDefinition.getOperations().clear();
294 Either<InterfaceDefinition, ResponseFormat> getInterfaceEither =
295 getOrCreateInterfaceDefinition(storedComponent, inputInterfaceDefinition,
296 optionalInterface.orElse(null));
297 if (getInterfaceEither.isRight()) {
298 return Either.right(getInterfaceEither.right().value());
300 InterfaceDefinition interfaceDef = getInterfaceEither.left().value();
302 updateOperationInputDefs(storedComponent, operationsToAddOrUpdate.values());
304 for (Operation operation : operationsToAddOrUpdate.values()) {
306 addOperationToInterface(interfaceDef, operation);
308 Optional<Map.Entry<String, Operation>> optionalOperation =
309 getOperationFromInterfaceDefinition(interfaceDef,
310 operation.getUniqueId());
311 if (!optionalOperation.isPresent()) {
313 return Either.right(componentsUtils
314 .getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND,
315 storedComponent.getUniqueId()));
318 Operation storedOperation = optionalOperation.get().getValue();
319 String artifactUuId = storedOperation.getImplementation().getArtifactUUID();
320 Either<Long, CassandraOperationStatus> artifactCount =
321 artifactCassandraDao.getCountOfArtifactById(artifactUuId);
322 if (artifactCount.isLeft()) {
323 CassandraOperationStatus cassandraStatus =
324 artifactCassandraDao.deleteArtifact(artifactUuId);
325 if (cassandraStatus != CassandraOperationStatus.OK) {
327 ResponseFormat responseFormatByArtifactId =
328 componentsUtils.getResponseFormatByArtifactId(
329 componentsUtils.convertFromStorageResponse(
330 componentsUtils.convertToStorageOperationStatus(
332 storedOperation.getImplementation().getArtifactDisplayName());
333 return Either.right(responseFormatByArtifactId);
336 updateOperationOnInterface(interfaceDef, operation, artifactUuId);
339 interfacesCollection.add(interfaceDef);
342 Either<List<InterfaceDefinition>, StorageOperationStatus> addCreateOperationEither =
343 interfaceOperation.updateInterfaces(storedComponent.getUniqueId(), interfacesCollection);
344 if (addCreateOperationEither.isRight()) {
346 return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
347 addCreateOperationEither.right().value(), storedComponent.getComponentType())));
351 interfacesCollection.forEach(interfaceDefinition -> interfaceDefinition.getOperations().entrySet().removeIf(
352 entry -> !operationsCollection.values().stream().map(OperationDataDefinition::getName)
353 .collect(Collectors.toList()).contains(entry.getValue().getName())));
354 return Either.left(interfacesCollection);
355 } catch (Exception e) {
357 LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "addOrUpdate", e);
358 return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
360 if (lockResult.isLeft() && lockResult.left().value()) {
361 graphLockOperation.unlockComponent(storedComponent.getUniqueId(),
362 NodeTypeEnum.getByNameIgnoreCase(storedComponent.getComponentType().getValue()));
367 public Either<Map<String, InterfaceDefinition>, ResponseFormat> getAllInterfaceLifecycleTypes() {
369 Either<Map<String, InterfaceDefinition>, StorageOperationStatus> interfaceLifecycleTypes =
370 interfaceLifecycleTypeOperation.getAllInterfaceLifecycleTypes();
371 if (interfaceLifecycleTypes.isRight()) {
372 return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_LIFECYCLE_TYPES_NOT_FOUND));
374 interfaceLifecycleTypes.left().value().values().forEach(id -> id.setOperations(
375 id.getOperations().keySet().stream().collect(Collectors.toMap(key -> key.replaceFirst(
376 id.getUniqueId() + ".", ""), i -> id.getOperations().get(i)))));
378 return Either.left(interfaceLifecycleTypes.left().value());
381 private Either<InterfaceDefinition, ResponseFormat> getOrCreateInterfaceDefinition(
382 org.openecomp.sdc.be.model.Component component, InterfaceDefinition interfaceDefinition,
383 InterfaceDefinition storedInterfaceDef) {
384 if (storedInterfaceDef != null) {
385 return Either.left(storedInterfaceDef);
387 interfaceDefinition.setUniqueId(UUID.randomUUID().toString());
388 interfaceDefinition.setToscaResourceName(interfaceDefinition.getType());
389 Either<List<InterfaceDefinition>, StorageOperationStatus> interfaceCreateEither =
390 interfaceOperation.addInterfaces(component.getUniqueId(),
391 Collections.singletonList(interfaceDefinition));
392 if (interfaceCreateEither.isRight()) {
394 return Either.right(componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(
395 interfaceCreateEither.right().value(), component.getComponentType())));
397 return Either.left(interfaceCreateEither.left().value().get(0));
400 private void updateOperationInputDefs(org.openecomp.sdc.be.model.Component component,
401 Collection<Operation> interfaceOperations) {
402 interfaceOperations.stream().filter(operation -> Objects.nonNull(operation.getInputs())).forEach(
403 operation -> operation.getInputs().getListToscaDataDefinition().forEach(
404 inp -> component.getInputs()
405 .forEach(in -> updateOperationInputDefinition(component, inp, in))));
408 private void updateOperationInputDefinition(org.openecomp.sdc.be.model.Component component,
409 OperationInputDefinition operationInput,
410 InputDefinition componentInput) {
411 if (operationInput.getInputId().equals(componentInput.getUniqueId())) {
412 //Set the default value, value and schema only for inputs mapped to component inputs
413 operationInput.setDefaultValue(componentInput.getDefaultValue());
414 operationInput.setToscaDefaultValue(getInputToscaDefaultValue(operationInput, component));
415 operationInput.setValue(componentInput.getValue());
416 operationInput.setSchema(componentInput.getSchema());
418 //Set the tosca default value for inputs mapped to component inputs as well as other outputs
419 operationInput.setToscaDefaultValue(getInputToscaDefaultValue(operationInput, component));
422 private String getInputToscaDefaultValue(OperationInputDefinition input,
423 org.openecomp.sdc.be.model.Component component) {
424 Map<String, List<String>> defaultInputValue;
425 if (isOperationInputMappedToComponentInput(input, component.getInputs())) {
426 String propertyName = input.getInputId().substring(input.getInputId().indexOf('.') + 1);
427 defaultInputValue = createMappedInputPropertyDefaultValue(propertyName);
429 //Currently inputs can only be mapped to a declared input or an other operation outputs
430 defaultInputValue = createMappedOutputDefaultValue(SELF, input.getInputId());
432 return new Gson().toJson(defaultInputValue);
435 private void addOperationToInterface(InterfaceDefinition interfaceDefinition, Operation interfaceOperation) {
436 interfaceOperation.setUniqueId(UUID.randomUUID().toString());
437 interfaceOperation.setImplementation(createArtifactDefinition(UUID.randomUUID().toString()));
438 interfaceDefinition.getOperations()
439 .put(interfaceOperation.getUniqueId(), new OperationDataDefinition(interfaceOperation));
442 private void updateOperationOnInterface(InterfaceDefinition interfaceDefinition, Operation interfaceOperation,
443 String artifactUuId) {
444 interfaceOperation.setImplementation(createArtifactDefinition(artifactUuId));
445 interfaceDefinition.getOperations()
446 .put(interfaceOperation.getUniqueId(), new OperationDataDefinition(interfaceOperation));
449 private ArtifactDefinition createArtifactDefinition(String artifactUuId) {
450 ArtifactDefinition artifactDefinition = new ArtifactDefinition();
451 artifactDefinition.setArtifactUUID(artifactUuId);
452 artifactDefinition.setUniqueId(artifactUuId);
453 artifactDefinition.setArtifactType(ArtifactTypeEnum.WORKFLOW.getType());
454 artifactDefinition.setArtifactGroupType(ArtifactGroupTypeEnum.DEPLOYMENT);
455 return artifactDefinition;
458 public Either<List<InterfaceDefinition>, ResponseFormat> updateInterfaceOperation(String componentId,
459 List<InterfaceDefinition> interfaceDefinitions, User user, boolean lock) {
460 return createOrUpdateInterfaceOperation(componentId, interfaceDefinitions, user, true,
461 UPDATE_INTERFACE_OPERATION, lock);
464 public Either<List<OperationInputDefinition>, ResponseFormat> getInputsListForOperation(String componentId,
465 String componentInstanceId, String interfaceId, String operationId, User user) {
466 Either<org.openecomp.sdc.be.model.Component, ResponseFormat> componentEither = getComponentDetails(componentId);
467 if (componentEither.isRight()){
468 return Either.right(componentEither.right().value());
471 org.openecomp.sdc.be.model.Component storedComponent = componentEither.left().value();
472 validateUserExists(user.getUserId(), GET_INTERFACE_OPERATION, true);
474 Either<Boolean, ResponseFormat> lockResult = lockComponentResult(true, storedComponent, GET_INTERFACE_OPERATION);
475 if (lockResult.isRight()) {
476 return Either.right(lockResult.right().value());
480 org.openecomp.sdc.be.model.Component parentComponent = componentEither.left().value();
481 Map<String, List<ComponentInstanceInterface>> componentInstanceInterfaces =
482 parentComponent.getComponentInstancesInterfaces();
483 if(MapUtils.isEmpty(componentInstanceInterfaces)) {
484 return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND,
485 componentInstanceId));
488 List<ComponentInstanceInterface> componentInstanceInterfaceList =
489 componentInstanceInterfaces.get(componentInstanceId);
490 for(ComponentInstanceInterface componentInstanceInterface : componentInstanceInterfaceList) {
491 if(componentInstanceInterface.getInterfaceId().equals(interfaceId)){
492 Map<String, OperationDataDefinition> operations = componentInstanceInterface.getOperations();
493 if(MapUtils.isNotEmpty(operations) && operations.containsKey(operationId)) {
494 ListDataDefinition<OperationInputDefinition> inputs = operations.get(operationId).getInputs();
495 return Either.left(CollectionUtils.isEmpty(inputs.getListToscaDataDefinition())
496 ? new ArrayList<>() : inputs.getListToscaDataDefinition());
500 return Either.left(new ArrayList<>());
502 catch (Exception e) {
503 LOGGER.error(EXCEPTION_OCCURRED_DURING_INTERFACE_OPERATION, "get", e);
505 return Either.right(componentsUtils.getResponseFormat(ActionStatus.INTERFACE_OPERATION_NOT_FOUND));
508 if (lockResult.isLeft() && lockResult.left().value()) {
509 graphLockOperation.unlockComponent(storedComponent.getUniqueId(),
510 NodeTypeEnum.getByNameIgnoreCase(storedComponent.getComponentType().getValue()));