com.jalios.jcms.tools.storemerge.rule
Class MergeRule
java.lang.Object
com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
com.jalios.jcms.tools.storemerge.rule.MergeRule
- All Implemented Interfaces:
- StoreConstants
public class MergeRule
- extends ConflictResolutionRule
This rule resolves Update/Update conflict on array attribute by merging the values.
- Since:
- jcms-8.0.0
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, MAP_ASSIGN, MAP_CHARS_TO_ESCAPE, MAP_CLASS_SEPARATOR, MAP_FLAG, NAMESPACE, REVISION, SH_SUFFIX, STORING_STATE, UPDATE_OP |
Method Summary |
boolean |
canResolveAttributeConflict(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. |
String |
getAction()
Returns the name of the action. |
String |
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 String |
mergeArray(String value1,
String value2)
|
protected String |
mergeMap(String value1,
String value2)
|
protected String |
mergeSet(String value1,
String value2)
|
Methods inherited from class com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule |
buildRule, canResolveUpdateDeleteConflict, decodeArray, decodeCollectionOrMapItemSet, decodeList, isArray, isArrayOrCollectionAttribute, isCollection, isMap, isMapAttribute, parseTarget, resolveUpdateDeleteConflict, selectorMatches, toString |
MergeRule
public MergeRule(String target)
canResolveAttributeConflict
public boolean canResolveAttributeConflict(String id,
String className,
String attName,
String value1,
String value2)
- Description copied from class:
ConflictResolutionRule
- Returns true if the conflict on the given attribute can be resolved by a rule.
- Overrides:
canResolveAttributeConflict
in class ConflictResolutionRule
- 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:
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 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
protected String mergeArray(String value1,
String value2)
mergeSet
protected String mergeSet(String value1,
String value2)
mergeMap
protected String mergeMap(String value1,
String value2)
getAction
public String getAction()
- Description copied from class:
ConflictResolutionRule
- Returns the name of the action.
- Overrides:
getAction
in class ConflictResolutionRule
- Returns:
- the name of the action.
Copyright © 2001-2010 Jalios SA. All Rights Reserved.