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 2008 Sun Microsystems, Inc. 025 * Portions Copyright 2014-2015 ForgeRock AS 026 */ 027package org.opends.server.admin.server; 028 029import java.util.List; 030 031import org.forgerock.i18n.LocalizableMessage; 032import org.forgerock.opendj.config.server.ConfigChangeResult; 033import org.opends.server.admin.Configuration; 034 035/** 036 * This interface defines the methods that a Directory Server 037 * configurable component should implement if it wishes to be able to 038 * receive notifications when an existing server managed object is 039 * deleted. 040 * 041 * @param <T> 042 * The type of server managed object that this listener 043 * should be notified about. 044 */ 045public interface ServerManagedObjectDeleteListener<T extends Configuration> { 046 047 /** 048 * Indicates whether the proposed deletion of an existing server 049 * managed object is acceptable to this delete listener. 050 * 051 * @param mo 052 * The server managed object that will be deleted. 053 * @param unacceptableReasons 054 * A list that can be used to hold messages about why the 055 * provided server managed object is not acceptable. 056 * @return Returns <code>true</code> if the proposed deletion is 057 * acceptable, or <code>false</code> if it is not. 058 */ 059 boolean isConfigurationDeleteAcceptable( 060 ServerManagedObject<? extends T> mo, List<LocalizableMessage> unacceptableReasons); 061 062 063 064 /** 065 * Deletes an existing server managed object from this delete 066 * listener. 067 * 068 * @param mo 069 * The existing server managed object that will be deleted. 070 * @return Returns information about the result of deleting the 071 * server managed object. 072 */ 073 ConfigChangeResult applyConfigurationDelete( 074 ServerManagedObject<? extends T> mo); 075}