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.forgerock.i18n.LocalizableMessageBuilder; 020import org.forgerock.opendj.config.server.ConfigChangeResult; 021import org.opends.server.config.ConfigEntry; 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 of new entries added below a configuration entry. 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 ConfigAddListener 034{ 035 /** 036 * Indicates whether the configuration entry that will result from a 037 * proposed add is acceptable to this add listener. 038 * 039 * @param configEntry The configuration entry that will 040 * result from the requested add. 041 * @param unacceptableReason A buffer to which this method can 042 * append a human-readable message 043 * explaining why the proposed entry is 044 * not acceptable. 045 * 046 * @return {@code true} if the proposed entry contains an 047 * acceptable configuration, or {@code false} if it does 048 * not. 049 */ 050 boolean configAddIsAcceptable(ConfigEntry configEntry, 051 LocalizableMessageBuilder unacceptableReason); 052 053 /** 054 * Attempts to apply a new configuration based on the provided added 055 * entry. 056 * 057 * @param configEntry The new configuration entry that contains 058 * the configuration to apply. 059 * 060 * @return Information about the result of processing the 061 * configuration change. 062 */ 063 ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry); 064}