org.opends.server.replication.plugin
Class AttributeInfo

java.lang.Object
  extended by org.opends.server.replication.plugin.AttributeInfo
Direct Known Subclasses:
AttrInfoMultiple, AttrInfoSingle

public abstract class AttributeInfo
extends java.lang.Object

This classes is used to store historical information. One object of this type is created for each attribute that was changed in the entry.


Constructor Summary
AttributeInfo()
           
 
Method Summary
static AttributeInfo createAttributeInfo(AttributeType type)
          Create a new AttributeInfo object that will be used with the givene type.
abstract  ChangeNumber getDeleteTime()
          Returns the last time when the attribute was deleted.
abstract  java.util.ArrayList<ValueInfo> getValuesInfo()
          Get the List of ValueInfo for this attribute Info.
abstract  void load(HistKey histKey, AttributeValue value, ChangeNumber cn)
          Load the provided information.
abstract  void processLocalOrNonConflictModification(ChangeNumber changeNumber, Modification mod)
          This method calculate the historical information and update the hist attribute to store the historical information for modify operation that does not conflict with previous operation.
abstract  boolean replayOperation(java.util.Iterator<Modification> modsIterator, ChangeNumber changeNumber, Entry modifiedEntry, Modification mod)
          This method will be called when replaying an operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeInfo

public AttributeInfo()
Method Detail

replayOperation

public abstract boolean replayOperation(java.util.Iterator<Modification> modsIterator,
                                        ChangeNumber changeNumber,
                                        Entry modifiedEntry,
                                        Modification mod)
This method will be called when replaying an operation. It should use whatever historical information is stored in this class to solve the conflict and modify the mod and the mods iterator accordingly

Parameters:
modsIterator - The iterator on the mods from which the mod is\ extracted.
changeNumber - The changeNumber associated to the operation.
modifiedEntry - The entry modified by this operation.
mod - The modification.
Returns:
a boolean indicating if a conflict was detected.

processLocalOrNonConflictModification

public abstract void processLocalOrNonConflictModification(ChangeNumber changeNumber,
                                                           Modification mod)
This method calculate the historical information and update the hist attribute to store the historical information for modify operation that does not conflict with previous operation. This is the usual path and should therefore be optimized. It does not check if the operation to process is conflicting or not with previous operations. The caller is responsible for this.

Parameters:
changeNumber - The changeNumber of the operation to process
mod - The modify operation to process.

createAttributeInfo

public static AttributeInfo createAttributeInfo(AttributeType type)
Create a new AttributeInfo object that will be used with the givene type.

Parameters:
type - the AttrbuteType with which the ATtributeInfo is going to be used.
Returns:
a new AttributeInfo object.

getValuesInfo

public abstract java.util.ArrayList<ValueInfo> getValuesInfo()
Get the List of ValueInfo for this attribute Info.

Returns:
the List of ValueInfo

getDeleteTime

public abstract ChangeNumber getDeleteTime()
Returns the last time when the attribute was deleted.

Returns:
the last time when the attribute was deleted

load

public abstract void load(HistKey histKey,
                          AttributeValue value,
                          ChangeNumber cn)
Load the provided information.

Parameters:
histKey - the key to load.
value - the associated value or null if there is no value;
cn - the associated ChangeNumber.