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

Jean-Noel Rouvignac
23.54.2015 b475afad809df9cb1a12aa737ee1a04a3db1be2b
Renamed openMethod local variables to importCommand.
4 files modified
45 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ImportSuffixCommand.java 22 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeBufferImporter.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeStorageImporter.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
@@ -667,8 +667,8 @@
    }
    for (DN dn : cfg.getBaseDN())
    {
      ImportSuffixCommand openMethod = new ImportSuffixCommand(dn, importConfig);
      if (openMethod.getSuffixImportStrategy() == SuffixImportStrategy.MERGE_DB_WITH_LDIF)
      ImportSuffixCommand importCommand = new ImportSuffixCommand(dn, importConfig);
      if (importCommand.getSuffixImportStrategy() == SuffixImportStrategy.MERGE_DB_WITH_LDIF)
      {
        // fail-fast to avoid ending up in an unrecoverable state for the server
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, ERR_IMPORT_UNSUPPORTED_WITH_BRANCH.get());
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ImportSuffixCommand.java
@@ -34,9 +34,10 @@
import org.opends.server.types.DirectoryException;
import org.opends.server.types.LDIFImportConfig;
 /** Command that describes how a suffix should be imported. Gives the strategy to use and the data to drive the
  * import operation of a single suffix.
  */
 /**
 * Command that describes how a suffix should be imported. Gives the strategy to use and the data to
 * drive the import operation of a single suffix.
 */
public class ImportSuffixCommand
{
  /** Strategy for importing a suffix. */
@@ -46,22 +47,17 @@
     * branches are needed, normally used for append or clear backend modes.
     */
    APPEND_OR_REPLACE,
    /**
     * Do not create a {@link Suffix}.
     */
    /** Do not create a {@link Suffix}. */
    SKIP_SUFFIX,
    /**
     * Before creating a {@link Suffix}, clear the {@link EntryContainer} of the baseDN.
     */
    /** Before creating a {@link Suffix}, clear the {@link EntryContainer} of the baseDN. */
    CLEAR_SUFFIX,
    /**
     * Create a temporary {@link EntryContainer} to merge LDIF with original data.
     */
    /** Create a temporary {@link EntryContainer} to merge LDIF with original data. */
    MERGE_DB_WITH_LDIF,
    /**
     * Create a {@link Suffix} specifying include and exclude branches and optionally a source {@link EntryContainer}.
     */
    INCLUDE_EXCLUDE_BRANCHES};
    INCLUDE_EXCLUDE_BRANCHES
  }
  private List<DN> includeBranches;
  private List<DN> excludeBranches;
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeBufferImporter.java
@@ -132,7 +132,6 @@
   * Shim that allows properly constructing an {@link OnDiskMergeBufferImporter} without polluting
   * {@link ImportStrategy} and {@link RootContainer} with this importer inner workings.
   */
  @SuppressWarnings("javadoc")
  static final class StrategyImpl implements ImportStrategy
  {
    private final PluggableBackendCfg backendCfg;
@@ -299,7 +298,6 @@
  /** Number of phase one buffers. */
  private int phaseOneBufferCount;
  @SuppressWarnings("javadoc")
  OnDiskMergeBufferImporter(RootContainer rootContainer, RebuildConfig rebuildConfig, PluggableBackendCfg cfg,
      ServerContext serverContext) throws InitializationException, StorageRuntimeException, ConfigException
  {
@@ -632,10 +630,10 @@
      throws ConfigException, DirectoryException
  {
    DN baseDN = entryContainer.getBaseDN();
    ImportSuffixCommand openMethod = new ImportSuffixCommand(baseDN, importCfg);
    ImportSuffixCommand importCommand = new ImportSuffixCommand(baseDN, importCfg);
    EntryContainer sourceEntryContainer = null;
    switch(openMethod.getSuffixImportStrategy())
    switch (importCommand.getSuffixImportStrategy())
    {
    case APPEND_OR_REPLACE:
      return new Suffix(entryContainer);
@@ -661,8 +659,8 @@
          ERR_IMPORT_UNKNOWN_SUFFIX_COMMAND_STRATEGY.get(baseDN));
    }
    return new Suffix(entryContainer, sourceEntryContainer, openMethod.getIncludeBranches(),
        openMethod.getExcludeBranches());
    return new Suffix(entryContainer, sourceEntryContainer, importCommand.getIncludeBranches(),
        importCommand.getExcludeBranches());
  }
  private static void clearSuffix(EntryContainer entryContainer)
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeStorageImporter.java
@@ -1084,7 +1084,6 @@
   * Shim that allows properly constructing an {@link OnDiskMergeStorageImporter} without polluting
   * {@link ImportStrategy} and {@link RootContainer} with this importer inner workings.
   */
  @SuppressWarnings("javadoc")
  static final class StrategyImpl implements ImportStrategy
  {
    private final PluggableBackendCfg backendCfg;
@@ -1408,10 +1407,10 @@
      throws ConfigException, DirectoryException
  {
    DN baseDN = entryContainer.getBaseDN();
    ImportSuffixCommand openMethod = new ImportSuffixCommand(baseDN, importCfg);
    ImportSuffixCommand importCommand = new ImportSuffixCommand(baseDN, importCfg);
    EntryContainer sourceEntryContainer = null;
    switch(openMethod.getSuffixImportStrategy())
    switch (importCommand.getSuffixImportStrategy())
    {
    case APPEND_OR_REPLACE:
      return new Suffix(entryContainer);
@@ -1437,8 +1436,8 @@
          ERR_IMPORT_UNKNOWN_SUFFIX_COMMAND_STRATEGY.get(baseDN));
    }
    return new Suffix(entryContainer, sourceEntryContainer, openMethod.getIncludeBranches(),
        openMethod.getExcludeBranches());
    return new Suffix(entryContainer, sourceEntryContainer, importCommand.getIncludeBranches(),
        importCommand.getExcludeBranches());
  }
  private static void clearSuffix(EntryContainer entryContainer)