001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2006-2008 Sun Microsystems, Inc.
025 *      Portions Copyright 2014-2015 ForgeRock AS
026 */
027package org.opends.server.backends;
028
029import java.util.ArrayList;
030import java.util.List;
031
032import org.forgerock.util.Reject;
033import org.opends.server.types.DN;
034
035/**
036 * This class represents the configuration of a JE backend verification process.
037 */
038public class VerifyConfig
039{
040  /** The base DN to be verified. */
041  private DN baseDN;
042  /** The names of indexes to be verified for completeness. */
043  private ArrayList<String> completeList = new ArrayList<>();
044  /** The names of indexes to be verified for cleanliness. */
045  private ArrayList<String> cleanList = new ArrayList<>();
046
047  /**
048   * Get the base DN to be verified.
049   * @return The base DN to be verified.
050   */
051  public DN getBaseDN()
052  {
053    return baseDN;
054  }
055
056  /**
057   * Set the base DN to be verified.
058   * @param baseDN The base DN to be verified.
059   */
060  public void setBaseDN(DN baseDN)
061  {
062    this.baseDN = baseDN;
063  }
064
065  /**
066   * Get the names of indexes to be verified for completeness.
067   * @return The names of indexes to be verified for completeness.
068   */
069  public List<String> getCompleteList()
070  {
071    return completeList;
072  }
073
074  /**
075   * Add the name of an index to those indexes to be verified for completeness.
076   * @param index The name of an index to be verified for completeness.
077   */
078  public void addCompleteIndex(String index)
079  {
080    Reject.ifNull(index);
081    completeList.add(index);
082  }
083
084  /**
085   * Get the names of indexes to be verified for cleanliness.
086   * @return The names of indexes to be verified for cleanliness.
087   */
088  public List<String> getCleanList()
089  {
090    return cleanList;
091  }
092
093  /**
094   * Add the name of an index to those indexes to be verified for cleanliness.
095   * @param index The name of an index to be verified for cleanliness.
096   */
097  public void addCleanIndex(String index)
098  {
099    Reject.ifNull(index);
100    cleanList.add(index);
101  }
102}