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.server;
027
028
029
030import java.util.SortedSet;
031import org.opends.server.admin.server.ConfigurationChangeListener;
032import org.opends.server.types.AttributeType;
033import org.opends.server.types.DN;
034
035
036
037/**
038 * A server-side interface for querying Regular Expression Identity
039 * Mapper settings.
040 * <p>
041 * The Regular Expression Identity Mapper provides a way to use a
042 * regular expression to translate the provided identifier when
043 * searching for the appropriate user entry.
044 */
045public interface RegularExpressionIdentityMapperCfg extends IdentityMapperCfg {
046
047  /**
048   * Gets the configuration class associated with this Regular Expression Identity Mapper.
049   *
050   * @return Returns the configuration class associated with this Regular Expression Identity Mapper.
051   */
052  Class<? extends RegularExpressionIdentityMapperCfg> configurationClass();
053
054
055
056  /**
057   * Register to be notified when this Regular Expression Identity Mapper is changed.
058   *
059   * @param listener
060   *          The Regular Expression Identity Mapper configuration change listener.
061   */
062  void addRegularExpressionChangeListener(ConfigurationChangeListener<RegularExpressionIdentityMapperCfg> listener);
063
064
065
066  /**
067   * Deregister an existing Regular Expression Identity Mapper configuration change listener.
068   *
069   * @param listener
070   *          The Regular Expression Identity Mapper configuration change listener.
071   */
072  void removeRegularExpressionChangeListener(ConfigurationChangeListener<RegularExpressionIdentityMapperCfg> listener);
073
074
075
076  /**
077   * Gets the "java-class" property.
078   * <p>
079   * Specifies the fully-qualified name of the Java class that
080   * provides the Regular Expression Identity Mapper implementation.
081   *
082   * @return Returns the value of the "java-class" property.
083   */
084  String getJavaClass();
085
086
087
088  /**
089   * Gets the "match-attribute" property.
090   * <p>
091   * Specifies the name or OID of the attribute whose value should
092   * match the provided identifier string after it has been processed
093   * by the associated regular expression.
094   * <p>
095   * All values must refer to the name or OID of an attribute type
096   * defined in the directory server schema. If multiple attributes or
097   * OIDs are provided, at least one of those attributes must contain
098   * the provided ID string value in exactly one entry.
099   *
100   * @return Returns an unmodifiable set containing the values of the "match-attribute" property.
101   */
102  SortedSet<AttributeType> getMatchAttribute();
103
104
105
106  /**
107   * Gets the "match-base-dn" property.
108   * <p>
109   * Specifies the base DN(s) that should be used when performing
110   * searches to map the provided ID string to a user entry. If
111   * multiple values are given, searches are performed below all the
112   * specified base DNs.
113   *
114   * @return Returns an unmodifiable set containing the values of the "match-base-dn" property.
115   */
116  SortedSet<DN> getMatchBaseDN();
117
118
119
120  /**
121   * Gets the "match-pattern" property.
122   * <p>
123   * Specifies the regular expression pattern that is used to identify
124   * portions of the ID string that will be replaced.
125   * <p>
126   * Any portion of the ID string that matches this pattern is
127   * replaced in accordance with the provided replace pattern (or is
128   * removed if no replace pattern is specified). If multiple
129   * substrings within the given ID string match this pattern, all
130   * occurrences are replaced. If no part of the given ID string
131   * matches this pattern, the ID string is not altered. Exactly one
132   * match pattern value must be provided, and it must be a valid
133   * regular expression as described in the API documentation for the
134   * java.util.regex.Pattern class, including support for capturing
135   * groups.
136   *
137   * @return Returns the value of the "match-pattern" property.
138   */
139  String getMatchPattern();
140
141
142
143  /**
144   * Gets the "replace-pattern" property.
145   * <p>
146   * Specifies the replacement pattern that should be used for
147   * substrings in the ID string that match the provided regular
148   * expression pattern.
149   * <p>
150   * If no replacement pattern is provided, then any matching portions
151   * of the ID string will be removed (i.e., replaced with an empty
152   * string). The replacement pattern may include a string from a
153   * capturing group by using a dollar sign ($) followed by an integer
154   * value that indicates which capturing group should be used.
155   *
156   * @return Returns the value of the "replace-pattern" property.
157   */
158  String getReplacePattern();
159
160}