public final class DeclarativeConfigUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Collection<String> |
ALL_ACCEPTED_SUFFIXES
Array of the suffixes accepted in Hazelcast configuration files.
|
static String |
ALL_ACCEPTED_SUFFIXES_STRING
The list of the suffixes accepted in Hazelcast configuration files.
|
static String |
SYSPROP_CLIENT_CONFIG
System property used for defining the configuring file used for
client configuration.
|
static String |
SYSPROP_CLIENT_FAILOVER_CONFIG
System property used for defining the configuring file used for
client failover configuration.
|
static String |
SYSPROP_MEMBER_CONFIG
System property used for defining the configuring file used for
member configuration.
|
static Collection<String> |
XML_ACCEPTED_SUFFIXES
Array of accepted suffixes for XML configuration files.
|
static String |
XML_ACCEPTED_SUFFIXES_STRING
List of accepted suffixes for XML configuration files.
|
static Collection<String> |
YAML_ACCEPTED_SUFFIXES
Array of accepted suffixes for YAML configuration files.
|
static String |
YAML_ACCEPTED_SUFFIXES_STRING
List of accepted suffixes for YAML configuration files.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isAcceptedSuffixConfigured(String configFile,
Collection<String> acceptedSuffixes)
Checks if the suffix of the passed
configFile is in the
accepted suffixes list passed in acceptedSuffixes . |
static void |
throwUnacceptedSuffixInSystemProperty(String propertyKey,
String configResource,
Collection<String> acceptedSuffixes)
Throws
HazelcastException unconditionally referring to that
the configuration file referenced in the system property
propertyKey has a suffix not in the accepted suffix list
defined in acceptedSuffixes . |
static void |
validateSuffixInSystemProperty(String propertyKey)
Validates if the config file referenced in
propertyKey
has an accepted suffix. |
public static final String SYSPROP_MEMBER_CONFIG
public static final String SYSPROP_CLIENT_CONFIG
public static final String SYSPROP_CLIENT_FAILOVER_CONFIG
public static final Collection<String> XML_ACCEPTED_SUFFIXES
public static final String XML_ACCEPTED_SUFFIXES_STRING
XML_ACCEPTED_SUFFIXES
public static final Collection<String> YAML_ACCEPTED_SUFFIXES
public static final String YAML_ACCEPTED_SUFFIXES_STRING
YAML_ACCEPTED_SUFFIXES
public static final Collection<String> ALL_ACCEPTED_SUFFIXES
public static final String ALL_ACCEPTED_SUFFIXES_STRING
ALL_ACCEPTED_SUFFIXES
public static void validateSuffixInSystemProperty(String propertyKey)
propertyKey
has an accepted suffix. If the system property is not set, the
validation passes without throwing exception.propertyKey
- The name of the system property to validateHazelcastException
- If the suffix of the config file name
is not in the accepted suffix listpublic static void throwUnacceptedSuffixInSystemProperty(String propertyKey, String configResource, Collection<String> acceptedSuffixes)
HazelcastException
unconditionally referring to that
the configuration file referenced in the system property
propertyKey
has a suffix not in the accepted suffix list
defined in acceptedSuffixes
.propertyKey
- The name of the system property key
holding the reference to the
configuration fileconfigResource
- The value of the system propertyacceptedSuffixes
- The list of the accepted suffixesHazelcastException
- Thrown unconditionally with a message
referring to the unaccepted suffix of
the file referenced by propertyKey
public static boolean isAcceptedSuffixConfigured(String configFile, Collection<String> acceptedSuffixes)
configFile
is in the
accepted suffixes list passed in acceptedSuffixes
.configFile
- The configuration file to checkacceptedSuffixes
- The list of the accepted suffixestrue
if the suffix of the configuration file is in
the accepted list, false
otherwiseCopyright © 2019 Hazelcast, Inc.. All rights reserved.