| | |
| | | // process: |
| | | // This is an error termination during the import |
| | | // The error is stored and the import is ended by returning null |
| | | final IEContext ieCtx = getImportExportContext(); |
| | | final ImportExportContext ieCtx = getImportExportContext(); |
| | | Message msg = null; |
| | | switch (importErrorMessageId) |
| | | { |
| | |
| | | |
| | | Backend backend = getBackend(); |
| | | |
| | | IEContext ieCtx = getImportExportContext(); |
| | | ImportExportContext ieCtx = getImportExportContext(); |
| | | try |
| | | { |
| | | if (!backend.supportsLDIFImport()) |
| | | { |
| | | ieCtx.setExceptionIfNoneSet(new DirectoryException(OTHER, |
| | | ERR_INIT_IMPORT_NOT_SUPPORTED.get(backend.getBackendID()))); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | |
| | | importConfig = new LDIFImportConfig(input); |
| | | List<DN> includeBranches = new ArrayList<DN>(); |
| | | includeBranches.add(getBaseDN()); |
| | |
| | | importErrorMessageId = -1; |
| | | |
| | | // TODO How to deal with rejected entries during the import |
| | | importConfig.writeRejectedEntries( |
| | | getFileForPath("logs" + File.separator + |
| | | "replInitRejectedEntries").getAbsolutePath(), |
| | | File rejectsFile = |
| | | getFileForPath("logs" + File.separator + "replInitRejectedEntries"); |
| | | importConfig.writeRejectedEntries(rejectsFile.getAbsolutePath(), |
| | | ExistingFileBehavior.OVERWRITE); |
| | | |
| | | // Process import |
| | |
| | | |
| | | stateSavingDisabled = false; |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | ieCtx.setExceptionIfNoneSet(new DirectoryException(ResultCode.OTHER, |