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 2007-2008 Sun Microsystems, Inc. 025 */ 026package org.forgerock.opendj.config.server; 027 028import org.forgerock.i18n.LocalizableMessage; 029import org.forgerock.opendj.config.Configuration; 030 031import java.util.List; 032 033/** 034 * This interface defines the methods that a Directory Server configurable 035 * component should implement if it wishes to be able to receive notifications 036 * when a its associated configuration is changed. 037 * 038 * @param <T> 039 * The type of configuration that this listener should be notified 040 * about. 041 */ 042public interface ConfigurationChangeListener<T extends Configuration> { 043 044 /** 045 * Indicates whether the proposed change to the configuration is acceptable 046 * to this change listener. 047 * 048 * @param configuration 049 * The new configuration containing the changes. 050 * @param unacceptableReasons 051 * A list that can be used to hold messages about why the 052 * provided configuration is not acceptable. 053 * @return Returns <code>true</code> if the proposed change is acceptable, 054 * or <code>false</code> if it is not. 055 */ 056 boolean isConfigurationChangeAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons); 057 058 /** 059 * Applies the configuration changes to this change listener. 060 * 061 * @param configuration 062 * The new configuration containing the changes. 063 * @return Returns information about the result of changing the 064 * configuration. 065 */ 066 ConfigChangeResult applyConfigurationChange(T configuration); 067}