ConfigAddListener.java revision bccd35904bb6c244e7eae5b7ddb28e5c295e856b
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford/*
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * CDDL HEADER START
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * The contents of this file are subject to the terms of the
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * Common Development and Distribution License, Version 1.0 only
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * (the "License"). You may not use this file except in compliance
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * with the License.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * or http://forgerock.org/license/CDDLv1.0.html.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * See the License for the specific language governing permissions
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * and limitations under the License.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * When distributing Covered Code, include this CDDL HEADER in each
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * file and include the License file at legal-notices/CDDLv1_0.txt.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * If applicable, add the following below this CDDL HEADER, with the
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * fields enclosed by brackets "[]" replaced with your own identifying
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * information:
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * Portions Copyright [yyyy] [name of copyright owner]
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
49a10b9b220f316a19b54ef6885f87936f30791cMareks Malnacs * CDDL HEADER END
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * Copyright 2006-2008 Sun Microsystems, Inc.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford */
48e27400d23e2586530cf943524e50c74d79a915Tony Bamfordpackage org.opends.server.config.spi;
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford
48e27400d23e2586530cf943524e50c74d79a915Tony Bamfordimport org.forgerock.i18n.LocalizableMessageBuilder;
48e27400d23e2586530cf943524e50c74d79a915Tony Bamfordimport org.forgerock.opendj.ldap.Entry;
48e27400d23e2586530cf943524e50c74d79a915Tony Bamfordimport org.opends.server.admin.server.ConfigChangeResult;
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford/**
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * This interface defines the methods that a Directory Server component should
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * implement if it wishes to be able to receive notification of new entries
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * added below a configuration entry.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford */
48e27400d23e2586530cf943524e50c74d79a915Tony Bamfordpublic interface ConfigAddListener {
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford /**
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * Indicates whether the configuration entry that will result from a
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * proposed add is acceptable to this add listener.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * @param configEntry
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * The configuration entry that will result from the requested
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * add.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * @param unacceptableReason
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * A buffer to which this method can append a human-readable
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * message explaining why the proposed entry is not acceptable.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * @return {@code true} if the proposed entry contains an acceptable
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * configuration, or {@code false} if it does not.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford */
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford public boolean configAddIsAcceptable(Entry configEntry, LocalizableMessageBuilder unacceptableReason);
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford /**
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * Attempts to apply a new configuration based on the provided added entry.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford *
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * @param configEntry
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * The new configuration entry that contains the configuration to
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * apply.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * @return Information about the result of processing the configuration
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford * change.
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford */
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford public ConfigChangeResult applyConfigurationAdd(Entry configEntry);
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford}
48e27400d23e2586530cf943524e50c74d79a915Tony Bamford