| | |
| | | * Don't run the special replication code on Operation that are |
| | | * specifically marked as don't synchronize. |
| | | */ |
| | | if (pluginOp != null && pluginOp instanceof Operation) |
| | | if (pluginOp instanceof Operation) |
| | | { |
| | | Operation op = ((Operation) pluginOp); |
| | | |
| | | final Operation op = (Operation) pluginOp; |
| | | if (op.dontSynchronize()) |
| | | return null; |
| | | |
| | |
| | | for (Iterator<Control> iter = controls.iterator(); iter.hasNext();) |
| | | { |
| | | Control c = iter.next(); |
| | | if (c.getOID().equals(OID_REPLICATION_REPAIR_CONTROL)) |
| | | if (OID_REPLICATION_REPAIR_CONTROL.equals(c.getOID())) |
| | | { |
| | | op.setSynchronizationOperation(true); |
| | | op.setDontSynchronize(true); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSynchronizationProvider( |
| | | ReplicationSynchronizationProviderCfg configuration) |
| | |
| | | */ |
| | | List<Modification> offlineSchemaChanges = |
| | | DirectoryServer.getOfflineSchemaChanges(); |
| | | if ((offlineSchemaChanges != null) && (! offlineSchemaChanges.isEmpty())) |
| | | if (offlineSchemaChanges != null && !offlineSchemaChanges.isEmpty()) |
| | | { |
| | | processSchemaChange(offlineSchemaChanges); |
| | | } |
| | |
| | | /** |
| | | * Create the threads that will wait for incoming update messages. |
| | | */ |
| | | private synchronized static void createReplayThreads() |
| | | private static synchronized void createReplayThreads() |
| | | { |
| | | replayThreads.clear(); |
| | | |
| | |
| | | /** |
| | | * Stop the threads that are waiting for incoming update messages. |
| | | */ |
| | | private synchronized static void stopReplayThreads() |
| | | private static synchronized void stopReplayThreads() |
| | | { |
| | | // stop the replay threads |
| | | for (ReplayThread replayThread : replayThreads) |
| | |
| | | replayThreads.clear(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | ReplicationDomainCfg configuration, List<Message> unacceptableReasons) |
| | |
| | | configuration, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | ReplicationDomainCfg configuration) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostOperation(PostOperationAddOperation addOperation) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostOperation(PostOperationDeleteOperation deleteOperation) |
| | | { |
| | |
| | | genericPostOperation(deleteOperation, dn); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostOperation(PostOperationModifyDNOperation modifyDNOperation) |
| | | { |
| | |
| | | genericPostOperation(modifyDNOperation, dn); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostOperation(PostOperationModifyOperation modifyOperation) |
| | | { |
| | |
| | | genericPostOperation(modifyOperation, dn); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult handleConflictResolution( |
| | | PreOperationModifyOperation modifyOperation) |
| | |
| | | return domain.handleConflictResolution(modifyOperation); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult handleConflictResolution( |
| | | PreOperationAddOperation addOperation) throws DirectoryException |
| | |
| | | return domain.handleConflictResolution(addOperation); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult handleConflictResolution( |
| | | PreOperationDeleteOperation deleteOperation) throws DirectoryException |
| | |
| | | return domain.handleConflictResolution(deleteOperation); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult handleConflictResolution( |
| | | PreOperationModifyDNOperation modifyDNOperation) throws DirectoryException |
| | |
| | | return domain.handleConflictResolution(modifyDNOperation); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult |
| | | doPreOperation(PreOperationModifyOperation modifyOperation) |
| | |
| | | DN operationDN = modifyOperation.getEntryDN(); |
| | | LDAPReplicationDomain domain = findDomain(operationDN, modifyOperation); |
| | | |
| | | if ((domain == null) || (!domain.solveConflict())) |
| | | if (domain == null || !domain.solveConflict()) |
| | | { |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | EntryHistorical historicalInformation = (EntryHistorical) |
| | | modifyOperation.getAttachment(EntryHistorical.HISTORICAL); |
| | |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult doPreOperation( |
| | | PreOperationDeleteOperation deleteOperation) throws DirectoryException |
| | |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult doPreOperation( |
| | | PreOperationModifyDNOperation modifyDNOperation) |
| | |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SynchronizationProviderResult doPreOperation( |
| | | PreOperationAddOperation addOperation) |
| | |
| | | return new SynchronizationProviderResult.ContinueProcessing(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSynchronizationProvider() |
| | | { |
| | |
| | | domain.synchronizeModifications(modifications); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processBackupBegin(Backend backend, BackupConfig config) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processBackupEnd(Backend backend, BackupConfig config, |
| | | boolean successful) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processRestoreBegin(Backend backend, RestoreConfig config) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processRestoreEnd(Backend backend, RestoreConfig config, |
| | | boolean successful) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processImportBegin(Backend backend, LDIFImportConfig config) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processImportEnd(Backend backend, LDIFImportConfig config, |
| | | boolean successful) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processExportBegin(Backend backend, LDIFExportConfig config) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processExportEnd(Backend backend, LDIFExportConfig config, |
| | | boolean successful) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | ReplicationDomainCfg configuration) |
| | |
| | | return new ConfigChangeResult(ResultCode.SUCCESS, false); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | ReplicationDomainCfg configuration, List<Message> unacceptableReasons) |
| | |
| | | return replicationServerListener; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ReplicationSynchronizationProviderCfg configuration, |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ReplicationSynchronizationProviderCfg configuration) |
| | |
| | | return new ConfigChangeResult(ResultCode.SUCCESS, false); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void completeSynchronizationProvider() |
| | | { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Gets the baseDn of the domains that have a private backend. |
| | | * @return The private baseDN. |
| | | * Gets the Set of baseDN of the domains which are disabled for the external |
| | | * changelog. |
| | | * |
| | | * @return The Set of baseDNs which are disabled for the external changelog. |
| | | */ |
| | | public static Set<String> getECLDisabledDomains() |
| | | { |
| | | Set<String> disabledBaseDNs = new HashSet<String>(); |
| | | |
| | | final Set<String> disabledBaseDNs = new HashSet<String>(domains.size()); |
| | | for (LDAPReplicationDomain domain : domains.values()) |
| | | { |
| | | if (!domain.isECLEnabled()) |
| | | { |
| | | disabledBaseDNs.add(domain.getBaseDN().toNormalizedString()); |
| | | } |
| | | } |
| | | return disabledBaseDNs; |
| | | } |
| | | |
| | | /** |
| | | * Returns whether the provided baseDN is disabled for the external changelog. |
| | | * |
| | | * @param baseDN |
| | | * the domain to check |
| | | * @return true if the provided baseDN is disabled for the external changelog, |
| | | * false otherwise |
| | | */ |
| | | public static boolean isECLDisabledDomain(DN baseDN) |
| | | { |
| | | for (LDAPReplicationDomain domain : domains.values()) |
| | | { |
| | | if (!domain.isECLEnabled() && domain.getBaseDN().equals(baseDN)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Returns the connection timeout in milli-seconds. |
| | | * |
| | | * @return The connection timeout in milli-seconds. |