From d3b558206d16b99d744c0bf9eebf3d388103d7fb Mon Sep 17 00:00:00 2001
From: jdemendi <jdemendi@localhost>
Date: Tue, 17 Jul 2007 07:53:22 +0000
Subject: [PATCH] Each and every operation wrapper has to extend the OperationWrapper class to avoid code duplication. OperationWrapper is the superclass that implements the Operation interface for the wrapping purpose.

---
 opends/src/server/org/opends/server/core/BindOperationWrapper.java |  461 --------------------------------------------------------
 1 files changed, 7 insertions(+), 454 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/BindOperationWrapper.java b/opends/src/server/org/opends/server/core/BindOperationWrapper.java
index ddb784c..8de5716 100644
--- a/opends/src/server/org/opends/server/core/BindOperationWrapper.java
+++ b/opends/src/server/org/opends/server/core/BindOperationWrapper.java
@@ -26,31 +26,24 @@
  */
 package org.opends.server.core;
 
-import java.util.List;
-import java.util.Map;
 
-import org.opends.server.api.ClientConnection;
 import org.opends.server.protocols.asn1.ASN1OctetString;
 import org.opends.server.types.AuthenticationInfo;
 import org.opends.server.types.AuthenticationType;
 import org.opends.server.types.ByteString;
-import org.opends.server.types.CancelRequest;
-import org.opends.server.types.CancelResult;
-import org.opends.server.types.Control;
 import org.opends.server.types.DN;
-import org.opends.server.types.DirectoryException;
-import org.opends.server.types.DisconnectReason;
 import org.opends.server.types.Entry;
-import org.opends.server.types.OperationType;
-import org.opends.server.types.ResultCode;
+
 
 /**
  * This abstract class wraps/decorates a given bind operation.
  * This class will be extended by sub-classes to enhance the
  * functionnality of the BindOperationBasis.
  */
-public abstract class BindOperationWrapper implements BindOperation
+public abstract class BindOperationWrapper extends OperationWrapper
+       implements BindOperation
 {
+  // The wrapped operation.
   private BindOperation bind;
 
   /**
@@ -58,95 +51,15 @@
    *
    * @param bind The bind operation to wrap
    */
-  protected BindOperationWrapper(BindOperation bind){
+  protected BindOperationWrapper(BindOperation bind)
+  {
+    super(bind);
     this.bind = bind;
   }
 
   /**
    * {@inheritDoc}
    */
-  public void addRequestControl(Control control)
-  {
-    bind.addRequestControl(control);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void addResponseControl(Control control)
-  {
-    bind.addResponseControl(control);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void appendAdditionalLogMessage(String message)
-  {
-    bind.appendAdditionalLogMessage(message);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void appendErrorMessage(String message)
-  {
-    bind.appendErrorMessage(message);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public CancelResult cancel(CancelRequest cancelRequest)
-  {
-    return bind.cancel(cancelRequest);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void disconnectClient(DisconnectReason disconnectReason,
-      boolean sendNotification, String message, int messageID)
-  {
-    bind.disconnectClient(disconnectReason, sendNotification, message,
-        messageID);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public boolean dontSynchronize()
-  {
-    return bind.dontSynchronize();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public StringBuilder getAdditionalLogMessage()
-  {
-    return bind.getAdditionalLogMessage();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public Object getAttachment(String name)
-  {
-    return bind.getAttachment(name);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public Map<String, Object> getAttachments()
-  {
-    return bind.getAttachments();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public AuthenticationInfo getAuthenticationInfo()
   {
     return bind.getAuthenticationInfo();
@@ -179,22 +92,6 @@
   /**
    * {@inheritDoc}
    */
-  public DN getAuthorizationDN()
-  {
-    return bind.getAuthorizationDN();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public Entry getAuthorizationEntry()
-  {
-    return bind.getAuthorizationEntry();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public DN getBindDN()
   {
     return bind.getBindDN();
@@ -203,110 +100,6 @@
   /**
    * {@inheritDoc}
    */
-  public CancelRequest getCancelRequest()
-  {
-    return bind.getCancelRequest();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public CancelResult getCancelResult()
-  {
-    return bind.getCancelResult();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public ClientConnection getClientConnection()
-  {
-    return bind.getClientConnection();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String[][] getCommonLogElements()
-  {
-    return bind.getCommonLogElements();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public long getConnectionID()
-  {
-    return bind.getConnectionID();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public StringBuilder getErrorMessage()
-  {
-    return bind.getErrorMessage();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public DN getMatchedDN()
-  {
-    return bind.getMatchedDN();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public int getMessageID()
-  {
-    return bind.getMessageID();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public long getOperationID()
-  {
-    return bind.getOperationID();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public OperationType getOperationType()
-  {
-    return bind.getOperationType();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public long getProcessingStartTime()
-  {
-    return bind.getProcessingStartTime();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public long getProcessingStopTime()
-  {
-    return bind.getProcessingStopTime();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public long getProcessingTime()
-  {
-    return bind.getProcessingTime();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public ByteString getRawBindDN()
   {
     return bind.getRawBindDN();
@@ -315,54 +108,6 @@
   /**
    * {@inheritDoc}
    */
-  public List<String> getReferralURLs()
-  {
-    return bind.getReferralURLs();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public List<Control> getRequestControls()
-  {
-    return bind.getRequestControls();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String[][] getRequestLogElements()
-  {
-    return bind.getRequestLogElements();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public List<Control> getResponseControls()
-  {
-    return bind.getResponseControls();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String[][] getResponseLogElements()
-  {
-    return bind.getResponseLogElements();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public ResultCode getResultCode()
-  {
-    return bind.getResultCode();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public Entry getSASLAuthUserEntry()
   {
     return bind.getSASLAuthUserEntry();
@@ -411,86 +156,6 @@
   /**
    * {@inheritDoc}
    */
-  public void indicateCancelled(CancelRequest cancelRequest)
-  {
-    bind.indicateCancelled(cancelRequest);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public boolean isInternalOperation()
-  {
-    return bind.isInternalOperation();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public boolean isSynchronizationOperation()
-  {
-    return bind.isSynchronizationOperation();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void operationCompleted()
-  {
-    bind.operationCompleted();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public Object removeAttachment(String name)
-  {
-    return bind.removeAttachment(name);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void removeRequestControl(Control control)
-  {
-    bind.removeRequestControl(control);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void removeResponseControl(Control control)
-  {
-    bind.removeResponseControl(control);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setAdditionalLogMessage(StringBuilder additionalLogMessage)
-  {
-    bind.setAdditionalLogMessage(additionalLogMessage);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public Object setAttachment(String name, Object value)
-  {
-    return bind.setAttachment(name, value);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setAttachments(Map<String, Object> attachments)
-  {
-    bind.setAttachments(attachments);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public void setAuthenticationInfo(AuthenticationInfo authInfo)
   {
     bind.setAuthenticationInfo(authInfo);
@@ -507,78 +172,6 @@
   /**
    * {@inheritDoc}
    */
-  public void setAuthorizationEntry(Entry authorizationEntry)
-  {
-    bind.setAuthorizationEntry(authorizationEntry);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public boolean setCancelRequest(CancelRequest cancelRequest)
-  {
-    return bind.setCancelRequest(cancelRequest);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setCancelResult(CancelResult cancelResult)
-  {
-    bind.setCancelResult(cancelResult);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setDontSynchronize(boolean dontSynchronize)
-  {
-    bind.setDontSynchronize(dontSynchronize);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setErrorMessage(StringBuilder errorMessage)
-  {
-    bind.setErrorMessage(errorMessage);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setInternalOperation(boolean isInternalOperation)
-  {
-    bind.setInternalOperation(isInternalOperation);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setMatchedDN(DN matchedDN)
-  {
-    bind.setMatchedDN(matchedDN);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setProcessingStartTime()
-  {
-    bind.setProcessingStartTime();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setProcessingStopTime()
-  {
-    bind.setProcessingStopTime();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public void setRawBindDN(ByteString rawBindDN)
   {
     bind.setRawBindDN(rawBindDN);
@@ -587,30 +180,6 @@
   /**
    * {@inheritDoc}
    */
-  public void setReferralURLs(List<String> referralURLs)
-  {
-    bind.setReferralURLs(referralURLs);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setResponseData(DirectoryException directoryException)
-  {
-    bind.setResponseData(directoryException);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setResultCode(ResultCode resultCode)
-  {
-    bind.setResultCode(resultCode);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public void setSASLAuthUserEntry(Entry saslAuthUserEntry)
   {
     bind.setSASLAuthUserEntry(saslAuthUserEntry);
@@ -644,14 +213,6 @@
   /**
    * {@inheritDoc}
    */
-  public void setSynchronizationOperation(boolean isSynchronizationOperation)
-  {
-    bind.setSynchronizationOperation(isSynchronizationOperation);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public void setUserEntryDN(DN userEntryDN){
     bind.setUserEntryDN(userEntryDN);
   }
@@ -667,14 +228,6 @@
   /**
    * {@inheritDoc}
    */
-  public void toString(StringBuilder buffer)
-  {
-    bind.toString(buffer);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   public void setProtocolVersion(String protocolVersion)
   {
     bind.setProtocolVersion(protocolVersion);

--
Gitblit v1.10.0