diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ToscaGetFunctionExceptionSupplier.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ToscaGetFunctionExceptionSupplier.java | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ToscaGetFunctionExceptionSupplier.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ToscaGetFunctionExceptionSupplier.java index 5e1d005bfa..44d6f50740 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ToscaGetFunctionExceptionSupplier.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ToscaGetFunctionExceptionSupplier.java @@ -26,6 +26,7 @@ import java.util.function.Supplier; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.datatypes.elements.ToscaGetFunctionDataDefinition; import org.openecomp.sdc.be.datatypes.enums.PropertySource; import org.openecomp.sdc.be.datatypes.tosca.ToscaGetFunctionType; @@ -37,13 +38,44 @@ public class ToscaGetFunctionExceptionSupplier { final String errorMsg = String.format("%s on %s", toscaGetFunctionType.getFunctionName(), propertySource.getName()); return () -> new ByActionStatusComponentException(ActionStatus.NOT_SUPPORTED, errorMsg); } - public static Supplier<ByActionStatusComponentException> propertyNotFoundOnTarget(final String propertyName, final PropertySource propertySource, final ToscaGetFunctionType functionType) { return propertyNotFoundOnTarget(List.of(propertyName), propertySource, functionType); } + public static Supplier<ByActionStatusComponentException> targetFunctionTypeNotFound() { + return () -> new ByActionStatusComponentException(ActionStatus.TOSCA_FUNCTION_MISSING_ATTRIBUTE, "function type"); + } + + public static Supplier<ByActionStatusComponentException> targetPropertySourceNotFound(final ToscaGetFunctionType toscaGetFunctionType) { + return () -> new ByActionStatusComponentException(ActionStatus.TOSCA_FUNCTION_MISSING_ATTRIBUTE, "property source of " + toscaGetFunctionType); + } + + public static Supplier<ByActionStatusComponentException> targetSourcePathNotFound(final ToscaGetFunctionType toscaGetFunctionType) { + return () -> new ByActionStatusComponentException(ActionStatus.TOSCA_FUNCTION_MISSING_ATTRIBUTE, "source path of " + toscaGetFunctionType); + } + + public static Supplier<ByActionStatusComponentException> propertyNameNotFound(final PropertySource propertySource) { + return () -> new ByActionStatusComponentException(ActionStatus.TOSCA_FUNCTION_MISSING_ATTRIBUTE, "property name of source " + + propertySource); + } + + public static Supplier<ByActionStatusComponentException> propertyIdNotFound(final PropertySource propertySource) { + return () -> new ByActionStatusComponentException(ActionStatus.TOSCA_FUNCTION_MISSING_ATTRIBUTE, "property id of source " + + propertySource); + } + + public static Supplier<ByActionStatusComponentException> sourceNameNotFound(final PropertySource propertySource) { + return () -> new ByActionStatusComponentException(ActionStatus.TOSCA_FUNCTION_MISSING_ATTRIBUTE, "source name of " + + propertySource); + } + + public static Supplier<ByActionStatusComponentException> sourceIdNotFound(final PropertySource propertySource) { + return () -> new ByActionStatusComponentException(ActionStatus.TOSCA_FUNCTION_MISSING_ATTRIBUTE, "source id of " + + propertySource); + } + public static Supplier<ByActionStatusComponentException> propertyNotFoundOnTarget(final List<String> propertyPathFromSource, final PropertySource propertySource, final ToscaGetFunctionType functionType) { |