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 legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2006-2008 Sun Microsystems, Inc. 025 * Portions Copyright 2014 ForgeRock AS 026 */ 027package org.opends.server.core; 028 029import java.util.List; 030 031import org.opends.server.types.*; 032import org.forgerock.opendj.ldap.ByteString; 033 034/** 035 * This interface defines an operation used to modify an entry in 036 * the Directory Server. 037 */ 038public interface ModifyOperation extends Operation 039{ 040 /** 041 * Retrieves the raw, unprocessed entry DN as included in the client request. 042 * The DN that is returned may or may not be a valid DN, since no validation 043 * will have been performed upon it. 044 * 045 * @return The raw, unprocessed entry DN as included in the client request. 046 */ 047 ByteString getRawEntryDN(); 048 049 /** 050 * Specifies the raw, unprocessed entry DN as included in the client request. 051 * This should only be called by pre-parse plugins. 052 * 053 * @param rawEntryDN The raw, unprocessed entry DN as included in the client 054 * request. 055 */ 056 void setRawEntryDN(ByteString rawEntryDN); 057 058 /** 059 * Retrieves the DN of the entry to modify. This should not be called by 060 * pre-parse plugins because the processed DN will not be available yet. 061 * Instead, they should call the <CODE>getRawEntryDN</CODE> method. 062 * 063 * @return The DN of the entry to modify, or <CODE>null</CODE> if the raw 064 * entry DN has not yet been processed. 065 */ 066 DN getEntryDN(); 067 068 /** 069 * Retrieves the set of raw, unprocessed modifications as included in the 070 * client request. Note that this may contain one or more invalid 071 * modifications, as no validation will have been performed on this 072 * information. The list returned must not be altered by the caller. 073 * 074 * @return The set of raw, unprocessed modifications as included in the 075 * client request. 076 */ 077 List<RawModification> getRawModifications(); 078 079 /** 080 * Adds the provided modification to the set of raw modifications for this 081 * modify operation. This must only be called by pre-parse plugins. 082 * 083 * @param rawModification The modification to add to the set of raw 084 * modifications for this modify operation. 085 */ 086 void addRawModification(RawModification rawModification); 087 088 /** 089 * Specifies the raw modifications for this modify operation. 090 * 091 * @param rawModifications The raw modifications for this modify operation. 092 */ 093 void setRawModifications(List<RawModification> rawModifications); 094 095 /** 096 * Retrieves the set of modifications for this modify operation. Its contents 097 * should not be altered. It will not be available to pre-parse plugins. 098 * 099 * @return The set of modifications for this modify operation, or 100 * <CODE>null</CODE> if the modifications have not yet been 101 * processed. 102 */ 103 List<Modification> getModifications(); 104 105 /** 106 * Adds the provided modification to the set of modifications to this modify 107 * operation. This may only be called by pre-operation plugins. 108 * 109 * @param modification The modification to add to the set of changes for 110 * this modify operation. 111 * 112 * @throws DirectoryException If an unexpected problem occurs while applying 113 * the modification to the entry. 114 */ 115 void addModification(Modification modification) throws DirectoryException; 116 117 /** 118 * Retrieves the proxied authorization DN for this operation if proxied 119 * authorization has been requested. 120 * 121 * @return The proxied authorization DN for this operation if proxied 122 * authorization has been requested, or {@code null} if proxied 123 * authorization has not been requested. 124 */ 125 DN getProxiedAuthorizationDN(); 126 127 /** 128 * Set the proxied authorization DN for this operation if proxied 129 * authorization has been requested. 130 * 131 * @param proxiedAuthorizationDN 132 * The proxied authorization DN for this operation if proxied 133 * authorization has been requested, or {@code null} if proxied 134 * authorization has not been requested. 135 */ 136 void setProxiedAuthorizationDN(DN proxiedAuthorizationDN); 137 138}