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
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.admin.std.client;
028    
029    
030    
031    import java.util.Collection;
032    import java.util.SortedSet;
033    import org.opends.server.admin.ConfigurationClient;
034    import org.opends.server.admin.IllegalPropertyValueException;
035    import org.opends.server.admin.ManagedObjectDefinition;
036    import org.opends.server.admin.std.meta.VirtualAttributeCfgDefn.ConflictBehavior;
037    import org.opends.server.admin.std.server.VirtualAttributeCfg;
038    import org.opends.server.types.AttributeType;
039    import 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     */
051    public 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 IllegalPropertyValueException
082       *           If the new value is invalid.
083       */
084      void setAttributeType(AttributeType value) throws IllegalPropertyValueException;
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 IllegalPropertyValueException
114       *           If one or more of the new values are invalid.
115       */
116      void setBaseDN(Collection<DN> values) throws IllegalPropertyValueException;
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 IllegalPropertyValueException
142       *           If the new value is invalid.
143       */
144      void setConflictBehavior(ConflictBehavior value) throws IllegalPropertyValueException;
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 IllegalPropertyValueException
166       *           If the new value is invalid.
167       */
168      void setEnabled(boolean value) throws IllegalPropertyValueException;
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 IllegalPropertyValueException
204       *           If one or more of the new values are invalid.
205       */
206      void setFilter(Collection<String> values) throws IllegalPropertyValueException;
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 IllegalPropertyValueException
240       *           If one or more of the new values are invalid.
241       */
242      void setGroupDN(Collection<DN> values) throws IllegalPropertyValueException;
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 IllegalPropertyValueException
266       *           If the new value is invalid.
267       */
268      void setJavaClass(String value) throws IllegalPropertyValueException;
269    
270    }