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