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 /** 035 * Creates a new modify operation based on the provided modify operation. 036 * 037 * @param modify The modify operation to wrap 038 */ 039 protected ModifyOperationWrapper(ModifyOperation modify) 040 { 041 super(modify); 042 } 043 044 /** {@inheritDoc} */ 045 @Override 046 public void addModification(Modification modification) 047 throws DirectoryException 048 { 049 getOperation().addModification(modification); 050 } 051 052 /** {@inheritDoc} */ 053 @Override 054 public void addRawModification(RawModification rawModification) 055 { 056 getOperation().addRawModification(rawModification); 057 } 058 059 /** {@inheritDoc} */ 060 @Override 061 public DN getEntryDN() 062 { 063 return getOperation().getEntryDN(); 064 } 065 066 /** {@inheritDoc} */ 067 @Override 068 public List<Modification> getModifications() 069 { 070 return getOperation().getModifications(); 071 } 072 073 /** {@inheritDoc} */ 074 @Override 075 public ByteString getRawEntryDN() 076 { 077 return getOperation().getRawEntryDN(); 078 } 079 080 /** {@inheritDoc} */ 081 @Override 082 public List<RawModification> getRawModifications() 083 { 084 return getOperation().getRawModifications(); 085 } 086 087 /** {@inheritDoc} */ 088 @Override 089 public void setRawEntryDN(ByteString rawEntryDN) 090 { 091 getOperation().setRawEntryDN(rawEntryDN); 092 } 093 094 /** {@inheritDoc} */ 095 @Override 096 public void setRawModifications(List<RawModification> rawModifications) 097 { 098 getOperation().setRawModifications(rawModifications); 099 } 100 101 /** {@inheritDoc} */ 102 @Override 103 public String toString() 104 { 105 return getOperation().toString(); 106 } 107 108}