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.client; 017 018 019 020import java.util.Collection; 021import java.util.SortedSet; 022import org.forgerock.opendj.config.ManagedObjectDefinition; 023import org.forgerock.opendj.config.PropertyException; 024import org.forgerock.opendj.ldap.DN; 025import org.forgerock.opendj.ldap.schema.AttributeType; 026import org.forgerock.opendj.server.config.server.RegularExpressionIdentityMapperCfg; 027 028 029 030/** 031 * A client-side interface for reading and modifying Regular 032 * Expression Identity Mapper settings. 033 * <p> 034 * The Regular Expression Identity Mapper provides a way to use a 035 * regular expression to translate the provided identifier when 036 * searching for the appropriate user entry. 037 */ 038public interface RegularExpressionIdentityMapperCfgClient extends IdentityMapperCfgClient { 039 040 /** 041 * Get the configuration definition associated with this Regular Expression Identity Mapper. 042 * 043 * @return Returns the configuration definition associated with this Regular Expression Identity Mapper. 044 */ 045 ManagedObjectDefinition<? extends RegularExpressionIdentityMapperCfgClient, ? extends RegularExpressionIdentityMapperCfg> definition(); 046 047 048 049 /** 050 * Gets the "java-class" property. 051 * <p> 052 * Specifies the fully-qualified name of the Java class that 053 * provides the Regular Expression Identity Mapper implementation. 054 * 055 * @return Returns the value of the "java-class" property. 056 */ 057 String getJavaClass(); 058 059 060 061 /** 062 * Sets the "java-class" property. 063 * <p> 064 * Specifies the fully-qualified name of the Java class that 065 * provides the Regular Expression Identity Mapper implementation. 066 * 067 * @param value The value of the "java-class" property. 068 * @throws PropertyException 069 * If the new value is invalid. 070 */ 071 void setJavaClass(String value) throws PropertyException; 072 073 074 075 /** 076 * Gets the "match-attribute" property. 077 * <p> 078 * Specifies the name or OID of the attribute whose value should 079 * match the provided identifier string after it has been processed 080 * by the associated regular expression. 081 * <p> 082 * All values must refer to the name or OID of an attribute type 083 * defined in the directory server schema. If multiple attributes or 084 * OIDs are provided, at least one of those attributes must contain 085 * the provided ID string value in exactly one entry. 086 * 087 * @return Returns the values of the "match-attribute" property. 088 */ 089 SortedSet<AttributeType> getMatchAttribute(); 090 091 092 093 /** 094 * Sets the "match-attribute" property. 095 * <p> 096 * Specifies the name or OID of the attribute whose value should 097 * match the provided identifier string after it has been processed 098 * by the associated regular expression. 099 * <p> 100 * All values must refer to the name or OID of an attribute type 101 * defined in the directory server schema. If multiple attributes or 102 * OIDs are provided, at least one of those attributes must contain 103 * the provided ID string value in exactly one entry. 104 * 105 * @param values The values of the "match-attribute" property. 106 * @throws PropertyException 107 * If one or more of the new values are invalid. 108 */ 109 void setMatchAttribute(Collection<AttributeType> values) throws PropertyException; 110 111 112 113 /** 114 * Gets the "match-base-dn" property. 115 * <p> 116 * Specifies the base DN(s) that should be used when performing 117 * searches to map the provided ID string to a user entry. If 118 * multiple values are given, searches are performed below all the 119 * specified base DNs. 120 * 121 * @return Returns the values of the "match-base-dn" property. 122 */ 123 SortedSet<DN> getMatchBaseDN(); 124 125 126 127 /** 128 * Sets the "match-base-dn" property. 129 * <p> 130 * Specifies the base DN(s) that should be used when performing 131 * searches to map the provided ID string to a user entry. If 132 * multiple values are given, searches are performed below all the 133 * specified base DNs. 134 * 135 * @param values The values of the "match-base-dn" property. 136 * @throws PropertyException 137 * If one or more of the new values are invalid. 138 */ 139 void setMatchBaseDN(Collection<DN> values) throws PropertyException; 140 141 142 143 /** 144 * Gets the "match-pattern" property. 145 * <p> 146 * Specifies the regular expression pattern that is used to identify 147 * portions of the ID string that will be replaced. 148 * <p> 149 * Any portion of the ID string that matches this pattern is 150 * replaced in accordance with the provided replace pattern (or is 151 * removed if no replace pattern is specified). If multiple 152 * substrings within the given ID string match this pattern, all 153 * occurrences are replaced. If no part of the given ID string 154 * matches this pattern, the ID string is not altered. Exactly one 155 * match pattern value must be provided, and it must be a valid 156 * regular expression as described in the API documentation for the 157 * java.util.regex.Pattern class, including support for capturing 158 * groups. 159 * 160 * @return Returns the value of the "match-pattern" property. 161 */ 162 String getMatchPattern(); 163 164 165 166 /** 167 * Sets the "match-pattern" property. 168 * <p> 169 * Specifies the regular expression pattern that is used to identify 170 * portions of the ID string that will be replaced. 171 * <p> 172 * Any portion of the ID string that matches this pattern is 173 * replaced in accordance with the provided replace pattern (or is 174 * removed if no replace pattern is specified). If multiple 175 * substrings within the given ID string match this pattern, all 176 * occurrences are replaced. If no part of the given ID string 177 * matches this pattern, the ID string is not altered. Exactly one 178 * match pattern value must be provided, and it must be a valid 179 * regular expression as described in the API documentation for the 180 * java.util.regex.Pattern class, including support for capturing 181 * groups. 182 * 183 * @param value The value of the "match-pattern" property. 184 * @throws PropertyException 185 * If the new value is invalid. 186 */ 187 void setMatchPattern(String value) throws PropertyException; 188 189 190 191 /** 192 * Gets the "replace-pattern" property. 193 * <p> 194 * Specifies the replacement pattern that should be used for 195 * substrings in the ID string that match the provided regular 196 * expression pattern. 197 * <p> 198 * If no replacement pattern is provided, then any matching portions 199 * of the ID string will be removed (i.e., replaced with an empty 200 * string). The replacement pattern may include a string from a 201 * capturing group by using a dollar sign ($) followed by an integer 202 * value that indicates which capturing group should be used. 203 * 204 * @return Returns the value of the "replace-pattern" property. 205 */ 206 String getReplacePattern(); 207 208 209 210 /** 211 * Sets the "replace-pattern" property. 212 * <p> 213 * Specifies the replacement pattern that should be used for 214 * substrings in the ID string that match the provided regular 215 * expression pattern. 216 * <p> 217 * If no replacement pattern is provided, then any matching portions 218 * of the ID string will be removed (i.e., replaced with an empty 219 * string). The replacement pattern may include a string from a 220 * capturing group by using a dollar sign ($) followed by an integer 221 * value that indicates which capturing group should be used. 222 * 223 * @param value The value of the "replace-pattern" property. 224 * @throws PropertyException 225 * If the new value is invalid. 226 */ 227 void setReplacePattern(String value) throws PropertyException; 228 229}