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