SevenBitCleanPlugin.java revision 3215
2372N/A * The contents of this file are subject to the terms of the 2372N/A * Common Development and Distribution License, Version 1.0 only 2372N/A * (the "License"). You may not use this file except in compliance 2372N/A * You can obtain a copy of the license at 2372N/A * See the License for the specific language governing permissions 2372N/A * and limitations under the License. 2372N/A * When distributing Covered Code, include this CDDL HEADER in each 2372N/A * file and include the License file at 2372N/A * add the following below this CDDL HEADER, with the fields enclosed 2372N/A * by brackets "[]" replaced with your own identifying information: 2372N/A * Portions Copyright [yyyy] [name of copyright owner] 3215N/A * Copyright 2008 Sun Microsystems, Inc. 2372N/A * This class implements a Directory Server plugin that can be used to ensure 2372N/A * that the values for a specified set of attributes (optionally, below a 2372N/A * specified set of base DNs) are 7-bit clean (i.e., contain only ASCII 2372N/A * The bitmask that will be used to make the comparisons. 2372N/A * The result that should be returned if a pre-parse operation fails the 7-bit 2372N/A // The current configuration for this plugin. 2372N/A * Creates a new instance of this Directory Server plugin. Every plugin must 2372N/A * implement a default constructor (it is the only one that will be used to 2372N/A * create plugins defined in the configuration), and every plugin constructor 2372N/A * must call {@code super()} as its first element. 2372N/A // Make sure that the plugin has been enabled for the appropriate types. 2372N/A // Get the current configuration for this plugin. 2372N/A // Make sure that the entry is within the scope of this plugin. While 2372N/A // processing an LDIF import, we don't have access to the set of public 2372N/A // naming contexts defined in the server, so if no explicit set of base DNs 2372N/A // is defined, then assume that the entry is in scope. 2372N/A // The entry is out of scope, so we won't process it. 2372N/A // Make sure all configured attributes have clean values. 2372N/A // If we've gotten here, then everything is acceptable. 2372N/A // Get the current configuration for this plugin. 2372N/A // If the entry is within the scope of this plugin, then make sure all 2372N/A // configured attributes have clean values. 2372N/A // If we've gotten here, then everything is acceptable. 2372N/A // Get the current configuration for this plugin. 2372N/A // If the target entry is within the scope of this plugin, then make sure 2372N/A // all values that will be added during the modification will be acceptable. 2372N/A // These are modification types that we will process. 2372N/A // This is not a modifiation type that we will process. 2372N/A // If we've gotten here, then everything is acceptable. 2372N/A // Get the current configuration for this plugin. 2372N/A // If the target entry is within the scope of this plugin, then make sure 2372N/A // all values that will be added during the modification will be acceptable. 2372N/A // If we've gotten here, then everything is acceptable. 2372N/A * Indicates whether the provided DN is within the scope of this plugin. 2372N/A * @param config The configuration to use when making the determination. 2372N/A * @param dn The DN for which to make the determination. 2372N/A * @return {@code true} if the provided DN is within the scope of this 2372N/A * plugin, or {@code false} if not. 2372N/A * Indicates whether the provided value is 7-bit clean. 2372N/A * @param value The value for which to make the determination. 2372N/A * @return {@code true} if the provided value is 7-bit clean, or {@code false} 2372N/A // Ensure that the set of plugin types is acceptable.