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.types.operation;
028    
029    
030    
031    import java.util.List;
032    
033    import org.opends.server.types.AttributeValue;
034    import org.opends.server.types.ByteString;
035    import org.opends.server.types.DirectoryException;
036    import org.opends.server.types.DN;
037    import org.opends.server.types.Entry;
038    import org.opends.server.types.Modification;
039    import org.opends.server.types.RawModification;
040    
041    
042    
043    /**
044     * This class defines a set of methods that are available for use by
045     * pre-operation plugins for modify operations.  Note that this
046     * interface is intended only to define an API for use by plugins and
047     * is not intended to be implemented by any custom classes.
048     */
049    @org.opends.server.types.PublicAPI(
050         stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
051         mayInstantiate=false,
052         mayExtend=false,
053         mayInvoke=true)
054    public interface PreOperationModifyOperation
055           extends PreOperationOperation
056    {
057      /**
058       * Retrieves the raw, unprocessed entry DN as included in the client
059       * request.  The DN that is returned may or may not be a valid DN,
060       * since no validation will have been performed upon it.
061       *
062       * @return  The raw, unprocessed entry DN as included in the client
063       *          request.
064       */
065      public ByteString getRawEntryDN();
066    
067    
068    
069      /**
070       * Retrieves the DN of the entry to modify.
071       *
072       * @return  The DN of the entry to modify.
073       */
074      public DN getEntryDN();
075    
076    
077    
078      /**
079       * Retrieves the set of raw, unprocessed modifications as included
080       * in the client request.  Note that this may contain one or more
081       * invalid modifications, as no validation will have been performed
082       * on this information.  The list returned must not be altered by
083       * the caller.
084       *
085       * @return  The set of raw, unprocessed modifications as included
086       *          in the client request.
087       */
088      public List<RawModification> getRawModifications();
089    
090    
091    
092      /**
093       * Retrieves the set of modifications for this modify operation.
094       Its contents should not be altered.
095       *
096       * @return  The set of modifications for this modify operation.
097       */
098      public List<Modification> getModifications();
099    
100    
101    
102      /**
103       * Adds the provided modification to the set of modifications to
104       * this modify operation.  Note that this will be called after the
105       * schema and access control processing, so the caller must be
106       * careful to avoid making any changes that will violate schema or
107       * access control constraints.
108       *
109       * @param  modification  The modification to add to the set of
110       *                       changes for this modify operation.
111       *
112       * @throws  DirectoryException  If an unexpected problem occurs
113       *                              while applying the modification to
114       *                              the entry.
115       */
116      public void addModification(Modification modification)
117             throws DirectoryException;
118    
119    
120    
121      /**
122       * Retrieves the current entry before any modifications are applied.
123       * It should not be modified by the caller.
124       *
125       * @return  The current entry before any modifications are applied.
126       */
127      public Entry getCurrentEntry();
128    
129    
130    
131      /**
132       * Retrieves the modified entry that is to be written to the
133       * backend.  This entry should not be modified directly, but should
134       * only be altered through the <CODE>addModification</CODE> method.
135       *
136       * @return  The modified entry that is to be written to the backend.
137       */
138      public Entry getModifiedEntry();
139    
140    
141    
142      /**
143       * Retrieves the set of clear-text current passwords for the user,
144       * if available.  This will only be available if the modify
145       * operation contains one or more delete elements that target the
146       * password attribute and provide the values to delete in the clear.
147       * This list should not be altered by the caller.
148       *
149       * @return  The set of clear-text current password values as
150       *          provided in the modify request, or <CODE>null</CODE> if
151       *          there were none.
152       */
153      public List<AttributeValue> getCurrentPasswords();
154    
155    
156    
157      /**
158       * Retrieves the set of clear-text new passwords for the user, if
159       * available.  This will only be available if the modify operation
160       * contains one or more add or replace elements that target the
161       * password attribute and provide the values in the clear.  This
162       * list should not be altered by the caller.
163       *
164       * @return  The set of clear-text new passwords as provided in the
165       *          modify request, or <CODE>null</CODE> if there were none.
166       */
167      public List<AttributeValue> getNewPasswords();
168    }
169