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 2006-2008 Sun Microsystems, Inc. 015 * Portions Copyright 2014-2015 ForgeRock AS. 016 */ 017package org.opends.server.api; 018 019import org.opends.server.config.ConfigEntry; 020import org.forgerock.opendj.config.server.ConfigChangeResult; 021import org.forgerock.i18n.LocalizableMessageBuilder; 022 023/** 024 * This interface defines the methods that a Directory Server 025 * component should implement if it wishes to be able to receive 026 * notification if entries below a configuration entry are removed. 027 */ 028@org.opends.server.types.PublicAPI( 029 stability=org.opends.server.types.StabilityLevel.VOLATILE, 030 mayInstantiate=false, 031 mayExtend=true, 032 mayInvoke=false) 033public interface ConfigDeleteListener 034{ 035 /** 036 * Indicates whether it is acceptable to remove the provided 037 * configuration entry. 038 * 039 * @param configEntry The configuration entry that will be 040 * removed from the configuration. 041 * @param unacceptableReason A buffer to which this method can 042 * append a human-readable message 043 * explaining why the proposed delete is 044 * not acceptable. 045 * 046 * @return {@code true} if the proposed entry may be removed from 047 * the configuration, or {@code false} if not. 048 */ 049 boolean configDeleteIsAcceptable(ConfigEntry configEntry, 050 LocalizableMessageBuilder unacceptableReason); 051 052 053 054 /** 055 * Attempts to apply a new configuration based on the provided 056 * deleted entry. 057 * 058 * @param configEntry The new configuration entry that has been 059 * deleted. 060 * 061 * @return Information about the result of processing the 062 * configuration change. 063 */ 064 ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry); 065} 066