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
031 import org.opends.server.types.ByteString;
032 import org.opends.server.types.DN;
033 import org.opends.server.types.DirectoryException;
034 import org.opends.server.types.Modification;
035 import org.opends.server.types.Operation;
036 import org.opends.server.types.RawModification;
037
038 /**
039 * This interface defines an operation used to modify an entry in
040 * the Directory Server.
041 */
042 public interface ModifyOperation extends Operation
043 {
044 /**
045 * Retrieves the raw, unprocessed entry DN as included in the client request.
046 * The DN that is returned may or may not be a valid DN, since no validation
047 * will have been performed upon it.
048 *
049 * @return The raw, unprocessed entry DN as included in the client request.
050 */
051 public abstract ByteString getRawEntryDN();
052
053 /**
054 * Specifies the raw, unprocessed entry DN as included in the client request.
055 * This should only be called by pre-parse plugins.
056 *
057 * @param rawEntryDN The raw, unprocessed entry DN as included in the client
058 * request.
059 */
060 public abstract void setRawEntryDN(ByteString rawEntryDN);
061
062 /**
063 * Retrieves the DN of the entry to modify. This should not be called by
064 * pre-parse plugins because the processed DN will not be available yet.
065 * Instead, they should call the <CODE>getRawEntryDN</CODE> method.
066 *
067 * @return The DN of the entry to modify, or <CODE>null</CODE> if the raw
068 * entry DN has not yet been processed.
069 */
070 public abstract DN getEntryDN();
071
072 /**
073 * Retrieves the set of raw, unprocessed modifications as included in the
074 * client request. Note that this may contain one or more invalid
075 * modifications, as no validation will have been performed on this
076 * information. The list returned must not be altered by the caller.
077 *
078 * @return The set of raw, unprocessed modifications as included in the
079 * client request.
080 */
081 public abstract List<RawModification> getRawModifications();
082
083 /**
084 * Adds the provided modification to the set of raw modifications for this
085 * modify operation. This must only be called by pre-parse plugins.
086 *
087 * @param rawModification The modification to add to the set of raw
088 * modifications for this modify operation.
089 */
090 public abstract void addRawModification(RawModification rawModification);
091
092 /**
093 * Specifies the raw modifications for this modify operation.
094 *
095 * @param rawModifications The raw modifications for this modify operation.
096 */
097 public abstract void setRawModifications(
098 List<RawModification> rawModifications);
099
100 /**
101 * Retrieves the set of modifications for this modify operation. Its contents
102 * should not be altered. It will not be available to pre-parse plugins.
103 *
104 * @return The set of modifications for this modify operation, or
105 * <CODE>null</CODE> if the modifications have not yet been
106 * processed.
107 */
108 public abstract List<Modification> getModifications();
109
110 /**
111 * Adds the provided modification to the set of modifications to this modify
112 * operation. This may only be called by pre-operation plugins.
113 *
114 * @param modification The modification to add to the set of changes for
115 * this modify operation.
116 *
117 * @throws DirectoryException If an unexpected problem occurs while applying
118 * the modification to the entry.
119 */
120 public abstract void addModification(Modification modification)
121 throws DirectoryException;
122
123 /**
124 * Retrieves the change number that has been assigned to this operation.
125 *
126 * @return The change number that has been assigned to this operation, or -1
127 * if none has been assigned yet or if there is no applicable
128 * synchronization mechanism in place that uses change numbers.
129 */
130 public abstract long getChangeNumber();
131
132 /**
133 * Specifies the change number that has been assigned to this operation by the
134 * synchronization mechanism.
135 *
136 * @param changeNumber The change number that has been assigned to this
137 * operation by the synchronization mechanism.
138 */
139 public abstract void setChangeNumber(long changeNumber);
140
141 /**
142 * Retrieves the proxied authorization DN for this operation if proxied
143 * authorization has been requested.
144 *
145 * @return The proxied authorization DN for this operation if proxied
146 * authorization has been requested, or {@code null} if proxied
147 * authorization has not been requested.
148 */
149 public abstract DN getProxiedAuthorizationDN();
150
151 /**
152 * Set the proxied authorization DN for this operation if proxied
153 * authorization has been requested.
154 *
155 * @param proxiedAuthorizationDN
156 * The proxied authorization DN for this operation if proxied
157 * authorization has been requested, or {@code null} if proxied
158 * authorization has not been requested.
159 */
160 public abstract void setProxiedAuthorizationDN(DN proxiedAuthorizationDN);
161
162 }