001/* 002 * Copyright 2012-2019 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2015-2019 Ping Identity Corporation 007 * 008 * This program is free software; you can redistribute it and/or modify 009 * it under the terms of the GNU General Public License (GPLv2 only) 010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 011 * as published by the Free Software Foundation. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Public License for more details. 017 * 018 * You should have received a copy of the GNU General Public License 019 * along with this program; if not, see <http://www.gnu.org/licenses>. 020 */ 021package com.unboundid.ldap.sdk.unboundidds; 022 023 024 025import com.unboundid.ldap.sdk.DN; 026import com.unboundid.ldap.sdk.ReadOnlyEntry; 027import com.unboundid.util.Extensible; 028import com.unboundid.util.ThreadSafety; 029import com.unboundid.util.ThreadSafetyLevel; 030 031 032 033/** 034 * This interface defines an API that may be implemented by classes which wish 035 * to be notified of processing performed in the course of moving a subtree 036 * between servers. 037 * <BR> 038 * <BLOCKQUOTE> 039 * <B>NOTE:</B> This class, and other classes within the 040 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 041 * supported for use against Ping Identity, UnboundID, and 042 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 043 * for proprietary functionality or for external specifications that are not 044 * considered stable or mature enough to be guaranteed to work in an 045 * interoperable way with other types of LDAP servers. 046 * </BLOCKQUOTE> 047 */ 048@Extensible() 049@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE) 050public interface MoveSubtreeListener 051{ 052 /** 053 * Performs any processing which may be needed before the provided entry is 054 * added to the target server. 055 * 056 * @param entry A read-only representation of the entry to be added to the 057 * target server. 058 * 059 * @return The original entry if the add should proceed without changes, a 060 * new entry (which must have the same DN as the provided entry) if 061 * the entry should be added with changes, or {@code null} if the 062 * entry should not be added to the target server (but will still be 063 * removed from the source server). 064 */ 065 ReadOnlyEntry doPreAddProcessing(ReadOnlyEntry entry); 066 067 068 069 /** 070 * Performs any processing which may be needed after the provided entry has 071 * been added to the target server. 072 * 073 * @param entry A read-only representation of the entry that was added to 074 * the target server. Note that depending on the algorithm 075 * used to perform the move, the entry may not yet be 076 * accessible in the target server. Also note that the add may 077 * potentially be reverted if move processing encounters an 078 * error later in its processing. 079 */ 080 void doPostAddProcessing(ReadOnlyEntry entry); 081 082 083 084 /** 085 * Performs any processing which may be needed before the specified entry is 086 * deleted from the source server. 087 * 088 * @param entryDN The DN of the entry that is to be removed from the 089 * source server. Note that depending on the algorithm used 090 * to perform the move, the entry may already be inaccessible 091 * in the source server. 092 */ 093 void doPreDeleteProcessing(DN entryDN); 094 095 096 097 /** 098 * Performs any processing which may be needed after the specified entry has 099 * been deleted from the source server. 100 * 101 * @param entryDN The DN of the entry that has been removed from the source 102 * server. Note that the delete may potentially be reverted 103 * if move processing encounters an error later in its 104 * processing. 105 */ 106 void doPostDeleteProcessing(DN entryDN); 107}