Factorized a lot of String joining code into Utils.joinAsString().
| | |
| | | |
| | | package org.opends.admin.ads; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | | import java.io.File; |
| | |
| | | |
| | | import org.opends.admin.ads.util.ConnectionUtils; |
| | | import org.opends.quicksetup.Constants; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.schema.SchemaConstants; |
| | | |
| | | |
| | | /** |
| | | * Class used to update and read the contents of the Administration Data. |
| | | */ |
| | |
| | | LocalizableMessage msg = ERR_ADS_ADMINISTRATOR_MERGE.get( |
| | | ConnectionUtils.getHostPort(adsCtx.getDirContext()), |
| | | ConnectionUtils.getHostPort(getDirContext()), |
| | | Utils.getStringFromCollection(notDefinedAdmins, |
| | | Constants.LINE_SEPARATOR), |
| | | joinAsString(Constants.LINE_SEPARATOR, notDefinedAdmins), |
| | | ConnectionUtils.getHostPort(getDirContext())); |
| | | throw new ADSContextException(ADSContextException.ErrorType.ERROR_MERGING, |
| | | msg, null); |
| | |
| | | */ |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | |
| | |
| | | import org.opends.guitools.controlpanel.ui.ColorAndFontConstants; |
| | | import org.opends.guitools.controlpanel.util.Utilities; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.backends.task.TaskState; |
| | | import org.opends.server.tools.tasks.TaskEntry; |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | String s = Utils.getStringFromCollection(values, "<br>"); |
| | | String s = joinAsString("<br>", values); |
| | | if (values.size() > 1) |
| | | { |
| | | msg = LocalizableMessage.raw( |
| | |
| | | |
| | | package org.opends.guitools.controlpanel.task; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | |
| | | import java.io.File; |
| | |
| | | import org.opends.guitools.controlpanel.ui.ProgressDialog; |
| | | import org.opends.guitools.controlpanel.util.Utilities; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.config.ConfigConstants; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.AttributeType; |
| | |
| | | } |
| | | if (ocNames.isEmpty()) |
| | | { |
| | | return INFO_CTRL_PANEL_NEW_ATTRIBUTES_TASK_DESCRIPTION.get( |
| | | Utils.getStringFromCollection(attrNames, ", ")); |
| | | return INFO_CTRL_PANEL_NEW_ATTRIBUTES_TASK_DESCRIPTION.get(joinAsString(", ", attrNames)); |
| | | } |
| | | else if (attrNames.isEmpty()) |
| | | { |
| | | return INFO_CTRL_PANEL_NEW_OBJECTCLASSES_TASK_DESCRIPTION.get( |
| | | Utils.getStringFromCollection(ocNames, ", ")); |
| | | return INFO_CTRL_PANEL_NEW_OBJECTCLASSES_TASK_DESCRIPTION.get(joinAsString(", ", ocNames)); |
| | | } |
| | | else |
| | | { |
| | | return INFO_CTRL_PANEL_NEW_SCHEMA_ELEMENTS_TASK_DESCRIPTION.get( |
| | | Utils.getStringFromCollection(attrNames, ", "), |
| | | Utils.getStringFromCollection(ocNames, ", ")); |
| | | joinAsString(", ", attrNames), |
| | | joinAsString(", ", ocNames)); |
| | | } |
| | | } |
| | | } |
| | |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append( |
| | | INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_ADD_SCHEMA_ELEMENT_OFFLINE.get( |
| | | Utils.getStringFromCollection(names, ", "), |
| | | joinAsString(", ", names), |
| | | schemaFile)) |
| | | .append("<br><b>"); |
| | | for (AttributeType attribute : attributes) |
| | |
| | | { |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append(INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_ADD_SCHEMA_ENTRY_OFFLINE.get( |
| | | Utils.getStringFromCollection(names, ", "), |
| | | joinAsString(", ", names), |
| | | schemaFile)).append("<br><b>"); |
| | | for (String line : getSchemaEntryLines()) |
| | | { |
| | |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.server.util.StaticUtils.toLowerCase; |
| | | |
| | |
| | | import org.opends.guitools.controlpanel.ui.renderer.TaskCellRenderer; |
| | | import org.opends.guitools.controlpanel.util.ConfigFromFile; |
| | | import org.opends.guitools.controlpanel.util.Utilities; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.tools.tasks.TaskEntry; |
| | | import org.opends.server.types.Attribute; |
| | |
| | | gbc.gridx = 1; |
| | | gbc.insets.right = 10; |
| | | |
| | | String s = Utils.getStringFromCollection(values, "\n"); |
| | | String s = joinAsString("\n", values); |
| | | detailsSubpanel.add( |
| | | Utilities.makeHtmlPane(s, ColorAndFontConstants.defaultFont), |
| | | gbc); |
| | |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.uninstaller; |
| | | |
| | | import org.opends.server.admin.client.cli.DsFrameworkCliReturnCode; |
| | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | |
| | | import org.opends.server.util.cli.MenuBuilder; |
| | | import org.opends.server.util.cli.MenuResult; |
| | | |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.Set; |
| | |
| | | INFO_CLI_UNINSTALL_CONFIRM_BACKUPS.get(), |
| | | INFO_CLI_UNINSTALL_CONFIRM_LDIFS.get(), |
| | | INFO_CLI_UNINSTALL_CONFIRM_OUTSIDEDBS.get( |
| | | Utils.getStringFromCollection(outsideDbs, |
| | | Constants.LINE_SEPARATOR)), |
| | | joinAsString(Constants.LINE_SEPARATOR, outsideDbs)), |
| | | INFO_CLI_UNINSTALL_CONFIRM_OUTSIDELOGS.get( |
| | | Utils.getStringFromCollection(outsideLogs, |
| | | Constants.LINE_SEPARATOR) |
| | | joinAsString(Constants.LINE_SEPARATOR, outsideLogs) |
| | | ) |
| | | }; |
| | | |
| | |
| | | |
| | | import org.opends.quicksetup.*; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.quicksetup.Step.FINISHED; |
| | | import static org.opends.quicksetup.Step.PROGRESS; |
| | | import static org.opends.quicksetup.Step.REVIEW; |
| | |
| | | String arg; |
| | | if (isWindows()) { |
| | | arg = installation.getUninstallBatFile() + getLineBreak().toString() + |
| | | getTab() + getStringFromCollection(paths, |
| | | getLineBreak().toString()); |
| | | getTab() + joinAsString(getLineBreak().toString(), paths); |
| | | } else { |
| | | arg = getStringFromCollection(paths, getLineBreak().toString()); |
| | | arg = joinAsString(getLineBreak().toString(), paths); |
| | | } |
| | | successMsg = |
| | | INFO_SUMMARY_UNINSTALL_FINISHED_SUCCESSFULLY_REMOVE_JARFILES_CLI |
| | |
| | | } else { |
| | | if (getUninstallUserData().getRemoveLibrariesAndTools()) { |
| | | String formattedPath = |
| | | addWordBreaks( |
| | | getStringFromCollection(paths, getLineBreak().toString()), 60, 5); |
| | | addWordBreaks(joinAsString(getLineBreak().toString(), paths), 60, 5); |
| | | successMsg = |
| | | INFO_SUMMARY_UNINSTALL_FINISHED_SUCCESSFULLY_REMOVE_JARFILES |
| | | .get(formattedPath); |
| | |
| | | import org.opends.quicksetup.ui.UIFactory; |
| | | import org.opends.quicksetup.util.Utils; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | /** |
| | | * A class used to describe the java arguments for a given command-line. |
| | |
| | | } |
| | | else |
| | | { |
| | | msg = LocalizableMessage.raw(collectionToString(lines, "<br>")); |
| | | msg = LocalizableMessage.raw(joinAsString("<br>", lines)); |
| | | } |
| | | } |
| | | return msg; |
| | |
| | | { |
| | | l.add(Utils.escapeCommandLineValue(arg)); |
| | | } |
| | | return Utils.getStringFromCollection(l, " "); |
| | | return joinAsString(" ", l); |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.opends.server.util.SetupUtils; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.quicksetup.Step.*; |
| | | import static org.opends.quicksetup.util.Utils.*; |
| | |
| | | if (isVerbose()) |
| | | { |
| | | mb.append(getFormattedProgress(INFO_PROGRESS_IMPORTING_LDIFS.get( |
| | | getStringFromCollection(ldifPaths, ", ")))); |
| | | joinAsString(", ", ldifPaths)))); |
| | | mb.append(getLineBreak()); |
| | | } |
| | | else |
| | | { |
| | | mb.append(getFormattedProgress( |
| | | INFO_PROGRESS_IMPORTING_LDIFS_NON_VERBOSE.get( |
| | | getStringFromCollection(ldifPaths, ", ")))); |
| | | joinAsString(", ", ldifPaths)))); |
| | | } |
| | | } |
| | | else |
| | |
| | | ae = new ApplicationException( |
| | | ReturnCode.IMPORT_ERROR, |
| | | getThrowableMsg(INFO_ERROR_IMPORT_AUTOMATICALLY_GENERATED.get( |
| | | listToString(argList, " "), t.getLocalizedMessage()), t), |
| | | joinAsString(" ", argList), t.getLocalizedMessage()), t), |
| | | t); |
| | | } |
| | | finally |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | | import org.opends.admin.ads.ServerDescriptor; |
| | |
| | | else if (linesToAdd.size() > 1) |
| | | { |
| | | String arg0 = getJavaPropertiesFilePath(userData); |
| | | String arg1 = Utils.getStringFromCollection(linesToAdd, "\n"); |
| | | String arg1 = joinAsString("\n", linesToAdd); |
| | | sb.append( |
| | | formatter.getFormattedProgress(INFO_EDIT_JAVA_PROPERTIES_LINES.get( |
| | | arg0, arg1))); |
| | |
| | | */ |
| | | package org.opends.quicksetup.util; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.server.util.DynamicConstants.SHORT_NAME; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * This is a helper method that gets a String representation of the elements |
| | | * in the Collection. The String will display the different elements separated |
| | | * by the separator String. |
| | | * |
| | | * @param col |
| | | * the collection containing the String. |
| | | * @param separator |
| | | * the separator String to be used. |
| | | * @return the String representation for the collection. |
| | | */ |
| | | public static String getStringFromCollection(Collection<String> col, |
| | | String separator) |
| | | { |
| | | StringBuilder msg = new StringBuilder(); |
| | | for (String m : col) |
| | | { |
| | | if (msg.length() > 0) |
| | | { |
| | | msg.append(separator); |
| | | } |
| | | msg.append(m); |
| | | } |
| | | return msg.toString(); |
| | | } |
| | | |
| | | /** |
| | | * This is a helper method that gets a LocalizableMessage representation of the elements |
| | | * in the Collection of Messages. The LocalizableMessage will display the different |
| | | * elements separated by the separator String. |
| | |
| | | * elements in the <code>list</code> separated by <code>separator</code>. |
| | | * @param list the list to print |
| | | * @param separator to use in separating elements |
| | | * @return String representing the list |
| | | */ |
| | | static public String listToString(List<?> list, String separator) { |
| | | return listToString(list, separator, null, null); |
| | | } |
| | | |
| | | /** |
| | | * Creates a string consisting of the string representation of the |
| | | * elements in the <code>list</code> separated by <code>separator</code>. |
| | | * @param list the list to print |
| | | * @param separator to use in separating elements |
| | | * @param prefix prepended to each individual element in the list before |
| | | * adding to the returned string. |
| | | * @param suffix appended to each individual element in the list before |
| | |
| | | else if (options.getBaseDns().size() > 1) |
| | | { |
| | | msg = INFO_REVIEW_CREATE_SUFFIX.get( |
| | | Utils.listToString(options.getBaseDns(), Constants.LINE_SEPARATOR), |
| | | joinAsString(Constants.LINE_SEPARATOR, options.getBaseDns()), |
| | | arg2); |
| | | } |
| | | else |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.client.cli; |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.backends.task.FailedDependencyAction; |
| | | import org.opends.server.backends.task.RecurringTask; |
| | | import org.opends.server.types.DirectoryException; |
| | |
| | | OPTION_SHORT_FAILED_DEPENDENCY_ACTION, |
| | | OPTION_LONG_FAILED_DEPENDENCY_ACTION, false, true, true, |
| | | INFO_ACTION_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_TASK_FAILED_DEPENDENCY_ACTION.get(StaticUtils |
| | | .collectionToString(fdaValSet, ","), FailedDependencyAction |
| | | .defaultValue().name())); |
| | | INFO_DESCRIPTION_TASK_FAILED_DEPENDENCY_ACTION.get( |
| | | Utils.joinAsString(",", fdaValSet), |
| | | FailedDependencyAction.defaultValue().name())); |
| | | |
| | | for (Argument arg : getArguments()) |
| | | { |
| | |
| | | Set<FailedDependencyAction> fdaValSet = |
| | | EnumSet.allOf(FailedDependencyAction.class); |
| | | throw new ArgumentException(ERR_TASKTOOL_INVALID_FDA.get(fda, |
| | | StaticUtils.collectionToString(fdaValSet, ","))); |
| | | Utils.joinAsString(",", fdaValSet))); |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.admin.std.meta.LocalDBIndexCfgDefn; |
| | | import org.opends.server.admin.std.meta.LocalDBIndexCfgDefn.IndexType; |
| | | import org.opends.server.admin.std.server.LocalDBBackendCfg; |
| | |
| | | default: |
| | | if (!rebuildConfig.isClearDegradedState()) |
| | | { |
| | | String indexes = collectionToString(rebuildConfig.getRebuildList(), ", "); |
| | | String indexes = Utils.joinAsString(", ", rebuildConfig.getRebuildList()); |
| | | message = NOTE_JEB_REBUILD_START.get(indexes, totalEntries); |
| | | } |
| | | break; |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.admin.ClassPropertyDefinition; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.server.ServerManagementContext; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | // Bug: we are in a section where configuration is null |
| | | throw new InitializationException(ERR_CONFIG_AUTHZ_CONFIG_NOT_ACCEPTABLE.get( |
| | | null /* WAS: configuration.dn() */, reasons)); |
| | |
| | | package org.opends.server.core; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_ACCTNOTHANDLER_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_ALERTHANDLER_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DirectoryException; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_SCHEMA_SYNTAX_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_CERTMAPPER_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.util.*; |
| | | import org.forgerock.util.Reject; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.util.args.*; |
| | | import org.opends.server.workflowelement.WorkflowElement; |
| | | import org.opends.server.workflowelement.WorkflowElementConfigManager; |
| | |
| | | BUILD_JVM_VERSION); |
| | | System.out.println(SetupUtils.BUILD_JVM_VENDOR+separator+BUILD_JVM_VENDOR); |
| | | System.out.println(SetupUtils.INCOMPATIBILITY_EVENTS+separator+ |
| | | StaticUtils.listToString( |
| | | VersionCompatibilityIssue.getAllEvents(), ",")); |
| | | Utils.joinAsString(",", VersionCompatibilityIssue.getAllEvents())); |
| | | |
| | | // Print extensions' extra information |
| | | String extensionInformation = |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_EXTENSION_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | import org.opends.server.api.plugin.PluginType; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | | import org.opends.server.protocols.ldap.LDAPControl; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reason = collectionToString(unacceptableReasons, ". "); |
| | | String reason = Utils.joinAsString(". ", unacceptableReasons); |
| | | LocalizableMessage message = ERR_CONFIG_GROUP_CONFIG_NOT_ACCEPTABLE.get( |
| | | configuration.dn(), reason); |
| | | throw new InitializationException(message); |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_IDMAPPER_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_KEYMANAGER_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_SCHEMA_MR_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_PWGENERATOR_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | package org.opends.server.core; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_PWSCHEME_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_PWVALIDATOR_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_SASL_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | throw new InitializationException( |
| | | ERR_CONFIG_TRUSTMANAGER_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), reasons)); |
| | | } |
| | |
| | | import org.opends.server.api.VirtualAttributeProvider; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.types.*; |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | List<LocalizableMessage> unacceptableReasons = new ArrayList<LocalizableMessage>(); |
| | | if (!provider.isConfigurationAcceptable(cfg, unacceptableReasons)) |
| | | { |
| | | String reasons = collectionToString(unacceptableReasons, ". "); |
| | | String reasons = Utils.joinAsString(". ", unacceptableReasons); |
| | | LocalizableMessage message = ERR_CONFIG_VATTR_CONFIG_NOT_ACCEPTABLE.get(cfg.dn(), reasons); |
| | | throw new InitializationException(message); |
| | | } |
| | |
| | | */ |
| | | package org.opends.server.core.networkgroups; |
| | | |
| | | |
| | | |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines a utility that will be used to manage the |
| | |
| | | if (!NetworkGroup.isConfigurationAcceptable(configuration, |
| | | unacceptableReasons)) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CONFIG_NETWORK_GROUP_CONFIG_NOT_ACCEPTABLE.get(configuration.dn(), StaticUtils.listToString( |
| | | unacceptableReasons, ". ")); |
| | | throw new InitializationException(message); |
| | | throw new InitializationException(ERR_CONFIG_NETWORK_GROUP_CONFIG_NOT_ACCEPTABLE.get( |
| | | configuration.dn(), Utils.joinAsString(". ", unacceptableReasons))); |
| | | } |
| | | |
| | | if (configuration.isEnabled()) |
| | |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.admin.Configuration; |
| | | import org.opends.server.api.AlertGenerator; |
| | | import org.opends.server.api.ClientConnection; |
| | |
| | | |
| | | if (resultCode != ResultCode.SUCCESS) |
| | | { |
| | | String reasons = StaticUtils.collectionToString(messages, ". "); |
| | | String reasons = Utils.joinAsString(". ", messages); |
| | | LocalizableMessage message = ERR_CONFIG_FILE_DELETE_APPLY_FAILED.get(reasons); |
| | | throw new DirectoryException(resultCode, message); |
| | | } |
| | |
| | | import java.util.Set; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.FileBasedHTTPAccessLogPublisherCfg; |
| | | import org.opends.server.api.HTTPAccessLogPublisher; |
| | |
| | | if (!unsupportedFields.isEmpty()) |
| | | { // there are some unsupported fields. List them. |
| | | return WARN_CONFIG_LOGGING_UNSUPPORTED_FIELDS_IN_LOG_FORMAT.get( |
| | | cfg.dn(), collectionToString(unsupportedFields, ", ")); |
| | | cfg.dn(), Utils.joinAsString(", ", unsupportedFields)); |
| | | } |
| | | if (fields.size() == unsupportedFields.size()) |
| | | { // all fields are unsupported |
| | |
| | | import org.opends.server.protocols.asn1.ASN1Writer; |
| | | import org.opends.server.replication.protocol.ProtocolVersion; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.util.StaticUtils; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | /** |
| | | * This class is used to associate serverIds with {@link CSN}s. |
| | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return StaticUtils.collectionToString(serverIdToCSN.values(), " "); |
| | | return Utils.joinAsString(" ", serverIdToCSN.values()); |
| | | } |
| | | |
| | | /** |
| | |
| | | import java.util.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.server.ServerManagementContext; |
| | | import org.opends.server.admin.std.server.*; |
| | |
| | | import org.opends.server.types.*; |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | | import static org.opends.server.replication.plugin.LDAPReplicationDomain.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | /** |
| | | * This class implements a Directory Server plugin that is used in fractional |
| | |
| | | { |
| | | if (values.size() > 0) |
| | | { |
| | | attrBuilder.add(className + ":" + collectionToString(values, ",")); |
| | | attrBuilder.add(className + ":" + Utils.joinAsString(",", values)); |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | import java.util.Set; |
| | | import java.util.zip.DataFormatException; |
| | | |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.replication.common.CSN; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | /** |
| | | * This class specifies the parameters of a search request on the ECL. |
| | |
| | | @Override |
| | | public byte[] getBytes(short protocolVersion) |
| | | { |
| | | String excludedBaseDNsString = |
| | | StaticUtils.collectionToString(excludedBaseDNs, ";"); |
| | | String excludedBaseDNsString = Utils.joinAsString(";", excludedBaseDNs); |
| | | |
| | | try |
| | | { |
| | |
| | | import org.forgerock.opendj.ldap.ByteSequenceReader; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ByteStringBuilder; |
| | | import org.opends.server.util.StaticUtils; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | /** |
| | | * This message is used by DS to confirm a RS he wants to connect to him (open |
| | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | String urls = StaticUtils.collectionToString(referralsURLs, " | "); |
| | | String urls = Utils.joinAsString(" | ", referralsURLs); |
| | | return "StartSessionMsg content:\nstatus: " + status + |
| | | "\nassuredFlag: " + assuredFlag + |
| | | "\nassuredMode: " + assuredMode + |
| | |
| | | import org.opends.server.admin.std.server.ReplicationDomainCfg; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | import org.opends.server.replication.common.*; |
| | | import org.opends.server.replication.plugin.MultimasterReplication; |
| | | import org.opends.server.replication.protocol.*; |
| | |
| | | |
| | | if (replicationServerInfos.size() > 0) |
| | | { |
| | | logger.warn(WARN_COULD_NOT_FIND_CHANGELOG.get(serverId, baseDN |
| | | .toNormalizedString(), collectionToString( |
| | | replicationServerInfos.keySet(), ", "))); |
| | | logger.warn(WARN_COULD_NOT_FIND_CHANGELOG.get(serverId, baseDN.toNormalizedString(), |
| | | Utils.joinAsString(", ", replicationServerInfos.keySet()))); |
| | | } |
| | | else |
| | | { |
| | |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | |
| | | } |
| | | if (nonExistingFiles.size() > 0) |
| | | { |
| | | errorMessages.add(ERR_INSTALLDS_NO_SUCH_LDIF_FILE.get( |
| | | Utils.getStringFromCollection(nonExistingFiles, ", "))); |
| | | errorMessages.add(ERR_INSTALLDS_NO_SUCH_LDIF_FILE.get(joinAsString(", ", nonExistingFiles))); |
| | | } |
| | | String rejectedFile = argParser.rejectedImportFileArg.getValue(); |
| | | if (rejectedFile != null) |
| | |
| | | if (nonExistingFiles.size() > 0) |
| | | { |
| | | println(); |
| | | println(ERR_INSTALLDS_NO_SUCH_LDIF_FILE.get( |
| | | Utils.getStringFromCollection(nonExistingFiles, ", "))); |
| | | println(ERR_INSTALLDS_NO_SUCH_LDIF_FILE.get(joinAsString(", ", nonExistingFiles))); |
| | | } |
| | | while (importLDIFFiles.isEmpty()) |
| | | { |
| | |
| | | else if (certManager.hasRealAliases()) |
| | | { |
| | | Collections.addAll(nicknameList, aliases); |
| | | String aliasString = Utils.getStringFromCollection(nicknameList, |
| | | ", "); |
| | | String aliasString = joinAsString(", ", nicknameList); |
| | | if (certNickname != null) |
| | | { |
| | | // Check if the certificate alias is in the list. |
| | |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.admin.ads.ServerDescriptor.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | |
| | | printlnProgress(); |
| | | LocalizableMessage msg = formatter.getFormattedProgress( |
| | | INFO_PROGRESS_PURGE_HISTORICAL.get(separator, |
| | | Utils.getStringFromCollection(uData.getBaseDNs(), separator))); |
| | | joinAsString(separator, uData.getBaseDNs()))); |
| | | printProgress(msg); |
| | | printlnProgress(); |
| | | |
| | |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_PURGE_SUFFIXES_NOT_FOUND.get( |
| | | Utils.getStringFromCollection(notFound, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, notFound))); |
| | | } |
| | | if (interactive) |
| | | { |
| | |
| | | if (userProvidedReplicatedSuffixes.size() > 0) |
| | | { |
| | | println(); |
| | | println( |
| | | INFO_ALREADY_REPLICATED_SUFFIXES.get( |
| | | Utils.getStringFromCollection(userProvidedReplicatedSuffixes, |
| | | Constants.LINE_SEPARATOR))); |
| | | println(INFO_ALREADY_REPLICATED_SUFFIXES.get( |
| | | joinAsString(Constants.LINE_SEPARATOR, userProvidedReplicatedSuffixes))); |
| | | } |
| | | suffixes.clear(); |
| | | } |
| | |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_ENABLE_SUFFIXES_NOT_FOUND.get( |
| | | Utils.getStringFromCollection(notFound, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, notFound))); |
| | | } |
| | | if (alreadyReplicated.size() > 0) |
| | | { |
| | | println(); |
| | | println(INFO_ALREADY_REPLICATED_SUFFIXES.get( |
| | | Utils.getStringFromCollection(alreadyReplicated, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, alreadyReplicated))); |
| | | } |
| | | if (interactive) |
| | | { |
| | |
| | | { |
| | | println(); |
| | | println(INFO_ALREADY_NOT_REPLICATED_SUFFIXES.get( |
| | | Utils.getStringFromCollection( |
| | | userProvidedNotReplicatedSuffixes, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, userProvidedNotReplicatedSuffixes))); |
| | | } |
| | | suffixes.clear(); |
| | | } |
| | |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_DISABLE_SUFFIXES_NOT_FOUND.get( |
| | | Utils.getStringFromCollection(notFound, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, notFound))); |
| | | } |
| | | if (alreadyNotReplicated.size() > 0 && displayErrors) |
| | | { |
| | | println(); |
| | | println(INFO_ALREADY_NOT_REPLICATED_SUFFIXES.get( |
| | | Utils.getStringFromCollection(alreadyNotReplicated, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, alreadyNotReplicated))); |
| | | } |
| | | if (interactive) |
| | | { |
| | |
| | | { |
| | | println(); |
| | | println(INFO_ALREADY_NOT_REPLICATED_SUFFIXES.get( |
| | | Utils.getStringFromCollection( |
| | | userProvidedNotReplicatedSuffixes, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, userProvidedNotReplicatedSuffixes))); |
| | | } |
| | | suffixes.clear(); |
| | | } |
| | |
| | | { |
| | | println(); |
| | | println(ERR_REPLICATION_INITIALIZE_LOCAL_SUFFIXES_NOT_FOUND.get( |
| | | Utils.getStringFromCollection(notFound, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, notFound))); |
| | | } |
| | | if (alreadyNotReplicated.size() > 0) |
| | | { |
| | | println(); |
| | | println(INFO_ALREADY_NOT_REPLICATED_SUFFIXES.get( |
| | | Utils.getStringFromCollection(alreadyNotReplicated, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, alreadyNotReplicated))); |
| | | } |
| | | if (interactive) |
| | | { |
| | |
| | | { |
| | | println(); |
| | | println(ERR_SUFFIXES_CANNOT_BE_INITIALIZED.get( |
| | | Utils.getStringFromCollection(notFound, |
| | | Constants.LINE_SEPARATOR))); |
| | | joinAsString(Constants.LINE_SEPARATOR, notFound))); |
| | | } |
| | | if (interactive) |
| | | { |
| | |
| | | { |
| | | LocalizableMessage errorMsg = |
| | | ERR_REPLICATION_NO_REPLICATION_SERVER.get( |
| | | Utils.getStringFromCollection(baseDNsWithNoReplicationServer, |
| | | Constants.LINE_SEPARATOR)); |
| | | joinAsString(Constants.LINE_SEPARATOR, baseDNsWithNoReplicationServer)); |
| | | throw new ReplicationCliException( |
| | | errorMsg, |
| | | ReplicationCliReturnCode.ERROR_USER_DATA, null); |
| | |
| | | { |
| | | LocalizableMessage confirmMsg = |
| | | INFO_REPLICATION_ONLY_ONE_REPLICATION_SERVER_CONFIRM.get( |
| | | Utils.getStringFromCollection(baseDNsWithOneReplicationServer, |
| | | Constants.LINE_SEPARATOR)); |
| | | joinAsString(Constants.LINE_SEPARATOR, baseDNsWithOneReplicationServer)); |
| | | try |
| | | { |
| | | if (!confirmAction(confirmMsg, false)) |
| | |
| | | { |
| | | LocalizableMessage warningMsg = |
| | | INFO_REPLICATION_ONLY_ONE_REPLICATION_SERVER_WARNING.get( |
| | | Utils.getStringFromCollection(baseDNsWithOneReplicationServer, |
| | | Constants.LINE_SEPARATOR)); |
| | | joinAsString(Constants.LINE_SEPARATOR, baseDNsWithOneReplicationServer)); |
| | | println(warningMsg); |
| | | println(); |
| | | } |
| | |
| | | } |
| | | if (!baseDNs.isEmpty()) |
| | | { |
| | | String arg = |
| | | Utils.getStringFromCollection(baseDNs, Constants.LINE_SEPARATOR); |
| | | String arg = joinAsString(Constants.LINE_SEPARATOR, baseDNs); |
| | | if (!isInteractive()) |
| | | { |
| | | println(INFO_DISABLE_REPLICATION_ONE_POINT_OF_FAILURE.get(arg)); |
| | |
| | | |
| | | if (!suffixArg.isEmpty()) |
| | | { |
| | | String arg = |
| | | Utils.getStringFromCollection(suffixArg, Constants.LINE_SEPARATOR); |
| | | String arg = joinAsString(Constants.LINE_SEPARATOR, suffixArg); |
| | | if (!isInteractive()) |
| | | { |
| | | println(INFO_DISABLE_REPLICATION_DISABLE_IN_REMOTE.get(arg)); |
| | |
| | | import org.opends.server.api.VirtualAttributeProvider; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import static org.forgerock.util.Reject.*; |
| | | |
| | | /** |
| | |
| | | if (!col.isEmpty()) |
| | | { |
| | | buffer.append("\""); |
| | | buffer.append(collectionToString(col, "\", \"")); |
| | | buffer.append(Utils.joinAsString("\", \"", col)); |
| | | buffer.append("\""); |
| | | } |
| | | } |
| | |
| | | import javax.naming.NamingException; |
| | | import javax.naming.ldap.InitialLdapContext; |
| | | |
| | | import org.forgerock.util.Reject; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.i18n.LocalizableMessageDescriptor; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.util.Reject; |
| | | import org.opends.messages.ToolMessages; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.ServerContext; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.opends.server.util.args.Argument; |
| | | import org.opends.server.util.args.ArgumentException; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Creates a string representation of the elements in the |
| | | * <code>list</code> separated by <code>separator</code>. |
| | | * |
| | | * @param list the list to print |
| | | * @param separator to use between elements |
| | | * |
| | | * @return String representing the list |
| | | */ |
| | | static public String listToString(List<?> list, String separator) |
| | | { |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | sb.append(list.get(i)); |
| | | if (i < list.size() - 1) { |
| | | sb.append(separator); |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * Creates a string representation of the elements in the |
| | | * <code>collection</code> separated by <code>separator</code>. |
| | | * |
| | | * @param collection to print |
| | | * @param separator to use between elements |
| | | * |
| | | * @return String representing the collection |
| | | */ |
| | | static public String collectionToString(Collection<?> collection, |
| | | String separator) |
| | | { |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Iterator<?> iter = collection.iterator(); iter.hasNext();) { |
| | | sb.append(iter.next()); |
| | | if (iter.hasNext()) { |
| | | sb.append(separator); |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Retrieves an array list containing the contents of the provided array. |
| | | * |
| | | * @param stringArray The string array to convert to an array list. |
| | |
| | | import org.opends.server.types.operation.PostSynchronizationModifyOperation; |
| | | import org.opends.server.types.operation.PreOperationModifyOperation; |
| | | import org.forgerock.util.Reject; |
| | | import org.forgerock.util.Utils; |
| | | |
| | | /** |
| | | * This class defines an operation used to modify an entry in a local backend |
| | |
| | | modifiedEntry.addAttribute(attr, duplicateValues); |
| | | if (!duplicateValues.isEmpty() && !permissiveModify) |
| | | { |
| | | String duplicateValuesStr = collectionToString(duplicateValues, ", "); |
| | | String duplicateValuesStr = Utils.joinAsString(", ", duplicateValues); |
| | | |
| | | throw newDirectoryException(currentEntry, |
| | | ResultCode.ATTRIBUTE_OR_VALUE_EXISTS, |
| | |
| | | { |
| | | if (! permissiveModify) |
| | | { |
| | | String missingValuesStr = collectionToString(missingValues, ", "); |
| | | String missingValuesStr = Utils.joinAsString(", ", missingValues); |
| | | |
| | | throw newDirectoryException(currentEntry, |
| | | ResultCode.NO_SUCH_ATTRIBUTE, |