From 6385fb6984cb076c5a4a3ef5233deed798dc81c2 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Thu, 02 Jun 2011 01:01:18 +0000
Subject: [PATCH] Fix OPENDJ-183: Add support for RequestContext and RequestHandlers

---
 opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java
index d9e55bc..e0ccf0d 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/LDAPConnection.java
@@ -29,6 +29,8 @@
 
 
 
+import static org.forgerock.opendj.ldap.ErrorResultException.newErrorResult;
+
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.List;
@@ -122,7 +124,7 @@
       if (connectionInvalidReason != null)
       {
         return new CompletedFutureResult<Void>(
-            ErrorResultException.wrap(connectionInvalidReason), messageID);
+            newErrorResult(connectionInvalidReason), messageID);
       }
       if (bindOrStartTLSInProgress.get())
       {
@@ -130,7 +132,7 @@
             ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
             "Bind or Start TLS operation in progress");
         return new CompletedFutureResult<Void>(
-            ErrorResultException.wrap(errorResult), messageID);
+            newErrorResult(errorResult), messageID);
       }
 
       // First remove the future associated with the request to be abandoned.
@@ -171,7 +173,7 @@
           ResultCode.CLIENT_SIDE_ENCODING_ERROR).setCause(e);
       connectionErrorOccurred(errorResult);
       return new CompletedFutureResult<Void>(
-          ErrorResultException.wrap(errorResult), messageID);
+          newErrorResult(errorResult), messageID);
     }
   }
 
@@ -273,7 +275,7 @@
           .newResult(ResultCode.CLIENT_SIDE_LOCAL_ERROR)
           .setDiagnosticMessage(
               "An error occurred while creating a bind context").setCause(e);
-      final ErrorResultException error = ErrorResultException.wrap(errorResult);
+      final ErrorResultException error = ErrorResultException.newErrorResult(errorResult);
       if (resultHandler != null)
       {
         resultHandler.handleErrorResult(error);
@@ -783,7 +785,7 @@
     {
       if (connectionInvalidReason != null)
       {
-        throw ErrorResultException.wrap(connectionInvalidReason);
+        throw newErrorResult(connectionInvalidReason);
       }
       pendingRequests.put(newMsgID, request);
     }
@@ -920,7 +922,7 @@
       for (final ConnectionEventListener listener : listeners)
       {
         listener.handleConnectionError(isDisconnectNotification,
-            ErrorResultException.wrap(reason));
+            newErrorResult(reason));
       }
     }
   }

--
Gitblit v1.10.0