mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
21.06.2016 b562bb7b23759b1ba50c4618eb35010054965226
Fix warnings during build
24 files modified
437 ■■■■■ changed files
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java 13 ●●●●● patch | view | raw | blame | history
opendj-core/clirr-ignored-api-changes.xml 35 ●●●●● patch | view | raw | blame | history
opendj-core/pom.xml 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Converters.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ControlPanelArgumentParser.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/SuperiorObjectClassesChangedEvent.java 17 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/SuperiorObjectClassesChangedListener.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/Backupable.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/Importer.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/AccountStatusNotificationHandlerConfigManager.java 23 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/CertificateMapperConfigManager.java 30 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/LDAPContext.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/AuthPasswordSyntax.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java 18 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/BackupManager.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java 77 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/resources/java-stubs/org/opends/server/util/DynamicConstants.java 147 ●●●● patch | view | raw | blame | history
opendj-server/src/main/java/org/forgerock/opendj/server/core/ArchivableDataProvider.java 8 ●●●● patch | view | raw | blame | history
opendj-server/src/main/java/org/forgerock/opendj/server/core/ExportableDataProvider.java 4 ●●●● patch | view | raw | blame | history
opendj-server/src/main/java/org/forgerock/opendj/server/core/ImportableDataProvider.java 13 ●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java
@@ -65,6 +65,8 @@
import org.forgerock.opendj.config.AttributeTypePropertyDefinition;
import org.forgerock.opendj.config.BooleanPropertyDefinition;
import org.forgerock.opendj.config.ClassPropertyDefinition;
import org.forgerock.opendj.config.Configuration;
import org.forgerock.opendj.config.ConfigurationClient;
import org.forgerock.opendj.config.ConfigurationFramework;
import org.forgerock.opendj.config.DNPropertyDefinition;
import org.forgerock.opendj.config.DefaultBehaviorProvider;
@@ -230,7 +232,7 @@
            return rd.getChildDefinition();
        }
        private boolean isHidden(RelationDefinition defn) {
        private boolean isHidden(RelationDefinition<?, ?> defn) {
            return defn == null || defn.hasOption(RelationOption.HIDDEN);
        }
@@ -413,7 +415,8 @@
                }
                @Override
                public String visitAggregation(AggregationPropertyDefinition prop, Void p) {
                public <C extends ConfigurationClient, S extends Configuration> String visitAggregation(
                        AggregationPropertyDefinition<C, S> prop, Void p) {
                    b.append(op);
                    final RelationDefinition<?, ?> rel = prop.getRelationDefinition();
                    if (isHidden(rel)) {
@@ -490,12 +493,12 @@
                }
                @Override
                public String visitEnum(EnumPropertyDefinition prop, Void p) {
                public <E extends Enum<E>> String visitEnum(EnumPropertyDefinition<E> prop, Void p) {
                    b.append("<variablelist>").append(EOL);
                    final Class<?> en = prop.getEnumClass();
                    final Object[] constants = en.getEnumConstants();
                    for (Object enumConstant : constants) {
                        final LocalizableMessage valueSynopsis = prop.getValueSynopsis((Enum) enumConstant);
                        final LocalizableMessage valueSynopsis = prop.getValueSynopsis((E) enumConstant);
                        appendVarListEntry(b, enumConstant.toString(), op + valueSynopsis + cp);
                    }
                    b.append("</variablelist>").append(EOL);
@@ -560,7 +563,7 @@
                }
                @Override
                public String visitUnknown(PropertyDefinition prop, Void p) {
                public <T> String visitUnknown(PropertyDefinition<T> prop, Void p) {
                    b.append(op).append(REF_DSCFG_UNKNOWN.get()).append(cp).append(EOL);
                    return null;
                }
opendj-core/clirr-ignored-api-changes.xml
@@ -32,4 +32,39 @@
Note: waiting on https://jira.codehaus.org/browse/MCLIRR-62 to be resolved to avoid the need to use \s* in the '<to>' tags.
-->
  <difference>
    <className>org/forgerock/opendj/ldap/Connections</className>
    <differenceType>7002</differenceType>
    <method>org.forgerock.opendj.ldap.ConnectionFactory newLoadBalancer(org.forgerock.opendj.ldap.LoadBalancingAlgorithm)</method>
    <justification>OPENDJ-2878 Implement sharded request load-balancer</justification>
  </difference>
  <difference>
    <className>org/forgerock/opendj/ldap/LoadBalancingAlgorithm</className>
    <differenceType>8001</differenceType>
    <justification>OPENDJ-2878 Implement sharded request load-balancer</justification>
  </difference>
  <difference>
    <className>org/forgerock/opendj/ldap/LdapPromise</className>
    <differenceType>7012</differenceType>
    <method>org.forgerock.opendj.ldap.LdapPromise thenFinally(java.lang.Runnable)</method>
    <justification>Consequence of COMMONs-5 Promise API improvements</justification>
  </difference>
  <difference>
    <className>org/forgerock/opendj/ldap/RootDSE</className>
    <differenceType>7004</differenceType>
    <method>org.forgerock.opendj.ldap.LdapPromise readRootDSEAsync(org.forgerock.opendj.ldap.Connection, org.forgerock.opendj.ldap.LdapResultHandler)</method>
    <justification>Code cleanup: remove unused LdapResultHandler parameter</justification>
  </difference>
  <difference>
    <className>org/forgerock/opendj/ldap/spi/LdapPromises</className>
    <differenceType>7004</differenceType>
    <method>org.forgerock.opendj.ldap.spi.BindResultLdapPromiseImpl newBindLdapPromise(int, org.forgerock.opendj.ldap.requests.BindRequest, org.forgerock.opendj.ldap.requests.BindClient, org.forgerock.opendj.ldap.IntermediateResponseHandler, org.forgerock.opendj.ldap.Connection)</method>
    <justification>Code cleanup: remove unused Connection parameter</justification>
  </difference>
  <difference>
    <className>org/forgerock/opendj/ldap/spi/LdapPromises</className>
    <differenceType>7002</differenceType>
    <method>org.forgerock.opendj.ldap.spi.BindResultLdapPromiseImpl newBindLdapPromise(int, org.forgerock.opendj.ldap.requests.BindRequest, org.forgerock.opendj.ldap.requests.BindClient, org.forgerock.opendj.ldap.IntermediateResponseHandler, org.forgerock.opendj.ldap.spi.LDAPConnectionImpl)</method>
    <justification>Code cleanup: remove overloaded method with unused parameter</justification>
  </difference>
</differences>
opendj-core/pom.xml
@@ -169,8 +169,7 @@
                            <comparisonArtifacts>
                                <comparisonArtifact>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>opendj-ldap-sdk</artifactId>
                                    <!-- former name of this jar -->
                                    <artifactId>opendj-core</artifactId>
                                    <version>3.0.0</version>
                                </comparisonArtifact>
                            </comparisonArtifacts>
opendj-server-legacy/src/main/java/org/forgerock/opendj/adapter/server3x/Converters.java
@@ -519,8 +519,8 @@
    /**
     * Converts from OpenDJ server
     * {@link org.opends.server.admin.std.meta.VirtualAttributeCfgDefn.Scope} to OpenDJ LDAP SDK
     * {@link org.forgerock.opendj.ldap.SearchScope}.
     * {@link org.forgerock.opendj.server.config.meta.VirtualAttributeCfgDefn.Scope}
     *  to OpenDJ LDAP SDK {@link org.forgerock.opendj.ldap.SearchScope}.
     *
     * @param srvScope
     *          The server scope value.
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ControlPanelArgumentParser.java
@@ -218,10 +218,10 @@
   * must be called after parsing the arguments.
   * @return the timeout to be used to connect in milliseconds.  Returns
   * {@code 0} if there is no timeout.
   * @throw {@code IllegalStateException} if the method is called before
   * @throws IllegalStateException if the method is called before
   * parsing the arguments.
   */
  public int getConnectTimeout()
  public int getConnectTimeout() throws IllegalStateException
  {
    try
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/SuperiorObjectClassesChangedEvent.java
@@ -12,9 +12,8 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2010 Sun Microsystems, Inc.
 * Portions Copyright 2015 ForgeRock AS.
 * Portions Copyright 2015-2016 ForgeRock AS.
 */
package org.opends.guitools.controlpanel.event;
import java.util.Collections;
@@ -24,13 +23,10 @@
import org.opends.server.types.ObjectClass;
/**
 * This is the event sent to notify the changes made in the superiors of a given
 * object class.  It is used mainly by the
 * {@link
 * org.opends.guitools.controlpanel.components.SuperiorObjectClassesEditor}
 * class.  It is linked to the {@link SuperiorObjectClassesChangedListener}
 * interface.
 *
 * This is the event sent to notify the changes made in the superiors of a given object class. It is
 * used mainly by the
 * {@link org.opends.guitools.controlpanel.ui.components.SuperiorObjectClassesEditor} class. It is
 * linked to the {@link SuperiorObjectClassesChangedListener} interface.
 */
public class SuperiorObjectClassesChangedEvent
{
@@ -42,8 +38,7 @@
   * @param source the source of the event.
   * @param newObjectClasses the set of new superior object classes.
   */
  public SuperiorObjectClassesChangedEvent(Object source,
      Set<ObjectClass> newObjectClasses)
  public SuperiorObjectClassesChangedEvent(Object source, Set<ObjectClass> newObjectClasses)
  {
    this.source = source;
    this.newObjectClasses.addAll(newObjectClasses);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/SuperiorObjectClassesChangedListener.java
@@ -12,16 +12,14 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2010 Sun Microsystems, Inc.
 * Portions Copyright 2016 ForgeRock AS.
 */
package org.opends.guitools.controlpanel.event;
/**
 * This is the listener that receives events about the changes made in the
 * superiors of a given object class.  It is used mainly by the
 * {@link
 * org.opends.guitools.controlpanel.components.SuperiorObjectClassesEditor}
 * class.
 *
 * This is the listener that receives events about the changes made in the superiors of a given
 * object class. It is used mainly by the
 * {@link org.opends.guitools.controlpanel.ui.components.SuperiorObjectClassesEditor} class.
 */
public interface SuperiorObjectClassesChangedListener
{
opendj-server-legacy/src/main/java/org/opends/server/api/Backupable.java
@@ -11,7 +11,7 @@
 * Header, with the fields enclosed by brackets [] replaced by your own identifying
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2015 ForgeRock AS.
 * Copyright 2015-2016 ForgeRock AS.
 */
package org.opends.server.api;
@@ -53,7 +53,7 @@
 * Actions taken before and after the restore should be handled in the {@code beforeRestore()} and
 * {@link #afterRestore(Path, Path)} methods.
 *
 * @see {@link BackupManager}
 * @see org.opends.server.util.BackupManager
 */
public interface Backupable
{
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/Importer.java
@@ -40,7 +40,7 @@
  /**
   * Creates a record with the provided key and value in the tree identified by the provided name. At the end of this
   * method, the record is visible by {@link read(TreeName, ByteSequence)} and {@link openCursor(TreeName)} methods of
   * method, the record is visible by {@link #read(TreeName, ByteSequence)} and {@link #openCursor(TreeName)} methods of
   * this instance. The record is guaranteed to be persisted only after {@link #close()}.
   *
   * @param treeName
@@ -65,7 +65,7 @@
  /**
   * Opens a cursor on the tree whose name is provided. Cursors are predictable only if there is no pending
   * {@link put(TreeName, ByteSequence, ByteSequence)} operations. Indeed, once opened, cursors might not reflect
   * {@link #put(TreeName, ByteSequence, ByteSequence)} operations. Indeed, once opened, cursors might not reflect
   * changes.
   *
   * @param treeName
opendj-server-legacy/src/main/java/org/opends/server/core/AccountStatusNotificationHandlerConfigManager.java
@@ -24,18 +24,18 @@
import java.util.concurrent.ConcurrentHashMap;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.util.Utils;
import org.forgerock.opendj.config.ClassPropertyDefinition;
import org.forgerock.opendj.config.server.ConfigChangeResult;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.config.server.ConfigurationAddListener;
import org.forgerock.opendj.config.server.ConfigurationChangeListener;
import org.forgerock.opendj.config.server.ConfigurationDeleteListener;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.server.config.meta.AccountStatusNotificationHandlerCfgDefn;
import org.forgerock.opendj.server.config.server.AccountStatusNotificationHandlerCfg;
import org.forgerock.opendj.server.config.server.RootCfg;
import org.forgerock.util.Utils;
import org.opends.server.api.AccountStatusNotificationHandler;
import org.forgerock.opendj.config.server.ConfigChangeResult;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.InitializationException;
/**
@@ -52,7 +52,7 @@
          ConfigurationDeleteListener <AccountStatusNotificationHandlerCfg>
{
  /** A mapping between the DNs of the config entries and the associated notification handlers. */
  private final ConcurrentHashMap<DN,AccountStatusNotificationHandler> notificationHandlers;
  private final ConcurrentHashMap<DN, AccountStatusNotificationHandler<?>> notificationHandlers;
  private final ServerContext serverContext;
@@ -150,7 +150,7 @@
    // Get the configuration entry DN and the associated handler class.
    DN configEntryDN = configuration.dn();
    AccountStatusNotificationHandler handler = notificationHandlers.get(configEntryDN);
    AccountStatusNotificationHandler<?> handler = notificationHandlers.get(configEntryDN);
    // If the new configuration has the notification handler disabled,
    // then remove it from the mapping list and clean it.
@@ -382,17 +382,12 @@
   * @param configEntryDN  the DN of the configuration entry associated to
   *                       the notification handler to remove
   */
  private void uninstallNotificationHandler(
      DN configEntryDN
      )
  private void uninstallNotificationHandler(DN configEntryDN)
  {
    AccountStatusNotificationHandler handler =
        notificationHandlers.remove (configEntryDN);
    AccountStatusNotificationHandler<?> handler = notificationHandlers.remove(configEntryDN);
    if (handler != null)
    {
      DirectoryServer.deregisterAccountStatusNotificationHandler (
          configEntryDN
          );
      DirectoryServer.deregisterAccountStatusNotificationHandler(configEntryDN);
      handler.finalizeStatusNotificationHandler();
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/core/CertificateMapperConfigManager.java
@@ -25,19 +25,19 @@
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.util.Utils;
import org.forgerock.opendj.config.ClassPropertyDefinition;
import org.forgerock.opendj.config.server.ConfigChangeResult;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.config.server.ConfigurationAddListener;
import org.forgerock.opendj.config.server.ConfigurationChangeListener;
import org.forgerock.opendj.config.server.ConfigurationDeleteListener;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.server.config.meta.CertificateMapperCfgDefn;
import org.forgerock.opendj.server.config.server.CertificateMapperCfg;
import org.forgerock.opendj.server.config.server.RootCfg;
import org.forgerock.util.Utils;
import org.opends.server.api.CertificateMapper;
import org.forgerock.opendj.config.server.ConfigChangeResult;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.InitializationException;
/**
@@ -55,7 +55,7 @@
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /** A mapping between the DNs of the config entries and the associated certificate mappers. */
  private ConcurrentHashMap<DN,CertificateMapper> certificateMappers;
  private ConcurrentHashMap<DN, CertificateMapper<?>> certificateMappers;
  private final ServerContext serverContext;
@@ -102,8 +102,7 @@
        String className = mapperConfiguration.getJavaClass();
        try
        {
          CertificateMapper mapper = loadMapper(className, mapperConfiguration,
                                                true);
          CertificateMapper<?> mapper = loadMapper(className, mapperConfiguration, true);
          certificateMappers.put(mapperConfiguration.dn(), mapper);
          DirectoryServer.registerCertificateMapper(mapperConfiguration.dn(), mapper);
        }
@@ -154,7 +153,7 @@
      return ccr;
    }
    CertificateMapper certificateMapper = null;
    CertificateMapper<?> certificateMapper = null;
    // Get the name of the class and make sure we can instantiate it as a
    // certificate mapper.
@@ -196,8 +195,7 @@
    DirectoryServer.deregisterCertificateMapper(configuration.dn());
    CertificateMapper certificateMapper =
         certificateMappers.remove(configuration.dn());
    CertificateMapper<?> certificateMapper = certificateMappers.remove(configuration.dn());
    if (certificateMapper != null)
    {
      certificateMapper.finalizeCertificateMapper();
@@ -238,8 +236,7 @@
    final ConfigChangeResult ccr = new ConfigChangeResult();
    // Get the existing mapper if it's already enabled.
    CertificateMapper existingMapper =
         certificateMappers.get(configuration.dn());
    CertificateMapper<?> existingMapper = certificateMappers.get(configuration.dn());
    // If the new configuration has the mapper disabled, then disable it if it
    // is enabled, or do nothing if it's already disabled.
@@ -249,8 +246,7 @@
      {
        DirectoryServer.deregisterCertificateMapper(configuration.dn());
        CertificateMapper certificateMapper =
             certificateMappers.remove(configuration.dn());
        CertificateMapper<?> certificateMapper = certificateMappers.remove(configuration.dn());
        if (certificateMapper != null)
        {
          certificateMapper.finalizeCertificateMapper();
@@ -276,7 +272,7 @@
      return ccr;
    }
    CertificateMapper certificateMapper = null;
    CertificateMapper<?> certificateMapper = null;
    try
    {
      certificateMapper = loadMapper(className, configuration, true);
@@ -312,7 +308,7 @@
   * @throws  InitializationException  If a problem occurred while attempting to
   *                                   initialize the certificate mapper.
   */
  private CertificateMapper loadMapper(String className,
  private CertificateMapper<?> loadMapper(String className,
                                       CertificateMapperCfg configuration,
                                       boolean initialize)
          throws InitializationException
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -868,7 +868,7 @@
      try
      {
        directoryServer.initializePlugins(Collections.EMPTY_SET);
        directoryServer.initializePlugins(Collections.<PluginType> emptySet());
      }
      catch (Exception e)
      {
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/LDAPContext.java
@@ -19,7 +19,7 @@
import org.forgerock.services.context.AbstractContext;
import org.forgerock.services.context.Context;
/** Context provided by this LDAP server to the embedded {@link HttpApplication}s. */
/** Context provided by this LDAP server to the embedded {@link org.forgerock.http.HttpApplication}s. */
public final class LDAPContext extends AbstractContext
{
  private final ConnectionFactory ldapConnectionFactory;
@@ -31,9 +31,9 @@
  }
  /**
   * Get the {@link LDAPConnectionFactory} attached to this context.
   * Get the {@link org.forgerock.opendj.ldap.LDAPConnectionFactory} attached to this context.
   *
   * @return The {@link LDAPConnectionFactory} attached to this context.
   * @return The {@link org.forgerock.opendj.ldap.LDAPConnectionFactory} attached to this context.
   */
  public ConnectionFactory getLdapConnectionFactory()
  {
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/api/ReplicationDomainDB.java
@@ -35,8 +35,9 @@
 *  <li>Across all replicaDBs of a domain, provided a {@link ServerState}</li>
 *  <li>On one replica DB for a domain and serverId, provided a CSN</li>
 * </ul>
 * The cursor starting point is specified by providing a key, a {@link KeyMatchingStrategy} and
 * a {@link PositionStrategy}.
 * The cursor starting point is specified by providing a key,
 * a {@link org.opends.server.replication.server.changelog.api.DBCursor.KeyMatchingStrategy} and
 * a {@link org.opends.server.replication.server.changelog.api.DBCursor.PositionStrategy}.
 */
public interface ReplicationDomainDB
{
opendj-server-legacy/src/main/java/org/opends/server/schema/AuthPasswordSyntax.java
@@ -89,7 +89,7 @@
  /**
   * Decodes the provided authentication password value into its component parts.
   * <p>
   * FIXME this is a duplicate of {@link org.forgerock.opendj.ldap.schema.AuthPasswordSyntaxImplTest}
   * FIXME this is a duplicate of {@link org.forgerock.opendj.ldap.schema.AuthPasswordSyntaxImpl}
   *
   * @param  authPasswordValue  The authentication password value to be decoded.
   * @return  A three-element array, containing the scheme, authInfo, and
opendj-server-legacy/src/main/java/org/opends/server/tools/LDAPAuthenticationHandler.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2006-2009 Sun Microsystems, Inc.
 * Portions Copyright 2012-2015 ForgeRock AS.
 * Portions Copyright 2012-2016 ForgeRock AS.
 */
package org.opends.server.tools;
@@ -57,18 +57,17 @@
import org.opends.server.protocols.ldap.ExtendedRequestProtocolOp;
import org.opends.server.protocols.ldap.ExtendedResponseProtocolOp;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.types.LDAPException;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.util.Base64;
import static com.forgerock.opendj.cli.ArgumentConstants.*;
import static org.opends.messages.ToolMessages.*;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static com.forgerock.opendj.cli.ArgumentConstants.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
/**
 * This class provides a generic interface that LDAP clients can use to perform
 * various kinds of authentication to the Directory Server.  This handles both
@@ -1019,15 +1018,6 @@
                            message, bindResponse2.getMatchedDN(), null);
  }
  /**
   * @param saslProperties
   * @param authID
   * @param name
   * @return
   * @throws ClientException
   */
  private String getAuthID(Map<String, List<String>> saslProperties, String authID, String name) throws ClientException
  {
    List<String> values = saslProperties.get(name);
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
@@ -761,7 +761,7 @@
   * Creates a new attribute builder with an undefined attribute type
   * and user-provided name. The attribute type, and optionally the
   * user-provided name, must be defined using
   * {@link #setAttributeType(AttributeType)} before the attribute
   * {@link #setAttributeDescription(AttributeDescription)} before the attribute
   * builder can be converted to an {@link Attribute}. Failure to do
   * so will yield an {@link IllegalStateException}.
   */
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeParser.java
@@ -32,8 +32,7 @@
/**
 * A fluent API for parsing attributes as different types of object. An
 * attribute parser is obtained from an entry using the method
 * {@link Entry#parseAttribute} or from an attribute using
 * {@link Attribute#parse}.
 * {@link Entry#parseAttribute}.
 * <p>
 * Methods throw an {@code IllegalArgumentException} when a value cannot be
 * parsed (e.g. because its syntax is invalid). Methods which return a
@@ -55,7 +54,6 @@
 * </pre>
 *
 * @see Entry#parseAttribute
 * @see Attribute#parse
 */
public final class AttributeParser {
    // TODO: enums, filters, rdns?
opendj-server-legacy/src/main/java/org/opends/server/util/BackupManager.java
@@ -76,7 +76,7 @@
/**
 * A backup manager for any entity that is backupable (backend, storage).
 *
 * @see {@link Backupable}
 * @see Backupable
 */
public class BackupManager
{
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
@@ -1489,11 +1489,8 @@
                        element, i));
                return false;
              }
              else
              {
                lastWasDot = true;
              }
            }
            else
            {
              // This is an illegal character.
@@ -1577,22 +1574,18 @@
    InetAddress address, int port,
    boolean allowReuse)
  {
    // Return pessimistic.
    boolean isInUse = true;
    Socket clientSocket = null;
    ServerSocket serverSocket = null;
    try {
      // HACK:
      // With dual stacks we can have a situation when INADDR_ANY/PORT
      // is bound in TCP4 space but available in TCP6 space and since
      // JavaServerSocket implemantation will always use TCP46 on dual
      // JavaServerSocket implementation will always use TCP46 on dual
      // stacks the bind below will always succeed in such cases thus
      // shadowing anything that is already bound to INADDR_ANY/PORT.
      // While technically correct, with IPv4 and IPv6 being separate
      // address spaces, it presents a problem to end users because a
      // common case scenario is to have a single service serving both
      // address spaces ie listening to the same port in both spaces
      // on wildcard addresses 0 and ::. ServerSocket implemantation
      // on wildcard addresses 0 and ::. ServerSocket implementation
      // does not provide any means of working with each address space
      // separately such as doing TCP4 or TCP6 only binds thus we have
      // to do a dummy connect to INADDR_ANY/PORT to check if it is
@@ -1600,48 +1593,37 @@
      // addresses as specific IPv4 or IPv6 addresses will always be
      // handled in their respective address space.
      if (address.isAnyLocalAddress()) {
        clientSocket = new Socket();
        try {
        try (Socket clientSocket = new Socket()) {
          // This might fail on some stacks but this is the best we
          // can do. No need for explicit timeout since it is local
          // address and we have to know for sure unless it fails.
          clientSocket.connect(new InetSocketAddress(address, port));
        } catch (IOException e) {
        // Expected, ignore.
        }
        if (clientSocket.isConnected()) {
          return true;
        }
        } catch (IOException ignore) {
          // ignore.
      }
      serverSocket = new ServerSocket();
      }
      try (ServerSocket serverSocket = new ServerSocket()) {
      serverSocket.setReuseAddress(allowReuse);
      serverSocket.bind(new InetSocketAddress(address, port));
      isInUse = false;
    } catch (IOException e) {
      isInUse = true;
    } finally {
      try {
        if (serverSocket != null) {
          serverSocket.close();
        return false;
        }
      } catch (Exception e) {}
      try {
        if (clientSocket != null) {
          clientSocket.close();
    } catch (IOException ignore) {
      // no-op
        }
      } catch (Exception e) {}
    }
    return isInUse;
    return true;
  }
  /**
   * Returns a lower-case string representation of a given string, verifying for null input string.
   * {@see com.forgerock.opendj.util.StaticUtils#toLowerCase(String s)}
   *
   * @param s the mixed case string
   * @return a lower-case string
   * @see com.forgerock.opendj.util.StaticUtils#toLowerCase(String)
   */
  public static String toLowerCase(String s)
  {
@@ -1651,7 +1633,6 @@
  /**
   * Appends a lower-case string representation of a given ByteSequence to a StringBuilder,
   * verifying for null input.
   * {@see com.forgerock.opendj.util.StaticUtils#toLowerCase(ByteSequence s, StringBuilder string)}
   *
   * @param  b       The byte array for which to obtain the lowercase string
   *                 representation.
@@ -1659,6 +1640,7 @@
   *                 be appended.
   * @param  trim    Indicates whether leading and trailing spaces should be
   *                 omitted from the string representation.
   * @see com.forgerock.opendj.util.StaticUtils#toLowerCase(ByteSequence, StringBuilder)}
   */
  public static void toLowerCase(ByteSequence b, StringBuilder buffer, boolean trim)
  {
@@ -2252,16 +2234,7 @@
  public static File getFileForPath(String path)
  {
    File f = new File (path);
    if (f.isAbsolute())
    {
      return f;
    }
    else
    {
      return new File(DirectoryServer.getInstanceRoot() + File.separator +
          path);
    }
    return f.isAbsolute() ? f : new File(DirectoryServer.getInstanceRoot(), path);
  }
  /**
@@ -2280,16 +2253,7 @@
  public static File getFileForPath(String path, ServerContext serverContext)
  {
    File f = new File (path);
    if (f.isAbsolute())
    {
      return f;
    }
    else
    {
      return new File(serverContext.getInstanceRoot() + File.separator +
          path);
    }
    return f.isAbsolute() ? f : new File(serverContext.getInstanceRoot(), path);
  }
@@ -2653,10 +2617,7 @@
          // We've been blocked for too long.
          return false;
        }
        else
        {
          waitTime = stopTime - currentTime;
        }
        Iterator<SelectionKey> iterator =
            selector.selectedKeys().iterator();
@@ -2868,7 +2829,7 @@
   * @return {@code true} if message corresponds to descriptor
   */
  public static boolean hasDescriptor(LocalizableMessage msg,
      LocalizableMessageDescriptor.Arg1 desc)
      LocalizableMessageDescriptor.Arg1<?> desc)
  {
    return msg.ordinal() == desc.ordinal()
        && msg.resourceName().equals(desc.resourceName());
@@ -2884,7 +2845,7 @@
   * @return {@code true} if message corresponds to descriptor
   */
  public static boolean hasDescriptor(LocalizableMessage msg,
      LocalizableMessageDescriptor.Arg2 desc)
      LocalizableMessageDescriptor.Arg2<?, ?> desc)
  {
    return msg.ordinal() == desc.ordinal()
        && msg.resourceName().equals(desc.resourceName());
@@ -2900,7 +2861,7 @@
   * @return {@code true} if message corresponds to descriptor
   */
  public static boolean hasDescriptor(LocalizableMessage msg,
      LocalizableMessageDescriptor.Arg3 desc)
      LocalizableMessageDescriptor.Arg3<?, ?, ?> desc)
  {
    return msg.ordinal() == desc.ordinal()
        && msg.resourceName().equals(desc.resourceName());
@@ -2916,7 +2877,7 @@
   * @return {@code true} if message corresponds to descriptor
   */
  public static boolean hasDescriptor(LocalizableMessage msg,
      LocalizableMessageDescriptor.Arg7 desc)
      LocalizableMessageDescriptor.Arg7<?, ?, ?, ?, ?, ?, ?> desc)
  {
    return msg.ordinal() == desc.ordinal()
        && msg.resourceName().equals(desc.resourceName());
opendj-server-legacy/src/main/resources/java-stubs/org/opends/server/util/DynamicConstants.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2006-2009 Sun Microsystems, Inc.
 * Portions Copyright 2011-2015 ForgeRock AS.
 * Portions Copyright 2011-2016 ForgeRock AS.
 */
package org.opends.server.util;
@@ -28,80 +28,41 @@
     mayInvoke=true)
public final class DynamicConstants
{
  /**
   * The official full product name for the Directory Server.
   */
  /** The official full product name for the Directory Server. */
  public static String PRODUCT_NAME = "${project.name}";
  /**
   * The short product name for the Directory Server.
   */
  /** The short product name for the Directory Server. */
  public static String SHORT_NAME = "${product.name}";
  /**
   * The major version number for the Directory Server.
   */
  /** The major version number for the Directory Server. */
  public static int MAJOR_VERSION = ${parsedVersion.majorVersion};
  /**
   * The minor version number for the Directory Server.
   */
  /** The minor version number for the Directory Server. */
  public static int MINOR_VERSION = ${parsedVersion.minorVersion};
  /**
   * The point version number for the Directory Server.
   */
  /** The point version number for the Directory Server. */
  public static int POINT_VERSION = ${parsedVersion.incrementalVersion};
  /**
   * The official build number for the Directory Server.
   */
  /** The official build number for the Directory Server. s*/
  public static int BUILD_NUMBER = ${parsedVersion.buildNumber};
  /**
   * The version qualifier string for the Directory Server.
   */
  /** The version qualifier string for the Directory Server. */
  public static String VERSION_QUALIFIER = "${parsedVersion.qualifier}";
  /**
   * The set of bug IDs for fixes included in this build of the Directory
   * Server.
   */
  /** The set of bug IDs for fixes included in this build of the Directory Server. */
  public static String FIX_IDS = "${patchFixIds}";
  /**
   * The build ID for the generated build of the Directory Server.
   */
  /** The build ID for the generated build of the Directory Server. */
  public static String BUILD_ID = "${buildDateTime}";
  /**
   * The username of the user that created this build.
   */
  /** The username of the user that created this build. */
  public static String BUILD_USER = "${user.name}";
  /**
   * The Java version used to generate this build.
   */
  /** The Java version used to generate this build. */
  public static String BUILD_JAVA_VERSION = "${java.version}";
  /**
   * The vendor for the Java version used to generate this build.
   */
  /** The vendor for the Java version used to generate this build. */
  public static String BUILD_JAVA_VENDOR = "${java.vendor}";
  /**
   * The JVM version used to generate this build.
   */
  /** The JVM version used to generate this build. */
  public static String BUILD_JVM_VERSION = "${java.vm.version}";
  /**
   * The vendor for the JVM used to generate this build.
   */
  /** The vendor for the JVM used to generate this build. */
  public static String BUILD_JVM_VENDOR = "${java.vm.vendor}";
  /**
   * The operating system on which this build was generated.
   */
  /** The operating system on which this build was generated. */
  public static String BUILD_OS = "${os.name} ${os.version} ${os.arch}";
  /**
@@ -114,51 +75,24 @@
  /** The revision on which this build is based. */
  public static String REVISION = "${buildRevision}";
  /**
   * The Subversion url repository location on which this build is based.
   */
  public static String URL_REPOSITORY =
      "${scm.url}";
  /** The version control url repository location on which this build is based. */
  public static String URL_REPOSITORY = "${scm.url}";
  /** The documentation home. */
  public static String DOC_REFERENCE_HOME = "${docHomepageUrl}";
  /** The documentation url. */
  public static String DOC_REFERENCE_WIKI = "${docWikiUrl}";
  /** The documentation url. */
  public static String DOC_QUICK_REFERENCE_GUIDE = "${docGuideRefUrl}";
  /**
   * The documentation home.
   */
  public static String DOC_REFERENCE_HOME =
      "${docHomepageUrl}";
   /** The administration guide. */
   public static String ADMINISTRATION_GUIDE_URL = "${docGuideAdminUrl}";
  /**
   * The documentation url.
   */
  public static String DOC_REFERENCE_WIKI =
      "${docWikiUrl}";
  /**
   * The documentation url.
   */
  public static String DOC_QUICK_REFERENCE_GUIDE =
      "${docGuideRefUrl}";
  /**
   * The administration guide.
   */
   public static String ADMINISTRATION_GUIDE_URL =
      "${docGuideAdminUrl}";
  /**
   * A string representation of the version number.
   */
  /** A string representation of the version number. */
  public static String VERSION_NUMBER_STRING = String.format("%s.%s.%s", MAJOR_VERSION, MINOR_VERSION, POINT_VERSION);
  /**
   * A string representation of the version number.
   */
  /** A string representation of the version number. */
  public static String OPENDJ_NUMBER_STRING = VERSION_NUMBER_STRING;
  /**
   * A string representation of the release version.
   */
  public static String RELEASE_VERSION_STRING =
       OPENDJ_NUMBER_STRING;
  /** A string representation of the release version. */
  public static String RELEASE_VERSION_STRING = OPENDJ_NUMBER_STRING;
  /**
@@ -168,9 +102,8 @@
   */
  static {
     try {
        Class c = Class.forName("org.opends.server.util.ReleaseDefinition");
        Class<?> c = Class.forName("org.opends.server.util.ReleaseDefinition");
        Object obj = c.newInstance();
        try {
@@ -271,28 +204,20 @@
                 + OPENDJ_NUMBER_STRING + ")" ;
        }
        catch (Exception ex) {}
      } catch (Exception ex) {
      } catch (Exception ex) {}
      }
  }
   /**
   * A compact version string for this product, suitable for use in path
   * names and similar cases.
   */
  /** A compact version string for this product, suitable for use in path names and similar cases. */
  public static String COMPACT_VERSION_STRING =
       SHORT_NAME + "-" + VERSION_NUMBER_STRING;
  /**
   * A full version string for this product.
   */
  /** A full version string for this product. */
  public static String FULL_VERSION_STRING = PRODUCT_NAME + " " + RELEASE_VERSION_STRING
      + (VERSION_QUALIFIER != null && !VERSION_QUALIFIER.isEmpty() ? "-" + VERSION_QUALIFIER : "")
      + (FIX_IDS != null && !FIX_IDS.isEmpty() ? "+" + FIX_IDS : "");
  /**
   * A printable version string for this product.
   */
  /** A printable version string for this product. */
  public static final String PRINTABLE_VERSION_STRING =
       FULL_VERSION_STRING + System.getProperty("line.separator") +
       "Build " + BUILD_ID + System.getProperty("line.separator");
}
opendj-server/src/main/java/org/forgerock/opendj/server/core/ArchivableDataProvider.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2008 Sun Microsystems, Inc.
 * Portions Copyright 2013-2014 ForgeRock AS.
 * Portions Copyright 2013-2016 ForgeRock AS.
 */
package org.forgerock.opendj.server.core;
@@ -26,11 +26,11 @@
 * <p>
 * TODO: do we need removeBackup?
 * <p>
 * TODO: is there any boiler plate code that abstracted in order to make
 * implementation simpler? E.g. initialization, crypto.
 * TODO: is there any boiler plate code that abstracted in order to make implementation simpler?
 * E.g. initialization, crypto.
 * <p>
 * FIXME: the async APIs used below are a bad fit. We do not want to return an
 * {@link LdapException}. We really need a more generic promises API.
 * {@link org.forgerock.opendj.ldap.LdapException}. We really need a more generic promises API.
 */
public interface ArchivableDataProvider {
opendj-server/src/main/java/org/forgerock/opendj/server/core/ExportableDataProvider.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2008 Sun Microsystems, Inc.
 * Portions Copyright 2013-2014 ForgeRock AS.
 * Portions Copyright 2013-2016 ForgeRock AS.
 */
package org.forgerock.opendj.server.core;
@@ -24,7 +24,7 @@
 * A data provider which supports LDIF export functionality.
 * <p>
 * FIXME: the async APIs used below are a bad fit. We do not want to return an
 * {@link LdapException}. We really need a more generic promises API.
 * {@link org.forgerock.opendj.ldap.LdapException}. We really need a more generic promises API.
 */
public interface ExportableDataProvider {
opendj-server/src/main/java/org/forgerock/opendj/server/core/ImportableDataProvider.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2008 Sun Microsystems, Inc.
 * Portions Copyright 2013-2014 ForgeRock AS.
 * Portions Copyright 2013-2016 ForgeRock AS.
 */
package org.forgerock.opendj.server.core;
@@ -24,14 +24,13 @@
 * A data provider which supports LDIF import functionality.
 * <p>
 * FIXME: the async APIs used below are a bad fit. We do not want to return an
 * {@link LdapException}. We really need a more generic promises API.
 * {@link org.forgerock.opendj.ldap.LdapException}. We really need a more generic promises API.
 * <p>
 * FIXME: it would be nice if we can use EntryReader, however we may need to
 * provide an optimized implementation for use in multi-threaded imports. E.g.
 * performing DN checking as early as possible before doing schema validation.
 * FIXME: it would be nice if we can use EntryReader, however we may need to provide an optimized
 * implementation for use in multi-threaded imports. E.g. performing DN checking as early as
 * possible before doing schema validation.
 * <p>
 * FIXME: import allows you to append, merge, replace entries. Do we need to
 * expose that here?
 * FIXME: import allows you to append, merge, replace entries. Do we need to expose that here?
 */
public interface ImportableDataProvider {