Class MergeRule
java.lang.Object
com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
com.jalios.jcms.tools.storemerge.rule.MergeRule
- All Implemented Interfaces:
StoreConstants
This rule resolves Update/Update conflict on array attribute by merging the values.
- Since:
- jcms-8.0.0
-
Field Summary
Fields inherited from class com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
ACTION_DELETE, ACTION_IGNORE, ACTION_IGNORE_EMPTY_ITEM, ACTION_IGNORE_ORDER, ACTION_MERGE, ACTION_PREFER_NOT_EMPTY, ACTION_STORE1, ACTION_STORE2, ACTION_UPDATEFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanResolveAttributeConflict(String id, String className, String attName, String value1, String value2) Returns true if the conflict on the given attribute can be resolved by a rule.Returns the name of the action.getResolvedAttributeValue(String id, String className, String attName, String value1, String value2) Returns the resolved value for the conflict on the given attribute or null if the conflict must be ignored.protected StringmergeArray(String value1, String value2) protected Stringprotected StringMethods inherited from class com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
buildRule, canResolveCreateCreateConflict, canResolveUpdateDeleteConflict, decodeArray, decodeCollectionOrMapItemSet, decodeList, isArray, isArrayOrCollectionAttribute, isCollection, isMap, isMapAttribute, parseTarget, resolveCreateCreateConflict, resolveUpdateDeleteConflict, selectorMatches, toString
-
Constructor Details
-
MergeRule
-
-
Method Details
-
canResolveAttributeConflict
public boolean canResolveAttributeConflict(String id, String className, String attName, String value1, String value2) Description copied from class:ConflictResolutionRuleReturns true if the conflict on the given attribute can be resolved by a rule.- Overrides:
canResolveAttributeConflictin classConflictResolutionRule- Parameters:
id- the data idclassName- the data classattName- the name of the attributevalue1- the value of the attribute in store1value2- the value of the attribute in store1- Returns:
- true if the conflict on the given attribute can be resolved by a rule.
-
getResolvedAttributeValue
public String getResolvedAttributeValue(String id, String className, String attName, String value1, String value2) Description copied from class:ConflictResolutionRuleReturns the resolved value for the conflict on the given attribute or null if the conflict must be ignored.- Overrides:
getResolvedAttributeValuein classConflictResolutionRule- Parameters:
id- the data idclassName- the data classattName- the name of the attributevalue1- the value of the attribute in store1value2- 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.
-
mergeArray
-
mergeSet
-
mergeMap
-
getAction
Description copied from class:ConflictResolutionRuleReturns the name of the action.- Overrides:
getActionin classConflictResolutionRule- Returns:
- the name of the action.
-