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.DN;
026import org.forgerock.opendj.ldap.schema.AttributeType;
027import org.forgerock.opendj.server.config.meta.VirtualAttributeCfgDefn.ConflictBehavior;
028import org.forgerock.opendj.server.config.meta.VirtualAttributeCfgDefn.Scope;
029import org.forgerock.opendj.server.config.server.VirtualAttributeCfg;
030
031
032
033/**
034 * A client-side interface for reading and modifying Virtual Attribute
035 * settings.
036 * <p>
037 * Virtual Attributes are responsible for dynamically generating
038 * attribute values that appear in entries but are not persistently
039 * stored in the backend.
040 */
041public interface VirtualAttributeCfgClient extends ConfigurationClient {
042
043  /**
044   * Get the configuration definition associated with this Virtual Attribute.
045   *
046   * @return Returns the configuration definition associated with this Virtual Attribute.
047   */
048  ManagedObjectDefinition<? extends VirtualAttributeCfgClient, ? extends VirtualAttributeCfg> definition();
049
050
051
052  /**
053   * Gets the "attribute-type" property.
054   * <p>
055   * Specifies the attribute type for the attribute whose values are
056   * to be dynamically assigned by the virtual attribute.
057   *
058   * @return Returns the value of the "attribute-type" property.
059   */
060  AttributeType getAttributeType();
061
062
063
064  /**
065   * Sets the "attribute-type" property.
066   * <p>
067   * Specifies the attribute type for the attribute whose values are
068   * to be dynamically assigned by the virtual attribute.
069   *
070   * @param value The value of the "attribute-type" property.
071   * @throws PropertyException
072   *           If the new value is invalid.
073   */
074  void setAttributeType(AttributeType value) throws PropertyException;
075
076
077
078  /**
079   * Gets the "base-dn" property.
080   * <p>
081   * Specifies the base DNs for the branches containing entries that
082   * are eligible to use this virtual attribute.
083   * <p>
084   * If no values are given, then the server generates virtual
085   * attributes anywhere in the server.
086   *
087   * @return Returns the values of the "base-dn" property.
088   */
089  SortedSet<DN> getBaseDN();
090
091
092
093  /**
094   * Sets the "base-dn" property.
095   * <p>
096   * Specifies the base DNs for the branches containing entries that
097   * are eligible to use this virtual attribute.
098   * <p>
099   * If no values are given, then the server generates virtual
100   * attributes anywhere in the server.
101   *
102   * @param values The values of the "base-dn" property.
103   * @throws PropertyException
104   *           If one or more of the new values are invalid.
105   */
106  void setBaseDN(Collection<DN> values) throws PropertyException;
107
108
109
110  /**
111   * Gets the "conflict-behavior" property.
112   * <p>
113   * Specifies the behavior that the server is to exhibit for entries
114   * that already contain one or more real values for the associated
115   * attribute.
116   *
117   * @return Returns the value of the "conflict-behavior" property.
118   */
119  ConflictBehavior getConflictBehavior();
120
121
122
123  /**
124   * Sets the "conflict-behavior" property.
125   * <p>
126   * Specifies the behavior that the server is to exhibit for entries
127   * that already contain one or more real values for the associated
128   * attribute.
129   *
130   * @param value The value of the "conflict-behavior" property.
131   * @throws PropertyException
132   *           If the new value is invalid.
133   */
134  void setConflictBehavior(ConflictBehavior value) throws PropertyException;
135
136
137
138  /**
139   * Gets the "enabled" property.
140   * <p>
141   * Indicates whether the Virtual Attribute is enabled for use.
142   *
143   * @return Returns the value of the "enabled" property.
144   */
145  Boolean isEnabled();
146
147
148
149  /**
150   * Sets the "enabled" property.
151   * <p>
152   * Indicates whether the Virtual Attribute is enabled for use.
153   *
154   * @param value The value of the "enabled" property.
155   * @throws PropertyException
156   *           If the new value is invalid.
157   */
158  void setEnabled(boolean value) throws PropertyException;
159
160
161
162  /**
163   * Gets the "filter" property.
164   * <p>
165   * Specifies the search filters to be applied against entries to
166   * determine if the virtual attribute is to be generated for those
167   * entries.
168   * <p>
169   * If no values are given, then any entry is eligible to have the
170   * value generated. If one or more filters are specified, then only
171   * entries that match at least one of those filters are allowed to
172   * have the virtual attribute.
173   *
174   * @return Returns the values of the "filter" property.
175   */
176  SortedSet<String> getFilter();
177
178
179
180  /**
181   * Sets the "filter" property.
182   * <p>
183   * Specifies the search filters to be applied against entries to
184   * determine if the virtual attribute is to be generated for those
185   * entries.
186   * <p>
187   * If no values are given, then any entry is eligible to have the
188   * value generated. If one or more filters are specified, then only
189   * entries that match at least one of those filters are allowed to
190   * have the virtual attribute.
191   *
192   * @param values The values of the "filter" property.
193   * @throws PropertyException
194   *           If one or more of the new values are invalid.
195   */
196  void setFilter(Collection<String> values) throws PropertyException;
197
198
199
200  /**
201   * Gets the "group-dn" property.
202   * <p>
203   * Specifies the DNs of the groups whose members can be eligible to
204   * use this virtual attribute.
205   * <p>
206   * If no values are given, then group membership is not taken into
207   * account when generating the virtual attribute. If one or more
208   * group DNs are specified, then only members of those groups are
209   * allowed to have the virtual attribute.
210   *
211   * @return Returns the values of the "group-dn" property.
212   */
213  SortedSet<DN> getGroupDN();
214
215
216
217  /**
218   * Sets the "group-dn" property.
219   * <p>
220   * Specifies the DNs of the groups whose members can be eligible to
221   * use this virtual attribute.
222   * <p>
223   * If no values are given, then group membership is not taken into
224   * account when generating the virtual attribute. If one or more
225   * group DNs are specified, then only members of those groups are
226   * allowed to have the virtual attribute.
227   *
228   * @param values The values of the "group-dn" property.
229   * @throws PropertyException
230   *           If one or more of the new values are invalid.
231   */
232  void setGroupDN(Collection<DN> values) throws PropertyException;
233
234
235
236  /**
237   * Gets the "java-class" property.
238   * <p>
239   * Specifies the fully-qualified name of the virtual attribute
240   * provider class that generates the attribute values.
241   *
242   * @return Returns the value of the "java-class" property.
243   */
244  String getJavaClass();
245
246
247
248  /**
249   * Sets the "java-class" property.
250   * <p>
251   * Specifies the fully-qualified name of the virtual attribute
252   * provider class that generates the attribute values.
253   *
254   * @param value The value of the "java-class" property.
255   * @throws PropertyException
256   *           If the new value is invalid.
257   */
258  void setJavaClass(String value) throws PropertyException;
259
260
261
262  /**
263   * Gets the "scope" property.
264   * <p>
265   * Specifies the LDAP scope associated with base DNs for entries
266   * that are eligible to use this virtual attribute.
267   *
268   * @return Returns the value of the "scope" property.
269   */
270  Scope getScope();
271
272
273
274  /**
275   * Sets the "scope" property.
276   * <p>
277   * Specifies the LDAP scope associated with base DNs for entries
278   * that are eligible to use this virtual attribute.
279   *
280   * @param value The value of the "scope" property.
281   * @throws PropertyException
282   *           If the new value is invalid.
283   */
284  void setScope(Scope value) throws PropertyException;
285
286}