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.server;
028    
029    
030    
031    import java.util.SortedSet;
032    import org.opends.server.admin.Configuration;
033    import org.opends.server.admin.server.ConfigurationChangeListener;
034    import org.opends.server.admin.std.meta.VirtualAttributeCfgDefn.ConflictBehavior;
035    import org.opends.server.types.AttributeType;
036    import org.opends.server.types.DN;
037    
038    
039    
040    /**
041     * A server-side interface for querying Virtual Attribute settings.
042     * <p>
043     * Virtual Attributes are responsible for dynamically generating
044     * attribute values that appear in entries but are not persistently
045     * stored in the backend.
046     */
047    public interface VirtualAttributeCfg extends Configuration {
048    
049      /**
050       * Gets the configuration class associated with this Virtual Attribute.
051       *
052       * @return Returns the configuration class associated with this Virtual Attribute.
053       */
054      Class<? extends VirtualAttributeCfg> configurationClass();
055    
056    
057    
058      /**
059       * Register to be notified when this Virtual Attribute is changed.
060       *
061       * @param listener
062       *          The Virtual Attribute configuration change listener.
063       */
064      void addChangeListener(ConfigurationChangeListener<VirtualAttributeCfg> listener);
065    
066    
067    
068      /**
069       * Deregister an existing Virtual Attribute configuration change listener.
070       *
071       * @param listener
072       *          The Virtual Attribute configuration change listener.
073       */
074      void removeChangeListener(ConfigurationChangeListener<VirtualAttributeCfg> listener);
075    
076    
077    
078      /**
079       * Gets the "attribute-type" property.
080       * <p>
081       * Specifies the attribute type for the attribute whose values are
082       * to be dynamically assigned by the virtual attribute.
083       *
084       * @return Returns the value of the "attribute-type" property.
085       */
086      AttributeType getAttributeType();
087    
088    
089    
090      /**
091       * Gets the "base-dn" property.
092       * <p>
093       * Specifies the base DNs for the branches containing entries that
094       * are eligible to use this virtual attribute.
095       * <p>
096       * If no values are given, then the server generates virtual
097       * attributes anywhere in the server.
098       *
099       * @return Returns an unmodifiable set containing the values of the "base-dn" property.
100       */
101      SortedSet<DN> getBaseDN();
102    
103    
104    
105      /**
106       * Gets the "conflict-behavior" property.
107       * <p>
108       * Specifies the behavior that the server is to exhibit for entries
109       * that already contain one or more real values for the associated
110       * attribute.
111       *
112       * @return Returns the value of the "conflict-behavior" property.
113       */
114      ConflictBehavior getConflictBehavior();
115    
116    
117    
118      /**
119       * Gets the "enabled" property.
120       * <p>
121       * Indicates whether the Virtual Attribute is enabled for use.
122       *
123       * @return Returns the value of the "enabled" property.
124       */
125      boolean isEnabled();
126    
127    
128    
129      /**
130       * Gets the "filter" property.
131       * <p>
132       * Specifies the search filters to be applied against entries to
133       * determine if the virtual attribute is to be generated for those
134       * entries.
135       * <p>
136       * If no values are given, then any entry is eligible to have the
137       * value generated. If one or more filters are specified, then only
138       * entries that match at least one of those filters are allowed to
139       * have the virtual attribute.
140       *
141       * @return Returns an unmodifiable set containing the values of the "filter" property.
142       */
143      SortedSet<String> getFilter();
144    
145    
146    
147      /**
148       * Gets the "group-dn" property.
149       * <p>
150       * Specifies the DNs of the groups whose members can be eligible to
151       * use this virtual attribute.
152       * <p>
153       * If no values are given, then group membership is not taken into
154       * account when generating the virtual attribute. If one or more
155       * group DNs are specified, then only members of those groups are
156       * allowed to have the virtual attribute.
157       *
158       * @return Returns an unmodifiable set containing the values of the "group-dn" property.
159       */
160      SortedSet<DN> getGroupDN();
161    
162    
163    
164      /**
165       * Gets the "java-class" property.
166       * <p>
167       * Specifies the fully-qualified name of the virtual attribute
168       * provider class that generates the attribute values.
169       *
170       * @return Returns the value of the "java-class" property.
171       */
172      String getJavaClass();
173    
174    }