| | |
| | | // Null when none is being processed. |
| | | private IEContext ieContext = null; |
| | | |
| | | // The backend information necessary to make an import or export. |
| | | private Backend backend; |
| | | |
| | | private int listenerThreadNumber = 10; |
| | | |
| | | private Collection<String> replicationServers; |
| | |
| | | monitor = new ReplicationMonitor(this); |
| | | DirectoryServer.registerMonitorProvider(monitor); |
| | | |
| | | backend = retrievesBackend(baseDN); |
| | | Backend backend = retrievesBackend(baseDN); |
| | | if (backend == null) |
| | | { |
| | | throw new ConfigException(ERR_SEARCHING_DOMAIN_BACKEND.get( |
| | |
| | | de.getMessageObject()); |
| | | MessageBuilder mb = new MessageBuilder(); |
| | | mb.append(de.getMessageObject()); |
| | | mb.append("Backend ID: "); |
| | | mb.append(backend.getBackendID()); |
| | | TRACER.debugInfo(Message.toString(mb.toMessage())); |
| | | broker.publish(errorMsg); |
| | | } |
| | |
| | | */ |
| | | public long computeGenerationId() throws DirectoryException |
| | | { |
| | | Backend backend = this.retrievesBackend(baseDN); |
| | | long bec = backend.getEntryCount(); |
| | | if (bec<0) |
| | | backend = this.retrievesBackend(baseDN); |
| | | bec = backend.getEntryCount(); |
| | | this.acquireIEContext(); |
| | | ieContext.checksumOutput = true; |
| | | ieContext.entryCount = (bec<1000?bec:1000); |
| | |
| | | protected void exportBackend() |
| | | throws DirectoryException |
| | | { |
| | | // FIXME Temporary workaround - will probably be fixed when implementing |
| | | // dynamic config |
| | | backend = retrievesBackend(this.baseDN); |
| | | Backend backend = retrievesBackend(this.baseDN); |
| | | |
| | | // Acquire a shared lock for the backend. |
| | | try |
| | |
| | | { |
| | | try |
| | | { |
| | | // FIXME Temporary workaround - will probably be fixed when implementing |
| | | // dynamic config |
| | | backend = retrievesBackend(this.baseDN); |
| | | Backend backend = retrievesBackend(this.baseDN); |
| | | |
| | | if (!backend.supportsLDIFExport()) |
| | | { |
| | |
| | | LDIFImportConfig importConfig = null; |
| | | DirectoryException de = null; |
| | | |
| | | Backend backend = this.retrievesBackend(baseDN); |
| | | |
| | | if (!backend.supportsLDIFImport()) |
| | | { |
| | | Message message = ERR_INIT_IMPORT_NOT_SUPPORTED.get( |
| | |
| | | ieContext.entryLeftCount = initializeMessage.getEntryCount(); |
| | | ieContext.initImportExportCounters(initializeMessage.getEntryCount()); |
| | | |
| | | preBackendImport(this.backend); |
| | | preBackendImport(backend); |
| | | |
| | | ieContext.ldifImportInputStream = new ReplLDIFInputStream(this); |
| | | importConfig = |
| | |
| | | // ExistingFileBehavior.OVERWRITE); |
| | | |
| | | // Process import |
| | | this.backend.importLDIF(importConfig); |
| | | backend.importLDIF(importConfig); |
| | | |
| | | TRACER.debugInfo("The import has ended successfully."); |
| | | stateSavingDisabled = false; |
| | |
| | | importConfig.close(); |
| | | |
| | | // Re-enable backend |
| | | closeBackendImport(this.backend); |
| | | closeBackendImport(backend); |
| | | |
| | | // Update the task that initiated the import |
| | | if ((ieContext != null ) && (ieContext.initializeTask != null)) |
| | |
| | | */ |
| | | public Backend getBackend() |
| | | { |
| | | return backend; |
| | | return retrievesBackend(baseDN); |
| | | } |
| | | |
| | | /** |