Class StoreAnonymizerManager
- java.lang.Object
-
- com.jalios.jstore.tools.anonymizer.StoreAnonymizerManager
-
- All Implemented Interfaces:
StoreConstants
,StoreAnonymizerConstants
public class StoreAnonymizerManager extends java.lang.Object implements StoreAnonymizerConstants
- Since:
- jcms-10.0.8
- Author:
- Sylvain Devaux
-
-
Field Summary
Fields Modifier and Type Field Description protected static char
PROP_FILE_KV_SEPARATOR
-
Fields inherited from interface com.jalios.jstore.tools.anonymizer.StoreAnonymizerConstants
CLASSNAME_PATTERN, CLOSE_WRAPPER, DATA_CLASSNAME_PATTERN, DB_DATAID_PATTERN, JSTORE_DATAID_PATTERN, OBFUSCATED, OPEN_WRAPPER
-
Fields 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StoreAnonymizerResult
anonymize(java.lang.String inputFilePath)
StoreAnonymizerResult
anonymize(java.lang.String inputFilePath, StoreAnonymizerParameters params)
StoreAnonymizerResult
anonymize(java.lang.String inputFilePath, java.lang.String outputFilePath)
java.lang.String
formatAsProperties(java.util.Map<java.lang.String,? extends java.util.Collection<java.lang.String>> propertiesMap)
Convenient way to log current configuration formatted as where it should come from, ie, a properties file.java.lang.String
generateOutputFilePath(java.lang.String inputFilePath)
Creates a filename following format: {inputFilePath}_store_anonymized_2024-05-29_18-12-24.xmlstatic StoreAnonymizerManager
getInstance()
Get the manager.java.util.Set<java.lang.String>
getStoreTagSet(java.lang.String inputFilePath)
boolean
isBoolean(java.lang.String value)
boolean
isClassname(java.lang.String value)
boolean
isClassSlashJcmsId(java.lang.String attrValueToken)
boolean
isClassSlashJcmsIdArrayOrCollection(java.lang.String attrValue)
boolean
isEmptyArrayCollectionOrMap(java.lang.String value)
boolean
isIdsArray(java.lang.String value)
boolean
isIdsArrayOrCollection(java.lang.String value)
boolean
isIdsCollection(java.lang.String value)
boolean
isJcmsId(java.lang.String value)
boolean
isJcmsIdTokens(java.lang.String[] tokens)
boolean
isMap(java.lang.String value)
boolean
isNumber(java.lang.String value)
boolean
isPercentage(java.lang.String value)
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>>
readPropertiesFile(java.lang.String filePath)
-
-
-
Field Detail
-
PROP_FILE_KV_SEPARATOR
protected static final char PROP_FILE_KV_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static StoreAnonymizerManager getInstance()
Get the manager.- Returns:
- StoreAnonymizerManager the singleton instance
-
anonymize
public StoreAnonymizerResult anonymize(java.lang.String inputFilePath) throws StoreAnonymizerException
- 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(java.lang.String inputFilePath, java.lang.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(java.lang.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
public java.lang.String generateOutputFilePath(java.lang.String inputFilePath)
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
public boolean isJcmsId(java.lang.String value)
-
isJcmsIdTokens
public boolean isJcmsIdTokens(java.lang.String[] tokens)
-
isIdsArray
public boolean isIdsArray(java.lang.String value)
-
isIdsCollection
public boolean isIdsCollection(java.lang.String value)
-
isIdsArrayOrCollection
public boolean isIdsArrayOrCollection(java.lang.String value)
-
isMap
public boolean isMap(java.lang.String value)
-
isEmptyArrayCollectionOrMap
public boolean isEmptyArrayCollectionOrMap(java.lang.String value)
-
isClassname
public boolean isClassname(java.lang.String value)
-
isClassSlashJcmsId
public boolean isClassSlashJcmsId(java.lang.String attrValueToken)
-
isClassSlashJcmsIdArrayOrCollection
public boolean isClassSlashJcmsIdArrayOrCollection(java.lang.String attrValue)
-
isNumber
public boolean isNumber(java.lang.String value)
-
isPercentage
public boolean isPercentage(java.lang.String value)
-
isBoolean
public boolean isBoolean(java.lang.String value)
-
getStoreTagSet
public java.util.Set<java.lang.String> getStoreTagSet(java.lang.String inputFilePath) throws StoreAnonymizerException
- Throws:
StoreAnonymizerException
-
readPropertiesFile
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> readPropertiesFile(java.lang.String filePath) throws StoreAnonymizerException
- Throws:
StoreAnonymizerException
-
formatAsProperties
public java.lang.String formatAsProperties(java.util.Map<java.lang.String,? extends java.util.Collection<java.lang.String>> propertiesMap)
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
-
-