ComponentParametersView filters = new ComponentParametersView();
filters.disableAll();
filters.setIgnoreInputs(false);
- Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
+ Either<Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
.getToscaElement(componentId, filters);
if (getComponentEither.isRight()) {
ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(getComponentEither.right().value());
log.debug(FAILED_TO_FOUND_COMPONENT_ERROR, componentId, actionStatus);
return Either.right(componentsUtils.getResponseFormat(actionStatus));
}
- org.openecomp.sdc.be.model.Component component = getComponentEither.left().value();
+ Component component = getComponentEither.left().value();
List<InputDefinition> inputs = component.getInputs();
return Either.left(inputs);
}
filters.setIgnoreInputs(false);
filters.setIgnoreComponentInstances(false);
filters.setIgnoreComponentInstancesInputs(false);
- Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
+ Either<Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
.getToscaElement(componentId, filters);
if (getComponentEither.isRight()) {
ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(getComponentEither.right().value());
log.debug(FAILED_TO_FOUND_COMPONENT_ERROR, componentId, actionStatus);
return Either.right(componentsUtils.getResponseFormat(actionStatus));
}
- org.openecomp.sdc.be.model.Component component = getComponentEither.left().value();
+ Component component = getComponentEither.left().value();
if (!ComponentValidations.validateComponentInstanceExist(component, componentInstanceId)) {
ActionStatus actionStatus = ActionStatus.COMPONENT_INSTANCE_NOT_FOUND;
log.debug("Failed to found component instance inputs {}, error: {}", componentInstanceId, actionStatus);
String instanceId, String inputId) {
validateUserExists(userId);
String parentId = componentId;
- org.openecomp.sdc.be.model.Component component;
+ Component component;
ComponentParametersView filters = new ComponentParametersView();
filters.disableAll();
filters.setIgnoreComponentInstances(false);
if (!instanceId.equals(inputId)) {
- Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
+ Either<Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
.getToscaElement(parentId, filters);
if (getComponentEither.isRight()) {
ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(getComponentEither.right().value());
filters.setIgnoreComponentInstancesProperties(false);
filters.setIgnoreComponentInstancesInputs(false);
filters.setIgnoreProperties(false);
- Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
+ Either<Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
.getToscaElement(parentId, filters);
if (getComponentEither.isRight()) {
ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(getComponentEither.right().value());
List<InputDefinition> inputs, String userId, boolean shouldLockComp) {
List<InputDefinition> returnInputs = new ArrayList<>();
Either<List<InputDefinition>, ResponseFormat> result = null;
- org.openecomp.sdc.be.model.Component component = null;
+ Component component = null;
try {
validateUserExists(userId);
ComponentParametersView componentParametersView = new ComponentParametersView();
public Either<List<ComponentInstanceInput>, ResponseFormat> getInputsForComponentInput(String userId, String componentId, String inputId) {
validateUserExists(userId);
- org.openecomp.sdc.be.model.Component component = null;
+ Component component = null;
ComponentParametersView filters = new ComponentParametersView();
filters.disableAll();
filters.setIgnoreComponentInstances(false);
filters.setIgnoreInputs(false);
filters.setIgnoreComponentInstancesInputs(false);
filters.setIgnoreProperties(false);
- Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
+ Either<Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
.getToscaElement(componentId, filters);
if (getComponentEither.isRight()) {
ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(getComponentEither.right().value());
boolean shouldLockComp,
boolean inTransaction) {
Either<List<InputDefinition>, ResponseFormat> result = null;
- org.openecomp.sdc.be.model.Component component = null;
+ Component component = null;
try {
validateUserExists(userId);
component = getAndValidateComponentForCreate(userId, componentId, componentType, shouldLockComp);
ComponentInstListInput componentListInput, boolean shouldLockComp,
boolean inTransaction) {
Either<List<InputDefinition>, ResponseFormat> result = null;
- org.openecomp.sdc.be.model.Component component = null;
+ Component component = null;
log.trace("#createListInput: enter");
try {
/* check if user exists */
return componentParametersView;
}
- private org.openecomp.sdc.be.model.Component getAndValidateComponentForCreate(
+ private Component getAndValidateComponentForCreate(
String userId, String componentId, ComponentTypeEnum componentType, boolean shouldLockComp
) {
ComponentParametersView componentParametersView = getBaseComponentParametersView();
- org.openecomp.sdc.be.model.Component component = validateComponentExists(componentId, componentType, componentParametersView);
+ Component component = validateComponentExists(componentId, componentType, componentParametersView);
if (shouldLockComp) {
// lock the component
lockComponent(component, CREATE_INPUT);
}
public Either<List<InputDefinition>, ResponseFormat> createInputsInGraph(Map<String, InputDefinition> inputs,
- org.openecomp.sdc.be.model.Component component) {
+ Component component) {
List<InputDefinition> resourceProperties = component.getInputs();
private Either<List<InputDefinition>, ResponseFormat> createListInputsInGraph(Map<String, InputDefinition> inputs,
Map<String, DataTypeDefinition> privateDataTypes,
- org.openecomp.sdc.be.model.Component component) {
+ Component component) {
log.trace("#createListInputsInGraph: enter");
componentParametersView.setIgnoreInterfaces(false);
componentParametersView.setIgnoreDataType(false);
componentParametersView.setIgnoreProperties(false);
- Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> componentEither = toscaOperationFacade
+ Either<Component, StorageOperationStatus> componentEither = toscaOperationFacade
.getToscaElement(componentId, componentParametersView);
if (componentEither.isRight()) {
throw new ByActionStatusComponentException(componentsUtils.convertFromStorageResponse(componentEither.right().value()));
}
- org.openecomp.sdc.be.model.Component component = componentEither.left().value();
+ Component component = componentEither.left().value();
// Validate inputId is child of the component
Optional<InputDefinition> optionalInput = component.getInputs().stream().
// filter by ID
}
private Either<InputDefinition, ResponseFormat> deleteListInput(String componentId, String inputId,
- org.openecomp.sdc.be.model.Component component, InputDefinition inputForDelete,
+ Component component, InputDefinition inputForDelete,
StorageOperationStatus status) {
// the input is created by 'Declare List'.
-
// need to 1. undeclare properties, 2. delete input, 3. delete private data type
StorageOperationStatus storageOperationStatus = propertyDeclarationOrchestrator.unDeclarePropertiesAsListInputs(component, inputForDelete);
if (storageOperationStatus != StorageOperationStatus.OK) {
filters.setIgnoreComponentInstancesInputs(false);
filters.setIgnoreComponentInstancesProperties(false);
filters.setIgnoreProperties(false);
- Either<org.openecomp.sdc.be.model.Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
+ Either<Component, StorageOperationStatus> getComponentEither = toscaOperationFacade
.getToscaElement(componentId, filters);
if (getComponentEither.isRight()) {
ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(getComponentEither.right().value());
log.debug(FAILED_TO_FOUND_COMPONENT_ERROR, componentId, actionStatus);
return Either.right(componentsUtils.getResponseFormat(actionStatus));
}
- org.openecomp.sdc.be.model.Component component = getComponentEither.left().value();
+ Component component = getComponentEither.left().value();
Optional<InputDefinition> op = component.getInputs().stream().filter(in -> in.getUniqueId().equals(inputId)).findFirst();
if (!op.isPresent()) {
ActionStatus actionStatus = componentsUtils.convertFromStorageResponse(getComponentEither.right().value());