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