import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstInputsMap;
+import org.openecomp.sdc.be.model.ComponentInstOutputsMap;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.ComponentInstanceProperty;
import org.openecomp.sdc.be.model.ComponentParametersView;
DataTypeValidatorConverter dataTypeValidatorConverter = DataTypeValidatorConverter.getInstance();
- public BaseBusinessLogic(IElementOperation elementDao, IGroupOperation groupOperation,
+ protected BaseBusinessLogic(IElementOperation elementDao, IGroupOperation groupOperation,
IGroupInstanceOperation groupInstanceOperation, IGroupTypeOperation groupTypeOperation, InterfaceOperation interfaceOperation,
InterfaceLifecycleOperation interfaceLifecycleTypeOperation, ArtifactsOperations artifactToscaOperation) {
this.elementDao = elementDao;
String innerType = getInnerType(property);
// Specific Update Logic
Either<Object, Boolean> isValid =
- propertyOperation.validateAndUpdatePropertyValue(propertyType, (String) property.getValue(), true,
+ propertyOperation.validateAndUpdatePropertyValue(propertyType, property.getValue(), true,
innerType, allDataTypes);
String newValue = property.getValue();
if (isValid.isRight()) {
public void validateCanWorkOnComponent(Component component, String userId) {
ActionStatus actionStatus = ActionStatus.RESTRICTED_OPERATION;
// verify resource is not archived
- if (component.isArchived() == true){
+ if (Boolean.TRUE.equals(component.isArchived())){
actionStatus = ActionStatus.COMPONENT_IS_ARCHIVED;
throw new ByActionStatusComponentException(actionStatus, component.getName());
}
}
-
ComponentTypeEnum getComponentTypeByParentComponentType(ComponentTypeEnum parentComponentType) {
switch (parentComponentType) {
case SERVICE:
return null;
}
-
-
protected Map<String, DataTypeDefinition> getAllDataTypes(ApplicationDataTypeCache applicationDataTypeCache) {
Either<Map<String, DataTypeDefinition>, JanusGraphOperationStatus> allDataTypes = applicationDataTypeCache.getAll();
if (allDataTypes.isRight()) {
if (type.equals(ToscaPropertyType.LIST.getType()) || type.equals(ToscaPropertyType.MAP.getType())) {
ImmutablePair<String, Boolean> propertyInnerTypeValid = propertyOperation.isPropertyInnerTypeValid(property, dataTypes);
innerType = propertyInnerTypeValid.getLeft();
- if (!propertyInnerTypeValid.getRight()) {
+ if (Boolean.FALSE.equals(propertyInnerTypeValid.getRight())) {
log.info("Invalid inner type for property '{}' type '{}', dataTypeCount '{}'", property.getName(), property.getType(), dataTypes.size());
ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.INVALID_PROPERTY_INNER_TYPE, innerType, property.getName());
return Either.right(responseFormat);
throw new ByActionStatusComponentException(actionStatus, params);
}
- public <T extends ToscaDataDefinition> Either<List<T>, ResponseFormat> declareProperties(String userId, String componentId,
- ComponentTypeEnum componentTypeEnum, ComponentInstInputsMap componentInstInputsMap) {
+ public <T extends ToscaDataDefinition> Either<List<T>, ResponseFormat> declareProperties(final String userId,
+ final String componentId,
+ final ComponentTypeEnum componentTypeEnum,
+ final ComponentInstInputsMap componentInstInputsMap) {
+ return Either.left(new ArrayList<>());
+ }
+ public <T extends ToscaDataDefinition> Either<List<T>, ResponseFormat> declareAttributes(final String userId,
+ final String componentId,
+ final ComponentTypeEnum componentTypeEnum,
+ final ComponentInstOutputsMap componentInstOutputsMap) {
return Either.left(new ArrayList<>());
}