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