001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.server.config.client;
017
018
019
020import java.util.Collection;
021import java.util.SortedSet;
022import org.forgerock.opendj.config.ConfigurationClient;
023import org.forgerock.opendj.config.ManagedObjectDefinition;
024import org.forgerock.opendj.config.PropertyException;
025import org.forgerock.opendj.ldap.schema.AttributeType;
026import org.forgerock.opendj.server.config.meta.BackendIndexCfgDefn.IndexType;
027import org.forgerock.opendj.server.config.server.BackendIndexCfg;
028
029
030
031/**
032 * A client-side interface for reading and modifying Backend Index
033 * settings.
034 * <p>
035 * Backend Indexes are used to store information that makes it
036 * possible to locate entries very quickly when processing search
037 * operations.
038 */
039public interface BackendIndexCfgClient extends ConfigurationClient {
040
041  /**
042   * Get the configuration definition associated with this Backend Index.
043   *
044   * @return Returns the configuration definition associated with this Backend Index.
045   */
046  ManagedObjectDefinition<? extends BackendIndexCfgClient, ? extends BackendIndexCfg> definition();
047
048
049
050  /**
051   * Gets the "attribute" property.
052   * <p>
053   * Specifies the name of the attribute for which the index is to be
054   * maintained.
055   *
056   * @return Returns the value of the "attribute" property.
057   */
058  AttributeType getAttribute();
059
060
061
062  /**
063   * Sets the "attribute" property.
064   * <p>
065   * Specifies the name of the attribute for which the index is to be
066   * maintained.
067   * <p>
068   * This property is read-only and can only be modified during
069   * creation of a Backend Index.
070   *
071   * @param value The value of the "attribute" property.
072   * @throws PropertyException
073   *           If the new value is invalid.
074   * @throws PropertyException
075   *           If this Backend Index is not being initialized.
076   */
077  void setAttribute(AttributeType value) throws PropertyException, PropertyException;
078
079
080
081  /**
082   * Gets the "confidentiality-enabled" property.
083   * <p>
084   * Specifies whether contents of the index should be confidential.
085   * <p>
086   * Setting the flag to true will hash keys for equality type indexes
087   * using SHA-1 and encrypt the list of entries matching a substring
088   * key for substring indexes.
089   *
090   * @return Returns the value of the "confidentiality-enabled" property.
091   */
092  boolean isConfidentialityEnabled();
093
094
095
096  /**
097   * Sets the "confidentiality-enabled" property.
098   * <p>
099   * Specifies whether contents of the index should be confidential.
100   * <p>
101   * Setting the flag to true will hash keys for equality type indexes
102   * using SHA-1 and encrypt the list of entries matching a substring
103   * key for substring indexes.
104   *
105   * @param value The value of the "confidentiality-enabled" property.
106   * @throws PropertyException
107   *           If the new value is invalid.
108   */
109  void setConfidentialityEnabled(Boolean value) throws PropertyException;
110
111
112
113  /**
114   * Gets the "index-entry-limit" property.
115   * <p>
116   * Specifies the maximum number of entries that are allowed to match
117   * a given index key before that particular index key is no longer
118   * maintained.
119   * <p>
120   * This is analogous to the ALL IDs threshold in the Sun Java System
121   * Directory Server. If this is specified, its value overrides the JE
122   * backend-wide configuration. For no limit, use 0 for the value.
123   *
124   * @return Returns the value of the "index-entry-limit" property.
125   */
126  Integer getIndexEntryLimit();
127
128
129
130  /**
131   * Sets the "index-entry-limit" property.
132   * <p>
133   * Specifies the maximum number of entries that are allowed to match
134   * a given index key before that particular index key is no longer
135   * maintained.
136   * <p>
137   * This is analogous to the ALL IDs threshold in the Sun Java System
138   * Directory Server. If this is specified, its value overrides the JE
139   * backend-wide configuration. For no limit, use 0 for the value.
140   *
141   * @param value The value of the "index-entry-limit" property.
142   * @throws PropertyException
143   *           If the new value is invalid.
144   */
145  void setIndexEntryLimit(Integer value) throws PropertyException;
146
147
148
149  /**
150   * Gets the "index-extensible-matching-rule" property.
151   * <p>
152   * The extensible matching rule in an extensible index.
153   * <p>
154   * An extensible matching rule must be specified using either LOCALE
155   * or OID of the matching rule.
156   *
157   * @return Returns the values of the "index-extensible-matching-rule" property.
158   */
159  SortedSet<String> getIndexExtensibleMatchingRule();
160
161
162
163  /**
164   * Sets the "index-extensible-matching-rule" property.
165   * <p>
166   * The extensible matching rule in an extensible index.
167   * <p>
168   * An extensible matching rule must be specified using either LOCALE
169   * or OID of the matching rule.
170   *
171   * @param values The values of the "index-extensible-matching-rule" property.
172   * @throws PropertyException
173   *           If one or more of the new values are invalid.
174   */
175  void setIndexExtensibleMatchingRule(Collection<String> values) throws PropertyException;
176
177
178
179  /**
180   * Gets the "index-type" property.
181   * <p>
182   * Specifies the type(s) of indexing that should be performed for
183   * the associated attribute.
184   * <p>
185   * For equality, presence, and substring index types, the associated
186   * attribute type must have a corresponding matching rule.
187   *
188   * @return Returns the values of the "index-type" property.
189   */
190  SortedSet<IndexType> getIndexType();
191
192
193
194  /**
195   * Sets the "index-type" property.
196   * <p>
197   * Specifies the type(s) of indexing that should be performed for
198   * the associated attribute.
199   * <p>
200   * For equality, presence, and substring index types, the associated
201   * attribute type must have a corresponding matching rule.
202   *
203   * @param values The values of the "index-type" property.
204   * @throws PropertyException
205   *           If one or more of the new values are invalid.
206   */
207  void setIndexType(Collection<IndexType> values) throws PropertyException;
208
209
210
211  /**
212   * Gets the "substring-length" property.
213   * <p>
214   * The length of substrings in a substring index.
215   *
216   * @return Returns the value of the "substring-length" property.
217   */
218  int getSubstringLength();
219
220
221
222  /**
223   * Sets the "substring-length" property.
224   * <p>
225   * The length of substrings in a substring index.
226   *
227   * @param value The value of the "substring-length" property.
228   * @throws PropertyException
229   *           If the new value is invalid.
230   */
231  void setSubstringLength(Integer value) throws PropertyException;
232
233}