org.opends.server.replication.plugin
Class AttrInfoSingle

java.lang.Object
  extended by org.opends.server.replication.plugin.AttributeInfo
      extended by org.opends.server.replication.plugin.AttrInfoSingle

public class AttrInfoSingle
extends AttributeInfo

This classes is used to store historical information for single valued attributes. One object of this type is created for each attribute that was changed in the entry. It allows to record the last time a given value was added, and the last time the whole attribute was deleted.


Constructor Summary
AttrInfoSingle()
           
 
Method Summary
 ChangeNumber getDeleteTime()
          Returns the last time when the attribute was deleted.
 java.util.ArrayList<ValueInfo> getValuesInfo()
          Get the List of ValueInfo for this attribute Info.
 void load(HistKey histKey, AttributeValue value, ChangeNumber cn)
          Load the provided information.
 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.
 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 org.opends.server.replication.plugin.AttributeInfo
createAttributeInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttrInfoSingle

public AttrInfoSingle()
Method Detail

getDeleteTime

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

Specified by:
getDeleteTime in class AttributeInfo
Returns:
the last time when the attribute was deleted

getValuesInfo

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

Specified by:
getValuesInfo in class AttributeInfo
Returns:
the List of ValueInfo

processLocalOrNonConflictModification

public 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.

Specified by:
processLocalOrNonConflictModification in class AttributeInfo
Parameters:
changeNumber - The changeNumber of the operation to process
mod - The modify operation to process.

replayOperation

public 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

Specified by:
replayOperation in class AttributeInfo
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.

load

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

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