From f38881bd757d7a30857ae4e12bbdc7b81338b6bf Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 14 Jun 2013 18:06:16 +0000
Subject: [PATCH] Fix OPENDJ-932: ConnectionFactory timeout setting is applied for persistent search requests

---
 opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/AbstractLDAPFutureResultImpl.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/AbstractLDAPFutureResultImpl.java b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/AbstractLDAPFutureResultImpl.java
index 4aa9c0f..0558a48 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/AbstractLDAPFutureResultImpl.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/ldap/AbstractLDAPFutureResultImpl.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2009-2010 Sun Microsystems, Inc.
- *      Portions copyright 2011 ForgeRock AS.
+ *      Portions copyright 2011-2013 ForgeRock AS.
  */
 
 package com.forgerock.opendj.ldap;
@@ -47,13 +47,9 @@
 abstract class AbstractLDAPFutureResultImpl<S extends Result>
         extends AsynchronousFutureResult<S, ResultHandler<? super S>>
         implements IntermediateResponseHandler {
-
     private final Connection connection;
-
     private final int requestID;
-
     private IntermediateResponseHandler intermediateResponseHandler;
-
     private volatile long timestamp;
 
     AbstractLDAPFutureResultImpl(final int requestID,
@@ -136,4 +132,16 @@
         timestamp = System.currentTimeMillis();
     }
 
+    /**
+     * Returns {@code true} if this request should be canceled once the timeout
+     * period expires. The default implementation is to return {@code true}
+     * which will be appropriate for nearly all requests, the one obvious
+     * exception being persistent searches.
+     *
+     * @return {@code true} if this request should be canceled once the timeout
+     *         period expires.
+     */
+    boolean checkForTimeout() {
+        return true;
+    }
 }

--
Gitblit v1.10.0