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.core; 018 019import java.util.List; 020 021import org.opends.server.types.*; 022import org.forgerock.opendj.ldap.ByteString; 023import org.forgerock.opendj.ldap.DN; 024 025/** 026 * This interface defines an operation used to modify an entry in 027 * the Directory Server. 028 */ 029public interface ModifyOperation extends Operation 030{ 031 /** 032 * Retrieves the raw, unprocessed entry DN as included in the client request. 033 * The DN that is returned may or may not be a valid DN, since no validation 034 * will have been performed upon it. 035 * 036 * @return The raw, unprocessed entry DN as included in the client request. 037 */ 038 ByteString getRawEntryDN(); 039 040 /** 041 * Specifies the raw, unprocessed entry DN as included in the client request. 042 * This should only be called by pre-parse plugins. 043 * 044 * @param rawEntryDN The raw, unprocessed entry DN as included in the client 045 * request. 046 */ 047 void setRawEntryDN(ByteString rawEntryDN); 048 049 /** 050 * Retrieves the DN of the entry to modify. This should not be called by 051 * pre-parse plugins because the processed DN will not be available yet. 052 * Instead, they should call the <CODE>getRawEntryDN</CODE> method. 053 * 054 * @return The DN of the entry to modify, or <CODE>null</CODE> if the raw 055 * entry DN has not yet been processed. 056 */ 057 DN getEntryDN(); 058 059 /** 060 * Retrieves the set of raw, unprocessed modifications as included in the 061 * client request. Note that this may contain one or more invalid 062 * modifications, as no validation will have been performed on this 063 * information. The list returned must not be altered by the caller. 064 * 065 * @return The set of raw, unprocessed modifications as included in the 066 * client request. 067 */ 068 List<RawModification> getRawModifications(); 069 070 /** 071 * Adds the provided modification to the set of raw modifications for this 072 * modify operation. This must only be called by pre-parse plugins. 073 * 074 * @param rawModification The modification to add to the set of raw 075 * modifications for this modify operation. 076 */ 077 void addRawModification(RawModification rawModification); 078 079 /** 080 * Specifies the raw modifications for this modify operation. 081 * 082 * @param rawModifications The raw modifications for this modify operation. 083 */ 084 void setRawModifications(List<RawModification> rawModifications); 085 086 /** 087 * Retrieves the set of modifications for this modify operation. Its contents 088 * should not be altered. It will not be available to pre-parse plugins. 089 * 090 * @return The set of modifications for this modify operation, or 091 * <CODE>null</CODE> if the modifications have not yet been 092 * processed. 093 */ 094 List<Modification> getModifications(); 095 096 /** 097 * Adds the provided modification to the set of modifications to this modify 098 * operation. This may only be called by pre-operation plugins. 099 * 100 * @param modification The modification to add to the set of changes for 101 * this modify operation. 102 * 103 * @throws DirectoryException If an unexpected problem occurs while applying 104 * the modification to the entry. 105 */ 106 void addModification(Modification modification) throws DirectoryException; 107 108 /** 109 * Retrieves the proxied authorization DN for this operation if proxied 110 * authorization has been requested. 111 * 112 * @return The proxied authorization DN for this operation if proxied 113 * authorization has been requested, or {@code null} if proxied 114 * authorization has not been requested. 115 */ 116 @Override 117 DN getProxiedAuthorizationDN(); 118 119 /** 120 * Set the proxied authorization DN for this operation if proxied 121 * authorization has been requested. 122 * 123 * @param proxiedAuthorizationDN 124 * The proxied authorization DN for this operation if proxied 125 * authorization has been requested, or {@code null} if proxied 126 * authorization has not been requested. 127 */ 128 @Override 129 void setProxiedAuthorizationDN(DN proxiedAuthorizationDN); 130 131}