Class EntryHistorical
- java.lang.Object
-
- org.opends.server.replication.plugin.EntryHistorical
-
public final class EntryHistorical extends Object
This class is used to store historical information that is used to resolve modify conflicts: it is effectively the content of theds-sync-histattribute.It is assumed that the common case is not to have conflict and therefore is optimized (in order of importance) for:
- detecting potential conflict
- fast update of historical information for non-conflicting change
- fast and efficient purge
- compact
- solve conflict. This should also be as fast as possible but not at the cost of any of the other previous objectives
ds-sync-histattribute must always convergeNote: the content of the
ds-sync-histattribute is considered the same as user data: any divergence in its content is considered a serious bug that should be fixed immediately.
-
-
Field Summary
Fields Modifier and Type Field Description static StringHISTORICAL_ATTRIBUTE_NAMEName of the attribute used to store historical information.
-
Constructor Summary
Constructors Constructor Description EntryHistorical()Default constructor used before decoding.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttrHistoricalAddValue(AttributeDescription attributeDescription, CSN csn, ByteString value)Updates this entry historical information with the provided add modification.voidaddAttrHistoricalDeleteAttr(AttributeDescription attributeDescription, CSN csn)Updates this entry historical information with the provided delete attribute modification.voidaddAttrHistoricalDeleteValue(AttributeDescription attributeDescription, CSN csn, ByteString value)Updates this entry historical information with the provided delete modification.voidaddAttrHistoricalReplaceValue(AttributeDescription attributeDescription, CSN csn, ByteString value)Updates this entry historical information with the provided replace modification.Map<AttributeDescription,AttrHistorical>getAllAttrHistorical()Returns the historical information for all attributes.AttrHistoricalgetAttrHistorical(AttributeDescription attributeDescription)Returns the historical information for the named attribute.CSNgetEntryADDDate()Returns the CSN of the operation that added this entry.CSNgetEntryMODDNDate()Returns the CSN of the operation that renamed this entry.static UUIDgetEntryUUID(Entry entry)Get the entry unique Id in String form.static booleanisHistoricalAttribute(Attribute attr)Check if a given attribute is an attribute used to store historical information.static EntryHistoricalnewInstanceFromEntry(Entry entry)Construct an Historical object from the provided entry by reading the historical attribute.voidsetEntryADDDate(CSN csn)Sets the CSN of the operation that added this entry.voidsetEntryMODDNDate(CSN csn)Sets the CSN of the operation that renamed this entry.StringtoString()
-
-
-
Field Detail
-
HISTORICAL_ATTRIBUTE_NAME
public static final String HISTORICAL_ATTRIBUTE_NAME
Name of the attribute used to store historical information.- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstanceFromEntry
public static EntryHistorical newInstanceFromEntry(Entry entry)
Construct an Historical object from the provided entry by reading the historical attribute. Return an empty object when the entry does not contain any historical attribute.- Parameters:
entry- The entry which historical information must be loaded- Returns:
- The constructed Historical information object
-
getEntryUUID
public static UUID getEntryUUID(Entry entry)
Get the entry unique Id in String form.- Parameters:
entry- The entry for which the unique id should be returned.- Returns:
- The Unique Id of the entry, or a fake one if none is found.
-
isHistoricalAttribute
public static boolean isHistoricalAttribute(Attribute attr)
Check if a given attribute is an attribute used to store historical information.- Parameters:
attr- The attribute that needs to be checked.- Returns:
- a boolean indicating if the given attribute is used to store historical information.
-
getEntryADDDate
public CSN getEntryADDDate()
Returns the CSN of the operation that added this entry.- Returns:
- The CSN of the operation that added this entry.
-
setEntryADDDate
public void setEntryADDDate(CSN csn)
Sets the CSN of the operation that added this entry.- Parameters:
csn- The CSN of the operation that added this entry.
-
getEntryMODDNDate
public CSN getEntryMODDNDate()
Returns the CSN of the operation that renamed this entry.- Returns:
- The CSN of the operation that renamed this entry.
-
setEntryMODDNDate
public void setEntryMODDNDate(CSN csn)
Sets the CSN of the operation that renamed this entry.- Parameters:
csn- The CSN of the operation that renamed this entry.
-
getAllAttrHistorical
public Map<AttributeDescription,AttrHistorical> getAllAttrHistorical()
Returns the historical information for all attributes.- Returns:
- The historical information for all attributes.
-
getAttrHistorical
public AttrHistorical getAttrHistorical(AttributeDescription attributeDescription)
Returns the historical information for the named attribute.- Parameters:
attributeDescription- The attribute name.- Returns:
- The historical information for the named attribute, or
nullif there isn't any.
-
addAttrHistoricalAddValue
public void addAttrHistoricalAddValue(AttributeDescription attributeDescription, CSN csn, ByteString value)
Updates this entry historical information with the provided add modification.- Parameters:
attributeDescription- The attribute description.csn- The CSN of the modification.value- The value that was added.
-
addAttrHistoricalDeleteValue
public void addAttrHistoricalDeleteValue(AttributeDescription attributeDescription, CSN csn, ByteString value)
Updates this entry historical information with the provided delete modification.- Parameters:
attributeDescription- The attribute description.csn- The CSN of the modification.value- The value that was deleted.
-
addAttrHistoricalReplaceValue
public void addAttrHistoricalReplaceValue(AttributeDescription attributeDescription, CSN csn, ByteString value)
Updates this entry historical information with the provided replace modification.- Parameters:
attributeDescription- The attribute description.csn- The CSN of the modification.value- The value that was replaced.
-
addAttrHistoricalDeleteAttr
public void addAttrHistoricalDeleteAttr(AttributeDescription attributeDescription, CSN csn)
Updates this entry historical information with the provided delete attribute modification.- Parameters:
attributeDescription- The attribute description.csn- The CSN of the modification.
-
-