ChangelogBackend.java revision a632fbfad0ddbe8b343c6abe8e28dc41e3df9b7e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2014-2015 ForgeRock AS.
*/
/**
* A backend that provides access to the changelog, i.e. the "cn=changelog"
* suffix. It is a read-only backend that is created by a
* {@link ReplicationServer} and is not configurable.
* <p>
* There are two modes to search the changelog:
* <ul>
* <li>Cookie mode: when a "ECL Cookie Exchange Control" is provided with the
* request. The cookie provided in the control is used to retrieve entries from
* the ReplicaDBs. The <code>changeNumber</code> attribute is not returned with
* the entries.</li>
* <li>Change number mode: when no "ECL Cookie Exchange Control" is provided
* with the request. The entries are retrieved using the ChangeNumberIndexDB and
* their attributes are set with the information from the ReplicasDBs. The
* <code>changeNumber</code> attribute value is set from the content of
* ChangeNumberIndexDB.</li>
* </ul>
* <h3>Searches flow</h3>
* <p>
* Here is the flow of searches within the changelog backend APIs:
* <ul>
* <li>Normal searches only go through:
* <ol>
* <li>{@link ChangelogBackend#search(SearchOperation)} (once, single threaded)</li>
* </ol>
* </li>
* <li>Persistent searches with <code>changesOnly=false</code> go through:
* <ol>
* <li>{@link ChangelogBackend#registerPersistentSearch(PersistentSearch)}
* (once, single threaded),</li>
* <li>
* {@link ChangelogBackend#search(SearchOperation)} (once, single threaded)</li>
* <li>{@link ChangelogBackend#notify*EntryAdded()} (multiple times, multi
* threaded)</li>
* </ol>
* </li>
* <li>Persistent searches with <code>changesOnly=true</code> go through:
* <ol>
* <li>{@link ChangelogBackend#registerPersistentSearch(PersistentSearch)}
* (once, single threaded)</li>
* <li>
* {@link ChangelogBackend#notify*EntryAdded()} (multiple times, multi
* threaded)</li>
* </ol>
* </li>
* </ul>
*
* @see ReplicationServer
*/
{
/** The id of this backend. */
private static final long CHANGE_NUMBER_FOR_EMPTY_CURSOR = 0L;
private static final String ENTRY_SENDER_ATTACHMENT = OID_ECL_COOKIE_EXCHANGE_CONTROL + ".entrySender";
/** The set of objectclasses that will be used in root entry. */
static
{
}
/** The set of objectclasses that will be used in ECL entries. */
static
{
CHANGELOG_ENTRY_OBJECT_CLASSES.put(DirectoryServer.getObjectClass(OC_CHANGELOG_ENTRY, true), OC_CHANGELOG_ENTRY);
}
/** The attribute type for the "creatorsName" attribute. */
private static final AttributeType CREATORS_NAME_TYPE =
/** The attribute type for the "modifiersName" attribute. */
private static final AttributeType MODIFIERS_NAME_TYPE =
/** The base DN for the external change log. */
public static final DN CHANGELOG_BASE_DN;
static
{
try
{
}
catch (DirectoryException e)
{
throw new RuntimeException(e);
}
}
/** The set of base DNs for this backend. */
/** The set of supported controls for this backend. */
private final Set<String> supportedControls = Collections.singleton(OID_ECL_COOKIE_EXCHANGE_CONTROL);
/** Whether the base changelog entry has subordinates. */
private Boolean baseEntryHasSubordinates;
/** The replication server on which the changelog is read. */
private final ReplicationServer replicationServer;
private final ECLEnabledDomainPredicate domainPredicate;
/** The set of cookie-based persistent searches registered with this backend. */
private final ConcurrentLinkedQueue<PersistentSearch> cookieBasedPersistentSearches = new ConcurrentLinkedQueue<>();
/** The set of change number-based persistent searches registered with this backend. */
new ConcurrentLinkedQueue<>();
/**
* Creates a new backend with the provided replication server.
*
* @param replicationServer
* The replication server on which the changes are read.
* @param domainPredicate
* Returns whether a domain is enabled for the external changelog.
*/
public ChangelogBackend(final ReplicationServer replicationServer, final ECLEnabledDomainPredicate domainPredicate)
{
this.replicationServer = replicationServer;
this.domainPredicate = domainPredicate;
setPrivateBackend(true);
}
private ChangelogDB getChangelogDB()
{
return replicationServer.getChangelogDB();
}
/**
* Returns the ChangelogBackend configured for "cn=changelog" in this directory server.
*
* @return the ChangelogBackend configured for "cn=changelog" in this directory server
* @deprecated instead inject the required object where needed
*/
public static ChangelogBackend getInstance()
{
}
/** {@inheritDoc} */
public void configureBackend(final Configuration config, ServerContext serverContext) throws ConfigException
{
throw new UnsupportedOperationException("The changelog backend is not configurable");
}
/** {@inheritDoc} */
public void openBackend() throws InitializationException
{
try
{
}
catch (final DirectoryException e)
{
throw new InitializationException(
}
}
/** {@inheritDoc} */
public void closeBackend()
{
try
{
}
catch (final DirectoryException e)
{
logger.traceException(e);
}
}
/** {@inheritDoc} */
public DN[] getBaseDNs()
{
return baseDNs;
}
/** {@inheritDoc} */
{
return true;
}
/** {@inheritDoc} */
{
{
}
throw new RuntimeException("Not implemented");
}
/** {@inheritDoc} */
{
{
{
return ConditionResult.UNDEFINED;
}
}
return ConditionResult.FALSE;
}
{
if (baseEntryHasSubordinates == null)
{
// compute its value
try
{
try
{
}
finally
{
}
}
catch (ChangelogException e)
{
}
}
return baseEntryHasSubordinates;
}
/** {@inheritDoc} */
{
throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, ERR_NUM_SUBORDINATES_NOT_SUPPORTED.get());
}
/** {@inheritDoc} */
{
throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, ERR_NUM_SUBORDINATES_NOT_SUPPORTED.get());
}
/**
* Notifies persistent searches of this backend that a new cookie entry was added to it.
* <p>
* Note: This method correspond to the "persistent search" phase.
* It is executed multiple times per persistent search, multi-threaded, until the persistent search is cancelled.
* <p>
* This method must only be called after the provided data have been persisted to disk.
*
* @param baseDN
* the baseDN of the newly added entry.
* @param updateMsg
* the update message of the newly added entry
* @throws ChangelogException
* If a problem occurs while notifying of the newly added entry.
*/
{
if (!(updateMsg instanceof LDAPUpdateMsg))
{
return;
}
try
{
{
}
}
catch (DirectoryException e)
{
throw new ChangelogException(e.getMessageObject(), e);
}
}
/**
* Notifies persistent searches of this backend that a new change number entry was added to it.
* <p>
* Note: This method correspond to the "persistent search" phase.
* It is executed multiple times per persistent search, multi-threaded, until the persistent search is cancelled.
* <p>
* This method must only be called after the provided data have been persisted to disk.
*
* @param baseDN
* the baseDN of the newly added entry.
* @param changeNumber
* the change number of the newly added entry. It will be greater
* than zero for entries added to the change number index and less
* than or equal to zero for entries added to any replica DB
* @param cookieString
* a string representing the cookie of the newly added entry.
* This is only meaningful for entries added to the change number index
* @param updateMsg
* the update message of the newly added entry
* @throws ChangelogException
* If a problem occurs while notifying of the newly added entry.
*/
public void notifyChangeNumberEntryAdded(DN baseDN, long changeNumber, String cookieString, UpdateMsg updateMsg)
throws ChangelogException
{
if (!(updateMsg instanceof LDAPUpdateMsg)
{
return;
}
try
{
// changeNumber entry can be shared with multiple persistent searches
{
}
}
catch (DirectoryException e)
{
throw new ChangelogException(e.getMessageObject(), e);
}
}
{
{
{
return true;
}
}
return false;
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
}
/**
* {@inheritDoc}
* <p>
* Runs the "initial search" phase (as opposed to a "persistent search"
* phase). The "initial search" phase is the only search run by normal
* searches, but it is also run by persistent searches with
* <code>changesOnly=false</code>. Persistent searches with
* <code>changesOnly=true</code> never execute this code.
* <p>
* Note: this method is executed only once per persistent search, single
* threaded.
*/
{
final ChangeNumberRange range = optimizeSearch(searchOperation.getBaseDN(), searchOperation.getFilter());
try
{
{
getCookieEntrySender(SearchPhase.INITIAL, searchOperation, cookie, excludedBaseDNs, isPersistentSearch));
}
else
{
}
}
catch (ChangelogException e)
{
}
}
private MultiDomainServerState getCookieFromControl(final SearchOperation searchOperation, Set<DN> excludedBaseDNs)
throws DirectoryException
{
if (eclRequestControl != null)
{
return cookie;
}
return null;
}
/** {@inheritDoc} */
{
return supportedControls;
}
/** {@inheritDoc} */
{
return Collections.emptySet();
}
/** {@inheritDoc} */
{
return false;
}
/** {@inheritDoc} */
throws DirectoryException
{
}
/** {@inheritDoc} */
throws DirectoryException
{
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
public void removeBackup(BackupDirectory backupDirectory, String backupID) throws DirectoryException
{
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
public long getEntryCount()
{
try
{
}
catch (DirectoryException e)
{
logger.traceException(e);
return -1;
}
}
/**
* Represent the change number range targeted by a search operation.
* <p>
* This class should be visible for tests.
*/
static final class ChangeNumberRange
{
private long lowerBound = -1;
private long upperBound = -1;
/**
* Returns the lowest change number to retrieve (inclusive).
*
* @return the lowest change number
*/
long getLowerBound()
{
return lowerBound;
}
/**
* Returns the highest change number to retrieve (inclusive).
*
* @return the highest change number
*/
long getUpperBound()
{
return upperBound;
}
}
/**
* Returns the set of DNs to exclude from the search.
*
* @return the DNs corresponding to domains to exclude from the search.
* @throws DirectoryException
* If a DN can't be decoded.
*/
{
return getExcludedChangelogDomains();
}
/**
* Optimize the search parameters by analyzing the DN and filter.
* It also performs validation on some search parameters
* for both cookie and change number based changelogs.
*
* @param baseDN the provided search baseDN.
* @param userFilter the provided search filter.
* @return the optimized change number range
* @throws DirectoryException when an exception occurs.
*/
ChangeNumberRange optimizeSearch(final DN baseDN, final SearchFilter userFilter) throws DirectoryException
{
{
case 1:
// "cn=changelog" : use user-provided search filter.
break;
case 2:
// It is probably "changeNumber=xxx,cn=changelog", use equality filter
// But it also could be "<service-id>,cn=changelog" so need to check on attribute
break;
default:
// "replicationCSN=xxx,<service-id>,cn=changelog" : use equality filter
break;
}
}
/**
* Build a search filter from given DN and attribute.
*
* @return the search filter or {@code null} if attribute is not present in
* the provided DN
*/
private SearchFilter buildSearchFilterFrom(final DN baseDN, final String lowerCaseAttr, final String upperCaseAttr)
{
{
}
return null;
}
private ChangeNumberRange optimizeSearchUsingFilter(final SearchFilter filter) throws DirectoryException
{
{
return range;
}
{
}
{
}
{
}
{
// == exact CSN
// validate provided CSN is correct
}
{
// TODO: it looks like it could be generalized to N components, not only two
long upper1 = -1;
long lower1 = -1;
long upper2 = -1;
long lower2 = -1;
{
}
{
}
if (upper1 == -1)
{
}
else if (upper2 == -1)
{
}
else
{
}
}
return range;
}
throws DirectoryException
{
try
{
}
catch (NumberFormatException e)
{
}
}
{
}
/**
* Search the changelog when a cookie control is provided.
*/
throws DirectoryException, ChangelogException
{
{ // only return the base entry: stop here
return;
}
try
{
{
}
}
finally
{
}
}
private CookieEntrySender getCookieEntrySender(SearchPhase startPhase, final SearchOperation searchOperation,
{
{
}
}
{
boolean continueSearch = true;
{
}
return continueSearch;
}
{
{
{
return true;
}
}
return false;
}
/** {@inheritDoc} */
{
{
}
else
{
}
super.registerPersistentSearch(pSearch);
}
{
// Validation must be done during registration for changes only persistent searches.
// Otherwise, when there is an initial search phase,
// validation is performed by the search() method.
if (pSearch.isChangesOnly())
{
}
final SearchPhase startPhase = pSearch.isChangesOnly() ? SearchPhase.PERSISTENT : SearchPhase.INITIAL;
if (isCookieBased(searchOp))
{
final MultiDomainServerState cookie = getCookie(pSearch.isChangesOnly(), searchOp, excludedBaseDNs);
}
else
{
}
}
private MultiDomainServerState getCookie(boolean isChangesOnly, SearchOperation searchOp, Set<DN> excludedBaseDNs)
throws DirectoryException
{
if (isChangesOnly)
{
// this changesOnly persistent search will not go through #initialSearch()
// so we must initialize the cookie here
return getNewestCookie(searchOp);
}
}
{
if (!isCookieBased(searchOp))
{
return null;
}
{
}
return cookie;
}
/**
* Validates the cookie contained in search parameters by checking its content
* with the actual replication server state.
*
* @throws DirectoryException
* If the state is not valid
*/
throws DirectoryException
{
{
}
}
/**
* Search the changelog using change number(s).
*/
throws ChangelogException, DirectoryException
{
{ // only return the base entry: stop here
return;
}
try
{
{
}
}
finally
{
}
}
{
{
}
}
DBCursor<ChangeNumberIndexRecord> cnIndexDBCursor, AtomicReference<MultiDomainDBCursor> replicaUpdatesCursor,
{
boolean continueSearch = true;
{
// Handle the current cnIndex record
{
}
else
{
}
if (continueSearch)
{
final UpdateMsg updateMsg = findReplicaUpdateMessage(replicaUpdatesCursor.get(), cnIndexRecord.getCSN());
{
}
}
}
return continueSearch;
}
/** Initialize the provided cookie from the provided change number index record. */
private void initializeCookieForChangeNumberMode(
MultiDomainServerState cookie, final ChangeNumberIndexRecord cnIndexRecord) throws ChangelogException
{
// Initialize the multi domain cursor only from the change number index record.
// The cookie is always empty at this stage.
CursorOptions options = new CursorOptions(LESS_THAN_OR_EQUAL_TO_KEY, ON_MATCHING_KEY, cnIndexRecord.getCSN());
MultiDomainDBCursor cursor = getChangelogDB().getReplicationDomainDB().getCursorFrom(unused, options);
{
}
}
/**
* Rebuilds the changelogcookie starting at the newest change number index record.
* <p>
* It updates the provided cookie with the changes from the provided ECL cursor,
* up to (and including) the provided change number index record.
* <p>
* Therefore, after calling this method, the cursor is positioned
* to the change immediately following the provided change number index record.
*
* @param cookie the cookie to update
* @param cursor the cursor where to read changes from
* @param cnIndexRecord the change number index record to go right after
* @throws ChangelogException if any problem occurs
*/
public static void updateCookieToMediumConsistencyPoint(
MultiDomainServerState cookie, ECLMultiDomainDBCursor cursor, ChangeNumberIndexRecord cnIndexRecord)
throws ChangelogException
{
if (cnIndexRecord == null)
{
return;
}
{
{
break;
}
}
}
{
// No need for ECLMultiDomainDBCursor in this case
// as updateMsg will be matched with cnIndexRecord
return replicaUpdatesCursor;
}
/**
* Returns the replica update message corresponding to the provided
* cnIndexRecord.
*
* @return the update message, which may be {@code null} if the update message
* could not be found because it was purged or because corresponding
* baseDN was removed from the changelog
* @throws DirectoryException
* If inconsistency is detected between the available update
* messages and the provided cnIndexRecord
*/
throws ChangelogException, DirectoryException
{
while (true)
{
if (compareIndexWithUpdateMsg < 0) {
// Either update message has been purged or baseDN has been removed from changelogDB,
// ignore current index record and go to the next one
return null;
}
else if (compareIndexWithUpdateMsg == 0)
{
// Found the matching update message
return updateMsg;
}
// Case compareIndexWithUpdateMsg > 0 : the update message has not bean reached yet
if (!replicaUpdatesCursor.next())
{
// Should never happen, as it means some messages have disappeared
// TODO : put the correct I18N message
}
}
}
/** Returns a cursor on CNIndexDB for the provided first change number. */
final long firstChangeNumber) throws ChangelogException
{
long changeNumberToUse = firstChangeNumber;
if (changeNumberToUse <= 1)
{
changeNumberToUse = oldestRecord == null ? CHANGE_NUMBER_FOR_EMPTY_CURSOR : oldestRecord.getChangeNumber();
}
}
/**
* Creates a changelog entry.
*/
private static Entry createEntryFromMsg(final DN baseDN, final long changeNumber, final String cookie,
{
{
}
else if (msg instanceof ModifyCommonMsg)
{
}
{
return createChangelogEntry(baseDN, changeNumber, cookie, delMsg, null, "delete", delMsg.getInitiatorsName());
}
LocalizableMessage.raw("Unexpected message type when trying to create changelog entry for dn %s : %s", baseDN,
}
/**
* Creates an entry from an add message.
* <p>
* Map addMsg to an LDIF string for the 'changes' attribute, and pull out
* change initiators name if available which is contained in the creatorsName
* attribute.
*/
private static Entry createAddMsg(final DN baseDN, final long changeNumber, final String cookie, final UpdateMsg msg)
throws DirectoryException
{
try
{
{
{
// This attribute is not multi-valued.
}
{
}
}
}
catch (Exception e)
{
}
return createChangelogEntry(baseDN, changeNumber, cookie, addMsg, ldifChanges, "add", changeInitiatorsName);
}
/**
* Creates an entry from a modify message.
* <p>
* Map the modifyMsg to an LDIF string for the 'changes' attribute, and pull
* out change initiators name if available which is contained in the
* modifiersName attribute.
*/
{
try
{
{
{
// This attribute is not multi-valued.
}
{
}
}
}
catch (Exception e)
{
}
if (isModifyDNMsg)
{
{
}
}
return entry;
}
/**
* Log an encoding message error.
*
* @param messageType
* String identifying type of message. Should be "add" or "modify".
* @param entryDN
* DN of original entry
*/
{
"An exception was encountered while trying to encode a replication " + messageType + " message for entry \""
}
{
{
}
}
/**
* Create a changelog entry from a set of provided information. This is the part of
* entry creation common to all types of msgs (ADD, DEL, MOD, MODDN).
*/
private static Entry createChangelogEntry(final DN baseDN, final long changeNumber, final String cookie,
{
if (changeNumber > 0)
{
// change number mode
}
else
{
// Cookie mode
}
// Operational standard attributes
// REQUIRED attributes
if (changeNumber > 0)
{
addAttributeByType("changenumber", "changeNumber", String.valueOf(changeNumber), userAttrs, opAttrs);
}
// NON REQUESTED attributes
if (ldifChanges != null)
{
}
if (changeInitiatorsName != null)
{
addAttributeByType("changeinitiatorsname", "changeInitiatorsName", changeInitiatorsName, userAttrs, opAttrs);
}
if (targetUUID != null)
{
}
{
{
{
}
}
addAttributeByType("includedattributes", "includedAttributes", includedAttributesLDIF, userAttrs, opAttrs);
}
}
/**
* Sends the entry if it matches the base, scope and filter of the current search operation.
* It will also send the base changelog entry if it needs to be sent and was not sent before.
*
* @return {@code true} if search should continue, {@code false} otherwise
*/
throws DirectoryException
{
{
}
// maybe the next entry will match?
return true;
}
/** Indicates if the provided entry matches the filter, base and scope. */
private static boolean matchBaseAndScopeAndFilter(SearchOperation searchOp, Entry entry) throws DirectoryException
{
}
{
{
return Collections.singletonList(c);
}
return Collections.emptyList();
}
/**
* Create and returns the base changelog entry to the underlying search operation.
* <p>
* "initial search" phase must return the base entry immediately.
*
* @return {@code true} if search should continue, {@code false} otherwise
*/
{
{
{
// Abandon, size limit reached.
return false;
}
}
}
{
// We never return the numSubordinates attribute for the base changelog entry
// and there is a very good reason for that:
// - Either we compute it before sending the entries,
// -- then we risk returning more entries if new entries come in after we computed numSubordinates
// -- or we risk returning less entries if purge kicks in after we computed numSubordinates
// - Or we accumulate all the entries that must be returned before sending them => OutOfMemoryError
addAttributeByUppercaseName(ATTR_COMMON_NAME, ATTR_COMMON_NAME, BACKEND_ID, userAttrs, operationalAttrs);
addAttributeByUppercaseName("hassubordinates", "hasSubordinates", hasSubordinatesStr, userAttrs, operationalAttrs);
addAttributeByUppercaseName("entrydn", "entryDN", DN_EXTERNAL_CHANGELOG_ROOT, userAttrs, operationalAttrs);
}
{
}
{
}
{
}
{
if (attrType.isOperational())
{
}
else
{
}
}
/**
* Describes the current search phase.
*/
private enum SearchPhase
{
/**
* "Initial search" phase. The "initial search" phase is running
* concurrently. All update notifications are ignored.
*/
/**
* Transitioning from the "initial search" phase to the "persistent search"
* phase. "Initial search" phase has finished reading from the DB. It now
* verifies if any more updates have been persisted to the DB since stopping
* and send them. All update notifications are blocked.
*/
/**
* "Persistent search" phase. "Initial search" phase has completed. All
* update notifications are published.
*/
}
/**
* Contains data to ensure that the same change is not sent twice to clients
* because of race conditions between the "initial search" phase and the
* "persistent search" phase.
*/
private static class SendEntryData<K extends Comparable<K>>
{
private final AtomicReference<SearchPhase> searchPhase = new AtomicReference<>(SearchPhase.INITIAL);
private volatile K lastKeySentByInitialSearch;
{
}
private void finalizeInitialSearch()
{
synchronized (transitioningLock)
{ // initial search phase has completed, release all persistent searches
}
}
public void transitioningToPersistentSearchPhase()
{
}
private void initialSearchSendsEntry(final K key)
{
}
private boolean persistentSearchCanSendEntry(K key)
{
switch (stateValue)
{
case INITIAL:
return false;
case TRANSITIONING:
synchronized (transitioningLock)
{
{
// "initial search" phase is over, and is now verifying whether new
// changes have been published to the DB.
// Wait for this check to complete
try
{
}
catch (InterruptedException e)
{
// Shutdown must have been called. Stop sending entries.
return false;
}
}
}
case PERSISTENT:
return true;
default:
}
}
}
/** Sends entries to clients for change number searches. */
private static class ChangeNumberEntrySender
{
private final SearchOperation searchOp;
private final long lowestChangeNumber;
private final long highestChangeNumber;
private ChangeNumberEntrySender(SearchOperation searchOp, SearchPhase startPhase, ChangeNumberRange range)
{
}
/**
* Indicates if provided change number is compatible with last change
* number.
*
* @param changeNumber
* The change number to test.
* @return {@code true} if and only if the provided change number is in the
* range of the last change number.
*/
boolean changeNumberIsInRange(long changeNumber)
{
}
private void finalizeInitialSearch()
{
}
private void transitioningToPersistentSearchPhase()
{
}
/**
* @return {@code true} if search should continue, {@code false} otherwise
*/
{
final Entry entry = createEntryFromMsg(baseDN, cnIndexRecord.getChangeNumber(), cookie.toString(), updateMsg);
}
{
{
}
}
}
/** Sends entries to clients for cookie-based searches. */
private static class CookieEntrySender {
private final SearchOperation searchOp;
private final SearchPhase startPhase;
private final MultiDomainServerState cookie;
new ConcurrentSkipListMap<>();
private CookieEntrySender(SearchOperation searchOp, SearchPhase startPhase, MultiDomainServerState cookie,
{
this.startPhase = startPhase;
this.excludedBaseDNs = excludedBaseDNs;
}
private void finalizeInitialSearch()
{
{
}
}
private void transitioningToPersistentSearchPhase()
{
{
}
}
{
{
}
return data;
}
private boolean initialSearchSendEntry(final UpdateMsg updateMsg, final DN baseDN) throws DirectoryException
{
}
throws DirectoryException
{
{
// multi threaded case: wait for the "initial search" phase to set the cookie
// FIXME JNR use this instead of previous line:
// entry.replaceAttribute(Attributes.create("changelogcookie", cookieString));
}
}
{
synchronized (cookie)
{ // forbid concurrent updates to the cookie
}
}
}
}