opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java
@@ -40,13 +40,11 @@ import java.util.Set; import java.util.TreeSet; import javax.swing.ButtonGroup; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JRadioButton; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; @@ -82,9 +80,6 @@ private JComboBox backends; private JTextField file; private JCheckBox dataCompressed; private JRadioButton overwrite; private JRadioButton append; private JCheckBox replaceEntries; private JCheckBox rejectNotSchemaCompliant; private JCheckBox doDNValidationAfter; private JCheckBox writeRejects; @@ -101,7 +96,6 @@ private JLabel lBackend; private JLabel lNoBackendsFound; private JLabel lFile; private JLabel lImportType; private JLabel lSchemaValidation; private JLabel lDNValidation; private JLabel lThreads; @@ -199,7 +193,7 @@ public void changedUpdate(DocumentEvent ev) { String text = file.getText().trim(); setEnabledOK(text != null && text.length() > 0 && !errorPane.isVisible()); setEnabledOK(text.length() > 0 && !errorPane.isVisible()); } /** {@inheritDoc} */ @Override @@ -254,52 +248,6 @@ gbc.insets.left = 0; gbc.insets.top = 10; gbc.gridwidth = 1; lImportType = Utilities.createPrimaryLabel( INFO_CTRL_PANEL_IMPORT_TYPE_LABEL.get()); add(lImportType, gbc); overwrite = Utilities.createRadioButton( INFO_CTRL_PANEL_IMPORT_OVERWRITE_LABEL.get()); overwrite.setSelected(true); lImportType.setLabelFor(overwrite); append = Utilities.createRadioButton(INFO_CTRL_PANEL_IMPORT_APPEND_LABEL.get()); ButtonGroup group = new ButtonGroup(); group.add(overwrite); group.add(append); gbc.insets.left = 10; gbc.gridx = 1; gbc.gridwidth = 2; add(overwrite, gbc); gbc.gridy ++; gbc.insets.top = 5; add(append, gbc); append.addChangeListener(new ChangeListener() { /** {@inheritDoc} */ @Override public void stateChanged(ChangeEvent ev) { replaceEntries.setEnabled(append.isSelected()); } }); replaceEntries = Utilities.createCheckBox(INFO_CTRL_PANEL_IMPORT_REPLACE_ENTRIES.get()); replaceEntries.setOpaque(false); replaceEntries.setEnabled(false); gbc.insets.left = 30; gbc.gridy ++; add(replaceEntries, gbc); gbc.gridx = 0; gbc.gridy ++; gbc.insets.left = 0; gbc.insets.top = 10; gbc.gridwidth = 1; lSchemaValidation = Utilities.createPrimaryLabel( INFO_CTRL_PANEL_SCHEMA_VALIDATION_LABEL.get()); add(lSchemaValidation, gbc); @@ -642,21 +590,13 @@ { task.canLaunch(newTask, errors); } boolean confirmed = true; boolean initializeAll = false; if (errors.isEmpty()) { Set<DN> replicatedBaseDNs = getReplicatedBaseDNs(); boolean canInitialize = !replicatedBaseDNs.isEmpty() && isServerRunning(); if (overwrite.isSelected() && !canInitialize) { confirmed = displayConfirmationDialog( INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(), INFO_CTRL_PANEL_CONFIRMATION_IMPORT_LDIF_DETAILS.get( backendName)); } else if (!overwrite.isSelected() && canInitialize) if (canInitialize) { ArrayList<String> dns = new ArrayList<>(); for (DN dn : replicatedBaseDNs) @@ -668,43 +608,7 @@ INFO_CTRL_PANEL_CONFIRMATION_INITIALIZE_ALL_DETAILS.get( Utilities.getStringFromCollection(dns, "<br>"))); } else if (overwrite.isSelected() && canInitialize) { ArrayList<String> dns = new ArrayList<>(); for (DN dn : replicatedBaseDNs) { dns.add(dn.toString()); } ConfirmInitializeAndImportDialog dlg = new ConfirmInitializeAndImportDialog( Utilities.getParentDialog(this), getInfo()); dlg.setMessage(INFO_CTRL_PANEL_CONFIRM_INITIALIZE_TITLE.get(), INFO_CTRL_PANEL_CONFIRMATION_INITIALIZE_ALL_AND_OVERWRITE_DETAILS.get( backendName, Utilities.getStringFromCollection(dns, "<br>"))); dlg.setModal(true); dlg.setVisible(true); ConfirmInitializeAndImportDialog.Result result = dlg.getResult(); switch (result) { case CANCEL: confirmed = false; break; case INITIALIZE_ALL: confirmed = true; initializeAll = true; break; case IMPORT_ONLY: confirmed = true; initializeAll = false; break; default: throw new RuntimeException("Unexpected result: "+result); } } } if (errors.isEmpty() && confirmed) { newTask.setInitializeAll(initializeAll); launchOperation(newTask, INFO_CTRL_PANEL_IMPORTING_LDIF_SUMMARY.get(backends.getSelectedItem()), @@ -730,7 +634,6 @@ { setPrimaryValid(lBackend); setPrimaryValid(lFile); setPrimaryValid(lImportType); setPrimaryValid(lSchemaValidation); setPrimaryValid(lDNValidation); setPrimaryValid(lThreads); @@ -842,18 +745,6 @@ { args.add("--isCompressed"); } if (overwrite.isSelected()) { args.add("--clearBackend"); } if (append.isSelected()) { args.add("--append"); if (replaceEntries.isSelected()) { args.add("--replaceExisting"); } } if (!rejectNotSchemaCompliant.isSelected()) { args.add("--skipSchemaValidation"); opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
@@ -854,7 +854,6 @@ } args.add("--backendID"); args.add(getBackendName()); args.add("--append"); } else { opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
@@ -80,8 +80,6 @@ argDisplayMap.put(ATTR_IMPORT_LDIF_FILE, INFO_IMPORT_ARG_LDIF_FILE.get()); argDisplayMap.put(ATTR_IMPORT_TEMPLATE_FILE, INFO_IMPORT_ARG_TEMPLATE_FILE.get()); argDisplayMap.put(ATTR_IMPORT_RANDOM_SEED, INFO_IMPORT_ARG_RANDOM_SEED.get()); argDisplayMap.put(ATTR_IMPORT_APPEND, INFO_IMPORT_ARG_APPEND.get()); argDisplayMap.put(ATTR_IMPORT_REPLACE_EXISTING, INFO_IMPORT_ARG_REPLACE_EXISTING.get()); argDisplayMap.put(ATTR_IMPORT_BACKEND_ID, INFO_IMPORT_ARG_BACKEND_ID.get()); argDisplayMap.put(ATTR_IMPORT_INCLUDE_BRANCH, INFO_IMPORT_ARG_INCL_BRANCH.get()); argDisplayMap.put(ATTR_IMPORT_EXCLUDE_BRANCH, INFO_IMPORT_ARG_EXCL_BRANCH.get()); @@ -99,11 +97,9 @@ } private boolean append; private boolean isCompressed; private boolean isEncrypted; private boolean overwrite; private boolean replaceExisting; private boolean skipSchemaValidation; private boolean clearBackend; private boolean skipDNValidation; @@ -156,8 +152,6 @@ AttributeType typeLdifFile = getAttributeTypeOrDefault(ATTR_IMPORT_LDIF_FILE); AttributeType typeTemplateFile = getAttributeTypeOrDefault(ATTR_IMPORT_TEMPLATE_FILE); AttributeType typeAppend = getAttributeTypeOrDefault(ATTR_IMPORT_APPEND); AttributeType typeReplaceExisting = getAttributeTypeOrDefault(ATTR_IMPORT_REPLACE_EXISTING); AttributeType typeBackendID = getAttributeTypeOrDefault(ATTR_IMPORT_BACKEND_ID); AttributeType typeIncludeBranch = getAttributeTypeOrDefault(ATTR_IMPORT_INCLUDE_BRANCH); AttributeType typeExcludeBranch = getAttributeTypeOrDefault(ATTR_IMPORT_EXCLUDE_BRANCH); @@ -212,10 +206,8 @@ } } append = asBoolean(taskEntry, typeAppend); skipDNValidation = asBoolean(taskEntry, typeDNCheckPhase2); tmpDirectory = asString(taskEntry, typeTmpDirectory); replaceExisting = asBoolean(taskEntry, typeReplaceExisting); backendID = asString(taskEntry, typeBackendID); includeBranchStrings = asListOfStrings(taskEntry, typeIncludeBranch); excludeBranchStrings = asListOfStrings(taskEntry, typeExcludeBranch); @@ -333,22 +325,6 @@ LocalizableMessage message = ERR_LDIFIMPORT_CANNOT_IMPORT.get(backendID); throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); } // Make sure that if the "backendID" argument was provided, no include // base was included, and the "append" option was not provided, the // "clearBackend" argument was also provided if there are more then one // baseDNs for the backend being imported. else if(!append && includeBranchStrings.isEmpty() && backend.getBaseDNs().length > 1 && !clearBackend) { StringBuilder builder = new StringBuilder(); for(DN dn : backend.getBaseDNs()) { builder.append(dn).append(" "); } LocalizableMessage message = ERR_LDIFIMPORT_MISSING_CLEAR_BACKEND.get( builder, typeClearBackend.getNameOrOID()); throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); } } else { @@ -517,23 +493,6 @@ logger.error(ERR_LDIFIMPORT_CANNOT_IMPORT, backendID); return TaskState.STOPPED_BY_ERROR; } // Make sure that if the "backendID" argument was provided, no include // base was included, and the "append" option was not provided, the // "clearBackend" argument was also provided if there are more then one // baseDNs for the backend being imported. else if(!append && includeBranches.isEmpty() && backend.getBaseDNs().length > 1 && !clearBackend) { StringBuilder builder = new StringBuilder(); builder.append(backend.getBaseDNs()[0]); for(int i = 1; i < backend.getBaseDNs().length; i++) { builder.append(" / "); builder.append(backend.getBaseDNs()[i]); } logger.error(ERR_LDIFIMPORT_MISSING_CLEAR_BACKEND, builder, ATTR_IMPORT_CLEAR_BACKEND); return TaskState.STOPPED_BY_ERROR; } } else { @@ -657,8 +616,6 @@ { tmpDirectory = "import-tmp"; } importConfig.setAppendToExistingData(append); importConfig.setReplaceExistingEntries(replaceExisting); importConfig.setCompressed(isCompressed); importConfig.setEncrypted(isEncrypted); importConfig.setClearBackend(clearBackend); opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
@@ -148,14 +148,12 @@ } /** Define the command-line arguments that may be used with this program. */ private BooleanArgument append; private BooleanArgument countRejects; private BooleanArgument displayUsage; private BooleanArgument isCompressed; private BooleanArgument isEncrypted; private BooleanArgument overwrite; private BooleanArgument quietMode; private BooleanArgument replaceExisting; private BooleanArgument skipSchemaValidation; private BooleanArgument clearBackend; private IntegerArgument randomSeed; @@ -331,20 +329,6 @@ INFO_LDIFIMPORT_DESCRIPTION_TEMPLATE_FILE.get()); argParser.addArgument(templateFile); append = new BooleanArgument("append", 'a', "append", INFO_LDIFIMPORT_DESCRIPTION_APPEND.get()); argParser.addArgument(append); replaceExisting = new BooleanArgument( "replaceexisting", 'r', "replaceExisting", INFO_LDIFIMPORT_DESCRIPTION_REPLACE_EXISTING.get()); argParser.addArgument(replaceExisting); backendID = new StringArgument("backendid", 'n', "backendID", false, false, true, INFO_BACKENDNAME_PLACEHOLDER.get(), null, null, @@ -507,8 +491,6 @@ addAttribute(attributes, ATTR_IMPORT_THREAD_COUNT, threadCount.getValue()); // Optional attributes addAttribute2(attributes, ATTR_IMPORT_APPEND, append); addAttribute2(attributes, ATTR_IMPORT_REPLACE_EXISTING, replaceExisting); addAttribute2(attributes, ATTR_IMPORT_BACKEND_ID, backendID); addAttribute(attributes, ATTR_IMPORT_INCLUDE_ATTRIBUTE, includeAttributeStrings.getValues()); addAttribute(attributes, ATTR_IMPORT_EXCLUDE_ATTRIBUTE, excludeAttributeStrings.getValues()); @@ -571,8 +553,7 @@ PrintStream err) { // Perform the initial bootstrap of the Directory Server and process the // configuration. // Perform the initial bootstrap of the Directory Server and process the configuration. DirectoryServer directoryServer = DirectoryServer.getInstance(); if (initializeServer) { @@ -932,21 +913,6 @@ } } // Make sure that if the "backendID" argument was provided, no include base // was included, the // "clearBackend" argument was also provided if there are more then one // baseDNs for the backend being imported. if(backendID.isPresent() && !includeBranchStrings.isPresent() && !append.isPresent() && defaultIncludeBranches.size() > 1 && !clearBackend.isPresent()) { StringBuilder builder = join(backend.getBaseDNs(), " / "); printWrappedText(err, ERR_LDIFIMPORT_MISSING_CLEAR_BACKEND.get(builder, clearBackend.getLongIdentifier())); return 1; } for (String s : excludeBranchStrings.getValues()) { DN excludeBranch; @@ -1032,8 +998,6 @@ // Create the LDIF import configuration to use when reading the LDIF. importConfig.setAppendToExistingData(append.isPresent()); importConfig.setReplaceExistingEntries(replaceExisting.isPresent()); importConfig.setCompressed(isCompressed.isPresent()); importConfig.setClearBackend(clearBackend.isPresent()); importConfig.setEncrypted(isEncrypted.isPresent()); @@ -1219,18 +1183,6 @@ return false; } private StringBuilder join(final DN[] baseDNs, final String separator) { final StringBuilder builder = new StringBuilder(); builder.append(baseDNs[0]); for (int i = 1; i < baseDNs.length; i++) { builder.append(separator); builder.append(baseDNs[i]); } return builder; } private Random newRandom() { if (randomSeed.isPresent()) opendj-server-legacy/src/messages/org/opends/messages/admin_tool.properties
@@ -1719,9 +1719,6 @@ INFO_CTRL_PANEL_IMPORT_LDIF_TITLE=Import LDIF INFO_CTRL_PANEL_DATA_IN_FILE_COMPRESSED=Data in File is Compressed INFO_CTRL_PANEL_IMPORT_TYPE_LABEL=Import Type: INFO_CTRL_PANEL_IMPORT_OVERWRITE_LABEL=Overwrite Any Existing Data INFO_CTRL_PANEL_IMPORT_APPEND_LABEL=Append to Existing Data INFO_CTRL_PANEL_FILE_TO_IMPORT_LABEL=File to Import: INFO_CTRL_PANEL_IMPORT_REPLACE_ENTRIES=Replace Entries that have Matching DNs \ with Imported Values opendj-server-legacy/src/messages/org/opends/messages/admin_tool_de.properties
@@ -1052,9 +1052,6 @@ INFO_CTRL_PANEL_IMPORT_LDIF_TITLE=Importieren von LDIF INFO_CTRL_PANEL_DATA_IN_FILE_COMPRESSED=Daten in Datei sind komprimiert INFO_CTRL_PANEL_IMPORT_TYPE_LABEL=Importtyp: INFO_CTRL_PANEL_IMPORT_OVERWRITE_LABEL=\u00dcberschreiben bestehender Daten INFO_CTRL_PANEL_IMPORT_APPEND_LABEL=An bestehende Daten anh\u00e4ngen INFO_CTRL_PANEL_FILE_TO_IMPORT_LABEL=Datei f\u00fcr Import: INFO_CTRL_PANEL_IMPORT_REPLACE_ENTRIES=Eintr\u00e4ge ersetzen, die \u00fcber \u00fcbereinstimmende DNs mit importierten Werten verf\u00fcgen INFO_CTRL_PANEL_SCHEMA_VALIDATION_LABEL=Schemavalidierung opendj-server-legacy/src/messages/org/opends/messages/admin_tool_es.properties
@@ -1052,9 +1052,6 @@ INFO_CTRL_PANEL_IMPORT_LDIF_TITLE=Importar LDIF INFO_CTRL_PANEL_DATA_IN_FILE_COMPRESSED=Los datos incluidos en el archivo est\u00e1n comprimidos INFO_CTRL_PANEL_IMPORT_TYPE_LABEL=importar tipo: INFO_CTRL_PANEL_IMPORT_OVERWRITE_LABEL=Sobrescribir los datos existentes INFO_CTRL_PANEL_IMPORT_APPEND_LABEL=Adjuntar a los datos existentes INFO_CTRL_PANEL_FILE_TO_IMPORT_LABEL=Archivo para importar: INFO_CTRL_PANEL_IMPORT_REPLACE_ENTRIES=Sustituir las entradas que tengan ND coincidentes con los valores importados INFO_CTRL_PANEL_SCHEMA_VALIDATION_LABEL=Validaci\u00f3n de esquema: opendj-server-legacy/src/messages/org/opends/messages/admin_tool_fr.properties
@@ -1052,9 +1052,6 @@ INFO_CTRL_PANEL_IMPORT_LDIF_TITLE=Importer LDIF INFO_CTRL_PANEL_DATA_IN_FILE_COMPRESSED=Les donn\u00e9es dans le fichier sont compress\u00e9es INFO_CTRL_PANEL_IMPORT_TYPE_LABEL=Type d'importation\u00a0: INFO_CTRL_PANEL_IMPORT_OVERWRITE_LABEL=\u00c9craser toute donn\u00e9e existante INFO_CTRL_PANEL_IMPORT_APPEND_LABEL=Ajouter \u00e0 toute donn\u00e9e existante INFO_CTRL_PANEL_FILE_TO_IMPORT_LABEL=Fichier \u00e0 importer\u00a0: INFO_CTRL_PANEL_IMPORT_REPLACE_ENTRIES=Remplacer les entr\u00e9es qui ont des DN correspondants avec des valeurs import\u00e9es INFO_CTRL_PANEL_SCHEMA_VALIDATION_LABEL=Validation de sch\u00e9ma\u00a0: opendj-server-legacy/src/messages/org/opends/messages/admin_tool_ja.properties
@@ -1049,9 +1049,6 @@ INFO_CTRL_PANEL_IMPORT_LDIF_TITLE=LDIF \u306e\u30a4\u30f3\u30dd\u30fc\u30c8 INFO_CTRL_PANEL_DATA_IN_FILE_COMPRESSED=\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u30c7\u30fc\u30bf\u306f\u5727\u7e2e\u3055\u308c\u307e\u3059 INFO_CTRL_PANEL_IMPORT_TYPE_LABEL=\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u30bf\u30a4\u30d7: INFO_CTRL_PANEL_IMPORT_OVERWRITE_LABEL=\u3059\u3079\u3066\u306e\u65e2\u5b58\u30c7\u30fc\u30bf\u306e\u4e0a\u66f8\u304d INFO_CTRL_PANEL_IMPORT_APPEND_LABEL=\u65e2\u5b58\u30c7\u30fc\u30bf\u3078\u306e\u8ffd\u52a0 INFO_CTRL_PANEL_FILE_TO_IMPORT_LABEL=\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u30d5\u30a1\u30a4\u30eb: INFO_CTRL_PANEL_IMPORT_REPLACE_ENTRIES=\u30a4\u30f3\u30dd\u30fc\u30c8\u3055\u308c\u305f\u5024\u3068\u4e00\u81f4\u3059\u308b DN \u3092\u6301\u3064\u30a8\u30f3\u30c8\u30ea\u306e\u7f6e\u304d\u63db\u3048 INFO_CTRL_PANEL_SCHEMA_VALIDATION_LABEL=\u30b9\u30ad\u30fc\u30de\u306e\u691c\u8a3c: opendj-server-legacy/src/messages/org/opends/messages/admin_tool_zh_CN.properties
@@ -1052,9 +1052,6 @@ INFO_CTRL_PANEL_IMPORT_LDIF_TITLE=\u5bfc\u5165 LDIF INFO_CTRL_PANEL_DATA_IN_FILE_COMPRESSED=\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u4e3a\u538b\u7f29\u6570\u636e INFO_CTRL_PANEL_IMPORT_TYPE_LABEL=\u5bfc\u5165\u7c7b\u578b: INFO_CTRL_PANEL_IMPORT_OVERWRITE_LABEL=\u8986\u5199\u4efb\u4f55\u73b0\u6709\u6570\u636e INFO_CTRL_PANEL_IMPORT_APPEND_LABEL=\u9644\u52a0\u5230\u73b0\u6709\u6570\u636e INFO_CTRL_PANEL_FILE_TO_IMPORT_LABEL=\u8981\u5bfc\u5165\u7684\u6587\u4ef6: INFO_CTRL_PANEL_IMPORT_REPLACE_ENTRIES=\u7528\u5bfc\u5165\u7684\u503c\u66ff\u6362\u5177\u6709\u5339\u914d DN \u7684\u6761\u76ee INFO_CTRL_PANEL_SCHEMA_VALIDATION_LABEL=\u6a21\u5f0f\u9a8c\u8bc1: opendj-server-legacy/src/test/java/org/opends/server/tasks/TestImportAndExport.java
@@ -191,8 +191,6 @@ "ds-task-import-is-encrypted: FALSE", "ds-task-import-reject-file: " + rejectFile.getPath(), "ds-task-import-overwrite-rejects: FALSE", "ds-task-import-append: TRUE", "ds-task-import-replace-existing: TRUE", "ds-task-import-skip-schema-validation: TRUE", "ds-task-import-include-branch: dc=example,dc=com", "ds-task-import-exclude-branch: o=exclude,dc=example,dc=com",