Class StoreAnonymizerManager

java.lang.Object
com.jalios.jstore.tools.anonymizer.StoreAnonymizerManager
All Implemented Interfaces:
StoreConstants, StoreAnonymizerConstants

public class StoreAnonymizerManager extends Object implements StoreAnonymizerConstants
Since:
jcms-10.0.8
Author:
Sylvain Devaux
  • Field Details

    • PROP_FILE_KV_SEPARATOR

      protected static final char PROP_FILE_KV_SEPARATOR
      See Also:
  • Method Details

    • getInstance

      public static StoreAnonymizerManager getInstance()
      Get the manager.
      Returns:
      StoreAnonymizerManager the singleton instance
    • anonymize

      public StoreAnonymizerResult anonymize(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(String inputFilePath, String outputFilePath) throws StoreAnonymizerException
      Parameters:
      inputFilePath - input file to process
      outputFilePath - 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 process
      params - the conversion parameters
      Returns:
      a result or null
      Throws:
      StoreAnonymizerException - if something unexpected occured
      Since:
      jcms-10.0.8
    • generateOutputFilePath

      public String generateOutputFilePath(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(String value)
    • isJcmsIdTokens

      public boolean isJcmsIdTokens(String[] tokens)
    • isIdsArray

      public boolean isIdsArray(String value)
    • isIdsCollection

      public boolean isIdsCollection(String value)
    • isIdsArrayOrCollection

      public boolean isIdsArrayOrCollection(String value)
    • isMap

      public boolean isMap(String value)
    • isEmptyArrayCollectionOrMap

      public boolean isEmptyArrayCollectionOrMap(String value)
    • isClassname

      public boolean isClassname(String value)
    • isClassSlashJcmsId

      public boolean isClassSlashJcmsId(String attrValueToken)
    • isClassSlashJcmsIdArrayOrCollection

      public boolean isClassSlashJcmsIdArrayOrCollection(String attrValue)
    • isNumber

      public boolean isNumber(String value)
    • isPercentage

      public boolean isPercentage(String value)
    • isBoolean

      public boolean isBoolean(String value)
    • getStoreTagSet

      public Set<String> getStoreTagSet(String inputFilePath) throws StoreAnonymizerException
      Throws:
      StoreAnonymizerException
    • readPropertiesFile

      protected Map<String,List<String>> readPropertiesFile(String filePath) throws StoreAnonymizerException
      Throws:
      StoreAnonymizerException
    • formatAsProperties

      public String formatAsProperties(Map<String,? extends Collection<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