public class EntryHistorical extends Object
It is assumed that the common case is not to have conflict and therefore is optimized (in order of importance) for:
Modifier and Type | Field and Description |
---|---|
static String |
ENTRYUUID_ATTRIBUTE_NAME
Name of the entryuuid attribute.
|
static String |
HISTORICAL
Name used to store attachment of historical information in the
operation.
|
static String |
HISTORICAL_ATTRIBUTE_NAME
Name of the attribute used to store historical information.
|
Constructor and Description |
---|
EntryHistorical() |
Modifier and Type | Method and Description |
---|---|
boolean |
addedOrRenamedAfter(CSN csn)
Indicates if the Entry was renamed or added after the CSN that is given as
a parameter.
|
Attribute |
encodeAndPurge()
Encode this historical information object in an operational attribute and
purge it from the values older than the purge delay.
|
static Iterable<FakeOperation> |
generateFakeOperations(Entry entry)
Use this historical information to generate fake operations that would
result in this historical information.
|
static CSN |
getCSN(Entry entry)
Returns the first CSN in the
ds-sync-hist attribute of the provided entry. |
CSN |
getDNDate()
Returns the lastCSN when the entry DN was modified.
|
static String |
getEntryUUID(Entry entry)
Get the entry unique Id in String form.
|
static String |
getEntryUUID(PreOperationAddOperation op)
Get the Entry Unique Id from an add operation.
|
static String |
getEntryUUID(org.forgerock.opendj.ldap.messages.SearchResultEntry entry)
Get the entry unique Id in String form.
|
static Iterable<Attribute> |
getHistoricalAttr(Entry entry)
Get the attribute used to store the historical information from the provided Entry.
|
int |
getLastPurgedValuesCount()
For stats/monitoring purpose, returns the number of historical values
purged the last time a purge has been applied on this entry historical.
|
CSN |
getOldestCSN()
Returns the oldest CSN stored in this entry historical attribute.
|
static boolean |
isHistoricalAttribute(Attribute attr)
Check if a given attribute is an attribute used to store historical
information.
|
static EntryHistorical |
newInstanceFromEntry(Entry entry)
Construct an Historical object from the provided entry by reading the historical attribute.
|
boolean |
replayOperation(PreOperationModifyOperation modifyOperation,
Entry modifiedEntry)
Process an operation.
|
static void |
setHistoricalAttrToOperation(PreOperationAddOperation addOperation)
Generate an attribute containing the historical information
from the replication context attached to the provided operation
and set this attribute in the operation.
|
void |
setHistoricalAttrToOperation(PreOperationModifyDNOperation modifyDNOperation)
For a MODDN operation, add new or update existing historical information.
|
void |
setHistoricalAttrToOperation(PreOperationModifyOperation modifyOperation)
Update the historical information for the provided operation.
|
void |
setPurgeDelay(long purgeDelay)
Set the delay to purge the historical information.
|
String |
toString() |
public static final String HISTORICAL_ATTRIBUTE_NAME
public static final String HISTORICAL
public static final String ENTRYUUID_ATTRIBUTE_NAME
public EntryHistorical()
public boolean replayOperation(PreOperationModifyOperation modifyOperation, Entry modifiedEntry)
modifyOperation
- the operation to be processedmodifiedEntry
- the entry that is being modified (before modification)public void setHistoricalAttrToOperation(PreOperationModifyOperation modifyOperation)
Steps:
modifyOperation
- the modification.public void setHistoricalAttrToOperation(PreOperationModifyDNOperation modifyDNOperation)
This method is NOT static because it relies on this Historical object created in the HandleConflictResolution phase.
modifyDNOperation
- the modification for which the historical information should be created.public static void setHistoricalAttrToOperation(PreOperationAddOperation addOperation)
addOperation
- The Operation to which the historical attribute will be added.public int getLastPurgedValuesCount()
public Attribute encodeAndPurge()
the decode
operation in HistoricalAttributeValue
public void setPurgeDelay(long purgeDelay)
purgeDelay
- the purge delay in mspublic boolean addedOrRenamedAfter(CSN csn)
csn
- The CSN with which the ADD or Rename date must be compared.public CSN getDNDate()
public static EntryHistorical newInstanceFromEntry(Entry entry)
entry
- The entry which historical information must be loadedpublic static Iterable<FakeOperation> generateFakeOperations(Entry entry)
entry
- The Entry to use to generate the FakeOperation Iterable.public static Iterable<Attribute> getHistoricalAttr(Entry entry)
entry
- The entry containing the historical information.public static String getEntryUUID(Entry entry)
entry
- The entry for which the unique id should be returned.public static String getEntryUUID(org.forgerock.opendj.ldap.messages.SearchResultEntry entry)
entry
- The entry for which the unique id should be returned.public static String getEntryUUID(PreOperationAddOperation op)
op
- The operationpublic static boolean isHistoricalAttribute(Attribute attr)
attr
- The attribute that needs to be checked.public CSN getOldestCSN()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.