| | |
| | | // until here session is encrypted then it depends on the negotiation |
| | | // The session initiator decides whether to use SSL. |
| | | if (!sessionInitiatorSSLEncryption) |
| | | { |
| | | session.stopEncryption(); |
| | | } |
| | | |
| | | // wait and process StartSessionMsg from remote RS |
| | | StartECLSessionMsg inStartECLSessionMsg = |
| | |
| | | e); |
| | | } |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("initializeChangelogDomainCtxts() ends with " |
| | | + dumpState()); |
| | | } |
| | | } |
| | | |
| | | private Set<DomainContext> buildDomainContexts(String providedCookie, |
| | |
| | | { |
| | | // skip the 'unreal' changelog domain |
| | | if (domain == this.replicationServerDomain) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | // skip the excluded domains |
| | | Set<String> excludedBaseDNs = startECLSessionMsg.getExcludedBaseDNs(); |
| | |
| | | { |
| | | // this is an excluded domain |
| | | if (allowUnknownDomains) |
| | | { |
| | | startStatesFromProvidedCookie.remove(domain.getBaseDN()); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | // skip unused domains |
| | | final ServerState latestState = domain.getLatestServerState(); |
| | | if (latestState.isEmpty()) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | // Creates the new domain context |
| | | final DomainContext newDomainCtxt; |
| | |
| | | public void shutdown() |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace(this + " shutdown()"); |
| | | } |
| | | releaseCursor(); |
| | | for (DomainContext domainCtxt : domainCtxts) { |
| | | if (!domainCtxt.unRegisterHandler()) { |
| | |
| | | registerIntoDomain(); |
| | | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace(getClass().getCanonicalName() + " " + getOperationId() |
| | | + " initialized: " + " " + dumpState() + domaimCtxtsToString("")); |
| | | } |
| | | } |
| | | |
| | | private void initializeChangelogSearch(StartECLSessionMsg msg) |
| | |
| | | |
| | | // TODO:ECL We should refactor so that a SH always have a session |
| | | if (session == null) |
| | | { |
| | | return msg; |
| | | } |
| | | |
| | | boolean interrupted = true; |
| | | boolean acquired = false; |
| | |
| | | { |
| | | ECLUpdateMsg eclMsg = getNextECLUpdate(); |
| | | if (eclMsg != null) |
| | | { |
| | | return eclMsg.getUpdateMsg(); |
| | | } |
| | | } |
| | | catch(DirectoryException de) |
| | | { |
| | |
| | | { |
| | | final CSN csn = oldestChange.getUpdateMsg().getCSN(); |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("getNextECLUpdate updates previousCookie:" + csn); |
| | | } |
| | | |
| | | previousCookie.update(oldestChange.getBaseDN(), csn); |
| | | oldestChange.setCookie(previousCookie); |
| | | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("getNextECLUpdate returns result oldestChange=" |
| | | + oldestChange); |
| | | } |
| | | } |
| | | return oldestChange; |
| | | } |
| | |
| | | final DN baseDNFromCNIndexDB = currentRecord.getBaseDN(); |
| | | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("assignChangeNumber() comparing the replicaDB's and" |
| | | + " CNIndexDB's baseDNs :" + baseDNFromReplicaDB + "?=" |
| | | + baseDNFromCNIndexDB + " timestamps:" + asDate(csnFromReplicaDB) |
| | | + " ?older" + asDate(csnFromCNIndexDB)); |
| | | } |
| | | |
| | | if (areSameChange(csnFromReplicaDB, baseDNFromReplicaDB, |
| | | csnFromCNIndexDB, baseDNFromCNIndexDB)) |
| | |
| | | + currentRecord.getChangeNumber() + " to change=" |
| | | + replicaDBChange); |
| | | |
| | | previousCookie = |
| | | new MultiDomainServerState(currentRecord.getPreviousCookie()); |
| | | previousCookie.update( |
| | | new MultiDomainServerState(currentRecord.getPreviousCookie())); |
| | | replicaDBChange.setCookie(previousCookie); |
| | | replicaDBChange.setChangeNumber(currentRecord.getChangeNumber()); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | if (!csnFromCNIndexDB.isOlderThan(csnFromReplicaDB)) |
| | | { |
| | | // the change from the replicaDB is older |
| | |
| | | return false; // TO BE CHECKED |
| | | } |
| | | |
| | | |
| | | // The change from the CNIndexDB is older. |
| | | // It means that the CNIndexDB change has been purged from the replicaDB |
| | | // and CNIndexDB has not been trimmed yet. |
| | |
| | | // starvation of changelog messages |
| | | // all domain have been unactived means are covered |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("In cn=changelog" + "," + this + " closeInitPhase(): " |
| | | + dumpState()); |
| | | } |
| | | |
| | | // go to persistent phase if one |
| | | for (DomainContext domainCtxt : domainCtxts) domainCtxt.active = true; |