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