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
010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 * Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 * Copyright 2008 Sun Microsystems, Inc.
026 */
027 package org.opends.server.core;
028
029
030 import java.util.List;
031 import org.opends.server.types.ByteString;
032 import org.opends.server.types.DN;
033 import org.opends.server.types.DirectoryException;
034 import org.opends.server.types.Modification;
035 import org.opends.server.types.RawModification;
036
037
038 /**
039 * This abstract class wraps/decorates a given modify operation.
040 * This class will be extended by sub-classes to enhance the
041 * functionnality of the ModifyOperationBasis.
042 */
043 public abstract class ModifyOperationWrapper extends OperationWrapper
044 implements ModifyOperation
045 {
046 // The wrapped operation.
047 private ModifyOperation modify;
048
049 /**
050 * Creates a new modify operation based on the provided modify operation.
051 *
052 * @param modify The modify operation to wrap
053 */
054 protected ModifyOperationWrapper(ModifyOperation modify)
055 {
056 super(modify);
057 this.modify = modify;
058 }
059
060 /**
061 * {@inheritDoc}
062 */
063 public void addModification(Modification modification)
064 throws DirectoryException
065 {
066 modify.addModification(modification);
067 }
068
069 /**
070 * {@inheritDoc}
071 */
072 public void addRawModification(RawModification rawModification)
073 {
074 modify.addRawModification(rawModification);
075 }
076
077 /**
078 * {@inheritDoc}
079 */
080 public boolean equals(Object obj)
081 {
082 return modify.equals(obj);
083 }
084
085 /**
086 * {@inheritDoc}
087 */
088 public DN getEntryDN()
089 {
090 return modify.getEntryDN();
091 }
092
093 /**
094 * {@inheritDoc}
095 */
096 public List<Modification> getModifications()
097 {
098 return modify.getModifications();
099 }
100
101 /**
102 * {@inheritDoc}
103 */
104 public ByteString getRawEntryDN()
105 {
106 return modify.getRawEntryDN();
107 }
108
109 /**
110 * {@inheritDoc}
111 */
112 public List<RawModification> getRawModifications()
113 {
114 return modify.getRawModifications();
115 }
116
117 /**
118 * {@inheritDoc}
119 */
120 public int hashCode()
121 {
122 return modify.hashCode();
123 }
124
125 /**
126 * {@inheritDoc}
127 */
128 public void setRawEntryDN(ByteString rawEntryDN)
129 {
130 modify.setRawEntryDN(rawEntryDN);
131 }
132
133 /**
134 * {@inheritDoc}
135 */
136 public void setRawModifications(List<RawModification> rawModifications)
137 {
138 modify.setRawModifications(rawModifications);
139 }
140
141 /**
142 * {@inheritDoc}
143 */
144 public String toString()
145 {
146 return modify.toString();
147 }
148
149 /**
150 * {@inheritDoc}
151 */
152 public final long getChangeNumber(){
153 return modify.getChangeNumber();
154 }
155
156 /**
157 * {@inheritDoc}
158 */
159 public void setChangeNumber(long changeNumber)
160 {
161 modify.setChangeNumber(changeNumber);
162 }
163
164 /**
165 * {@inheritDoc}
166 */
167 public DN getProxiedAuthorizationDN()
168 {
169 return modify.getProxiedAuthorizationDN();
170 }
171
172 /**
173 * {@inheritDoc}
174 */
175 public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN){
176 modify.setProxiedAuthorizationDN(proxiedAuthorizationDN);
177 }
178
179 }