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 2006-2008 Sun Microsystems, Inc. 015 * Portions Copyright 2014-2016 ForgeRock AS. 016 */ 017package org.opends.server.types.operation; 018 019 020 021import java.util.List; 022 023import org.forgerock.opendj.ldap.ByteString; 024import org.forgerock.opendj.ldap.DN; 025import org.opends.server.types.Entry; 026import org.opends.server.types.Modification; 027import org.forgerock.opendj.ldap.RDN; 028 029 030 031/** 032 * This class defines a set of methods that are available for use by 033 * pre-operation plugins for modify DN operations. Note that this 034 * interface is intended only to define an API for use by plugins and 035 * is not intended to be implemented by any custom classes. 036 */ 037@org.opends.server.types.PublicAPI( 038 stability=org.opends.server.types.StabilityLevel.UNCOMMITTED, 039 mayInstantiate=false, 040 mayExtend=false, 041 mayInvoke=true) 042public interface PreOperationModifyDNOperation 043 extends PreOperationOperation 044{ 045 /** 046 * Retrieves the raw, unprocessed entry DN as included in the client 047 * request. The DN that is returned may or may not be a valid DN, 048 * since no validation will have been performed upon it. 049 * 050 * @return The raw, unprocessed entry DN as included in the client 051 * request. 052 */ 053 ByteString getRawEntryDN(); 054 055 056 057 /** 058 * Retrieves the DN of the entry to rename. This should not be 059 * called by pre-parse plugins because the processed DN will not be 060 * available yet. Instead, they should call the 061 * <CODE>getRawEntryDN</CODE> method. 062 * 063 * @return The DN of the entry to rename, or <CODE>null</CODE> if 064 * the raw entry DN has not yet been processed. 065 */ 066 DN getEntryDN(); 067 068 069 070 /** 071 * Retrieves the raw, unprocessed newRDN as included in the request 072 * from the client. This may or may not contain a valid RDN, as no 073 * validation will have been performed on it. 074 * 075 * @return The raw, unprocessed newRDN as included in the request 076 * from the client. 077 */ 078 ByteString getRawNewRDN(); 079 080 081 082 /** 083 * Retrieves the new RDN to use for the entry. This should not be 084 * called by pre-parse plugins, because the processed newRDN will 085 * not yet be available. Pre-parse plugins should instead use the 086 * <CODE>getRawNewRDN</CODE> method. 087 * 088 * @return The new RDN to use for the entry, or <CODE>null</CODE> 089 * if the raw newRDN has not yet been processed. 090 */ 091 RDN getNewRDN(); 092 093 094 095 /** 096 * Indicates whether the current RDN value should be removed from 097 * the entry. 098 * 099 * @return <CODE>true</CODE> if the current RDN value should be 100 * removed from the entry, or <CODE>false</CODE> if not. 101 */ 102 boolean deleteOldRDN(); 103 104 105 106 /** 107 * Retrieves the raw, unprocessed newSuperior from the client 108 * request. This may or may not contain a valid DN, as no 109 * validation will have been performed on it. 110 * 111 * @return The raw, unprocessed newSuperior from the client 112 * request, or <CODE>null</CODE> if there is none. 113 */ 114 ByteString getRawNewSuperior(); 115 116 117 118 /** 119 * Retrieves the newSuperior DN for the entry. This should not be 120 * called by pre-parse plugins, because the processed DN will not 121 * yet be available at that time. Instead, they should use the 122 * <CODE>getRawNewSuperior</CODE> method. 123 * 124 * @return The newSuperior DN for the entry, or <CODE>null</CODE> 125 * if there is no newSuperior DN for this request or if the 126 * raw newSuperior has not yet been processed. 127 */ 128 DN getNewSuperior(); 129 130 131 132 /** 133 * Retrieves the set of modifications applied to attributes of the 134 * target entry in the course of processing this modify DN 135 * operation. This will include attribute-level changes from the 136 * modify DN itself (e.g., removing old RDN values if deleteOldRDN 137 * is set, or adding new RDN values that don't already exist), but 138 * it may also be used by pre-operation plugins to cause additional 139 * changes in the entry. In this case, those plugins may add 140 * modifications to this list through the 141 * <CODE>addModification</CODE> method (the list returned from this 142 * method should not be modified directly) if any changes should be 143 * processed in addition to the core modify DN processing. Backends 144 * may read this list to identify which attribute-level changes were 145 * applied in order to more easily apply updates to attribute 146 * indexes. 147 * 148 * @return The set of modifications applied to attributes during 149 * the course of the modify DN processing, or 150 * <CODE>null</CODE> if that information is not yet 151 * available (e.g., during pre-parse plugins). 152 */ 153 List<Modification> getModifications(); 154 155 156 157 /** 158 * Adds the provided modification to the set of modifications to be 159 * applied as part of the update. This should only be called by 160 * pre-operation plugins. 161 * 162 * @param modification The modification to add to the set of 163 * modifications to apply to the entry. 164 */ 165 void addModification(Modification modification); 166 167 168 169 /** 170 * Retrieves the current entry, before it is renamed. This will not 171 * be available to pre-parse plugins or during the conflict 172 * resolution portion of the synchronization processing. 173 * 174 * @return The current entry, or <CODE>null</CODE> if it is not yet 175 * available. 176 */ 177 Entry getOriginalEntry(); 178 179 180 181 /** 182 * Retrieves the new entry, as it will appear after it is renamed. 183 * This will not be available to pre-parse plugins or during the 184 * conflict resolution portion of the synchronization processing. 185 * 186 * @return The updated entry, or <CODE>null</CODE> if it is not yet 187 * available. 188 */ 189 Entry getUpdatedEntry(); 190} 191