mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
23.27.2006 e1862b6b8d276a6719f1277a7ca9781a1294180c
Update the delete, modify, modify DN, and search operations to add a check for
a cancel between the pre-operation plugin processing and sending the request to
the backend.

OpenDS Issue Number: 713
4 files modified
100 ■■■■■ changed files
opends/src/server/org/opends/server/core/DeleteOperation.java 25 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/ModifyDNOperation.java 25 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/ModifyOperation.java 25 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/SearchOperation.java 25 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/DeleteOperation.java
@@ -971,6 +971,31 @@
        }
        // Check for and handle a request to cancel this operation.
        if (cancelRequest != null)
        {
          setCancelResult(CancelResult.CANCELED);
          if (cancelRequest.notifyOriginalRequestor() ||
              DirectoryServer.notifyAbandonedOperations())
          {
            setResultCode(ResultCode.CANCELED);
            String cancelReason = cancelRequest.getCancelReason();
            if (cancelReason != null)
            {
              appendErrorMessage(cancelReason);
            }
            clientConnection.sendResponse(this);
          }
          processingStopTime = System.currentTimeMillis();
          logDeleteResponse(this);
          return;
        }
        // Get the backend to use for the delete.  If there is none, then fail.
        Backend backend = DirectoryServer.getBackend(entryDN);
        if (backend == null)
opends/src/server/org/opends/server/core/ModifyDNOperation.java
@@ -1798,6 +1798,31 @@
        }
        // Check for and handle a request to cancel this operation.
        if (cancelRequest != null)
        {
          setCancelResult(CancelResult.CANCELED);
          if (cancelRequest.notifyOriginalRequestor() ||
              DirectoryServer.notifyAbandonedOperations())
          {
            setResultCode(ResultCode.CANCELED);
            String cancelReason = cancelRequest.getCancelReason();
            if (cancelReason != null)
            {
              appendErrorMessage(cancelReason);
            }
            clientConnection.sendResponse(this);
          }
          processingStopTime = System.currentTimeMillis();
          logModifyDNResponse(this);
          return;
        }
        // Actually perform the modify DN operation.  This should include taking
        // care of any synchronization that might be needed.
        try
opends/src/server/org/opends/server/core/ModifyOperation.java
@@ -2326,6 +2326,31 @@
        }
        // Check for and handle a request to cancel this operation.
        if (cancelRequest != null)
        {
          setCancelResult(CancelResult.CANCELED);
          if (cancelRequest.notifyOriginalRequestor() ||
              DirectoryServer.notifyAbandonedOperations())
          {
            setResultCode(ResultCode.CANCELED);
            String cancelReason = cancelRequest.getCancelReason();
            if (cancelReason != null)
            {
              appendErrorMessage(cancelReason);
            }
            clientConnection.sendResponse(this);
          }
          processingStopTime = System.currentTimeMillis();
          logModifyResponse(this);
          return;
        }
        // Actually perform the modify operation.  This should also include
        // taking care of any synchronization that might be needed.
        Backend backend = DirectoryServer.getBackend(entryDN);
opends/src/server/org/opends/server/core/SearchOperation.java
@@ -1974,6 +1974,31 @@
      }
      // Check for and handle a request to cancel this operation.
      if (cancelRequest != null)
      {
        setCancelResult(CancelResult.CANCELED);
        if (cancelRequest.notifyOriginalRequestor() ||
            DirectoryServer.notifyAbandonedOperations())
        {
          setResultCode(ResultCode.CANCELED);
          String cancelReason = cancelRequest.getCancelReason();
          if (cancelReason != null)
          {
            appendErrorMessage(cancelReason);
          }
          clientConnection.sendResponse(this);
        }
        processingStopTime = System.currentTimeMillis();
        logSearchResultDone(this);
        return;
      }
      // Get the backend that should hold the search base.  If there is none,
      // then fail.
      Backend backend = DirectoryServer.getBackend(baseDN);