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 2007-2008 Sun Microsystems, Inc. 015 */ 016package org.forgerock.opendj.config.server; 017 018import org.forgerock.i18n.LocalizableMessage; 019import org.forgerock.opendj.config.Configuration; 020 021import java.util.List; 022 023/** 024 * This interface defines the methods that a Directory Server configurable 025 * component should implement if it wishes to be able to receive notifications 026 * when a new configuration is added. 027 * 028 * @param <T> 029 * The type of configuration that this listener should be notified 030 * about. 031 */ 032public interface ConfigurationAddListener<T extends Configuration> { 033 034 /** 035 * Indicates whether the proposed addition of a new configuration is 036 * acceptable to this add listener. 037 * 038 * @param configuration 039 * The configuration that will be added. 040 * @param unacceptableReasons 041 * A list that can be used to hold messages about why the 042 * provided configuration is not acceptable. 043 * @return Returns <code>true</code> if the proposed addition is acceptable, 044 * or <code>false</code> if it is not. 045 */ 046 boolean isConfigurationAddAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons); 047 048 /** 049 * Adds a new configuration to this add listener. 050 * 051 * @param configuration 052 * The configuration that will be added. 053 * @return Returns information about the result of adding the configuration. 054 */ 055 ConfigChangeResult applyConfigurationAdd(T configuration); 056}