| | |
| | | + ") state checkpointer for domain \"" + getBaseDNString() + "\""); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | this.startCSN = replServerMaxCSN; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | catch (DirectoryException e) |
| | | { |
| | | logError(ERR_LOADING_GENERATION_ID.get( |
| | | getBaseDNString(), e.getLocalizedMessage())); |
| | | getBaseDNString(), stackTraceToSingleLineString(e))); |
| | | } |
| | | |
| | | /* |
| | |
| | | // Should not happen as normally already called without problem in |
| | | // isConfigurationChangeAcceptable or isConfigurationAcceptable |
| | | // if we come up to this method |
| | | Message message = NOTE_ERR_FRACTIONAL.get(getBaseDNString(), |
| | | e.getLocalizedMessage()); |
| | | logError(message); |
| | | logError(NOTE_ERR_FRACTIONAL.get(getBaseDNString(), |
| | | stackTraceToSingleLineString(e))); |
| | | return; |
| | | } |
| | | |
| | |
| | | catch (ConfigException e) |
| | | { |
| | | // Should not happen |
| | | Message message = NOTE_ERR_FRACTIONAL.get(getBaseDNString(), |
| | | e.getLocalizedMessage()); |
| | | logError(message); |
| | | logError(NOTE_ERR_FRACTIONAL.get(getBaseDNString(), |
| | | stackTraceToSingleLineString(e))); |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | // Should not happen as configuration in domain root entry is flushed |
| | | // from valid configuration in local variables |
| | | Message message = NOTE_ERR_FRACTIONAL.get( |
| | | fractionalConfig.getBaseDn().toString(), e.getLocalizedMessage()); |
| | | logError(message); |
| | | logError(NOTE_ERR_FRACTIONAL.get( |
| | | fractionalConfig.getBaseDn().toString(), |
| | | stackTraceToSingleLineString(e))); |
| | | return false; |
| | | } |
| | | |
| | |
| | | // Should not happen as configuration in domain root entry is flushed |
| | | // from valid configuration in local variables so both should have already |
| | | // been checked |
| | | Message message = NOTE_ERR_FRACTIONAL.get( |
| | | fractionalConfig.getBaseDn().toString(), e.getLocalizedMessage()); |
| | | logError(message); |
| | | logError(NOTE_ERR_FRACTIONAL.get( |
| | | fractionalConfig.getBaseDn().toString(), |
| | | stackTraceToSingleLineString(e))); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | this.attrValIt = attrValIt; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasNext() |
| | | { |
| | | return attrValIt.hasNext(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String next() |
| | | { |
| | | return attrValIt.next().getValue().toString(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | // Should not be needed anyway |
| | | @Override |
| | | public void remove() |
| | |
| | | } |
| | | catch(DirectoryException e) |
| | | { |
| | | Message message = NOTE_ERR_FRACTIONAL.get(getBaseDNString(), |
| | | e.getLocalizedMessage()); |
| | | logError(message); |
| | | logError(NOTE_ERR_FRACTIONAL.get(getBaseDNString(), |
| | | stackTraceToSingleLineString(e))); |
| | | return FRACTIONAL_HAS_NO_FRACTIONAL_FILTERED_ATTRIBUTES; |
| | | } |
| | | Set<ObjectClass> entryClasses = entryToModify.getObjectClasses().keySet(); |
| | |
| | | { |
| | | AttributeType modAttrType = mod.getAttribute().getAttributeType(); |
| | | if ((mod.getModificationType() == ModificationType.DELETE |
| | | || mod.getModificationType() == ModificationType.REPLACE) |
| | | || mod.getModificationType() == ModificationType.REPLACE) |
| | | && currentRDN.hasAttributeType(modAttrType)) |
| | | { |
| | | if (currentRDN.hasAttributeType(modAttrType)) |
| | | { |
| | | // the attribute can't be deleted because it is used |
| | | // in the RDN, turn this operation is a replace with the |
| | | // current RDN value(s); |
| | | mod.setModificationType(ModificationType.REPLACE); |
| | | Attribute newAttribute = mod.getAttribute(); |
| | | AttributeBuilder attrBuilder = new AttributeBuilder(newAttribute); |
| | | attrBuilder.add(currentRDN.getAttributeValue(modAttrType)); |
| | | mod.setAttribute(attrBuilder.toAttribute()); |
| | | } |
| | | // the attribute can't be deleted because it is used in the RDN, |
| | | // turn this operation is a replace with the current RDN value(s); |
| | | mod.setModificationType(ModificationType.REPLACE); |
| | | Attribute newAttribute = mod.getAttribute(); |
| | | AttributeBuilder attrBuilder = new AttributeBuilder(newAttribute); |
| | | attrBuilder.add(currentRDN.getAttributeValue(modAttrType)); |
| | | mod.setAttribute(attrBuilder.toAttribute()); |
| | | } |
| | | } |
| | | msg.setMods(mods); |
| | |
| | | mb.append(" "); |
| | | mb.append(String.valueOf(conflictOp)); |
| | | mb.append(" "); |
| | | mb.append(e.getLocalizedMessage()); |
| | | mb.append(stackTraceToSingleLineString(e)); |
| | | logError(mb.toMessage()); |
| | | } |
| | | |
| | |
| | | * should we stop the modifications ? |
| | | */ |
| | | logError(ERR_LOADING_GENERATION_ID.get( |
| | | getBaseDNString(), e.getLocalizedMessage())); |
| | | getBaseDNString(), stackTraceToSingleLineString(e))); |
| | | return; |
| | | } |
| | | |
| | |
| | | return genId; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getGenerationID() |
| | | { |
| | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | Message message = ERR_LOADING_GENERATION_ID.get( |
| | | getBaseDNString(), e.getLocalizedMessage()); |
| | | logError(message); |
| | | logError(ERR_LOADING_GENERATION_ID.get( |
| | | getBaseDNString(), stackTraceToSingleLineString(e))); |
| | | } |
| | | } |
| | | } |
| | |
| | | Message message = ERR_LDIFEXPORT_CANNOT_LOCK_BACKEND.get( |
| | | backend.getBackendID(), String.valueOf(failureReason)); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message, null); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Message message = |
| | | ERR_LDIFEXPORT_CANNOT_LOCK_BACKEND.get( |
| | | backend.getBackendID(), e.getLocalizedMessage()); |
| | | Message message = ERR_LDIFEXPORT_CANNOT_LOCK_BACKEND.get( |
| | | backend.getBackendID(), stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message, null); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | |
| | | long numberOfEntries = backend.numSubordinates(getBaseDN(), true) + 1; |
| | |
| | | Message message = |
| | | ERR_LDIFEXPORT_ERROR_DURING_EXPORT.get(de.getMessageObject()); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message, null); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | Message message = ERR_LDIFEXPORT_ERROR_DURING_EXPORT.get( |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message, null); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | finally |
| | | { |
| | |
| | | Message message = WARN_LDIFEXPORT_CANNOT_UNLOCK_BACKEND.get( |
| | | backend.getBackendID(), String.valueOf(failureReason)); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message, null); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | Message message = WARN_LDIFEXPORT_CANNOT_UNLOCK_BACKEND.get( |
| | | backend.getBackendID(), stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message, null); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | } |
| | | return genID; |
| | |
| | | { |
| | | if (!backend.supportsLDIFImport()) |
| | | { |
| | | Message message = ERR_INIT_IMPORT_NOT_SUPPORTED.get( |
| | | backend.getBackendID()); |
| | | if (ieContext.getException() == null) |
| | | ieContext.setException(new DirectoryException(OTHER, message)); |
| | | ieContext.setExceptionIfNoneSet(new DirectoryException(OTHER, |
| | | ERR_INIT_IMPORT_NOT_SUPPORTED.get(backend.getBackendID()))); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | if (ieContext.getException() == null) |
| | | ieContext.setException(new DirectoryException( |
| | | ResultCode.OTHER, |
| | | ERR_INIT_IMPORT_FAILURE.get(e.getLocalizedMessage()))); |
| | | ieContext.setExceptionIfNoneSet(new DirectoryException(ResultCode.OTHER, |
| | | ERR_INIT_IMPORT_FAILURE.get(stackTraceToSingleLineString(e)))); |
| | | } |
| | | finally |
| | | { |
| | |
| | | // so we don't bother about the new Exception. |
| | | // However if there was no Exception before we want |
| | | // to return this Exception to the task creator. |
| | | if (ieContext.getException() == null) |
| | | ieContext.setException(new DirectoryException( |
| | | ResultCode.OTHER, |
| | | ERR_INIT_IMPORT_FAILURE.get(fe.getLocalizedMessage()))); |
| | | ieContext.setExceptionIfNoneSet(new DirectoryException( |
| | | ResultCode.OTHER, |
| | | ERR_INIT_IMPORT_FAILURE.get(stackTraceToSingleLineString(fe)))); |
| | | } |
| | | } |
| | | |
| | |
| | | for (SynchronizationProvider<?> provider : |
| | | DirectoryServer.getSynchronizationProviders()) |
| | | { |
| | | if (!( provider instanceof MultimasterReplication)) |
| | | if (!(provider instanceof MultimasterReplication)) |
| | | { |
| | | Message message = ERR_INVALID_PROVIDER.get(); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | |
| | | LDAPReplicationDomain domain = MultimasterReplication.findDomain(dn, null); |
| | | if (domain != null && domain.getBaseDN().equals(dn)) |
| | | { |
| | | Message message = ERR_SYNC_INVALID_DN.get(); |
| | | unacceptableReasons.add(message); |
| | | unacceptableReasons.add(ERR_SYNC_INVALID_DN.get()); |
| | | return false; |
| | | } |
| | | |
| | | // Check that the base DN is configured as a base-dn of the directory server |
| | | if (retrievesBackend(dn) == null) |
| | | { |
| | | Message message = ERR_UNKNOWN_DN.get(dn.toString()); |
| | | unacceptableReasons.add(message); |
| | | unacceptableReasons.add(ERR_UNKNOWN_DN.get(dn.toString())); |
| | | return false; |
| | | } |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ReplicationDomainCfg configuration) |
| | |
| | | return new ConfigChangeResult(ResultCode.SUCCESS, false); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ReplicationDomainCfg configuration, List<Message> unacceptableReasons) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Map<String, String> getAlerts() |
| | | { |
| | |
| | | return alerts; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getClassName() |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getComponentEntryDN() |
| | | { |
| | |
| | | catch(Exception e) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | MessageBuilder mb = new MessageBuilder(); |
| | | mb.append(e.getMessage()); |
| | | Message msg = ERR_CHECK_CREATE_REPL_BACKEND_FAILED.get(mb.toString()); |
| | | logError(msg); |
| | | logError(ERR_CHECK_CREATE_REPL_BACKEND_FAILED.get( |
| | | stackTraceToSingleLineString(e))); |
| | | } |
| | | } |
| | | |
| | |
| | | eclDomain = new ExternalChangelogDomain(this, eclDomCfg); |
| | | } |
| | | } |
| | | catch (Exception de) |
| | | catch (Exception e) |
| | | { |
| | | throw new ConfigException(NOTE_ERR_UNABLE_TO_ENABLE_ECL.get( |
| | | "Replication Domain on " + getBaseDNString(), |
| | | de.getMessage() + " " + de.getCause().getMessage()), de); |
| | | stackTraceToSingleLineString(e)), e); |
| | | } |
| | | } |
| | | |
| | |
| | | return buffer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void sessionInitiated( |
| | | ServerStatus initStatus, |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | Message message = NOTE_ERR_UNABLE_TO_ENABLE_ECL.get( |
| | | logError(NOTE_ERR_UNABLE_TO_ENABLE_ECL.get( |
| | | "Replication Domain on " + getBaseDNString(), |
| | | de.getMessage() + " " + de.getCause().getMessage()); |
| | | logError(message); |
| | | stackTraceToSingleLineString(de))); |
| | | // and go on |
| | | } |
| | | } |
| | |
| | | // Go into bad data set status |
| | | setNewStatus(StatusMachineEvent.TO_BAD_GEN_ID_STATUS_EVENT); |
| | | broker.signalStatusChange(status); |
| | | Message message = NOTE_FRACTIONAL_BAD_DATA_SET_NEED_RESYNC.get( |
| | | getBaseDNString()); |
| | | logError(message); |
| | | logError(NOTE_FRACTIONAL_BAD_DATA_SET_NEED_RESYNC.get(getBaseDNString())); |
| | | return; // Do not send changes to the replication server |
| | | } |
| | | |
| | |
| | | } |
| | | } catch (Exception e) |
| | | { |
| | | Message message = ERR_PUBLISHING_FAKE_OPS.get(getBaseDNString(), |
| | | e.getLocalizedMessage() + " " + stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | logError(ERR_PUBLISHING_FAKE_OPS.get(getBaseDNString(), |
| | | stackTraceToSingleLineString(e))); |
| | | } |
| | | } |
| | | |
| | |
| | | Backend backend = retrievesBackend(getBaseDN()); |
| | | if (!backend.supportsLDIFExport()) |
| | | { |
| | | Message message = ERR_INIT_EXPORT_NOT_SUPPORTED.get( |
| | | backend.getBackendID()); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | Message msg = ERR_INIT_EXPORT_NOT_SUPPORTED.get(backend.getBackendID()); |
| | | logError(msg); |
| | | throw new DirectoryException(ResultCode.OTHER, msg); |
| | | } |
| | | |
| | | return backend.numSubordinates(getBaseDN(), true) + 1; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean processUpdate(UpdateMsg updateMsg, AtomicBoolean shutdown) |
| | | { |
| | |
| | | */ |
| | | public int decodeSource(String sourceString) throws DirectoryException |
| | | { |
| | | int source = 0; |
| | | Throwable cause = null; |
| | | int source = 0; |
| | | try |
| | | { |
| | | source = Integer.decode(sourceString); |
| | |
| | | return source; |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | cause = e; |
| | | } |
| | | |
| | | ResultCode resultCode = ResultCode.OTHER; |
| | | if (cause != null) |
| | | catch (Exception e) |
| | | { |
| | | Message message = ERR_INVALID_IMPORT_SOURCE.get( |
| | | getBaseDNString(), Integer.toString(getServerId()), |
| | | Integer.toString(source), "Details: " + cause.getLocalizedMessage()); |
| | | throw new DirectoryException(resultCode, message, cause); |
| | | sourceString, stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(ResultCode.OTHER, message, e); |
| | | } |
| | | |
| | | Message message = ERR_INVALID_IMPORT_SOURCE.get(getBaseDNString(), |
| | | Integer.toString(getServerId()), Integer.toString(source), ""); |
| | | throw new DirectoryException(resultCode, message); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | | |
| | | /** |
| | |
| | | Map<String, Set<String>> fractionalSpecificClassesAttributes, |
| | | Set<String> fractionalAllClassesAttributes) throws ConfigException |
| | | { |
| | | int fractionalMode; |
| | | |
| | | // Determine if fractional-exclude or fractional-include property is used: |
| | | // only one of them is allowed |
| | | int fractionalMode; |
| | | Iterator<String> iterator; |
| | | |
| | | // Deduce the wished fractional mode |
| | | if (exclIt != null && exclIt.hasNext()) |
| | | { |
| | | if (inclIt != null && inclIt.hasNext()) |
| | |
| | | return false; |
| | | |
| | | // Compare modes |
| | | if ((cfg1.isFractional() != cfg2.isFractional()) |
| | | || (cfg1.isFractionalExclusive() != cfg2.isFractionalExclusive())) |
| | | if (cfg1.isFractional() != cfg2.isFractional() |
| | | || cfg1.isFractionalExclusive() != cfg2.isFractionalExclusive()) |
| | | return false; |
| | | |
| | | // Compare all classes attributes |