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 import java.util.List;
030 import java.util.Map;
031
032 import org.opends.server.types.Attribute;
033 import org.opends.server.types.AttributeType;
034 import org.opends.server.types.ByteString;
035 import org.opends.server.types.DN;
036 import org.opends.server.types.ObjectClass;
037 import org.opends.server.types.RawAttribute;
038
039
040 /**
041 * This abstract class wraps/decorates a given add operation.
042 * This class will be extended by sub-classes to enhance the
043 * functionnality of the AddOperationBasis.
044 */
045 public abstract class AddOperationWrapper extends OperationWrapper
046 implements AddOperation
047 {
048 // The wrapped operation.
049 private AddOperation add;
050
051 /**
052 * Creates a new add operation based on the provided add operation.
053 *
054 * @param add The add operation to wrap
055 */
056 public AddOperationWrapper(AddOperation add)
057 {
058 super(add);
059 this.add = add;
060 }
061
062 /**
063 * {@inheritDoc}
064 */
065 public void addObjectClass(ObjectClass objectClass, String name)
066 {
067 add.addObjectClass(objectClass, name);
068 }
069
070 /**
071 * {@inheritDoc}
072 */
073 public void addRawAttribute(RawAttribute rawAttribute)
074 {
075 add.addRawAttribute(rawAttribute);
076 }
077
078 /**
079 * {@inheritDoc}
080 */
081 public long getChangeNumber()
082 {
083 return add.getChangeNumber();
084 }
085
086 /**
087 * {@inheritDoc}
088 */
089 public DN getEntryDN()
090 {
091 return add.getEntryDN();
092 }
093
094 /**
095 * {@inheritDoc}
096 */
097 public Map<ObjectClass, String> getObjectClasses()
098 {
099 return add.getObjectClasses();
100 }
101
102 /**
103 * {@inheritDoc}
104 */
105 public Map<AttributeType, List<Attribute>> getOperationalAttributes()
106 {
107 return add.getOperationalAttributes();
108 }
109
110 /**
111 * {@inheritDoc}
112 */
113 public List<RawAttribute> getRawAttributes()
114 {
115 return add.getRawAttributes();
116 }
117
118 /**
119 * {@inheritDoc}
120 */
121 public ByteString getRawEntryDN()
122 {
123 return add.getRawEntryDN();
124 }
125
126 /**
127 * {@inheritDoc}
128 */
129 public Map<AttributeType, List<Attribute>> getUserAttributes()
130 {
131 return add.getUserAttributes();
132 }
133
134 /**
135 * {@inheritDoc}
136 */
137 public void removeAttribute(AttributeType attributeType)
138 {
139 add.removeAttribute(attributeType);
140 }
141
142 /**
143 * {@inheritDoc}
144 */
145 public void removeObjectClass(ObjectClass objectClass)
146 {
147 add.removeObjectClass(objectClass);
148 }
149
150 /**
151 * {@inheritDoc}
152 */
153 public void setAttribute(AttributeType attributeType,
154 List<Attribute> attributeList)
155 {
156 add.setAttribute(attributeType, attributeList);
157 }
158
159 /**
160 * {@inheritDoc}
161 */
162 public void setChangeNumber(long changeNumber)
163 {
164 add.setChangeNumber(changeNumber);
165 }
166
167 /**
168 * {@inheritDoc}
169 */
170 public void setRawAttributes(List<RawAttribute> rawAttributes)
171 {
172 add.setRawAttributes(rawAttributes);
173 }
174
175 /**
176 * {@inheritDoc}
177 */
178 public void setRawEntryDN(ByteString rawEntryDN)
179 {
180 add.setRawEntryDN(rawEntryDN);
181 }
182
183 /**
184 * {@inheritDoc}
185 */
186 public String toString()
187 {
188 return add.toString();
189 }
190
191 /**
192 * {@inheritDoc}
193 */
194 public DN getProxiedAuthorizationDN()
195 {
196 return add.getProxiedAuthorizationDN();
197 }
198
199 /**
200 * {@inheritDoc}
201 */
202 public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
203 {
204 add.setProxiedAuthorizationDN(proxiedAuthorizationDN);
205 }
206
207 }