Class Store2Rule

  • All Implemented Interfaces:
    StoreConstants

    public class Store2Rule
    extends ConflictResolutionRule
    This rule resolves Update/Update conflict on attribute by setting the value of store2. This rule resolves Update/Delete conflict on data by selecting operation list of store2.
    Since:
    jcms-8.0.0
    • Constructor Detail

      • Store2Rule

        public Store2Rule​(java.lang.String target)
    • Method Detail

      • getResolvedAttributeValue

        public java.lang.String getResolvedAttributeValue​(java.lang.String id,
                                                          java.lang.String className,
                                                          java.lang.String attName,
                                                          java.lang.String value1,
                                                          java.lang.String value2)
        Description copied from class: ConflictResolutionRule
        Returns the resolved value for the conflict on the given attribute or null if the conflict must be ignored.
        Overrides:
        getResolvedAttributeValue in class ConflictResolutionRule
        Parameters:
        id - the data id
        className - the data class
        attName - the name of the attribute
        value1 - the value of the attribute in store1
        value2 - the value of the attribute in store1
        Returns:
        the resolved value for the conflict on the given attribute or null if the conflict must be ignored.
      • resolveUpdateDeleteConflict

        public java.util.List<StorableLogEntry> resolveUpdateDeleteConflict​(java.util.List<StorableLogEntry> store1OpList,
                                                                            java.util.List<StorableLogEntry> store2OpList)
        Description copied from class: ConflictResolutionRule
        Returns either store1OpList or store2OpList according the resolution behavior.
        Overrides:
        resolveUpdateDeleteConflict in class ConflictResolutionRule
        Parameters:
        store1OpList - the list of operations on the data from store 1
        store2OpList - the list of operations on the data from store 1
        Returns:
        either store1OpList or store2OpList according the resolution behavior.
      • resolveCreateCreateConflict

        public java.util.List<StorableLogEntry> resolveCreateCreateConflict​(java.util.List<StorableLogEntry> store1OpList,
                                                                            java.util.List<StorableLogEntry> store2OpList)
        Description copied from class: ConflictResolutionRule
        Returns either store1OpList or store2OpList according the resolution behavior.
        Overrides:
        resolveCreateCreateConflict in class ConflictResolutionRule
        Parameters:
        store1OpList - the list of operations on the data from store 1
        store2OpList - the list of operations on the data from store 1
        Returns:
        either store1OpList or store2OpList according the resolution behavior.