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