com.jalios.jcms.tools.storemerge.rule
Class Store2Rule

java.lang.Object
  extended by com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
      extended by com.jalios.jcms.tools.storemerge.rule.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

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_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
Store2Rule(String target)
           
 
Method Summary
 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.
 List<StorableLogEntry> resolveUpdateDeleteConflict(List<StorableLogEntry> store1OpList, List<StorableLogEntry> store2OpList)
          Returns either store1OpList or store2OpList according the resolution behavior.
 
Methods inherited from class com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
buildRule, canResolveAttributeConflict, canResolveUpdateDeleteConflict, decodeArray, decodeCollectionOrMapItemSet, decodeList, isArray, isArrayOrCollectionAttribute, isCollection, isMap, isMapAttribute, parseTarget, selectorMatches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Store2Rule

public Store2Rule(String target)
Method Detail

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 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 List<StorableLogEntry> resolveUpdateDeleteConflict(List<StorableLogEntry> store1OpList,
                                                          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.

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.