Remove getBaseDNString() methods.
After changing ArgX.get() to accept Object parameters instead of String + relaxing line length to 120 characters, it is now possible to get rid of getBaseDNString() methods, and directly use the getBaseDN() methods instead.
| | |
| | | import org.opends.server.tasks.PurgeConflictsHistoricalTask; |
| | | import org.opends.server.tasks.TaskUtils; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.Modification; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.Operation; |
| | | import org.opends.server.types.OperationType; |
| | | import org.opends.server.types.RDN; |
| | | import org.opends.server.types.operation.*; |
| | | import org.opends.server.util.LDIFReader; |
| | | import org.opends.server.util.TimeThread; |
| | |
| | | { |
| | | protected ServerStateFlush() |
| | | { |
| | | super("Replica DS(" + getServerId() |
| | | + ") state checkpointer for domain \"" + getBaseDNString() + "\""); |
| | | super("Replica DS(" + getServerId() + ") state checkpointer for domain \"" + getBaseDN() + "\""); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | |
| | | protected RSUpdater(CSN replServerMaxCSN) |
| | | { |
| | | super("Replica DS(" + getServerId() |
| | | + ") missing change publisher for domain \"" + getBaseDNString() |
| | | + "\""); |
| | | super("Replica DS(" + getServerId() + ") missing change publisher for domain \"" + getBaseDN() + "\""); |
| | | this.startCSN = replServerMaxCSN; |
| | | } |
| | | |
| | |
| | | * Log an error for the repair tool |
| | | * that will need to re-synchronize the servers. |
| | | */ |
| | | logger.error(ERR_CANNOT_RECOVER_CHANGES, getBaseDNString()); |
| | | logger.error(ERR_CANNOT_RECOVER_CHANGES, getBaseDN()); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | * Log an error for the repair tool |
| | | * that will need to re-synchronize the servers. |
| | | */ |
| | | logger.error(ERR_CANNOT_RECOVER_CHANGES, getBaseDNString()); |
| | | logger.error(ERR_CANNOT_RECOVER_CHANGES, getBaseDN()); |
| | | } |
| | | finally |
| | | { |
| | |
| | | Backend<?> backend = getBackend(); |
| | | if (backend == null) |
| | | { |
| | | throw new ConfigException(ERR_SEARCHING_DOMAIN_BACKEND.get( |
| | | getBaseDNString())); |
| | | throw new ConfigException(ERR_SEARCHING_DOMAIN_BACKEND.get(getBaseDN())); |
| | | } |
| | | |
| | | try |
| | |
| | | } |
| | | catch (DirectoryException e) |
| | | { |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDN(), stackTraceToSingleLineString(e)); |
| | | } |
| | | |
| | | /* |
| | |
| | | // Should not happen as normally already called without problem in |
| | | // isConfigurationChangeAcceptable or isConfigurationAcceptable |
| | | // if we come up to this method |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDN(), stackTraceToSingleLineString(e)); |
| | | return; |
| | | } |
| | | |
| | |
| | | catch (ConfigException e) |
| | | { |
| | | // Should not happen |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDN(), stackTraceToSingleLineString(e)); |
| | | return; |
| | | } |
| | | |
| | |
| | | // Read config stored in domain root entry |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace( |
| | | "Attempt to read the potential fractional config in domain root " |
| | | + "entry " + getBaseDNString()); |
| | | logger.trace("Attempt to read the potential fractional config in domain root entry " + getBaseDN()); |
| | | } |
| | | |
| | | // Search the domain root entry that is used to save the generation id |
| | |
| | | if (search.getResultCode() != ResultCode.SUCCESS |
| | | && search.getResultCode() != ResultCode.NO_SUCH_OBJECT) |
| | | { |
| | | logger.error(ERR_SEARCHING_GENERATION_ID, |
| | | search.getResultCode().getName() + " " + search.getErrorMessage(), |
| | | getBaseDNString()); |
| | | String errorMsg = search.getResultCode().getName() + " " + search.getErrorMessage(); |
| | | logger.error(ERR_SEARCHING_GENERATION_ID, errorMsg, getBaseDN()); |
| | | return false; |
| | | } |
| | | |
| | |
| | | } |
| | | if (attr.size() > 1) |
| | | { |
| | | logger.error(ERR_LOADING_GENERATION_ID, |
| | | getBaseDNString(), |
| | | "#Values=" + attr.size() + " Must be exactly 1 in entry " + resultEntry.toLDIFString()); |
| | | String errorMsg = "#Values=" + attr.size() + " Must be exactly 1 in entry " + resultEntry.toLDIFString(); |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDN(), errorMsg); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch(DirectoryException e) |
| | | { |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.info(NOTE_ERR_FRACTIONAL, getBaseDN(), stackTraceToSingleLineString(e)); |
| | | return FRACTIONAL_HAS_NO_FRACTIONAL_FILTERED_ATTRIBUTES; |
| | | } |
| | | Set<ObjectClass> entryClasses = entryToModify.getObjectClasses().keySet(); |
| | |
| | | switch (importErrorMessageId) |
| | | { |
| | | case IMPORT_ERROR_MESSAGE_BAD_REMOTE: |
| | | msg = NOTE_ERR_FULL_UPDATE_IMPORT_FRACTIONAL_BAD_REMOTE.get( |
| | | getBaseDNString(), ieCtx.getImportSource()); |
| | | msg = NOTE_ERR_FULL_UPDATE_IMPORT_FRACTIONAL_BAD_REMOTE.get(getBaseDN(), ieCtx.getImportSource()); |
| | | break; |
| | | case IMPORT_ERROR_MESSAGE_REMOTE_IS_FRACTIONAL: |
| | | msg = NOTE_ERR_FULL_UPDATE_IMPORT_FRACTIONAL_REMOTE_IS_FRACTIONAL.get( |
| | | getBaseDNString(), ieCtx.getImportSource()); |
| | | msg = NOTE_ERR_FULL_UPDATE_IMPORT_FRACTIONAL_REMOTE_IS_FRACTIONAL.get(getBaseDN(), ieCtx.getImportSource()); |
| | | break; |
| | | } |
| | | ieCtx.setException(new DirectoryException(UNWILLING_TO_PERFORM, msg)); |
| | |
| | | { |
| | | if (target == RoutableMsg.ALL_SERVERS && fractionalConfig.isFractional()) |
| | | { |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_FULL_UPDATE_FRACTIONAL.get( |
| | | getBaseDNString(), getServerId()); |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_FULL_UPDATE_FRACTIONAL.get(getBaseDN(), getServerId()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | | |
| | |
| | | { |
| | | if (!deleteOperation.isSynchronizationOperation() && !brokerIsConnected()) |
| | | { |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDNString()); |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDN()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | |
| | | { |
| | | if (!addOperation.isSynchronizationOperation() && !brokerIsConnected()) |
| | | { |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDNString()); |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDN()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | |
| | | */ |
| | | if (fractionalFilterOperation(addOperation, false)) |
| | | { |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_OPERATION.get( |
| | | getBaseDNString(), addOperation); |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_OPERATION.get(getBaseDN(), addOperation); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | |
| | | { |
| | | if (!modifyDNOperation.isSynchronizationOperation() && !brokerIsConnected()) |
| | | { |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDNString()); |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDN()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | |
| | | */ |
| | | if (fractionalFilterOperation(modifyDNOperation, false)) |
| | | { |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_OPERATION.get( |
| | | getBaseDNString(), modifyDNOperation); |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_OPERATION.get(getBaseDN(), modifyDNOperation); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | |
| | | { |
| | | if (!modifyOperation.isSynchronizationOperation() && !brokerIsConnected()) |
| | | { |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDNString()); |
| | | LocalizableMessage msg = ERR_REPLICATION_COULD_NOT_CONNECT.get(getBaseDN()); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | |
| | | case FRACTIONAL_HAS_FRACTIONAL_FILTERED_ATTRIBUTES: |
| | | // Some attributes not compliant with fractional configuration : |
| | | // forbid the operation |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_OPERATION.get( |
| | | getBaseDNString(), modifyOperation); |
| | | LocalizableMessage msg = NOTE_ERR_FRACTIONAL_FORBIDDEN_OPERATION.get(getBaseDN(), modifyOperation); |
| | | return new SynchronizationProviderResult.StopProcessing( |
| | | ResultCode.UNWILLING_TO_PERFORM, msg); |
| | | } |
| | |
| | | } catch (TimeoutException ex) |
| | | { |
| | | // This exception may only be raised if assured replication is enabled |
| | | logger.info(NOTE_DS_ACK_TIMEOUT, getBaseDNString(), getAssuredTimeout(), msg); |
| | | logger.info(NOTE_DS_ACK_TIMEOUT, getBaseDN(), getAssuredTimeout(), msg); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | String conflictRDN = |
| | | generateConflictRDN(entryUUID, op.getEntryDN().rdn().toString()); |
| | | msg.setDN(DN.valueOf(conflictRDN + "," + getBaseDNString())); |
| | | msg.setDN(DN.valueOf(conflictRDN + "," + getBaseDN())); |
| | | // reset the parent entryUUID so that the check done is the |
| | | // handleConflict phase does not fail. |
| | | msg.setParentEntryUUID(null); |
| | |
| | | * not available, log an error and retry upon timeout |
| | | * should we stop the modifications ? |
| | | */ |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDN(), stackTraceToSingleLineString(e)); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | if (result != ResultCode.SUCCESS) |
| | | { |
| | | logger.error(ERR_UPDATING_GENERATION_ID, result.getName(), getBaseDNString()); |
| | | logger.error(ERR_UPDATING_GENERATION_ID, result.getName(), getBaseDN()); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("Attempt to read generation ID from DB " |
| | | + getBaseDNString()); |
| | | logger.trace("Attempt to read generation ID from DB " + getBaseDN()); |
| | | } |
| | | |
| | | /* |
| | |
| | | { |
| | | if (search.getResultCode() != ResultCode.NO_SUCH_OBJECT) |
| | | { |
| | | logger.error(ERR_SEARCHING_GENERATION_ID, |
| | | search.getResultCode().getName() + " " + search.getErrorMessage(), |
| | | getBaseDNString()); |
| | | String errorMsg = search.getResultCode().getName() + " " + search.getErrorMessage(); |
| | | logger.error(ERR_SEARCHING_GENERATION_ID, errorMsg, getBaseDN()); |
| | | } |
| | | } |
| | | else |
| | |
| | | Attribute attr = attrs.get(0); |
| | | if (attr.size()>1) |
| | | { |
| | | logger.error(ERR_LOADING_GENERATION_ID, |
| | | getBaseDNString(), |
| | | "#Values=" + attr.size() + " Must be exactly 1 in entry " + resultEntry.toLDIFString()); |
| | | String errorMsg = "#Values=" + attr.size() + " Must be exactly 1 in entry " + resultEntry.toLDIFString(); |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDN(), errorMsg); |
| | | } |
| | | else if (attr.size() == 1) |
| | | { |
| | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.error(ERR_LOADING_GENERATION_ID, getBaseDN(), stackTraceToSingleLineString(e)); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("Generation ID created for domain baseDN=" |
| | | + getBaseDNString() + " generationId=" + aGenerationId); |
| | | logger.trace("Generation ID created for domain baseDN=" + getBaseDN() + " generationId=" + aGenerationId); |
| | | } |
| | | } |
| | | else |
| | |
| | | generationIdSavedStatus = true; |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("Generation ID successfully read from domain baseDN=" |
| | | + getBaseDNString() + " generationId=" + aGenerationId); |
| | | logger.trace("Generation ID successfully read from domain baseDN=" + getBaseDN() |
| | | + " generationId=" + aGenerationId); |
| | | } |
| | | } |
| | | return aGenerationId; |
| | |
| | | state.save(); |
| | | } |
| | | |
| | | /** |
| | | * Do whatever is needed when a backup is finished. |
| | | */ |
| | | /** Do whatever is needed when a backup is finished. */ |
| | | void backupEnd() |
| | | { |
| | | // Nothing is needed at the moment |
| | |
| | | catch (Exception e) |
| | | { |
| | | throw new ConfigException(NOTE_ERR_UNABLE_TO_ENABLE_ECL.get( |
| | | "Replication Domain on " + getBaseDNString(), stackTraceToSingleLineString(e)), e); |
| | | "Replication Domain on " + getBaseDN(), stackTraceToSingleLineString(e)), e); |
| | | } |
| | | } |
| | | |
| | |
| | | if (forceBadDataSet) |
| | | { |
| | | signalNewStatus(StatusMachineEvent.TO_BAD_GEN_ID_STATUS_EVENT); |
| | | logger.info(NOTE_FRACTIONAL_BAD_DATA_SET_NEED_RESYNC, getBaseDNString()); |
| | | logger.info(NOTE_FRACTIONAL_BAD_DATA_SET_NEED_RESYNC, getBaseDN()); |
| | | return; // Do not send changes to the replication server |
| | | } |
| | | |
| | |
| | | } |
| | | } catch (Exception e) |
| | | { |
| | | logger.error(ERR_PUBLISHING_FAKE_OPS, getBaseDNString(), stackTraceToSingleLineString(e)); |
| | | logger.error(ERR_PUBLISHING_FAKE_OPS, getBaseDN(), stackTraceToSingleLineString(e)); |
| | | } |
| | | } |
| | | |
| | |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_INVALID_IMPORT_SOURCE.get( |
| | | getBaseDNString(), getServerId(), sourceString, stackTraceToSingleLineString(e)); |
| | | getBaseDN(), getServerId(), sourceString, stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(ResultCode.OTHER, message, e); |
| | | } |
| | | |
| | | LocalizableMessage message = ERR_INVALID_IMPORT_SOURCE.get( |
| | | getBaseDNString(), getServerId(), source, ""); |
| | | LocalizableMessage message = ERR_INVALID_IMPORT_SOURCE.get(getBaseDN(), getServerId(), source, ""); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | |
| | |
| | | long endDate) throws DirectoryException |
| | | { |
| | | logger.trace("[PURGE] purgeConflictsHistorical " |
| | | + "on domain: " + getBaseDNString() |
| | | + "on domain: " + getBaseDN() |
| | | + "endDate:" + new Date(endDate) |
| | | + "lastCSNPurgedFromHist: " |
| | | + lastCSNPurgedFromHist.toStringUI()); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | | import java.io.IOException; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import java.util.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.server.replication.common.*; |
| | | import org.opends.server.replication.protocol.*; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.replication.common.ServerStatus.*; |
| | | import static org.opends.server.replication.common.StatusMachine.*; |
| | | import static org.opends.server.replication.protocol.ProtocolVersion.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.replication.common.*; |
| | | import org.opends.server.replication.protocol.*; |
| | | import org.opends.server.types.*; |
| | | |
| | | /** |
| | | * This class defines a server handler, which handles all interaction with a |
| | | * peer server (RS or DS). |
| | |
| | | if (event == StatusMachineEvent.TO_BAD_GEN_ID_STATUS_EVENT |
| | | && status == ServerStatus.FULL_UPDATE_STATUS) |
| | | { |
| | | // Prevent useless error message (full update status cannot lead to bad |
| | | // gen status) |
| | | // Prevent useless error message (full update status cannot lead to bad gen status) |
| | | logger.info(NOTE_BAD_GEN_ID_IN_FULL_UPDATE, replicationServer.getServerId(), |
| | | getBaseDNString(), serverId, generationId, newGenId); |
| | | getBaseDN(), serverId, generationId, newGenId); |
| | | return; |
| | | } |
| | | |
| | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("In RS " + replicationServer.getServerId() |
| | | + ", DS " + getServerId() + " for baseDN=" + getBaseDNString() |
| | | + ", DS " + getServerId() + " for baseDN=" + getBaseDN() |
| | | + " has already generation id " + newGenId |
| | | + " so no ChangeStatusMsg sent to him."); |
| | | } |
| | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("In RS " + replicationServer.getServerId() |
| | | + ", closing connection to DS " + getServerId() + " for baseDN=" |
| | | + getBaseDNString() + " to force reconnection as new local" |
| | | + " generationId and remote one match and DS is in bad gen id: " |
| | | + newGenId); |
| | | + ", closing connection to DS " + getServerId() + " for baseDN=" + getBaseDN() |
| | | + " to force reconnection as new local generationId" |
| | | + " and remote one match and DS is in bad gen id: " + newGenId); |
| | | } |
| | | |
| | | // Connection closure must not be done calling RSD.stopHandler() as it |
| | |
| | | { |
| | | logger.trace("In RS " + replicationServer.getServerId() |
| | | + " Sending change status " + origin + " to " + getServerId() |
| | | + " for baseDN=" + getBaseDNString() + ":\n" + csMsg); |
| | | + " for baseDN=" + getBaseDN() + ":\n" + csMsg); |
| | | } |
| | | |
| | | session.publish(csMsg); |
| | |
| | | if (generationId != localGenerationId) |
| | | { |
| | | logger.warn(WARN_BAD_GENERATION_ID_FROM_DS, serverId, session.getReadableRemoteAddress(), |
| | | generationId, getBaseDNString(), |
| | | getReplicationServerId(), localGenerationId); |
| | | generationId, getBaseDN(), getReplicationServerId(), localGenerationId); |
| | | } |
| | | } |
| | | else |
| | |
| | | // If the LDAP server has already sent changes |
| | | // it is not expected to connect to an empty RS |
| | | logger.warn(WARN_BAD_GENERATION_ID_FROM_DS, serverId, session.getReadableRemoteAddress(), |
| | | generationId, getBaseDNString(), |
| | | getReplicationServerId(), localGenerationId); |
| | | generationId, getBaseDN(), getReplicationServerId(), localGenerationId); |
| | | } |
| | | else |
| | | { |
| | |
| | | // WARNING: Must be done before computing topo message to send |
| | | // to peer server as topo message must embed valid generation id |
| | | // for our server |
| | | oldGenerationId = |
| | | replicationServerDomain.changeGenerationId(generationId); |
| | | oldGenerationId = replicationServerDomain.changeGenerationId(generationId); |
| | | } |
| | | } |
| | | return startSessionMsg; |
| | |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.types.Attributes.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.types.Attributes.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | /** |
| | | * This class implements a buffering/producer/consumer mechanism of |
| | | * replication changes (UpdateMsg) used inside the replication server. |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get the baseDN for this handler as a String. |
| | | * |
| | | * @return The name of the baseDN. |
| | | */ |
| | | protected String getBaseDNString() |
| | | { |
| | | return baseDN.toString(); |
| | | } |
| | | |
| | | /** |
| | | * Increase the counter of updates received from the server. |
| | | */ |
| | | void incrementInCount() |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.replication.protocol.ProtocolVersion.*; |
| | | |
| | | import java.io.IOException; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.replication.common.DSInfo; |
| | | import org.opends.server.replication.common.RSInfo; |
| | | import org.opends.server.replication.common.ServerState; |
| | | import org.opends.server.replication.common.ServerStatus; |
| | | import org.opends.server.replication.protocol.*; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.replication.protocol.ProtocolVersion.*; |
| | | |
| | | /** |
| | | * This class defines a server handler, which handles all interaction with a |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | |
| | | /** |
| | | * Properties filled only if remote server is a RS. |
| | | */ |
| | | /** Properties filled only if remote server is a RS. */ |
| | | private String serverAddressURL; |
| | | /** |
| | | * this collection will contain as many elements as there are |
| | |
| | | * replicationServerDomain.setGenerationId(generationId, false); |
| | | */ |
| | | logger.warn(WARN_BAD_GENERATION_ID_FROM_RS, serverId, session.getReadableRemoteAddress(), generationId, |
| | | getBaseDNString(), getReplicationServerId(), localGenerationId); |
| | | getBaseDN(), getReplicationServerId(), localGenerationId); |
| | | } |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | | import java.io.IOException; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.Set; |
| | |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.server.admin.std.server.MonitorProviderCfg; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.admin.std.server.MonitorProviderCfg; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.replication.common.AssuredMode; |
| | | import org.opends.server.replication.common.CSN; |
| | | import org.opends.server.replication.common.RSInfo; |
| | | import org.opends.server.replication.common.ServerStatus; |
| | | import org.opends.server.replication.protocol.*; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class defines a server handler : |
| | |
| | | List<Attribute> attributes = super.getMonitorData(); |
| | | |
| | | attributes.add(Attributes.create("server-id", String.valueOf(serverId))); |
| | | attributes.add(Attributes.create("domain-name", getBaseDNString())); |
| | | attributes.add(Attributes.create("domain-name", String.valueOf(getBaseDN()))); |
| | | |
| | | // Deprecated |
| | | attributes.add(Attributes.create("max-waiting-changes", String |
| | |
| | | if (!lockAcquired) |
| | | { |
| | | LocalizableMessage message = WARN_TIMEOUT_WHEN_CROSS_CONNECTION.get( |
| | | getBaseDNString(), |
| | | serverId, |
| | | session.getReadableRemoteAddress(), |
| | | getReplicationServerId()); |
| | | getBaseDN(), serverId, session.getReadableRemoteAddress(), getReplicationServerId()); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | } |
| | |
| | | if (isDataServer()) |
| | | { |
| | | return ERR_DS_BADLY_DISCONNECTED.get(getReplicationServerId(), |
| | | getServerId(), session.getReadableRemoteAddress(), getBaseDNString()); |
| | | getServerId(), session.getReadableRemoteAddress(), getBaseDN()); |
| | | } |
| | | return ERR_RS_BADLY_DISCONNECTED.get(getReplicationServerId(), |
| | | getServerId(), session.getReadableRemoteAddress(), getBaseDNString()); |
| | | getServerId(), session.getReadableRemoteAddress(), getBaseDN()); |
| | | } |
| | | } |
| | |
| | | */ |
| | | package org.opends.server.replication.service; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.replication.common.AssuredMode.*; |
| | | import static org.opends.server.replication.common.StatusMachine.*; |
| | | |
| | | import java.io.BufferedOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.replication.common.AssuredMode.*; |
| | | import static org.opends.server.replication.common.StatusMachine.*; |
| | | |
| | | /** |
| | | * This class should be used as a base for Replication implementations. |
| | | * <p> |
| | |
| | | // Sanity check: is it a valid initial status? |
| | | if (!isValidInitialStatus(initStatus)) |
| | | { |
| | | logger.error(ERR_DS_INVALID_INIT_STATUS, initStatus, getBaseDNString(), getServerId()); |
| | | logger.error(ERR_DS_INVALID_INIT_STATUS, initStatus, getBaseDN(), getServerId()); |
| | | } |
| | | else |
| | | { |
| | |
| | | StatusMachineEvent event = StatusMachineEvent.statusToEvent(reqStatus); |
| | | if (event == StatusMachineEvent.INVALID_EVENT) |
| | | { |
| | | logger.error(ERR_DS_INVALID_REQUESTED_STATUS, reqStatus, getBaseDNString(), getServerId()); |
| | | logger.error(ERR_DS_INVALID_REQUESTED_STATUS, reqStatus, getBaseDN(), getServerId()); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Gets the baseDN of this domain. |
| | | * |
| | | * @return The baseDN for this domain. |
| | | */ |
| | | public String getBaseDNString() |
| | | { |
| | | return getBaseDN().toString(); |
| | | } |
| | | |
| | | /** |
| | | * Get the server ID. The identifier of this Replication Domain inside the |
| | | * Replication Service. Each Domain must use a unique ServerID. |
| | | * |
| | |
| | | if (serverToInitialize == RoutableMsg.ALL_SERVERS) |
| | | { |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_START_ALL, |
| | | countEntries(), getBaseDNString(), getServerId()); |
| | | countEntries(), getBaseDN(), getServerId()); |
| | | |
| | | ieCtx.startList.addAll(getReplicaInfos().keySet()); |
| | | |
| | |
| | | else |
| | | { |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_START, countEntries(), |
| | | getBaseDNString(), getServerId(), serverToInitialize); |
| | | getBaseDN(), getServerId(), serverToInitialize); |
| | | |
| | | ieCtx.startList.add(serverToInitialize); |
| | | |
| | |
| | | { |
| | | throw new DirectoryException( |
| | | ResultCode.OTHER, |
| | | ERR_INIT_NO_SUCCESS_START_FROM_SERVERS.get(getBaseDNString(), |
| | | ieCtx.failureList)); |
| | | ERR_INIT_NO_SUCCESS_START_FROM_SERVERS.get(getBaseDN(), ieCtx.failureList)); |
| | | } |
| | | |
| | | exportBackend(new BufferedOutputStream(new ReplOutputStream(this))); |
| | |
| | | if (serverToInitialize == RoutableMsg.ALL_SERVERS) |
| | | { |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_END_ALL, |
| | | getBaseDNString(), getServerId(), cause); |
| | | getBaseDN(), getServerId(), cause); |
| | | } |
| | | else |
| | | { |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FOR_REMOTE_END, |
| | | getBaseDNString(), getServerId(), serverToInitialize, cause); |
| | | getBaseDN(), getServerId(), serverToInitialize, cause); |
| | | } |
| | | |
| | | |
| | |
| | | && getConnectedRemoteDS(ieCtx.importSource) == null) |
| | | { |
| | | LocalizableMessage errMsg = ERR_INIT_EXPORTER_DISCONNECTION.get( |
| | | getBaseDNString(), getServerId(), ieCtx.importSource); |
| | | ieCtx.setExceptionIfNoneSet(new DirectoryException( |
| | | ResultCode.OTHER, errMsg)); |
| | | getBaseDN(), getServerId(), ieCtx.importSource); |
| | | ieCtx.setExceptionIfNoneSet(new DirectoryException(ResultCode.OTHER, errMsg)); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | LocalizableMessage errMsg = !broker.isConnected() |
| | | ? ERR_INITIALIZATION_FAILED_NOCONN.get(getBaseDNString()) |
| | | ? ERR_INITIALIZATION_FAILED_NOCONN.get(getBaseDN()) |
| | | : null; |
| | | |
| | | /* |
| | |
| | | try |
| | | { |
| | | // Log starting |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FROM_REMOTE_START, getBaseDNString(), |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FROM_REMOTE_START, getBaseDN(), |
| | | initTargetMsgReceived.getSenderID(), getServerId()); |
| | | |
| | | // Go into full update status |
| | |
| | | } |
| | | finally |
| | | { |
| | | String errorMsg = ieCtx.getException() != null ? ieCtx.getException().getLocalizedMessage() : ""; |
| | | logger.info(NOTE_FULL_UPDATE_ENGAGED_FROM_REMOTE_END, |
| | | getBaseDNString(), initTargetMsgReceived.getSenderID(), getServerId(), |
| | | (ieCtx.getException() != null ? ieCtx.getException().getLocalizedMessage() : "")); |
| | | getBaseDN(), initTargetMsgReceived.getSenderID(), getServerId(), errorMsg); |
| | | releaseIEContext(); |
| | | } // finally |
| | | } // finally |
| | |
| | | } |
| | | if (!allSet) |
| | | { |
| | | LocalizableMessage message = ERR_RESET_GENERATION_ID_FAILED.get(getBaseDNString()); |
| | | LocalizableMessage message = ERR_RESET_GENERATION_ID_FAILED.get(getBaseDN()); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | } |
| | |
| | | |
| | | if (!isConnected()) |
| | | { |
| | | LocalizableMessage message = ERR_RESET_GENERATION_CONN_ERR_ID.get(getBaseDNString(), |
| | | LocalizableMessage message = ERR_RESET_GENERATION_CONN_ERR_ID.get(getBaseDN(), |
| | | getServerId(), genIdMessage.getGenerationId()); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | |
| | | synchronized (sessionLock) |
| | | { |
| | | final String threadName = "Replica DS(" + getServerId() |
| | | + ") listener for domain \"" + getBaseDNString() + "\""; |
| | | + ") listener for domain \"" + getBaseDN() + "\""; |
| | | |
| | | listenerThread = new DirectoryThread(new Runnable() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2013-2014 ForgeRock AS. |
| | | * Portions copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.service; |
| | | |
| | |
| | | import org.opends.server.admin.std.server.MonitorProviderCfg; |
| | | import org.opends.server.api.MonitorProvider; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.replication.service.ReplicationDomain.*; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.replication.service.ReplicationDomain.ImportExportContext; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeBuilder; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.Attributes; |
| | | |
| | | /** |
| | | * Class used to generate monitoring information for the replication. |
| | |
| | | this.domain = domain; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | { |
| | | // no implementation needed. |
| | |
| | | public String getMonitorInstanceName() |
| | | { |
| | | return "Directory server DS(" + domain.getServerId() + ") " |
| | | + domain.getLocalUrl() + ",cn=" |
| | | + domain.getBaseDNString().replace(',', '_').replace('=', '_') |
| | | + domain.getLocalUrl() |
| | | + ",cn=" + domain.getBaseDN().toString().replace(',', '_').replace('=', '_') |
| | | + ",cn=Replication"; |
| | | } |
| | | |
| | |
| | | { |
| | | List<Attribute> attributes = new ArrayList<Attribute>(); |
| | | |
| | | attributes.add(Attributes.create("domain-name", domain.getBaseDNString())); |
| | | attributes.add(Attributes.create("connected-to", domain |
| | | .getReplicationServer())); |
| | | addMonitorData(attributes, "lost-connections", |
| | | domain.getNumLostConnections()); |
| | | attributes.add(Attributes.create("domain-name", String.valueOf(domain.getBaseDN()))); |
| | | attributes.add(Attributes.create("connected-to", domain.getReplicationServer())); |
| | | addMonitorData(attributes, "lost-connections", domain.getNumLostConnections()); |
| | | addMonitorData(attributes, "received-updates", domain.getNumRcvdUpdates()); |
| | | addMonitorData(attributes, "sent-updates", domain.getNumSentUpdates()); |
| | | |
| | | // get number of changes replayed |
| | | addMonitorData(attributes, "replayed-updates", |
| | | domain.getNumProcessedUpdates()); |
| | | addMonitorData(attributes, "replayed-updates", domain.getNumProcessedUpdates()); |
| | | |
| | | addMonitorData(attributes, "server-id", domain.getServerId()); |
| | | |
| | | // get window information |
| | | addMonitorData(attributes, "max-rcv-window", domain.getMaxRcvWindow()); |
| | | addMonitorData(attributes, "current-rcv-window", |
| | | domain.getCurrentRcvWindow()); |
| | | addMonitorData(attributes, "max-send-window", |
| | | domain.getMaxSendWindow()); |
| | | addMonitorData(attributes, "current-send-window", |
| | | domain.getCurrentSendWindow()); |
| | | addMonitorData(attributes, "current-rcv-window", domain.getCurrentRcvWindow()); |
| | | addMonitorData(attributes, "max-send-window", domain.getMaxSendWindow()); |
| | | addMonitorData(attributes, "current-send-window", domain.getCurrentSendWindow()); |
| | | |
| | | // get the Server State |
| | | final String ATTR_SERVER_STATE = "server-state"; |
| | | AttributeType type = |
| | | DirectoryServer.getDefaultAttributeType(ATTR_SERVER_STATE); |
| | | AttributeType type = DirectoryServer.getDefaultAttributeType(ATTR_SERVER_STATE); |
| | | AttributeBuilder builder = new AttributeBuilder(type, ATTR_SERVER_STATE); |
| | | for (String str : domain.getServerState().toStringSet()) |
| | | { |
| | |
| | | } |
| | | attributes.add(builder.toAttribute()); |
| | | |
| | | attributes.add(Attributes.create("ssl-encryption", |
| | | String.valueOf(domain.isSessionEncrypted()))); |
| | | |
| | | attributes.add(Attributes.create("generation-id", |
| | | String.valueOf(domain.getGenerationID()))); |
| | | attributes.add(Attributes.create("ssl-encryption", String.valueOf(domain.isSessionEncrypted()))); |
| | | attributes.add(Attributes.create("generation-id", String.valueOf(domain.getGenerationID()))); |
| | | |
| | | // Add import/export monitoring attributes |
| | | final ImportExportContext ieContext = domain.getImportExportContext(); |
| | | if (ieContext != null) |
| | | { |
| | | addMonitorData(attributes, "total-update", |
| | | ieContext.importInProgress() ? "import" : "export"); |
| | | addMonitorData(attributes, "total-update-entry-count", |
| | | ieContext.getTotalEntryCount()); |
| | | addMonitorData(attributes, "total-update-entry-left", |
| | | ieContext.getLeftEntryCount()); |
| | | addMonitorData(attributes, "total-update", ieContext.importInProgress() ? "import" : "export"); |
| | | addMonitorData(attributes, "total-update-entry-count", ieContext.getTotalEntryCount()); |
| | | addMonitorData(attributes, "total-update-entry-left", ieContext.getLeftEntryCount()); |
| | | } |
| | | |
| | | |
| | |
| | | * Add assured replication related monitoring fields |
| | | * (see domain.getXXX() method comment for field meaning) |
| | | */ |
| | | |
| | | addMonitorData(attributes, "assured-sr-sent-updates", |
| | | domain.getAssuredSrSentUpdates()); |
| | | addMonitorData(attributes, "assured-sr-acknowledged-updates", |
| | | domain.getAssuredSrAcknowledgedUpdates()); |
| | | addMonitorData(attributes, "assured-sr-not-acknowledged-updates", |
| | | domain.getAssuredSrNotAcknowledgedUpdates()); |
| | | addMonitorData(attributes, "assured-sr-timeout-updates", |
| | | domain.getAssuredSrTimeoutUpdates()); |
| | | addMonitorData(attributes, "assured-sr-wrong-status-updates", |
| | | domain.getAssuredSrWrongStatusUpdates()); |
| | | addMonitorData(attributes, "assured-sr-replay-error-updates", |
| | | domain.getAssuredSrReplayErrorUpdates()); |
| | | |
| | | addMonitorData(attributes, "assured-sr-server-not-acknowledged-updates", |
| | | domain.getAssuredSrServerNotAcknowledgedUpdates()); |
| | | |
| | | addMonitorData(attributes, "assured-sr-received-updates", |
| | | domain.getAssuredSrReceivedUpdates()); |
| | | addMonitorData(attributes, "assured-sr-received-updates-acked", |
| | | domain.getAssuredSrReceivedUpdatesAcked()); |
| | | addMonitorData(attributes, "assured-sr-received-updates-not-acked", |
| | | domain.getAssuredSrReceivedUpdatesNotAcked()); |
| | | addMonitorData(attributes, "assured-sd-sent-updates", |
| | | domain.getAssuredSdSentUpdates()); |
| | | addMonitorData(attributes, "assured-sd-acknowledged-updates", |
| | | domain.getAssuredSdAcknowledgedUpdates()); |
| | | addMonitorData(attributes, "assured-sd-timeout-updates", |
| | | domain.getAssuredSdTimeoutUpdates()); |
| | | |
| | | addMonitorData(attributes, "assured-sd-server-timeout-updates", |
| | | domain.getAssuredSdServerTimeoutUpdates()); |
| | | addMonitorData(attributes, "assured-sr-sent-updates", domain.getAssuredSrSentUpdates()); |
| | | addMonitorData(attributes, "assured-sr-acknowledged-updates", domain.getAssuredSrAcknowledgedUpdates()); |
| | | addMonitorData(attributes, "assured-sr-not-acknowledged-updates", domain.getAssuredSrNotAcknowledgedUpdates()); |
| | | addMonitorData(attributes, "assured-sr-timeout-updates", domain.getAssuredSrTimeoutUpdates()); |
| | | addMonitorData(attributes, "assured-sr-wrong-status-updates", domain.getAssuredSrWrongStatusUpdates()); |
| | | addMonitorData(attributes, "assured-sr-replay-error-updates", domain.getAssuredSrReplayErrorUpdates()); |
| | | addMonitorData(attributes, "assured-sr-server-not-acknowledged-updates", domain |
| | | .getAssuredSrServerNotAcknowledgedUpdates()); |
| | | addMonitorData(attributes, "assured-sr-received-updates", domain.getAssuredSrReceivedUpdates()); |
| | | addMonitorData(attributes, "assured-sr-received-updates-acked", domain.getAssuredSrReceivedUpdatesAcked()); |
| | | addMonitorData(attributes, "assured-sr-received-updates-not-acked", domain.getAssuredSrReceivedUpdatesNotAcked()); |
| | | addMonitorData(attributes, "assured-sd-sent-updates", domain.getAssuredSdSentUpdates()); |
| | | addMonitorData(attributes, "assured-sd-acknowledged-updates", domain.getAssuredSdAcknowledgedUpdates()); |
| | | addMonitorData(attributes, "assured-sd-timeout-updates", domain.getAssuredSdTimeoutUpdates()); |
| | | addMonitorData(attributes, "assured-sd-server-timeout-updates", domain.getAssuredSdServerTimeoutUpdates()); |
| | | |
| | | // Status related monitoring fields |
| | | addMonitorData(attributes, "last-status-change-date", |
| | | domain.getLastStatusChangeDate().toString()); |
| | | addMonitorData(attributes, "last-status-change-date", domain.getLastStatusChangeDate().toString()); |
| | | |
| | | addMonitorData(attributes, "status", domain.getStatus().toString()); |
| | | |
| | |
| | | * @param name the name of the attribute to add. |
| | | * @param value The integer value of he attribute to add. |
| | | */ |
| | | public static void addMonitorData(List<Attribute> attributes, String name, |
| | | int value) |
| | | public static void addMonitorData(List<Attribute> attributes, String name, int value) |
| | | { |
| | | addMonitorData(attributes, name, String.valueOf(value)); |
| | | } |
| | |
| | | * @param name the name of the attribute to add. |
| | | * @param value The integer value of he attribute to add. |
| | | */ |
| | | private static void addMonitorData(List<Attribute> attributes, String name, |
| | | long value) |
| | | private static void addMonitorData(List<Attribute> attributes, String name, long value) |
| | | { |
| | | addMonitorData(attributes, name, String.valueOf(value)); |
| | | } |
| | |
| | | * @param name the name of the attribute to add. |
| | | * @param value The String value of he attribute to add. |
| | | */ |
| | | private static void addMonitorData(List<Attribute> attributes, String name, |
| | | String value) |
| | | private static void addMonitorData(List<Attribute> attributes, String name, String value) |
| | | { |
| | | AttributeType type = DirectoryServer.getDefaultAttributeType(name); |
| | | attributes.add(Attributes.create(type, value)); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tasks; |
| | | |
| | | import static org.opends.messages.BackendMessages.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.core.DirectoryServer.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.messages.TaskMessages; |
| | | import org.opends.server.backends.task.Task; |
| | | import org.opends.server.backends.task.TaskState; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.replication.plugin.LDAPReplicationDomain; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import static org.opends.messages.BackendMessages.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.core.DirectoryServer.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | |
| | | /** |
| | | * This class provides an implementation of a Directory Server task that can |
| | |
| | | private int target; |
| | | private long total; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getDisplayName() { |
| | | return TaskMessages.INFO_TASK_INITIALIZE_TARGET_NAME.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeTask() throws DirectoryException |
| | | { |
| | |
| | | // FIXME -- Do we need any special authorization here? |
| | | Entry taskEntry = getTaskEntry(); |
| | | |
| | | AttributeType typeDomainBase = |
| | | getAttributeType(ATTR_TASK_INITIALIZE_TARGET_DOMAIN_DN, true); |
| | | AttributeType typeScope = |
| | | getAttributeType(ATTR_TASK_INITIALIZE_TARGET_SCOPE, true); |
| | | AttributeType typeDomainBase = getAttributeType(ATTR_TASK_INITIALIZE_TARGET_DOMAIN_DN, true); |
| | | AttributeType typeScope = getAttributeType(ATTR_TASK_INITIALIZE_TARGET_SCOPE, true); |
| | | |
| | | List<Attribute> attrList = taskEntry.getAttribute(typeDomainBase); |
| | | domainString = TaskUtils.getSingleValueString(attrList); |
| | |
| | | setTotal(0); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected TaskState runTask() |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | logger.trace("[IE] InitializeTargetTask is starting on domain: " |
| | | + domain.getBaseDNString()); |
| | | { |
| | | logger.trace("[IE] InitializeTargetTask is starting on domain: " + domain.getBaseDN()); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tasks; |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.core.DirectoryServer.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.messages.TaskMessages; |
| | | import org.opends.server.backends.task.Task; |
| | | import org.opends.server.backends.task.TaskState; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.replication.plugin.LDAPReplicationDomain; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | |
| | | /** |
| | | * This class provides an implementation of a Directory Server task that can |
| | |
| | | private LDAPReplicationDomain domain; |
| | | private TaskState initState; |
| | | |
| | | /** |
| | | * The total number of entries expected to be processed when this import will |
| | | * end successfully. |
| | | */ |
| | | private long total = 0; |
| | | /** The total number of entries expected to be processed when this import will end successfully. */ |
| | | private long total; |
| | | /** The number of entries still to be processed for this import to be completed. */ |
| | | private long left; |
| | | private LocalizableMessage taskCompletionError; |
| | | |
| | | /** |
| | | * The number of entries still to be processed for this import to be |
| | | * completed. |
| | | */ |
| | | private long left = 0; |
| | | |
| | | private LocalizableMessage taskCompletionError = null; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getDisplayName() { |
| | | return TaskMessages.INFO_TASK_INITIALIZE_NAME.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override public void initializeTask() throws DirectoryException |
| | | { |
| | | if (TaskState.isDone(getTaskState())) |
| | |
| | | replaceAttributeValue(ATTR_TASK_INITIALIZE_DONE, String.valueOf(0)); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected TaskState runTask() |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("[IE] InitializeTask is starting on domain: %s " |
| | | + " from source:%d", domain.getBaseDNString(), source); |
| | | logger.trace("[IE] InitializeTask is starting on domain: %s from source:%d", domain.getBaseDN(), source); |
| | | } |
| | | initState = getTaskState(); |
| | | try |
| | |
| | | while (initState == TaskState.RUNNING) |
| | | { |
| | | initState.wait(1000); |
| | | replaceAttributeValue( |
| | | ATTR_TASK_INITIALIZE_LEFT, String.valueOf(left)); |
| | | replaceAttributeValue( |
| | | ATTR_TASK_INITIALIZE_DONE, String.valueOf(total-left)); |
| | | replaceAttributeValue(ATTR_TASK_INITIALIZE_LEFT, String.valueOf(left)); |
| | | replaceAttributeValue(ATTR_TASK_INITIALIZE_DONE, String.valueOf(total-left)); |
| | | } |
| | | } |
| | | replaceAttributeValue(ATTR_TASK_INITIALIZE_LEFT, String.valueOf(left)); |
| | | replaceAttributeValue( |
| | | ATTR_TASK_INITIALIZE_DONE, String.valueOf(total-left)); |
| | | replaceAttributeValue(ATTR_TASK_INITIALIZE_DONE, String.valueOf(total-left)); |
| | | |
| | | // Error raised at completion time |
| | | if (taskCompletionError != null) |
| | | { |
| | | logger.error(taskCompletionError); |
| | | } |
| | | |
| | | } |
| | | catch(InterruptedException ie) {} |
| | |
| | | try |
| | | { |
| | | if (de == null) |
| | | { |
| | | initState = TaskState.COMPLETED_SUCCESSFULLY; |
| | | } |
| | | else |
| | | { |
| | | taskCompletionError = de.getMessageObject(); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tasks; |
| | | |
| | |
| | | */ |
| | | public class PurgeConflictsHistoricalTask extends Task |
| | | { |
| | | /** |
| | | * The default value for the maximum duration of the purge expressed in |
| | | * seconds. |
| | | */ |
| | | /** The default value for the maximum duration of the purge expressed in seconds. */ |
| | | public static final int DEFAULT_MAX_DURATION = 60 * 60; |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | |
| | | private TaskState initState; |
| | | |
| | | |
| | | private static final void debugInfo(String s) |
| | | private static void debugInfo(String s) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getDisplayName() { |
| | | return TaskMessages.INFO_TASK_PURGE_CONFLICTS_HIST_NAME.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override public void initializeTask() throws DirectoryException |
| | | { |
| | | if (TaskState.isDone(getTaskState())) |
| | |
| | | // FIXME -- Do we need any special authorization here? |
| | | Entry taskEntry = getTaskEntry(); |
| | | |
| | | AttributeType typeDomainBase; |
| | | typeDomainBase = |
| | | getAttributeType(ATTR_TASK_CONFLICTS_HIST_PURGE_DOMAIN_DN, true); |
| | | |
| | | List<Attribute> attrList; |
| | | attrList = taskEntry.getAttribute(typeDomainBase); |
| | | AttributeType typeDomainBase = getAttributeType(ATTR_TASK_CONFLICTS_HIST_PURGE_DOMAIN_DN, true); |
| | | List<Attribute> attrList = taskEntry.getAttribute(typeDomainBase); |
| | | domainString = TaskUtils.getSingleValueString(attrList); |
| | | |
| | | try |
| | |
| | | LocalizableMessageBuilder mb = new LocalizableMessageBuilder(); |
| | | mb.append(TaskMessages.ERR_TASK_INITIALIZE_INVALID_DN.get()); |
| | | mb.append(e.getMessage()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | mb.toMessage()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, mb.toMessage()); |
| | | } |
| | | |
| | | AttributeType typeMaxDuration; |
| | | typeMaxDuration = |
| | | getAttributeType(ATTR_TASK_CONFLICTS_HIST_PURGE_MAX_DURATION, true); |
| | | AttributeType typeMaxDuration = getAttributeType(ATTR_TASK_CONFLICTS_HIST_PURGE_MAX_DURATION, true); |
| | | attrList = taskEntry.getAttribute(typeMaxDuration); |
| | | String maxDurationStringInSec = TaskUtils.getSingleValueString(attrList); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected TaskState runTask() |
| | | { |
| | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask is starting " |
| | | + "on domain: " + domain.getBaseDNString() |
| | | + "on domain: " + domain.getBaseDN() |
| | | + "max duration (sec):" + purgeTaskMaxDurationInSec); |
| | | } |
| | | try |
| | | { |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COMPLETED_IN_TIME, |
| | | purgeCompletedInTime.toString()); |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COMPLETED_IN_TIME, purgeCompletedInTime.toString()); |
| | | |
| | | // launch the task |
| | | domain.purgeConflictsHistorical(this, |
| | | TimeThread.getTime() + (purgeTaskMaxDurationInSec*1000)); |
| | | domain.purgeConflictsHistorical(this, TimeThread.getTime() + purgeTaskMaxDurationInSec*1000); |
| | | |
| | | purgeCompletedInTime = true; |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COMPLETED_IN_TIME, |
| | | purgeCompletedInTime.toString()); |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COMPLETED_IN_TIME, purgeCompletedInTime.toString()); |
| | | |
| | | initState = TaskState.COMPLETED_SUCCESSFULLY; |
| | | } |
| | | catch(DirectoryException de) |
| | | { |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask exception " + |
| | | de.getLocalizedMessage()); |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask exception " + de.getLocalizedMessage()); |
| | | if (de.getResultCode() != ResultCode.ADMIN_LIMIT_EXCEEDED) |
| | | { |
| | | // Error raised at submission time |
| | |
| | | try |
| | | { |
| | | // sets in the attributes the last stats values |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COUNT, |
| | | String.valueOf(this.purgeCount)); |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_LAST_CSN, |
| | | this.lastCSN.toStringUI()); |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COUNT, String.valueOf(purgeCount)); |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_LAST_CSN, lastCSN.toStringUI()); |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask write attrs "); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask exception " + |
| | | e.getLocalizedMessage()); |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask exception " + e.getLocalizedMessage()); |
| | | initState = TaskState.STOPPED_BY_ERROR; |
| | | } |
| | | } |
| | | |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask is ending " + |
| | | "with state:" + initState.toString() + |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask is ending with state:" + initState + |
| | | " completedInTime:" + purgeCompletedInTime); |
| | | } |
| | | return initState; |
| | | } |
| | | |
| | | private int updateAttrPeriod = 0; |
| | | private int updateAttrPeriod; |
| | | private CSN lastCSN; |
| | | private int purgeCount; |
| | | |
| | |
| | | try |
| | | { |
| | | if (purgeCount == 0) |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_FIRST_CSN, |
| | | lastCSN.toStringUI()); |
| | | { |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_FIRST_CSN, lastCSN.toStringUI()); |
| | | } |
| | | |
| | | // we don't want the update of the task to overload too much task duration |
| | | this.purgeCount = purgeCount; |
| | | this.lastCSN = lastCSN; |
| | | if (++updateAttrPeriod % 100 == 0) |
| | | { |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COUNT, |
| | | String.valueOf(purgeCount)); |
| | | |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_LAST_CSN, |
| | | lastCSN.toStringUI()); |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask write attrs " |
| | | + purgeCount); |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_COUNT, String.valueOf(purgeCount)); |
| | | replaceAttributeValue(ATTR_TASK_CONFLICTS_HIST_PURGE_LAST_CSN, lastCSN.toStringUI()); |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask write attrs " + purgeCount); |
| | | } |
| | | } |
| | | catch(DirectoryException de) |
| | | { |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask exception " + |
| | | de.getLocalizedMessage()); |
| | | debugInfo("[PURGE] PurgeConflictsHistoricalTask exception " + de.getLocalizedMessage()); |
| | | initState = TaskState.STOPPED_BY_ERROR; |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tasks; |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.core.DirectoryServer.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.messages.TaskMessages; |
| | | import org.opends.server.backends.task.Task; |
| | | import org.opends.server.backends.task.TaskState; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.replication.plugin.LDAPReplicationDomain; |
| | | import org.opends.server.replication.service.ReplicationDomain; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | |
| | | /** |
| | | * This class provides an implementation of a Directory Server task that can |
| | |
| | | public class SetGenerationIdTask extends Task |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | private String domainString = null; |
| | | private ReplicationDomain domain = null; |
| | | private Long generationId = null; |
| | | private String domainString; |
| | | private ReplicationDomain domain; |
| | | private Long generationId; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getDisplayName() { |
| | | return TaskMessages.INFO_TASK_SET_GENERATION_ID_NAME.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeTask() throws DirectoryException |
| | | { |
| | |
| | | Entry taskEntry = getTaskEntry(); |
| | | |
| | | // Retrieves the eventual generation-ID |
| | | AttributeType typeNewValue = |
| | | getAttributeType(ATTR_TASK_SET_GENERATION_ID_NEW_VALUE, true); |
| | | AttributeType typeNewValue = getAttributeType(ATTR_TASK_SET_GENERATION_ID_NEW_VALUE, true); |
| | | List<Attribute> attrList = taskEntry.getAttribute(typeNewValue); |
| | | if ((attrList != null) && !attrList.isEmpty()) |
| | | if (attrList != null && !attrList.isEmpty()) |
| | | { |
| | | try |
| | | { |
| | |
| | | LocalizableMessageBuilder mb = new LocalizableMessageBuilder(); |
| | | mb.append(TaskMessages.ERR_TASK_INITIALIZE_INVALID_GENERATION_ID.get()); |
| | | mb.append(e.getMessage()); |
| | | throw new DirectoryException(ResultCode.CLIENT_SIDE_PARAM_ERROR, |
| | | mb.toMessage()); |
| | | throw new DirectoryException(ResultCode.CLIENT_SIDE_PARAM_ERROR, mb.toMessage()); |
| | | } |
| | | } |
| | | |
| | | // Retrieves the replication domain |
| | | AttributeType typeDomainBase = |
| | | getAttributeType(ATTR_TASK_SET_GENERATION_ID_DOMAIN_DN, true); |
| | | |
| | | AttributeType typeDomainBase = getAttributeType(ATTR_TASK_SET_GENERATION_ID_DOMAIN_DN, true); |
| | | attrList = taskEntry.getAttribute(typeDomainBase); |
| | | domainString = TaskUtils.getSingleValueString(attrList); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected TaskState runTask() |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("setGenerationIdTask is starting on domain %s" |
| | | + domain.getBaseDNString()); |
| | | logger.trace("setGenerationIdTask is starting on domain %s" + domain.getBaseDN()); |
| | | } |
| | | |
| | | try |
| | |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * Copyright 2013-2014 ForgeRock AS |
| | | * Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | import org.opends.server.replication.common.StatusMachineEvent; |
| | | import org.opends.server.replication.protocol.UpdateMsg; |
| | | import org.opends.server.replication.service.ReplicationDomain; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | |
| | | @SuppressWarnings("javadoc") |
| | | public class DummyReplicationDomain extends ReplicationDomain |
| | | { |
| | | |
| | | private static DN baseDN; |
| | | static |
| | | { |
| | | try |
| | | { |
| | | baseDN = DN.valueOf("cn=DummyReplicationDomain"); |
| | | } |
| | | catch (DirectoryException e) |
| | | { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | public DummyReplicationDomain(long generationId) |
| | | { |
| | | super(new DomainFakeCfg(null, -1, new TreeSet<String>()), generationId); |
| | | } |
| | | |
| | | @Override |
| | | public String getBaseDNString() |
| | | public DN getBaseDN() |
| | | { |
| | | return "DummyReplicationDomain"; |
| | | return baseDN; |
| | | } |
| | | |
| | | @Override |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.service; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Map; |
| | | import java.util.SortedSet; |
| | |
| | | import org.testng.annotations.DataProvider; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.TestCaseUtils.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | /** |
| | | * Test the Generic Replication Service. |
| | | */ |
| | |
| | | catch (TimeoutException ex) |
| | | { |
| | | // This exception may only be raised if assured replication is enabled |
| | | logger.info(NOTE_DS_ACK_TIMEOUT, domain.getBaseDNString(), domain.getAssuredTimeout(), updateMsg); |
| | | logger.info(NOTE_DS_ACK_TIMEOUT, domain.getBaseDN(), domain.getAssuredTimeout(), updateMsg); |
| | | } |
| | | } |
| | | |