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 2006-2008 Sun Microsystems, Inc.
026 */
027 package org.opends.server.core;
028
029 import org.opends.messages.MessageBuilder;
030 import org.opends.messages.Message;
031
032 import java.util.List;
033 import java.util.Map;
034
035 import org.opends.server.api.ClientConnection;
036 import org.opends.server.types.*;
037
038
039 /**
040 * This abstract class is a generic operation wrapper intended to be
041 * subclassed by a specific operation wrapper.
042 */
043 public class OperationWrapper implements Operation
044 {
045 // The wrapped operation.
046 private Operation operation;
047
048
049 /**
050 * Creates a new generic operation wrapper.
051 *
052 * @param operation the generic operation to wrap
053 */
054 public OperationWrapper(Operation operation)
055 {
056 this.operation = operation;
057 }
058
059 /**
060 * {@inheritDoc}
061 */
062 public void addRequestControl(Control control)
063 {
064 operation.addRequestControl(control);
065 }
066
067 /**
068 * {@inheritDoc}
069 */
070 public void addResponseControl(Control control)
071 {
072 operation.addResponseControl(control);
073 }
074
075 /**
076 * {@inheritDoc}
077 */
078 public void appendAdditionalLogMessage(Message message)
079 {
080 operation.appendAdditionalLogMessage(message);
081 }
082
083 /**
084 * {@inheritDoc}
085 */
086 public void appendErrorMessage(Message message)
087 {
088 operation.appendErrorMessage(message);
089 }
090
091 /**
092 * {@inheritDoc}
093 */
094 public CancelResult cancel(CancelRequest cancelRequest)
095 {
096 return operation.cancel(cancelRequest);
097 }
098
099 /**
100 * {@inheritDoc}
101 */
102 public void abort(CancelRequest cancelRequest)
103 {
104 operation.abort(cancelRequest);
105 }
106
107 /**
108 * {@inheritDoc}
109 */
110 public void disconnectClient(
111 DisconnectReason disconnectReason,
112 boolean sendNotification,
113 Message message
114 )
115 {
116 operation.disconnectClient(
117 disconnectReason, sendNotification, message);
118 }
119
120 /**
121 * {@inheritDoc}
122 */
123 public boolean dontSynchronize()
124 {
125 return operation.dontSynchronize();
126 }
127
128 /**
129 * {@inheritDoc}
130 */
131 public MessageBuilder getAdditionalLogMessage()
132 {
133 return operation.getAdditionalLogMessage();
134 }
135
136 /**
137 * {@inheritDoc}
138 */
139 public Object getAttachment(String name)
140 {
141 return operation.getAttachment(name);
142 }
143
144 /**
145 * {@inheritDoc}
146 */
147 public Map<String, Object> getAttachments()
148 {
149 return operation.getAttachments();
150 }
151
152 /**
153 * {@inheritDoc}
154 */
155 public DN getAuthorizationDN()
156 {
157 return operation.getAuthorizationDN();
158 }
159
160 /**
161 * {@inheritDoc}
162 */
163 public Entry getAuthorizationEntry()
164 {
165 return operation.getAuthorizationEntry();
166 }
167
168 /**
169 * {@inheritDoc}
170 */
171 public CancelRequest getCancelRequest()
172 {
173 return operation.getCancelRequest();
174 }
175
176 /**
177 * {@inheritDoc}
178 */
179 public CancelResult getCancelResult()
180 {
181 return operation.getCancelResult();
182 }
183
184 /**
185 * {@inheritDoc}
186 */
187 public ClientConnection getClientConnection()
188 {
189 return operation.getClientConnection();
190 }
191
192 /**
193 * {@inheritDoc}
194 */
195 public String[][] getCommonLogElements()
196 {
197 return operation.getCommonLogElements();
198 }
199
200 /**
201 * {@inheritDoc}
202 */
203 public long getConnectionID()
204 {
205 return operation.getConnectionID();
206 }
207
208 /**
209 * {@inheritDoc}
210 */
211 public MessageBuilder getErrorMessage()
212 {
213 return operation.getErrorMessage();
214 }
215
216 /**
217 * {@inheritDoc}
218 */
219 public DN getMatchedDN()
220 {
221 return operation.getMatchedDN();
222 }
223
224 /**
225 * {@inheritDoc}
226 */
227 public int getMessageID()
228 {
229 return operation.getMessageID();
230 }
231
232 /**
233 * {@inheritDoc}
234 */
235 public long getOperationID()
236 {
237 return operation.getOperationID();
238 }
239
240 /**
241 * {@inheritDoc}
242 */
243 public OperationType getOperationType()
244 {
245 return operation.getOperationType();
246 }
247
248 /**
249 * {@inheritDoc}
250 */
251 public long getProcessingStartTime()
252 {
253 return operation.getProcessingStartTime();
254 }
255
256 /**
257 * {@inheritDoc}
258 */
259 public long getProcessingStopTime()
260 {
261 return operation.getProcessingStopTime();
262 }
263
264 /**
265 * {@inheritDoc}
266 */
267 public long getProcessingTime()
268 {
269 return operation.getProcessingTime();
270 }
271
272 /**
273 * {@inheritDoc}
274 */
275 public long getProcessingNanoTime()
276 {
277 return operation.getProcessingNanoTime();
278 }
279
280 /**
281 * {@inheritDoc}
282 */
283 public List<String> getReferralURLs()
284 {
285 return operation.getReferralURLs();
286 }
287
288 /**
289 * {@inheritDoc}
290 */
291 public List<Control> getRequestControls()
292 {
293 return operation.getRequestControls();
294 }
295
296 /**
297 * {@inheritDoc}
298 */
299 public String[][] getRequestLogElements()
300 {
301 return operation.getRequestLogElements();
302 }
303
304 /**
305 * {@inheritDoc}
306 */
307 public List<Control> getResponseControls()
308 {
309 return operation.getResponseControls();
310 }
311
312 /**
313 * {@inheritDoc}
314 */
315 public String[][] getResponseLogElements()
316 {
317 return operation.getResponseLogElements();
318 }
319
320 /**
321 * {@inheritDoc}
322 */
323 public ResultCode getResultCode()
324 {
325 return operation.getResultCode();
326 }
327
328 /**
329 * {@inheritDoc}
330 */
331 public boolean isInternalOperation()
332 {
333 return operation.isInternalOperation();
334 }
335
336 /**
337 * {@inheritDoc}
338 */
339 public boolean isSynchronizationOperation()
340 {
341 return operation.isSynchronizationOperation();
342 }
343
344 /**
345 * {@inheritDoc}
346 */
347 public void operationCompleted()
348 {
349 operation.operationCompleted();
350 }
351
352 /**
353 * {@inheritDoc}
354 */
355 public Object removeAttachment(String name)
356 {
357 return operation.removeAttachment(name);
358 }
359
360 /**
361 * {@inheritDoc}
362 */
363 public void removeRequestControl(Control control)
364 {
365 operation.removeRequestControl(control);
366 }
367
368 /**
369 * {@inheritDoc}
370 */
371 public void removeResponseControl(Control control)
372 {
373 operation.removeResponseControl(control);
374 }
375
376 /**
377 * {@inheritDoc}
378 */
379 public void setAdditionalLogMessage(MessageBuilder additionalLogMessage)
380 {
381 operation.setAdditionalLogMessage(additionalLogMessage);
382 }
383
384 /**
385 * {@inheritDoc}
386 */
387 public Object setAttachment(String name, Object value)
388 {
389 return operation.setAttachment(name, value);
390 }
391
392 /**
393 * {@inheritDoc}
394 */
395 public void setAttachments(Map<String, Object> attachments)
396 {
397 operation.setAttachments(attachments);
398 }
399
400 /**
401 * {@inheritDoc}
402 */
403 public void setAuthorizationEntry(Entry authorizationEntry)
404 {
405 operation.setAuthorizationEntry(authorizationEntry);
406 }
407
408 /**
409 * {@inheritDoc}
410 */
411 public void setDontSynchronize(boolean dontSynchronize)
412 {
413 operation.setDontSynchronize(dontSynchronize);
414 }
415
416 /**
417 * {@inheritDoc}
418 */
419 public void setErrorMessage(MessageBuilder errorMessage)
420 {
421 operation.setErrorMessage(errorMessage);
422 }
423
424 /**
425 * {@inheritDoc}
426 */
427 public void setInternalOperation(boolean isInternalOperation)
428 {
429 operation.setInternalOperation(isInternalOperation);
430 }
431
432 /**
433 * {@inheritDoc}
434 */
435 public void setMatchedDN(DN matchedDN)
436 {
437 operation.setMatchedDN(matchedDN);
438 }
439
440 /**
441 * {@inheritDoc}
442 */
443 public void setReferralURLs(List<String> referralURLs)
444 {
445 operation.setReferralURLs(referralURLs);
446 }
447
448 /**
449 * {@inheritDoc}
450 */
451 public void setResponseData(DirectoryException directoryException)
452 {
453 operation.setResponseData(directoryException);
454 }
455
456 /**
457 * {@inheritDoc}
458 */
459 public void setResultCode(ResultCode resultCode)
460 {
461 operation.setResultCode(resultCode);
462 }
463
464 /**
465 * {@inheritDoc}
466 */
467 public void setSynchronizationOperation(boolean isSynchronizationOperation)
468 {
469 operation.setSynchronizationOperation(isSynchronizationOperation);
470 }
471
472 /**
473 * {@inheritDoc}
474 */
475 public void toString(StringBuilder buffer)
476 {
477 operation.toString(buffer);
478 }
479
480 /**
481 * {@inheritDoc}
482 */
483 public synchronized final void checkIfCanceled(boolean signalTooLate)
484 throws CanceledOperationException {
485 operation.checkIfCanceled(signalTooLate);
486 }
487 }
488