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 2008 Sun Microsystems, Inc. 015 * Portions Copyright 2011-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 abstract class wraps/decorates a given modify operation. 027 * This class will be extended by sub-classes to enhance the 028 * functionality of the ModifyOperationBasis. 029 */ 030public abstract class ModifyOperationWrapper extends 031 OperationWrapper<ModifyOperation> implements ModifyOperation 032{ 033 /** 034 * Creates a new modify operation based on the provided modify operation. 035 * 036 * @param modify The modify operation to wrap 037 */ 038 protected ModifyOperationWrapper(ModifyOperation modify) 039 { 040 super(modify); 041 } 042 043 @Override 044 public void addModification(Modification modification) 045 throws DirectoryException 046 { 047 getOperation().addModification(modification); 048 } 049 050 @Override 051 public void addRawModification(RawModification rawModification) 052 { 053 getOperation().addRawModification(rawModification); 054 } 055 056 @Override 057 public DN getEntryDN() 058 { 059 return getOperation().getEntryDN(); 060 } 061 062 @Override 063 public List<Modification> getModifications() 064 { 065 return getOperation().getModifications(); 066 } 067 068 @Override 069 public ByteString getRawEntryDN() 070 { 071 return getOperation().getRawEntryDN(); 072 } 073 074 @Override 075 public List<RawModification> getRawModifications() 076 { 077 return getOperation().getRawModifications(); 078 } 079 080 @Override 081 public void setRawEntryDN(ByteString rawEntryDN) 082 { 083 getOperation().setRawEntryDN(rawEntryDN); 084 } 085 086 @Override 087 public void setRawModifications(List<RawModification> rawModifications) 088 { 089 getOperation().setRawModifications(rawModifications); 090 } 091 092 @Override 093 public String toString() 094 { 095 return getOperation().toString(); 096 } 097}