Class IndexDefMergerUtils


  • public class IndexDefMergerUtils
    extends java.lang.Object
    Utility that allows to merge index definitions.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.jackrabbit.oak.commons.json.JsonObject merge​(java.lang.String path, java.lang.String ancestorName, org.apache.jackrabbit.oak.commons.json.JsonObject ancestor, java.lang.String customName, org.apache.jackrabbit.oak.commons.json.JsonObject custom, org.apache.jackrabbit.oak.commons.json.JsonObject product)
      Merge index definition changes.
      static void merge​(org.apache.jackrabbit.oak.commons.json.JsonObject newIndexes, org.apache.jackrabbit.oak.commons.json.JsonObject allIndexes)
      For indexes that were modified both by the customer and in the product, merge the changes, and create a new index.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IndexDefMergerUtils

        public IndexDefMergerUtils()
    • Method Detail

      • merge

        public static org.apache.jackrabbit.oak.commons.json.JsonObject merge​(java.lang.String path,
                                                                              java.lang.String ancestorName,
                                                                              org.apache.jackrabbit.oak.commons.json.JsonObject ancestor,
                                                                              java.lang.String customName,
                                                                              org.apache.jackrabbit.oak.commons.json.JsonObject custom,
                                                                              org.apache.jackrabbit.oak.commons.json.JsonObject product)
        Merge index definition changes.
        Parameters:
        path - the path of the change itself (e.g. /oak:index/lucene-1/indexRules/acme)
        ancestorName - the name of the node of the ancestor index (e.g. /oak:index/lucene-1)
        ancestor - the common ancestor (the old product index, e.g. lucene)
        customName - the name of the node of the customized index (e.g. /oak:index/lucene-1-custom-1)
        custom - the latest customized version (e.g. lucene-1-custom-1)
        product - the latest product index (e.g. lucene-2)
        Returns:
        the merged index definition (e.g. lucene-2-custom-1)
      • merge

        public static void merge​(org.apache.jackrabbit.oak.commons.json.JsonObject newIndexes,
                                 org.apache.jackrabbit.oak.commons.json.JsonObject allIndexes)
        For indexes that were modified both by the customer and in the product, merge the changes, and create a new index. The new index (if any) is stored in the "newIndexes" object.
        Parameters:
        newIndexes - the new indexes
        allIndexes - all index definitions (including the new ones)