Class StoreAnonymizerManager
java.lang.Object
com.jalios.jstore.tools.anonymizer.StoreAnonymizerManager
- All Implemented Interfaces:
StoreConstants,StoreAnonymizerConstants
- Since:
- jcms-10.0.8
- Author:
- Sylvain Devaux
-
Field Summary
FieldsFields inherited from interface com.jalios.jstore.tools.anonymizer.StoreAnonymizerConstants
CLASSNAME_PATTERN, CLOSE_WRAPPER, DATA_CLASSNAME_PATTERN, DB_DATAID_PATTERN, JSTORE_DATAID_PATTERN, OBFUSCATED, OPEN_WRAPPERFields inherited from interface com.jalios.jstore.StoreConstants
ARRAY_FLAG, CLEANING_STATE, COLLECTION_FLAG, CREATE_OP, DELETE_OP, IDLE_STATE, INNER_LOGS, INNER_MILESTONE, INNER_PREFIX, INNER_SYNC, ITEM_ESCAPE_CHAR, ITEM_SEPARATOR, LOADING_STATE, LOG_DIR_LOG_PREFIX, LOG_DIR_LOG_WORK, MAP_ASSIGN, MAP_CHARS_TO_ESCAPE, MAP_CLASS_SEPARATOR, MAP_FLAG, NAMESPACE, SH_SUFFIX, STORING_STATE, UPDATE_OP -
Method Summary
Modifier and TypeMethodDescriptionanonymize(String inputFilePath, StoreAnonymizerParameters params) formatAsProperties(Map<String, ? extends Collection<String>> propertiesMap) Convenient way to log current configuration formatted as where it should come from, ie, a properties file.generateOutputFilePath(String inputFilePath) Creates a filename following format: {inputFilePath}_store_anonymized_2024-05-29_18-12-24.xmlstatic StoreAnonymizerManagerGet the manager.getStoreTagSet(String inputFilePath) booleanbooleanisClassname(String value) booleanisClassSlashJcmsId(String attrValueToken) booleanisClassSlashJcmsIdArrayOrCollection(String attrValue) booleanbooleanisIdsArray(String value) booleanisIdsArrayOrCollection(String value) booleanisIdsCollection(String value) booleanbooleanisJcmsIdTokens(String[] tokens) booleanbooleanbooleanisPercentage(String value) readPropertiesFile(String filePath)
-
Field Details
-
PROP_FILE_KV_SEPARATOR
protected static final char PROP_FILE_KV_SEPARATOR- See Also:
-
-
Method Details
-
getInstance
Get the manager.- Returns:
- StoreAnonymizerManager the singleton instance
-
anonymize
- Parameters:
inputFilePath- input file to process- Returns:
- a result or null
- Throws:
StoreAnonymizerException- if something unexpected occured- Since:
- jcms-10.0.8
-
anonymize
public StoreAnonymizerResult anonymize(String inputFilePath, String outputFilePath) throws StoreAnonymizerException - Parameters:
inputFilePath- input file to processoutputFilePath- the path to result to, optional- Returns:
- a result or null
- Throws:
StoreAnonymizerException- if something unexpected occured- Since:
- jcms-10.0.8
-
anonymize
public StoreAnonymizerResult anonymize(String inputFilePath, StoreAnonymizerParameters params) throws StoreAnonymizerException - Parameters:
inputFilePath- input file to processparams- the conversion parameters- Returns:
- a result or null
- Throws:
StoreAnonymizerException- if something unexpected occured- Since:
- jcms-10.0.8
-
generateOutputFilePath
Creates a filename following format: {inputFilePath}_store_anonymized_2024-05-29_18-12-24.xml- Parameters:
inputFilePath- the input file, must not be null- Returns:
- a path with timestamp for output file
- Since:
- jcms-10.0.8
-
isJcmsId
-
isJcmsIdTokens
-
isIdsArray
-
isIdsCollection
-
isIdsArrayOrCollection
-
isMap
-
isEmptyArrayCollectionOrMap
-
isClassname
-
isClassSlashJcmsId
-
isClassSlashJcmsIdArrayOrCollection
-
isNumber
-
isPercentage
-
isBoolean
-
getStoreTagSet
- Throws:
StoreAnonymizerException
-
readPropertiesFile
protected Map<String,List<String>> readPropertiesFile(String filePath) throws StoreAnonymizerException - Throws:
StoreAnonymizerException
-
formatAsProperties
Convenient way to log current configuration formatted as where it should come from, ie, a properties file.- Parameters:
propertiesMap- map to print- Returns:
- formatted map for properties file
-