Package com.denodo.configuration
Class ConfigurationHelper
java.lang.Object
com.denodo.configuration.ConfigurationHelper
Utility class to deal with parameters from a
ParameterStructure-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Parameter<T>buildSimpleMultiValuedParam(String param, Collection<T> values) static <T> Parameter<T>buildSimpleParam(String param, T value) static <T> Collection<T>getMandatoryMultivaluedParameter(String paramName, ParameterStructure parameters) static booleangetMandatoryParameterAsBoolean(String paramName, ParameterStructure parameters) static byte[]getMandatoryParameterAsByteArray(String paramName, ParameterStructure parameters) static intgetMandatoryParameterAsInt(String paramName, ParameterStructure parameters) static longgetMandatoryParameterAsLong(String paramName, ParameterStructure parameters) static StringgetMandatoryParameterAsString(String paramName, ParameterStructure parameters) static <T> Collection<T>getOptionalMultivaluedParameter(String paramName, ParameterStructure parameters) static booleangetOptionalParameterAsBoolean(String paramName, boolean defaultValue, ParameterStructure parameters) static BooleangetOptionalParameterAsBoolean(String paramName, Boolean defaultValue, ParameterStructure parameters) static bytegetOptionalParameterAsByte(String paramName, byte defaultValue, ParameterStructure parameters) static byte[]getOptionalParameterAsByteArray(String paramName, byte[] defaultValue, ParameterStructure parameters) static chargetOptionalParameterAsChar(String paramName, char defaultValue, ParameterStructure parameters) static intgetOptionalParameterAsInt(String paramName, int defaultValue, ParameterStructure parameters) static longgetOptionalParameterAsLong(String paramName, long defaultValue, ParameterStructure parameters) static floatgetOptionalParameterAsNonNegativeFloat(String paramName, float defaultValue, ParameterStructure parameters) static intgetOptionalParameterAsNonNegativeInt(String paramName, int defaultValue, ParameterStructure parameters) static longgetOptionalParameterAsNonNegativeLong(String paramName, long defaultValue, ParameterStructure parameters) static intgetOptionalParameterAsPositiveInt(String paramName, int defaultValue, ParameterStructure parameters) static StringgetOptionalParameterAsString(String paramName, String defaultValue, ParameterStructure parameters) static <T> Collection<T>getValues(ParameterStructure params, String pathExpressions) Obtains the values of the parameters indicated in the pathExpression.static booleanisParamEncrypted(ParameterStructure parameters, String parameterName) static voidstatic voidpostProcessConfiguration(Configuration config, boolean legacy) static voidpostProcessConfiguration(MetadataManager manager, Configuration config) static voidpostProcessConfiguration(MetadataManager manager, Configuration config, boolean legacy) static voidreplaceAll(ParameterStructure params, String pathExpressions, UnaryOperator<String> getElementName) static voidreplaceAll(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues) Replaces each value of the parameters indicated in the pathExpression with the given replacement in the map provided.static voidreplaceAll(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues, boolean keepCurrentIfNoReplacement) static Collection<String>replaceAllWithWarnings(ParameterStructure params, String pathExpressions, UnaryOperator<String> getElementName) static Collection<String>replaceAllWithWarnings(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues) static Collection<String>replaceAllWithWarnings(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues, boolean keepCurrentIfNoReplacement)
-
Field Details
-
UNSPECIFIED_VALUE
- See Also:
-
UNKNOWN_VALUE
- See Also:
-
-
Method Details
-
getMandatoryParameterAsString
public static String getMandatoryParameterAsString(String paramName, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsString
public static String getOptionalParameterAsString(String paramName, String defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsChar
public static char getOptionalParameterAsChar(String paramName, char defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getMandatoryParameterAsInt
public static int getMandatoryParameterAsInt(String paramName, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsNonNegativeInt
public static int getOptionalParameterAsNonNegativeInt(String paramName, int defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsPositiveInt
public static int getOptionalParameterAsPositiveInt(String paramName, int defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsInt
public static int getOptionalParameterAsInt(String paramName, int defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsByte
public static byte getOptionalParameterAsByte(String paramName, byte defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getMandatoryParameterAsLong
public static long getMandatoryParameterAsLong(String paramName, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsNonNegativeLong
public static long getOptionalParameterAsNonNegativeLong(String paramName, long defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsLong
public static long getOptionalParameterAsLong(String paramName, long defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsNonNegativeFloat
public static float getOptionalParameterAsNonNegativeFloat(String paramName, float defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getMandatoryParameterAsBoolean
public static boolean getMandatoryParameterAsBoolean(String paramName, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsBoolean
public static boolean getOptionalParameterAsBoolean(String paramName, boolean defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsBoolean
public static Boolean getOptionalParameterAsBoolean(String paramName, Boolean defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getMandatoryParameterAsByteArray
public static byte[] getMandatoryParameterAsByteArray(String paramName, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalParameterAsByteArray
public static byte[] getOptionalParameterAsByteArray(String paramName, byte[] defaultValue, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getMandatoryMultivaluedParameter
public static <T> Collection<T> getMandatoryMultivaluedParameter(String paramName, ParameterStructure parameters) throws ConfigurationException - Throws:
ConfigurationException
-
getOptionalMultivaluedParameter
public static <T> Collection<T> getOptionalMultivaluedParameter(String paramName, ParameterStructure parameters) -
replaceAll
public static void replaceAll(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues) Replaces each value of the parameters indicated in the pathExpression with the given replacement in the map provided.- Parameters:
params-pathExpressions- A path expression describes the location of a Parameter in the ParameterStructure. By starting at the root parameter, select any parameter creating a chain of children parameters. The last parameter of the expression should be a SimpleParameter.Each parameter is separated by "::". Each path expression is separated by ",". For example: for replacing the values of parameters dataSource and filterSequenceID the path expression should be: "dataSource,processor::filterSequenceID".paramValues- Map containing the replacements for the parameter values. The key of the Map is parameter value to be replaced. The value of the Map is the replacement.
-
replaceAll
public static void replaceAll(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues, boolean keepCurrentIfNoReplacement) -
replaceAll
public static void replaceAll(ParameterStructure params, String pathExpressions, UnaryOperator<String> getElementName) -
replaceAllWithWarnings
public static Collection<String> replaceAllWithWarnings(ParameterStructure params, String pathExpressions, UnaryOperator<String> getElementName) -
replaceAllWithWarnings
public static Collection<String> replaceAllWithWarnings(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues) -
replaceAllWithWarnings
public static Collection<String> replaceAllWithWarnings(ParameterStructure params, String pathExpressions, Map<String, ?> paramValues, boolean keepCurrentIfNoReplacement) -
getValues
Obtains the values of the parameters indicated in the pathExpression.- Type Parameters:
T-- Parameters:
params-pathExpressions- A path expression describes the location of a Parameter in the ParameterStructure. By starting at the root parameter, select any parameter creating a chain of children parameters. The last parameter of the expression should be a SimpleParameter. Each parameter is separated by "::". Each path expression is separated by ",". For example: for obtaining the values of parameters type of crawler and type of exporter the path expression should be: "crawler::type,processor::exporter::type".- Returns:
- a Collection containing the parameter values.
-
isParamEncrypted
public static boolean isParamEncrypted(ParameterStructure parameters, String parameterName) throws ConfigurationException - Throws:
ConfigurationException
-
buildSimpleParam
-
buildSimpleMultiValuedParam
-
postProcessConfiguration
public static void postProcessConfiguration(Configuration config) throws ConfigurationException, InstanceNotFoundException, DuplicateInstanceException, InternalErrorException -
postProcessConfiguration
public static void postProcessConfiguration(MetadataManager manager, Configuration config) throws ConfigurationException, InstanceNotFoundException, DuplicateInstanceException, InternalErrorException -
postProcessConfiguration
public static void postProcessConfiguration(Configuration config, boolean legacy) throws ConfigurationException, InstanceNotFoundException, DuplicateInstanceException, InternalErrorException -
postProcessConfiguration
public static void postProcessConfiguration(MetadataManager manager, Configuration config, boolean legacy) throws ConfigurationException, InstanceNotFoundException, DuplicateInstanceException, InternalErrorException
-