|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
public abstract class ConflictResolutionRule
Field Summary | |
---|---|
static String |
ACTION_DELETE
|
static String |
ACTION_IGNORE
|
static String |
ACTION_IGNORE_EMPTY_ITEM
|
static String |
ACTION_IGNORE_ORDER
|
static String |
ACTION_MERGE
|
static String |
ACTION_PREFER_NOT_EMPTY
|
static String |
ACTION_STORE1
|
static String |
ACTION_STORE2
|
static String |
ACTION_UPDATE
|
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 |
Constructor Summary | |
---|---|
ConflictResolutionRule(String target)
|
Method Summary | |
---|---|
static ConflictResolutionRule |
buildRule(String action,
String target)
Returns a new rule according an action and a target. |
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. |
boolean |
canResolveUpdateDeleteConflict(String id,
String className)
Returns true if the Update/Delete conflict on the given data can be resolved. |
protected String[] |
decodeArray(String value)
Returns an String[] from the encoded value. |
protected Set<String> |
decodeCollectionOrMapItemSet(String value)
Returns a Set from the encoded value. |
protected List<String> |
decodeList(String value)
Returns a List from the encoded value. |
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 boolean |
isArray(String value)
Returns true if this value is an array. |
protected boolean |
isArrayOrCollectionAttribute(String value1,
String value2)
Returns true if one of the 2 values is an array or a collection. |
protected boolean |
isCollection(String value)
Returns true if this value is a collection. |
protected boolean |
isMap(String value)
Returns true if this value is a map. |
protected boolean |
isMapAttribute(String value1,
String value2)
Returns true if one of the 2 values is a map. |
protected void |
parseTarget(String target)
|
List<StorableLogEntry> |
resolveUpdateDeleteConflict(List<StorableLogEntry> store1OpList,
List<StorableLogEntry> store2OpList)
Returns either store1OpList or store2OpList according the resolution behavior. |
protected boolean |
selectorMatches(String id,
String className,
String attName)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ACTION_IGNORE
public static final String ACTION_IGNORE_ORDER
public static final String ACTION_IGNORE_EMPTY_ITEM
public static final String ACTION_PREFER_NOT_EMPTY
public static final String ACTION_MERGE
public static final String ACTION_STORE1
public static final String ACTION_STORE2
public static final String ACTION_UPDATE
public static final String ACTION_DELETE
Constructor Detail |
---|
public ConflictResolutionRule(String target)
Method Detail |
---|
protected void parseTarget(String target)
public boolean canResolveAttributeConflict(String id, String className, String attName, String value1, String value2)
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
public String getResolvedAttributeValue(String id, String className, String attName, String value1, String value2)
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
public boolean canResolveUpdateDeleteConflict(String id, String className)
id
- the data idclassName
- the data class
public List<StorableLogEntry> resolveUpdateDeleteConflict(List<StorableLogEntry> store1OpList, List<StorableLogEntry> store2OpList)
store1OpList
- the list of operations on the data from store 1store2OpList
- the list of operations on the data from store 1
protected boolean selectorMatches(String id, String className, String attName)
protected boolean isArray(String value)
value
- the encoded value.
protected boolean isCollection(String value)
value
- the encoded value.
protected boolean isMap(String value)
value
- the encoded value.
protected boolean isArrayOrCollectionAttribute(String value1, String value2)
value1
- the first valuevalue2
- the second value.
protected boolean isMapAttribute(String value1, String value2)
value1
- the first valuevalue2
- the second value.
protected String[] decodeArray(String value)
value
- the encoded value
protected Set<String> decodeCollectionOrMapItemSet(String value)
value
- the encoded value
protected List<String> decodeList(String value)
value
- the encoded value
public String getAction()
public static ConflictResolutionRule buildRule(String action, String target)
action
- the actiontarget
- the target.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |