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
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2006-2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.core;
028    
029    import java.util.List;
030    import org.opends.server.types.ByteString;
031    import org.opends.server.types.DN;
032    import org.opends.server.types.Entry;
033    import org.opends.server.types.Modification;
034    import org.opends.server.types.Operation;
035    import org.opends.server.types.RDN;
036    import org.opends.server.types.operation.SubordinateModifyDNOperation;
037    
038    /**
039     * This interface defines an operation used to move an entry in
040     * the Directory Server.
041     */
042    public interface ModifyDNOperation
043           extends Operation, SubordinateModifyDNOperation
044    {
045    
046      /**
047       * Retrieves the raw, unprocessed entry DN as included in the client request.
048       * The DN that is returned may or may not be a valid DN, since no validation
049       * will have been performed upon it.
050       *
051       * @return  The raw, unprocessed entry DN as included in the client request.
052       */
053      public ByteString getRawEntryDN();
054    
055      /**
056       * Specifies the raw, unprocessed entry DN as included in the client request.
057       * This should only be called by pre-parse plugins.
058       *
059       * @param  rawEntryDN  The raw, unprocessed entry DN as included in the client
060       *                     request.
061       */
062      public void setRawEntryDN(ByteString rawEntryDN);
063    
064    
065      /**
066       * Retrieves the DN of the entry to rename.  This should not be called by
067       * pre-parse plugins because the processed DN will not be available yet.
068       * Instead, they should call the <CODE>getRawEntryDN</CODE> method.
069       *
070       * @return  The DN of the entry to rename, or <CODE>null</CODE> if the raw
071       *          entry DN has not yet been processed.
072       */
073      public DN getEntryDN();
074    
075      /**
076       * Retrieves the raw, unprocessed newRDN as included in the request from the
077       * client.  This may or may not contain a valid RDN, as no validation will
078       * have been performed on it.
079       *
080       * @return  The raw, unprocessed newRDN as included in the request from the
081       *          client.
082       */
083      public ByteString getRawNewRDN();
084    
085      /**
086       * Specifies the raw, unprocessed newRDN as included in the request from the
087       * client.  This should only be called by pre-parse plugins and should not be
088       * used in later stages of processing.
089       *
090       * @param  rawNewRDN  The raw, unprocessed newRDN as included in the request
091       *                    from the client.
092       */
093      public void setRawNewRDN(ByteString rawNewRDN);
094    
095      /**
096       * Retrieves the new RDN to use for the entry.  This should not be called by
097       * pre-parse plugins, because the processed newRDN will not yet be available.
098       * Pre-parse plugins should instead use the <CODE>getRawNewRDN</CODE> method.
099       *
100       * @return  The new RDN to use for the entry, or <CODE>null</CODE> if the raw
101       *          newRDN has not yet been processed.
102       */
103      public RDN getNewRDN();
104    
105    
106      /**
107       * Indicates whether the current RDN value should be removed from the entry.
108       *
109       * @return  <CODE>true</CODE> if the current RDN value should be removed from
110       *          the entry, or <CODE>false</CODE> if not.
111       */
112      public boolean deleteOldRDN();
113    
114      /**
115       * Specifies whether the current RDN value should be removed from the entry.
116       *
117       * @param  deleteOldRDN  Specifies whether the current RDN value should be
118       *                       removed from the entry.
119       */
120      public void setDeleteOldRDN(boolean deleteOldRDN);
121    
122      /**
123       * Retrieves the raw, unprocessed newSuperior from the client request.  This
124       * may or may not contain a valid DN, as no validation will have been
125       * performed on it.
126       *
127       * @return  The raw, unprocessed newSuperior from the client request, or
128       *          <CODE>null</CODE> if there is none.
129       */
130      public ByteString getRawNewSuperior();
131    
132      /**
133       * Specifies the raw, unprocessed newSuperior for this modify DN operation, as
134       * provided in the request from the client.  This method should only be called
135       * by pre-parse plugins.
136       *
137       * @param  rawNewSuperior  The raw, unprocessed newSuperior as provided in the
138       *                         request from the client.
139       */
140      public void setRawNewSuperior(ByteString rawNewSuperior);
141    
142      /**
143       * Retrieves the newSuperior DN for the entry.  This should not be called by
144       * pre-parse plugins, because the processed DN will not yet be available at
145       * that time.  Instead, they should use the <CODE>getRawNewSuperior</CODE>
146       * method.
147       *
148       * @return  The newSuperior DN for the entry, or <CODE>null</CODE> if there is
149       *          no newSuperior DN for this request or if the raw newSuperior has
150       *          not yet been processed.
151       */
152      public DN getNewSuperior();
153    
154      /**
155       * Retrieves the new DN for the entry.
156       *
157       * @return The new DN for the entry, or <CODE>null</CODE> if there is
158       *          neither newRDN, nor entryDN for this request.
159       */
160      public DN getNewDN();
161    
162      /**
163       * Retrieves the set of modifications applied to attributes of the target
164       * entry in the course of processing this modify DN operation.  This will
165       * include attribute-level changes from the modify DN itself (e.g., removing
166       * old RDN values if deleteOldRDN is set, or adding new RDN values that don't
167       * already exist), but it may also be used by pre-operation plugins to cause
168       * additional changes in the entry.  In this case, those plugins may add
169       * modifications to this list (they may not remove existing modifications) if
170       * any changes should be processed in addition to the core modify DN
171       * processing.  Backends may read this list to identify which attribute-level
172       * changes were applied in order to more easily apply updates to attribute
173       * indexes.
174       *
175       * @return  The set of modifications applied to attributes during the course
176       *          of the modify DN processing, or <CODE>null</CODE> if that
177       *          information is not yet available (e.g., during pre-parse plugins).
178       */
179      public List<Modification> getModifications();
180    
181      /**
182       * Adds the provided modification to the set of modifications to be applied
183       * as part of the update.  This should only be called by pre-operation
184       * plugins.
185       *
186       * @param  modification  The modification to add to the set of modifications
187       *                       to apply to the entry.
188       */
189      public void addModification(Modification modification);
190    
191      /**
192       * Retrieves the current entry, before it is renamed.  This will not be
193       * available to pre-parse plugins or during the conflict resolution portion of
194       * the synchronization processing.
195       *
196       * @return  The current entry, or <CODE>null</CODE> if it is not yet
197       *           available.
198       */
199      public Entry getOriginalEntry();
200    
201    
202      /**
203       * Retrieves the new entry, as it will appear after it is renamed.  This will
204       * not be  available to pre-parse plugins or during the conflict resolution
205       * portion of the synchronization processing.
206       *
207       * @return  The updated entry, or <CODE>null</CODE> if it is not yet
208       *           available.
209       */
210      public Entry getUpdatedEntry();
211    
212      /**
213       * Retrieves the change number that has been assigned to this operation.
214       *
215       * @return  The change number that has been assigned to this operation, or -1
216       *          if none has been assigned yet or if there is no applicable
217       *          synchronization mechanism in place that uses change numbers.
218       */
219      public long getChangeNumber();
220    
221    
222      /**
223       * Specifies the change number that has been assigned to this operation by the
224       * synchronization mechanism.
225       *
226       * @param  changeNumber  The change number that has been assigned to this
227       *                       operation by the synchronization mechanism.
228       */
229      public void setChangeNumber(long changeNumber);
230    
231    
232      /**
233       * Retrieves the proxied authorization DN for this operation if proxied
234       * authorization has been requested.
235       *
236       * @return  The proxied authorization DN for this operation if proxied
237       *          authorization has been requested, or {@code null} if proxied
238       *          authorization has not been requested.
239       */
240      public DN getProxiedAuthorizationDN();
241    
242    
243      /**
244       * Sets the proxied authorization DN for this operation if proxied
245       * authorization has been requested.
246       *
247       * @param dn  The proxied authorization DN for this operation if proxied
248       *            authorization has been requested, or {@code null} if proxied
249       *            authorization has not been requested.
250       */
251      public void setProxiedAuthorizationDN(DN dn);
252    
253    }