From a415256cc798baf286d618a2c9ddd427c26a518d Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 14 Dec 2009 13:21:39 +0000
Subject: [PATCH] Remove optional P parameter from result handlers as it is hardly ever needed in practice and just pollutes the APIs.
---
sdk/src/com/sun/opends/sdk/tools/ModRate.java | 8
sdk/src/com/sun/opends/sdk/ldap/LDAPConnection.java | 245 ++++++-----
sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java | 9
sdk/src/org/opends/sdk/HeartBeatConnectionFactory.java | 123 ++---
sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java | 7
sdk/src/com/sun/opends/sdk/ldap/SearchResultFutureImpl.java | 23
sdk/src/org/opends/sdk/AsynchronousConnection.java | 121 +----
sdk/src/org/opends/sdk/ResultHandler.java | 14
sdk/src/com/sun/opends/sdk/ldap/ExtendedResultFutureImpl.java | 8
sdk/src/org/opends/sdk/AbstractConnection.java | 17
sdk/src/org/opends/sdk/RootDSE.java | 15
sdk/src/org/opends/sdk/SynchronousConnection.java | 27
sdk/src/com/sun/opends/sdk/ldap/CompareResultFutureImpl.java | 8
sdk/src/org/opends/sdk/ConnectionResultHandler.java | 16
sdk/src/com/sun/opends/sdk/tools/SearchRate.java | 10
sdk/src/com/sun/opends/sdk/ldap/ResultFutureImpl.java | 8
sdk/src/com/sun/opends/sdk/util/ResultChain.java | 25
sdk/src/org/opends/sdk/Connection.java | 13
sdk/src/org/opends/sdk/SearchResultHandler.java | 19
sdk/src/org/opends/sdk/AuthenticatedConnectionFactory.java | 153 +++----
sdk/src/org/opends/sdk/ldap/LDAPConnectionFactory.java | 8
sdk/src/org/opends/sdk/schema/Schema.java | 30
sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java | 14
sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java | 45 -
sdk/src/com/sun/opends/sdk/util/ResultTransformer.java | 21
sdk/src/com/sun/opends/sdk/ldap/AbstractResultFutureImpl.java | 32
sdk/src/org/opends/sdk/ConnectionFactory.java | 11
sdk/src/org/opends/sdk/ConnectionPool.java | 128 ++---
sdk/src/org/opends/sdk/AbstractAsynchronousConnection.java | 57 +-
sdk/src/com/sun/opends/sdk/ldap/BindResultFutureImpl.java | 8
sdk/src/org/opends/sdk/AbstractConnectionFactory.java | 14
31 files changed, 534 insertions(+), 703 deletions(-)
diff --git a/sdk/src/com/sun/opends/sdk/ldap/AbstractResultFutureImpl.java b/sdk/src/com/sun/opends/sdk/ldap/AbstractResultFutureImpl.java
index 7cb7dc1..66dc52f 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/AbstractResultFutureImpl.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/AbstractResultFutureImpl.java
@@ -47,23 +47,23 @@
/**
* Abstract result future implementation.
*/
-public abstract class AbstractResultFutureImpl<R extends Result, P> implements
- ResultFuture<R>, Runnable
+public abstract class AbstractResultFutureImpl<R extends Result>
+ implements ResultFuture<R>, Runnable
{
private final LDAPConnection connection;
- private final ResultHandler<? super R, P> handler;
+ private final ResultHandler<? super R> handler;
private final ExecutorService handlerExecutor;
private final int messageID;
+ // Use a semaphore instead of a lock because semaphores can be
+ // released by different thread to acquirer.
private final Semaphore invokerLock;
private final CountDownLatch latch = new CountDownLatch(1);
- private final P p;
-
private volatile boolean isCancelled = false;
private volatile R result = null;
@@ -71,12 +71,11 @@
AbstractResultFutureImpl(int messageID,
- ResultHandler<? super R, P> handler, P p,
- LDAPConnection connection, ExecutorService handlerExecutor)
+ ResultHandler<? super R> handler, LDAPConnection connection,
+ ExecutorService handlerExecutor)
{
this.messageID = messageID;
this.handler = handler;
- this.p = p;
this.connection = connection;
this.handlerExecutor = handlerExecutor;
if (handlerExecutor == null)
@@ -155,17 +154,17 @@
if (result.getResultCode().isExceptional())
{
ErrorResultException e = ErrorResultException.wrap(result);
- handler.handleErrorResult(p, e);
+ handler.handleErrorResult(e);
}
else
{
- handler.handleResult(p, result);
+ handler.handleResult(result);
}
}
- synchronized void handleErrorResult(Result result)
+ final void handleErrorResult(Result result)
{
R errorResult = newErrorResult(result.getResultCode(), result
.getDiagnosticMessage(), result.getCause());
@@ -179,7 +178,7 @@
- void handleResult(R result)
+ final void handleResult(R result)
{
if (!isDone())
{
@@ -194,7 +193,7 @@
- protected void invokeHandler(final Runnable runnable)
+ final void invokeHandler(final Runnable runnable)
{
try
{
@@ -238,6 +237,9 @@
"Invoke thread interrupted: %s", StaticUtils
.getExceptionMessage(e)));
}
+
+ // Reset interrupt status.
+ Thread.currentThread().interrupt();
}
}
@@ -247,8 +249,8 @@
{
if (isCancelled())
{
- throw ErrorResultException.wrap(
- Responses.newResult(ResultCode.CLIENT_SIDE_USER_CANCELLED));
+ throw ErrorResultException.wrap(Responses
+ .newResult(ResultCode.CLIENT_SIDE_USER_CANCELLED));
}
else if (result.getResultCode().isExceptional())
{
diff --git a/sdk/src/com/sun/opends/sdk/ldap/BindResultFutureImpl.java b/sdk/src/com/sun/opends/sdk/ldap/BindResultFutureImpl.java
index 047c94e..b1d61b5 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/BindResultFutureImpl.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/BindResultFutureImpl.java
@@ -44,8 +44,8 @@
/**
* Bind result future implementation.
*/
-public final class BindResultFutureImpl<P> extends
- AbstractResultFutureImpl<BindResult, P> implements
+public final class BindResultFutureImpl extends
+ AbstractResultFutureImpl<BindResult> implements
ResultFuture<BindResult>
{
private final BindRequest request;
@@ -55,10 +55,10 @@
BindResultFutureImpl(int messageID, BindRequest request,
- ResultHandler<? super BindResult, P> handler, P p,
+ ResultHandler<? super BindResult> handler,
LDAPConnection connection, ExecutorService handlerExecutor)
{
- super(messageID, handler, p, connection, handlerExecutor);
+ super(messageID, handler, connection, handlerExecutor);
this.request = request;
}
diff --git a/sdk/src/com/sun/opends/sdk/ldap/CompareResultFutureImpl.java b/sdk/src/com/sun/opends/sdk/ldap/CompareResultFutureImpl.java
index 5bd0716..c56bb8b 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/CompareResultFutureImpl.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/CompareResultFutureImpl.java
@@ -43,8 +43,8 @@
/**
* Compare result future implementation.
*/
-public final class CompareResultFutureImpl<P> extends
- AbstractResultFutureImpl<CompareResult, P> implements
+public final class CompareResultFutureImpl extends
+ AbstractResultFutureImpl<CompareResult> implements
ResultFuture<CompareResult>
{
private final CompareRequest request;
@@ -52,10 +52,10 @@
CompareResultFutureImpl(int messageID, CompareRequest request,
- ResultHandler<? super CompareResult, P> handler, P p,
+ ResultHandler<? super CompareResult> handler,
LDAPConnection connection, ExecutorService handlerExecutor)
{
- super(messageID, handler, p, connection, handlerExecutor);
+ super(messageID, handler, connection, handlerExecutor);
this.request = request;
}
diff --git a/sdk/src/com/sun/opends/sdk/ldap/ExtendedResultFutureImpl.java b/sdk/src/com/sun/opends/sdk/ldap/ExtendedResultFutureImpl.java
index cdf11a3..f4a59c4 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/ExtendedResultFutureImpl.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/ExtendedResultFutureImpl.java
@@ -40,18 +40,18 @@
/**
* Extended result future implementation.
*/
-public final class ExtendedResultFutureImpl<R extends Result, P> extends
- AbstractResultFutureImpl<R, P> implements ResultFuture<R>
+public final class ExtendedResultFutureImpl<R extends Result> extends
+ AbstractResultFutureImpl<R> implements ResultFuture<R>
{
private final ExtendedRequest<R> request;
ExtendedResultFutureImpl(int messageID, ExtendedRequest<R> request,
- ResultHandler<? super R, P> handler, P p,
+ ResultHandler<? super R> handler,
LDAPConnection connection, ExecutorService handlerExecutor)
{
- super(messageID, handler, p, connection, handlerExecutor);
+ super(messageID, handler, connection, handlerExecutor);
this.request = request;
}
diff --git a/sdk/src/com/sun/opends/sdk/ldap/LDAPConnection.java b/sdk/src/com/sun/opends/sdk/ldap/LDAPConnection.java
index d3e7233..78f1a6c 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/LDAPConnection.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/LDAPConnection.java
@@ -83,13 +83,13 @@
@Override
public void handleAddResult(int messageID, Result result)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof ResultFutureImpl<?>)
+ if (pendingRequest instanceof ResultFutureImpl)
{
- ResultFutureImpl<?> future = (ResultFutureImpl<?>) pendingRequest;
+ ResultFutureImpl future = (ResultFutureImpl) pendingRequest;
if (future.getRequest() instanceof AddRequest)
{
future.handleResult(result);
@@ -108,13 +108,13 @@
@Override
public void handleBindResult(int messageID, BindResult result)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof BindResultFutureImpl<?>)
+ if (pendingRequest instanceof BindResultFutureImpl)
{
- BindResultFutureImpl<?> future = ((BindResultFutureImpl<?>) pendingRequest);
+ BindResultFutureImpl future = ((BindResultFutureImpl) pendingRequest);
BindRequest request = future.getRequest();
if (request instanceof SASLBindRequest<?>)
@@ -138,8 +138,10 @@
// FIXME: I18N need to have a better error message.
// FIXME: Is this the best result code?
Result errorResult = Responses.newResult(
- ResultCode.CLIENT_SIDE_LOCAL_ERROR).setDiagnosticMessage(
- "An error occurred during SASL authentication").setCause(e);
+ ResultCode.CLIENT_SIDE_LOCAL_ERROR)
+ .setDiagnosticMessage(
+ "An error occurred during SASL authentication")
+ .setCause(e);
future.handleErrorResult(errorResult);
return;
}
@@ -168,10 +170,12 @@
{
pendingRequests.remove(messageID);
- // FIXME: what other sort of IOExceptions can be thrown?
+ // FIXME: what other sort of IOExceptions can be
+ // thrown?
// FIXME: Is this the best result code?
Result errorResult = Responses.newResult(
- ResultCode.CLIENT_SIDE_ENCODING_ERROR).setCause(e);
+ ResultCode.CLIENT_SIDE_ENCODING_ERROR)
+ .setCause(e);
connectionErrorOccurred(errorResult);
future.handleErrorResult(errorResult);
}
@@ -211,13 +215,13 @@
@Override
public void handleCompareResult(int messageID, CompareResult result)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof CompareResultFutureImpl<?>)
+ if (pendingRequest instanceof CompareResultFutureImpl)
{
- CompareResultFutureImpl<?> future = (CompareResultFutureImpl<?>) pendingRequest;
+ CompareResultFutureImpl future = (CompareResultFutureImpl) pendingRequest;
future.handleResult(result);
}
else
@@ -235,13 +239,13 @@
@Override
public void handleDeleteResult(int messageID, Result result)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof ResultFutureImpl<?>)
+ if (pendingRequest instanceof ResultFutureImpl)
{
- ResultFutureImpl<?> future = (ResultFutureImpl<?>) pendingRequest;
+ ResultFutureImpl future = (ResultFutureImpl) pendingRequest;
if (future.getRequest() instanceof DeleteRequest)
{
future.handleResult(result);
@@ -260,7 +264,7 @@
public void handleException(Throwable throwable)
{
Result errorResult;
- if(throwable instanceof EOFException)
+ if (throwable instanceof EOFException)
{
// FIXME: Is this the best result code?
errorResult = Responses.newResult(
@@ -292,8 +296,9 @@
OID_NOTICE_OF_DISCONNECTION))
{
- Result errorResult = Responses.newResult(result.getResultCode())
- .setDiagnosticMessage(result.getDiagnosticMessage());
+ Result errorResult = Responses.newResult(
+ result.getResultCode()).setDiagnosticMessage(
+ result.getDiagnosticMessage());
close(null, true, errorResult);
return;
}
@@ -317,12 +322,12 @@
}
}
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
- if (pendingRequest instanceof ExtendedResultFutureImpl<?, ?>)
+ if (pendingRequest instanceof ExtendedResultFutureImpl<?>)
{
- ExtendedResultFutureImpl<?, ?> extendedFuture = ((ExtendedResultFutureImpl<?, ?>) pendingRequest);
+ ExtendedResultFutureImpl<?> extendedFuture = ((ExtendedResultFutureImpl<?>) pendingRequest);
try
{
handleExtendedResult0(extendedFuture, result);
@@ -330,7 +335,8 @@
catch (DecodeException de)
{
// FIXME: should the connection be closed as well?
- Result errorResult = Responses.newResult(ResultCode.CLIENT_SIDE_DECODING_ERROR)
+ Result errorResult = Responses.newResult(
+ ResultCode.CLIENT_SIDE_DECODING_ERROR)
.setDiagnosticMessage(de.getLocalizedMessage()).setCause(
de);
extendedFuture.handleErrorResult(errorResult);
@@ -351,7 +357,7 @@
public void handleIntermediateResponse(int messageID,
GenericIntermediateResponse response)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
@@ -394,13 +400,13 @@
@Override
public void handleModifyDNResult(int messageID, Result result)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof ResultFutureImpl<?>)
+ if (pendingRequest instanceof ResultFutureImpl)
{
- ResultFutureImpl<?> future = (ResultFutureImpl<?>) pendingRequest;
+ ResultFutureImpl future = (ResultFutureImpl) pendingRequest;
if (future.getRequest() instanceof ModifyDNRequest)
{
future.handleResult(result);
@@ -419,13 +425,13 @@
@Override
public void handleModifyResult(int messageID, Result result)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof ResultFutureImpl<?>)
+ if (pendingRequest instanceof ResultFutureImpl)
{
- ResultFutureImpl<?> future = (ResultFutureImpl<?>) pendingRequest;
+ ResultFutureImpl future = (ResultFutureImpl) pendingRequest;
if (future.getRequest() instanceof ModifyRequest)
{
future.handleResult(result);
@@ -444,13 +450,13 @@
@Override
public void handleSearchResult(int messageID, Result result)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof SearchResultFutureImpl<?>)
+ if (pendingRequest instanceof SearchResultFutureImpl)
{
- ((SearchResultFutureImpl<?>) pendingRequest)
+ ((SearchResultFutureImpl) pendingRequest)
.handleResult(result);
}
else
@@ -469,13 +475,13 @@
public void handleSearchResultEntry(int messageID,
SearchResultEntry entry)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.get(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof SearchResultFutureImpl<?>)
+ if (pendingRequest instanceof SearchResultFutureImpl)
{
- ((SearchResultFutureImpl<?>) pendingRequest)
+ ((SearchResultFutureImpl) pendingRequest)
.handleSearchResultEntry(entry);
}
else
@@ -494,13 +500,13 @@
public void handleSearchResultReference(int messageID,
SearchResultReference reference)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.get(messageID);
if (pendingRequest != null)
{
- if (pendingRequest instanceof SearchResultFutureImpl<?>)
+ if (pendingRequest instanceof SearchResultFutureImpl)
{
- ((SearchResultFutureImpl<?>) pendingRequest)
+ ((SearchResultFutureImpl) pendingRequest)
.handleSearchResultReference(reference);
}
else
@@ -646,14 +652,13 @@
private boolean isClosed = false;
- private final List<ConnectionEventListener> listeners =
- new CopyOnWriteArrayList<ConnectionEventListener>();
+ private final List<ConnectionEventListener> listeners = new CopyOnWriteArrayList<ConnectionEventListener>();
private final AtomicInteger nextMsgID = new AtomicInteger(1);
private volatile int pendingBindOrStartTLS = -1;
- private final ConcurrentHashMap<Integer, AbstractResultFutureImpl<?, ?>> pendingRequests = new ConcurrentHashMap<Integer, AbstractResultFutureImpl<?, ?>>();
+ private final ConcurrentHashMap<Integer, AbstractResultFutureImpl<?>> pendingRequests = new ConcurrentHashMap<Integer, AbstractResultFutureImpl<?>>();
private final InetSocketAddress serverAddress;
@@ -694,7 +699,7 @@
*/
public void abandon(AbandonRequest request)
{
- AbstractResultFutureImpl<?, ?> pendingRequest = pendingRequests
+ AbstractResultFutureImpl<?> pendingRequest = pendingRequests
.remove(request.getMessageID());
if (pendingRequest != null)
{
@@ -744,12 +749,12 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Result> add(AddRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> add(AddRequest request,
+ ResultHandler<Result> handler)
{
int messageID = nextMsgID.getAndIncrement();
- ResultFutureImpl<P> future = new ResultFutureImpl<P>(messageID,
- request, handler, p, this, connFactory.getHandlerInvokers());
+ ResultFutureImpl future = new ResultFutureImpl(messageID, request,
+ handler, this, connFactory.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -764,9 +769,9 @@
}
if (pendingBindOrStartTLS > 0)
{
- future
- .handleResult(Responses.newResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("Bind or Start TLS operation in progress"));
+ future.handleResult(Responses.newResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "Bind or Start TLS operation in progress"));
return future;
}
pendingRequests.put(messageID, future);
@@ -823,13 +828,12 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<BindResult> bind(BindRequest request,
- ResultHandler<? super BindResult, P> handler, P p)
+ public ResultFuture<BindResult> bind(BindRequest request,
+ ResultHandler<? super BindResult> handler)
{
int messageID = nextMsgID.getAndIncrement();
- BindResultFutureImpl<P> future = new BindResultFutureImpl<P>(
- messageID, request, handler, p, this, connFactory
- .getHandlerInvokers());
+ BindResultFutureImpl future = new BindResultFutureImpl(messageID,
+ request, handler, this, connFactory.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -844,16 +848,16 @@
}
if (pendingBindOrStartTLS > 0)
{
- future
- .handleResult(Responses.newBindResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("Bind or Start TLS operation in progress"));
+ future.handleResult(Responses.newBindResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "Bind or Start TLS operation in progress"));
return future;
}
if (!pendingRequests.isEmpty())
{
- future
- .handleResult(Responses.newBindResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("There are other operations pending on this connection"));
+ future.handleResult(Responses.newBindResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "There are other operations pending on this connection"));
return future;
}
@@ -878,8 +882,10 @@
// FIXME: I18N need to have a better error message.
// FIXME: Is this the best result code?
Result errorResult = Responses.newResult(
- ResultCode.CLIENT_SIDE_LOCAL_ERROR).setDiagnosticMessage(
- "An error occurred during SASL authentication").setCause(e);
+ ResultCode.CLIENT_SIDE_LOCAL_ERROR)
+ .setDiagnosticMessage(
+ "An error occurred during SASL authentication")
+ .setCause(e);
future.handleErrorResult(errorResult);
return future;
}
@@ -920,31 +926,33 @@
}
+
/**
* {@inheritDoc}
*/
public void close(UnbindRequest request, String reason)
- throws NullPointerException {
+ throws NullPointerException
+ {
// FIXME: I18N need to internationalize this message.
Validator.ensureNotNull(request);
- close(request, false,
- Responses.newResult(ResultCode.CLIENT_SIDE_USER_CANCELLED)
- .setDiagnosticMessage("Connection closed by client" +
- (reason != null ? ": " + reason : "")));
+ close(request, false, Responses.newResult(
+ ResultCode.CLIENT_SIDE_USER_CANCELLED).setDiagnosticMessage(
+ "Connection closed by client"
+ + (reason != null ? ": " + reason : "")));
}
+
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<CompareResult> compare(
- CompareRequest request,
- ResultHandler<? super CompareResult, P> handler, P p)
+ public ResultFuture<CompareResult> compare(CompareRequest request,
+ ResultHandler<? super CompareResult> handler)
{
int messageID = nextMsgID.getAndIncrement();
- CompareResultFutureImpl<P> future = new CompareResultFutureImpl<P>(
- messageID, request, handler, p, this, connFactory
+ CompareResultFutureImpl future = new CompareResultFutureImpl(
+ messageID, request, handler, this, connFactory
.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -960,9 +968,9 @@
}
if (pendingBindOrStartTLS > 0)
{
- future
- .handleResult(Responses.newCompareResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("Bind or Start TLS operation in progress"));
+ future.handleResult(Responses.newCompareResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "Bind or Start TLS operation in progress"));
return future;
}
pendingRequests.put(messageID, future);
@@ -998,12 +1006,12 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Result> delete(DeleteRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> delete(DeleteRequest request,
+ ResultHandler<Result> handler)
{
int messageID = nextMsgID.getAndIncrement();
- ResultFutureImpl<P> future = new ResultFutureImpl<P>(messageID,
- request, handler, p, this, connFactory.getHandlerInvokers());
+ ResultFutureImpl future = new ResultFutureImpl(messageID, request,
+ handler, this, connFactory.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -1018,9 +1026,9 @@
}
if (pendingBindOrStartTLS > 0)
{
- future
- .handleResult(Responses.newResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("Bind or Start TLS operation in progress"));
+ future.handleResult(Responses.newResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "Bind or Start TLS operation in progress"));
return future;
}
pendingRequests.put(messageID, future);
@@ -1056,13 +1064,12 @@
/**
* {@inheritDoc}
*/
- public <R extends Result, P> ResultFuture<R> extendedRequest(
- ExtendedRequest<R> request, ResultHandler<? super R, P> handler,
- P p)
+ public <R extends Result> ResultFuture<R> extendedRequest(
+ ExtendedRequest<R> request, ResultHandler<? super R> handler)
{
int messageID = nextMsgID.getAndIncrement();
- ExtendedResultFutureImpl<R, P> future = new ExtendedResultFutureImpl<R, P>(
- messageID, request, handler, p, this, connFactory
+ ExtendedResultFutureImpl<R> future = new ExtendedResultFutureImpl<R>(
+ messageID, request, handler, this, connFactory
.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -1135,12 +1142,12 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Result> modify(ModifyRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modify(ModifyRequest request,
+ ResultHandler<Result> handler)
{
int messageID = nextMsgID.getAndIncrement();
- ResultFutureImpl<P> future = new ResultFutureImpl<P>(messageID,
- request, handler, p, this, connFactory.getHandlerInvokers());
+ ResultFutureImpl future = new ResultFutureImpl(messageID, request,
+ handler, this, connFactory.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -1155,9 +1162,9 @@
}
if (pendingBindOrStartTLS > 0)
{
- future
- .handleResult(Responses.newResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("Bind or Start TLS operation in progress"));
+ future.handleResult(Responses.newResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "Bind or Start TLS operation in progress"));
return future;
}
pendingRequests.put(messageID, future);
@@ -1193,12 +1200,12 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Result> modifyDN(ModifyDNRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modifyDN(ModifyDNRequest request,
+ ResultHandler<Result> handler)
{
int messageID = nextMsgID.getAndIncrement();
- ResultFutureImpl<P> future = new ResultFutureImpl<P>(messageID,
- request, handler, p, this, connFactory.getHandlerInvokers());
+ ResultFutureImpl future = new ResultFutureImpl(messageID, request,
+ handler, this, connFactory.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -1213,9 +1220,9 @@
}
if (pendingBindOrStartTLS > 0)
{
- future
- .handleResult(Responses.newResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("Bind or Start TLS operation in progress"));
+ future.handleResult(Responses.newResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "Bind or Start TLS operation in progress"));
return future;
}
pendingRequests.put(messageID, future);
@@ -1267,14 +1274,14 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Result> search(SearchRequest request,
- ResultHandler<Result, P> resultHandler,
- SearchResultHandler<P> searchResulthandler, P p)
+ public ResultFuture<Result> search(SearchRequest request,
+ ResultHandler<Result> resultHandler,
+ SearchResultHandler searchResulthandler)
{
int messageID = nextMsgID.getAndIncrement();
- SearchResultFutureImpl<P> future = new SearchResultFutureImpl<P>(
- messageID, request, resultHandler, searchResulthandler, p,
- this, connFactory.getHandlerInvokers());
+ SearchResultFutureImpl future = new SearchResultFutureImpl(
+ messageID, request, resultHandler, searchResulthandler, this,
+ connFactory.getHandlerInvokers());
ASN1StreamWriter asn1Writer = connFactory
.getASN1Writer(streamWriter);
@@ -1289,9 +1296,9 @@
}
if (pendingBindOrStartTLS > 0)
{
- future
- .handleResult(Responses.newResult(ResultCode.OPERATIONS_ERROR)
- .setDiagnosticMessage("Bind or Start TLS operation in progress"));
+ future.handleResult(Responses.newResult(
+ ResultCode.OPERATIONS_ERROR).setDiagnosticMessage(
+ "Bind or Start TLS operation in progress"));
return future;
}
pendingRequests.put(messageID, future);
@@ -1391,7 +1398,7 @@
}
// First abort all outstanding requests.
- for (AbstractResultFutureImpl<?, ?> future : pendingRequests
+ for (AbstractResultFutureImpl<?> future : pendingRequests
.values())
{
if (pendingBindOrStartTLS <= 0)
@@ -1509,6 +1516,9 @@
return isClosed;
}
}
+
+
+
//
//
//
@@ -1556,8 +1566,8 @@
// Needed in order to expose type information.
private <R extends Result> void handleExtendedResult0(
- ExtendedResultFutureImpl<R, ?> future,
- GenericExtendedResult result) throws DecodeException
+ ExtendedResultFutureImpl<R> future, GenericExtendedResult result)
+ throws DecodeException
{
R decodedResponse = future.decodeResponse(result.getResultCode(),
result.getMatchedDN(), result.getDiagnosticMessage(), result
@@ -1587,11 +1597,12 @@
private void handleIncorrectResponse(
- AbstractResultFutureImpl<?, ?> pendingRequest)
+ AbstractResultFutureImpl<?> pendingRequest)
{
// FIXME: I18N need to have a better error message.
- Result errorResult = Responses.newResult(ResultCode.CLIENT_SIDE_DECODING_ERROR)
- .setDiagnosticMessage("LDAP response message did not match request");
+ Result errorResult = Responses.newResult(
+ ResultCode.CLIENT_SIDE_DECODING_ERROR).setDiagnosticMessage(
+ "LDAP response message did not match request");
pendingRequest.handleErrorResult(errorResult);
connectionErrorOccurred(errorResult);
diff --git a/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java b/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java
index 8b7edc8..42069ae 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java
@@ -77,7 +77,8 @@
@Override
- protected void removeMessageHandler(com.sun.grizzly.Connection<?> connection)
+ protected void removeMessageHandler(
+ com.sun.grizzly.Connection<?> connection)
{
ldapConnectionAttr.remove(connection);
}
@@ -139,10 +140,10 @@
- private class ConnectionFutureImpl<P> implements
+ private class ConnectionFutureImpl implements
ConnectionFuture<AsynchronousConnection>,
com.sun.grizzly.CompletionHandler<com.sun.grizzly.Connection>,
- ResultHandler<Result, Void>
+ ResultHandler<Result>
{
private volatile AsynchronousConnection connection;
@@ -154,20 +155,16 @@
private final CountDownLatch latch = new CountDownLatch(1);
- private final ConnectionResultHandler<? super AsynchronousConnection, P> handler;
+ private final ConnectionResultHandler<? super AsynchronousConnection> handler;
private boolean cancelled;
- private final P p;
-
private ConnectionFutureImpl(
- ConnectionResultHandler<? super AsynchronousConnection, P> handler,
- P p)
+ ConnectionResultHandler<? super AsynchronousConnection> handler)
{
this.handler = handler;
- this.p = p;
}
@@ -258,8 +255,7 @@
{
StartTLSRequest startTLS = new StartTLSRequest(options
.getSSLContext());
- sslFuture = this.connection.extendedRequest(startTLS, this,
- null);
+ sslFuture = this.connection.extendedRequest(startTLS, this);
}
else if (options.getSSLContext() != null)
{
@@ -271,7 +267,7 @@
latch.countDown();
if (handler != null)
{
- handler.handleConnection(p, this.connection);
+ handler.handleConnection(this.connection);
}
}
catch (CancellationException ce)
@@ -285,7 +281,7 @@
latch.countDown();
if (handler != null)
{
- handler.handleConnectionError(p, exception);
+ handler.handleConnectionError(exception);
}
}
}
@@ -294,7 +290,7 @@
latch.countDown();
if (handler != null)
{
- handler.handleConnection(p, this.connection);
+ handler.handleConnection(this.connection);
}
}
}
@@ -311,7 +307,7 @@
latch.countDown();
if (handler != null)
{
- handler.handleConnectionError(p, exception);
+ handler.handleConnectionError(exception);
}
}
@@ -329,25 +325,25 @@
// This is called when the StartTLS request is successful
- public void handleResult(Void v, Result result)
+ public void handleResult(Result result)
{
latch.countDown();
if (handler != null)
{
- handler.handleConnection(p, connection);
+ handler.handleConnection(connection);
}
}
// This is called when the StartTLS request is not successful
- public void handleErrorResult(Void v, ErrorResultException error)
+ public void handleErrorResult(ErrorResultException error)
{
exception = error;
latch.countDown();
if (handler != null)
{
- handler.handleConnectionError(p, exception);
+ handler.handleConnectionError(exception);
}
}
}
@@ -486,12 +482,10 @@
/**
* {@inheritDoc}
*/
- public <P> ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
- ConnectionResultHandler<? super AsynchronousConnection, P> handler,
- P p)
+ public ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
+ ConnectionResultHandler<? super AsynchronousConnection> handler)
{
- ConnectionFutureImpl<P> future = new ConnectionFutureImpl<P>(
- handler, p);
+ ConnectionFutureImpl future = new ConnectionFutureImpl(handler);
try
{
@@ -590,7 +584,8 @@
t = t.getCause();
}
- Result result = Responses.newResult(ResultCode.CLIENT_SIDE_CONNECT_ERROR).setCause(t)
+ Result result = Responses.newResult(
+ ResultCode.CLIENT_SIDE_CONNECT_ERROR).setCause(t)
.setDiagnosticMessage(t.getMessage());
return ErrorResultException.wrap(result);
}
diff --git a/sdk/src/com/sun/opends/sdk/ldap/ResultFutureImpl.java b/sdk/src/com/sun/opends/sdk/ldap/ResultFutureImpl.java
index 7282da4..3129167 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/ResultFutureImpl.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/ResultFutureImpl.java
@@ -43,18 +43,18 @@
/**
* Result future implementation.
*/
-public final class ResultFutureImpl<P> extends
- AbstractResultFutureImpl<Result, P> implements ResultFuture<Result>
+public final class ResultFutureImpl extends
+ AbstractResultFutureImpl<Result> implements ResultFuture<Result>
{
private final Request request;
ResultFutureImpl(int messageID, Request request,
- ResultHandler<Result, P> handler, P p, LDAPConnection connection,
+ ResultHandler<Result> handler, LDAPConnection connection,
ExecutorService handlerExecutor)
{
- super(messageID, handler, p, connection, handlerExecutor);
+ super(messageID, handler, connection, handlerExecutor);
this.request = request;
}
diff --git a/sdk/src/com/sun/opends/sdk/ldap/SearchResultFutureImpl.java b/sdk/src/com/sun/opends/sdk/ldap/SearchResultFutureImpl.java
index 31da817..5266d71 100644
--- a/sdk/src/com/sun/opends/sdk/ldap/SearchResultFutureImpl.java
+++ b/sdk/src/com/sun/opends/sdk/ldap/SearchResultFutureImpl.java
@@ -46,32 +46,29 @@
/**
* Search result future implementation.
*/
-public final class SearchResultFutureImpl<P> extends
- AbstractResultFutureImpl<Result, P> implements ResultFuture<Result>
+public final class SearchResultFutureImpl extends
+ AbstractResultFutureImpl<Result> implements ResultFuture<Result>
{
- private final SearchResultHandler<P> searchResultHandler;
-
- private final P p;
+ private final SearchResultHandler searchResultHandler;
private final SearchRequest request;
SearchResultFutureImpl(int messageID, SearchRequest request,
- ResultHandler<Result, P> resultHandler,
- SearchResultHandler<P> searchResultHandler, P p,
+ ResultHandler<Result> resultHandler,
+ SearchResultHandler searchResultHandler,
LDAPConnection connection, ExecutorService handlerExecutor)
{
- super(messageID, resultHandler, p, connection, handlerExecutor);
+ super(messageID, resultHandler, connection, handlerExecutor);
this.request = request;
this.searchResultHandler = searchResultHandler;
- this.p = p;
}
- synchronized void handleSearchResultEntry(
+ void handleSearchResultEntry(
final SearchResultEntry entry)
{
if (!isDone())
@@ -82,7 +79,7 @@
{
public void run()
{
- searchResultHandler.handleEntry(p, entry);
+ searchResultHandler.handleEntry(entry);
}
});
}
@@ -91,7 +88,7 @@
- synchronized void handleSearchResultReference(
+ void handleSearchResultReference(
final SearchResultReference reference)
{
if (!isDone())
@@ -102,7 +99,7 @@
{
public void run()
{
- searchResultHandler.handleReference(p, reference);
+ searchResultHandler.handleReference(reference);
}
});
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java b/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
index 34975e0..bb69539 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
@@ -349,11 +349,10 @@
/**
* {@inheritDoc}
*/
- public <P> ConnectionFuture<? extends AsynchronousConnection> getAsynchronousConnection(
- ConnectionResultHandler<? super AsynchronousConnection, P> handler,
- P p)
+ public ConnectionFuture<? extends AsynchronousConnection> getAsynchronousConnection(
+ ConnectionResultHandler<? super AsynchronousConnection> handler)
{
- return connFactory.getAsynchronousConnection(handler, p);
+ return connFactory.getAsynchronousConnection(handler);
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java b/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java
index d58a2bb..2bc5d85 100644
--- a/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java
+++ b/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java
@@ -65,8 +65,7 @@
- private class LDAPSearchResultHandler implements
- SearchResultHandler<Void>
+ private class LDAPSearchResultHandler implements SearchResultHandler
{
private int entryCount = 0;
@@ -75,7 +74,7 @@
/**
* {@inheritDoc}
*/
- public void handleEntry(Void p, SearchResultEntry entry)
+ public void handleEntry(SearchResultEntry entry)
{
entryCount++;
@@ -168,7 +167,7 @@
/**
* {@inheritDoc}
*/
- public void handleReference(Void p, SearchResultReference reference)
+ public void handleReference(SearchResultReference reference)
{
println(LocalizableMessage.raw(reference.toString()));
}
@@ -1041,7 +1040,7 @@
Result result;
try
{
- result = connection.search(search, resultHandler, null);
+ result = connection.search(search, resultHandler);
}
catch (InterruptedException e)
{
diff --git a/sdk/src/com/sun/opends/sdk/tools/ModRate.java b/sdk/src/com/sun/opends/sdk/tools/ModRate.java
index 5147a0b..1aaf465 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ModRate.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ModRate.java
@@ -273,7 +273,7 @@
private class ModifyWorkerThread extends
- WorkerThread<ResultHandler<Result, Void>>
+ WorkerThread<ResultHandler<Result>>
{
private ModifyRequest mr;
private Object[] data;
@@ -288,7 +288,7 @@
- public ResultHandler<Result, Void> getHandler(long startTime)
+ public ResultHandler<Result> getHandler(long startTime)
{
return new UpdateStatsResultHandler<Result>(startTime);
}
@@ -297,14 +297,14 @@
public ResultFuture<?> performOperation(
AsynchronousConnection connection,
- ResultHandler<Result, Void> handler, DataSource[] dataSources)
+ ResultHandler<Result> handler, DataSource[] dataSources)
{
if (dataSources != null)
{
data = DataSource.generateData(dataSources, data);
}
mr = newModifyRequest(data);
- return connection.modify(mr, handler, null);
+ return connection.modify(mr, handler);
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java b/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java
index f2915c2..01dd45f 100644
--- a/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java
+++ b/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java
@@ -237,7 +237,7 @@
|| noRebindArgument.isPresent())
{
connection = connectionFactory.getAsynchronousConnection(
- null, null).get();
+ null).get();
}
for (int j = 0; j < numThreads; j++)
{
@@ -299,7 +299,7 @@
class UpdateStatsResultHandler<S extends Result> implements
- ResultHandler<S, Void>
+ ResultHandler<S>
{
private long eTime;
@@ -312,7 +312,7 @@
- public void handleResult(Void p, S result)
+ public void handleResult(S result)
{
successRecentCount.getAndIncrement();
eTime = System.nanoTime() - eTime;
@@ -333,7 +333,7 @@
- public void handleErrorResult(Void p, ErrorResultException error)
+ public void handleErrorResult(ErrorResultException error)
{
failedRecentCount.getAndIncrement();
app.println(LocalizableMessage.raw(error.getResult().toString()));
@@ -349,7 +349,7 @@
- abstract class WorkerThread<R extends ResultHandler<?, ?>> extends
+ abstract class WorkerThread<R extends ResultHandler<?>> extends
Thread
{
private int count;
@@ -412,7 +412,7 @@
try
{
connection = connectionFactory.getAsynchronousConnection(
- null, null).get();
+ null).get();
}
catch (InterruptedException e)
{
@@ -440,7 +440,7 @@
AuthenticatedAsynchronousConnection ac = (AuthenticatedAsynchronousConnection) connection;
try
{
- ac.rebind(null, null).get();
+ ac.rebind(null).get();
}
catch (InterruptedException e)
{
diff --git a/sdk/src/com/sun/opends/sdk/tools/SearchRate.java b/sdk/src/com/sun/opends/sdk/tools/SearchRate.java
index d2af841..f5fbdb1 100644
--- a/sdk/src/com/sun/opends/sdk/tools/SearchRate.java
+++ b/sdk/src/com/sun/opends/sdk/tools/SearchRate.java
@@ -328,8 +328,7 @@
private class SearchStatsHandler extends
- UpdateStatsResultHandler<Result> implements
- SearchResultHandler<Void>
+ UpdateStatsResultHandler<Result> implements SearchResultHandler
{
private SearchStatsHandler(long eTime)
{
@@ -338,15 +337,14 @@
- public void handleEntry(Void p, SearchResultEntry entry)
+ public void handleEntry(SearchResultEntry entry)
{
entryRecentCount.getAndIncrement();
}
- public void handleReference(Void p,
- SearchResultReference reference)
+ public void handleReference(SearchResultReference reference)
{
}
}
@@ -402,7 +400,7 @@
sr.setFilter(String.format(filter, data));
sr.setName(String.format(baseDN, data));
}
- return connection.search(sr, handler, handler, null);
+ return connection.search(sr, handler, handler);
}
}
diff --git a/sdk/src/com/sun/opends/sdk/util/ResultChain.java b/sdk/src/com/sun/opends/sdk/util/ResultChain.java
index b8642d2..4c78eac 100644
--- a/sdk/src/com/sun/opends/sdk/util/ResultChain.java
+++ b/sdk/src/com/sun/opends/sdk/util/ResultChain.java
@@ -51,17 +51,14 @@
* The type of the inner result.
* @param <N>
* The type of the outer result.
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
*/
-public abstract class ResultChain<M, N, P> implements ResultFuture<N>,
- ResultHandler<M, P>
+public abstract class ResultChain<M, N> implements ResultFuture<N>,
+ ResultHandler<M>
{
private ErrorResultException errorResult;
- private final ResultHandler<? super N, P> handler;
+ private final ResultHandler<? super N> handler;
private final Object stateLock = new Object();
@@ -82,7 +79,7 @@
* @param handler
* The outer result handler.
*/
- protected ResultChain(ResultHandler<? super N, P> handler)
+ protected ResultChain(ResultHandler<? super N> handler)
{
this.handler = handler;
}
@@ -168,7 +165,7 @@
/**
* {@inheritDoc}
*/
- public void handleErrorResult(P p, ErrorResultException error)
+ public void handleErrorResult(ErrorResultException error)
{
synchronized (stateLock)
{
@@ -181,7 +178,7 @@
errorResult = e;
if (handler != null)
{
- handler.handleErrorResult(p, errorResult);
+ handler.handleErrorResult(errorResult);
}
latch.countDown();
}
@@ -193,7 +190,7 @@
/**
* {@inheritDoc}
*/
- public void handleResult(P p, M result)
+ public void handleResult(M result)
{
synchronized (stateLock)
{
@@ -206,7 +203,7 @@
errorResult = e;
if (handler != null)
{
- handler.handleErrorResult(p, errorResult);
+ handler.handleErrorResult(errorResult);
}
latch.countDown();
}
@@ -288,8 +285,8 @@
* should terminate.
*/
protected ResultFuture<N> chainErrorResult(
- ErrorResultException innerError,
- ResultHandler<? super N, P> handler) throws ErrorResultException
+ ErrorResultException innerError, ResultHandler<? super N> handler)
+ throws ErrorResultException
{
throw innerError;
}
@@ -310,6 +307,6 @@
* should terminate.
*/
protected abstract ResultFuture<N> chainResult(M innerResult,
- ResultHandler<? super N, P> handler) throws ErrorResultException;
+ ResultHandler<? super N> handler) throws ErrorResultException;
}
diff --git a/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java b/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java
index d879c2f..80dc5fa 100644
--- a/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java
+++ b/sdk/src/com/sun/opends/sdk/util/ResultTransformer.java
@@ -47,15 +47,12 @@
* The type of the inner result.
* @param <N>
* The type of the outer result.
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
*/
-public abstract class ResultTransformer<M, N, P> implements
- ResultFuture<N>, ResultHandler<M, P>
+public abstract class ResultTransformer<M, N> implements
+ ResultFuture<N>, ResultHandler<M>
{
- private final ResultHandler<? super N, P> handler;
+ private final ResultHandler<? super N> handler;
private volatile ResultFuture<M> future = null;
@@ -98,7 +95,7 @@
* @param handler
* The outer result handler.
*/
- protected ResultTransformer(ResultHandler<? super N, P> handler)
+ protected ResultTransformer(ResultHandler<? super N> handler)
{
this.handler = handler;
}
@@ -108,11 +105,11 @@
/**
* {@inheritDoc}
*/
- public final void handleErrorResult(P p, ErrorResultException error)
+ public final void handleErrorResult(ErrorResultException error)
{
if (handler != null)
{
- handler.handleErrorResult(p, error);
+ handler.handleErrorResult(error);
}
}
@@ -121,17 +118,17 @@
/**
* {@inheritDoc}
*/
- public final void handleResult(P p, M result)
+ public final void handleResult(M result)
{
if (handler != null)
{
try
{
- handler.handleResult(p, transformResult(result));
+ handler.handleResult(transformResult(result));
}
catch (ErrorResultException e)
{
- handler.handleErrorResult(p, e);
+ handler.handleErrorResult(e);
}
}
}
diff --git a/sdk/src/org/opends/sdk/AbstractAsynchronousConnection.java b/sdk/src/org/opends/sdk/AbstractAsynchronousConnection.java
index 58a6f89..905afa6 100644
--- a/sdk/src/org/opends/sdk/AbstractAsynchronousConnection.java
+++ b/sdk/src/org/opends/sdk/AbstractAsynchronousConnection.java
@@ -55,11 +55,11 @@
AsynchronousConnection
{
- private static final class SingleEntryFuture<P> implements
- ResultFuture<SearchResultEntry>, ResultHandler<Result, P>,
- SearchResultHandler<P>
+ private static final class SingleEntryFuture implements
+ ResultFuture<SearchResultEntry>, ResultHandler<Result>,
+ SearchResultHandler
{
- private final ResultHandler<? super SearchResultEntry, P> handler;
+ private final ResultHandler<? super SearchResultEntry> handler;
private volatile SearchResultEntry firstEntry = null;
@@ -72,7 +72,7 @@
private SingleEntryFuture(
- ResultHandler<? super SearchResultEntry, P> handler)
+ ResultHandler<? super SearchResultEntry> handler)
{
this.handler = handler;
}
@@ -152,7 +152,7 @@
- public void handleEntry(P p, SearchResultEntry entry)
+ public void handleEntry(SearchResultEntry entry)
{
if (firstEntry == null)
{
@@ -163,17 +163,17 @@
- public void handleErrorResult(P p, ErrorResultException error)
+ public void handleErrorResult(ErrorResultException error)
{
if (handler != null)
{
- handler.handleErrorResult(p, error);
+ handler.handleErrorResult(error);
}
}
- public void handleReference(P p, SearchResultReference reference)
+ public void handleReference(SearchResultReference reference)
{
if (firstReference == null)
{
@@ -183,17 +183,17 @@
- public void handleResult(P p, Result result)
+ public void handleResult(Result result)
{
if (handler != null)
{
try
{
- handler.handleResult(p, get0());
+ handler.handleResult(get0());
}
catch (ErrorResultException e)
{
- handler.handleErrorResult(p, e);
+ handler.handleErrorResult(e);
}
}
}
@@ -245,16 +245,16 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> readEntry(DN name,
+ public ResultFuture<SearchResultEntry> readEntry(DN name,
Collection<String> attributeDescriptions,
- ResultHandler<? super SearchResultEntry, P> handler, P p)
+ ResultHandler<? super SearchResultEntry> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
SearchRequest request = Requests.newSearchRequest(name,
SearchScope.BASE_OBJECT, Filter.getObjectClassPresentFilter())
.addAttribute(attributeDescriptions);
- return searchSingleEntry(request, handler, p);
+ return searchSingleEntry(request, handler);
}
@@ -262,11 +262,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<RootDSE> readRootDSE(
- ResultHandler<RootDSE, P> handler, P p)
+ public ResultFuture<RootDSE> readRootDSE(
+ ResultHandler<RootDSE> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return RootDSE.readRootDSE(this, handler, p);
+ return RootDSE.readRootDSE(this, handler);
}
@@ -274,11 +274,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchema(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchema(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return Schema.readSchema(this, name, handler, p);
+ return Schema.readSchema(this, name, handler);
}
@@ -286,11 +286,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchemaForEntry(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchemaForEntry(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return Schema.readSchema(this, name, handler, p);
+ return Schema.readSchema(this, name, handler);
}
@@ -298,16 +298,15 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> searchSingleEntry(
+ public ResultFuture<SearchResultEntry> searchSingleEntry(
SearchRequest request,
- ResultHandler<? super SearchResultEntry, P> handler, P p)
+ ResultHandler<? super SearchResultEntry> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- final SingleEntryFuture<P> innerFuture = new SingleEntryFuture<P>(
- handler);
+ final SingleEntryFuture innerFuture = new SingleEntryFuture(handler);
final ResultFuture<Result> future = search(request, innerFuture,
- innerFuture, p);
+ innerFuture);
innerFuture.setResultFuture(future);
return innerFuture;
}
diff --git a/sdk/src/org/opends/sdk/AbstractConnection.java b/sdk/src/org/opends/sdk/AbstractConnection.java
index 7b3f780..53fc0bc 100644
--- a/sdk/src/org/opends/sdk/AbstractConnection.java
+++ b/sdk/src/org/opends/sdk/AbstractConnection.java
@@ -53,7 +53,7 @@
{
private static final class SingleEntryHandler implements
- SearchResultHandler<Void>
+ SearchResultHandler
{
private volatile SearchResultEntry firstEntry = null;
@@ -63,7 +63,7 @@
- public void handleEntry(Void p, SearchResultEntry entry)
+ public void handleEntry(SearchResultEntry entry)
{
if (firstEntry == null)
{
@@ -74,7 +74,7 @@
- public void handleReference(Void p, SearchResultReference reference)
+ public void handleReference(SearchResultReference reference)
{
if (firstReference == null)
{
@@ -299,18 +299,17 @@
Validator.ensureNotNull(request, entries);
// FIXME: does this need to be thread safe?
- SearchResultHandler<Void> handler = new SearchResultHandler<Void>()
+ SearchResultHandler handler = new SearchResultHandler()
{
- public void handleEntry(Void p, SearchResultEntry entry)
+ public void handleEntry(SearchResultEntry entry)
{
entries.add(entry);
}
- public void handleReference(Void p,
- SearchResultReference reference)
+ public void handleReference(SearchResultReference reference)
{
if (references != null)
{
@@ -319,7 +318,7 @@
}
};
- return search(request, handler, null);
+ return search(request, handler);
}
@@ -345,7 +344,7 @@
NullPointerException
{
SingleEntryHandler handler = new SingleEntryHandler();
- search(request, handler, null);
+ search(request, handler);
if (handler.entryCount == 0)
{
diff --git a/sdk/src/org/opends/sdk/AbstractConnectionFactory.java b/sdk/src/org/opends/sdk/AbstractConnectionFactory.java
index 93fb7c4..ea77f1a 100644
--- a/sdk/src/org/opends/sdk/AbstractConnectionFactory.java
+++ b/sdk/src/org/opends/sdk/AbstractConnectionFactory.java
@@ -59,8 +59,8 @@
/**
* {@inheritDoc}
*/
- public abstract <P> ConnectionFuture<? extends C> getAsynchronousConnection(
- ConnectionResultHandler<? super C, P> handler, P p);
+ public abstract ConnectionFuture<? extends C> getAsynchronousConnection(
+ ConnectionResultHandler<? super C> handler);
@@ -104,8 +104,7 @@
protected final C blockingGetAsynchronousConnection()
throws ErrorResultException
{
- ConnectionFuture<? extends C> future =
- getAsynchronousConnection(null, null);
+ ConnectionFuture<? extends C> future = getAsynchronousConnection(null);
try
{
return future.get();
@@ -115,10 +114,9 @@
// Cancel the request if possible.
future.cancel(false);
- Result result =
- Responses.newResult(ResultCode.CLIENT_SIDE_CONNECT_ERROR)
- .setCause(e)
- .setDiagnosticMessage(e.getLocalizedMessage());
+ Result result = Responses.newResult(
+ ResultCode.CLIENT_SIDE_CONNECT_ERROR).setCause(e)
+ .setDiagnosticMessage(e.getLocalizedMessage());
throw ErrorResultException.wrap(result);
}
}
diff --git a/sdk/src/org/opends/sdk/AsynchronousConnection.java b/sdk/src/org/opends/sdk/AsynchronousConnection.java
index 1091574..a1ea6fb 100644
--- a/sdk/src/org/opends/sdk/AsynchronousConnection.java
+++ b/sdk/src/org/opends/sdk/AsynchronousConnection.java
@@ -165,17 +165,12 @@
* Adds an entry to the Directory Server using the provided add
* request.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The add request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support add operations.
@@ -185,8 +180,8 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> ResultFuture<Result> add(AddRequest request,
- ResultHandler<Result, P> handler, P p)
+ ResultFuture<Result> add(AddRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -215,17 +210,12 @@
* Authenticates to the Directory Server using the provided bind
* request.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The bind request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support bind operations.
@@ -235,8 +225,8 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> ResultFuture<BindResult> bind(BindRequest request,
- ResultHandler<? super BindResult, P> handler, P p)
+ ResultFuture<BindResult> bind(BindRequest request,
+ ResultHandler<? super BindResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -297,17 +287,12 @@
* Compares an entry in the Directory Server using the provided
* compare request.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The compare request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support compare operations.
@@ -317,8 +302,8 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> ResultFuture<CompareResult> compare(CompareRequest request,
- ResultHandler<? super CompareResult, P> handler, P p)
+ ResultFuture<CompareResult> compare(CompareRequest request,
+ ResultHandler<? super CompareResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -328,17 +313,12 @@
* Deletes an entry from the Directory Server using the provided
* delete request.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The delete request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support delete operations.
@@ -348,8 +328,8 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> ResultFuture<Result> delete(DeleteRequest request,
- ResultHandler<Result, P> handler, P p)
+ ResultFuture<Result> delete(DeleteRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -361,17 +341,12 @@
*
* @param <R>
* The type of result returned by the extended request.
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The extended request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support extended operations.
@@ -381,9 +356,9 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <R extends Result, P> ResultFuture<R> extendedRequest(
- ExtendedRequest<R> request, ResultHandler<? super R, P> handler,
- P p) throws UnsupportedOperationException, IllegalStateException,
+ <R extends Result> ResultFuture<R> extendedRequest(
+ ExtendedRequest<R> request, ResultHandler<? super R> handler)
+ throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -405,17 +380,12 @@
* Modifies an entry in the Directory Server using the provided modify
* request.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The modify request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support modify operations.
@@ -425,8 +395,8 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> ResultFuture<Result> modify(ModifyRequest request,
- ResultHandler<Result, P> handler, P p)
+ ResultFuture<Result> modify(ModifyRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -436,17 +406,12 @@
* Renames an entry in the Directory Server using the provided modify
* DN request.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The modify DN request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support modify DN operations.
@@ -456,8 +421,8 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> ResultFuture<Result> modifyDN(ModifyDNRequest request,
- ResultHandler<Result, P> handler, P p)
+ ResultFuture<Result> modifyDN(ModifyDNRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -478,9 +443,6 @@
* connection.searchSingleEntry(request, resultHandler, p);
* </pre>
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param name
* The distinguished name of the entry to be read.
* @param attributeDescriptions
@@ -491,8 +453,6 @@
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -502,9 +462,9 @@
* @throws NullPointerException
* If the {@code name} was {@code null}.
*/
- <P> ResultFuture<SearchResultEntry> readEntry(DN name,
+ ResultFuture<SearchResultEntry> readEntry(DN name,
Collection<String> attributeDescriptions,
- ResultHandler<? super SearchResultEntry, P> handler, P p)
+ ResultHandler<? super SearchResultEntry> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -517,15 +477,10 @@
* request will fail with an {@link EntryNotFoundException}. More
* specifically, the returned future will never return {@code null}.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -533,8 +488,7 @@
* If this connection has already been closed, i.e. if
* {@code isClosed() == true}.
*/
- <P> ResultFuture<RootDSE> readRootDSE(
- ResultHandler<RootDSE, P> handler, P p)
+ ResultFuture<RootDSE> readRootDSE(ResultHandler<RootDSE> handler)
throws UnsupportedOperationException, IllegalStateException;
@@ -551,17 +505,12 @@
* Implementations may choose to perform optimizations such as
* caching.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param name
* The distinguished name of the subschema sub-entry.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -569,8 +518,7 @@
* If this connection has already been closed, i.e. if
* {@code isClosed() == true}.
*/
- <P> ResultFuture<Schema> readSchema(DN name,
- ResultHandler<Schema, P> handler, P p)
+ ResultFuture<Schema> readSchema(DN name, ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException;
@@ -589,18 +537,13 @@
* schema. However, implementations may choose to perform other
* optimizations, such as caching.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param name
* The distinguished name of the entry whose schema is to be
* located.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
- * {@code null}.
- * @param p
- * Optional additional handler parameter.
+ * {@code null}. Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -608,8 +551,8 @@
* If this connection has already been closed, i.e. if
* {@code isClosed() == true}.
*/
- <P> ResultFuture<Schema> readSchemaForEntry(DN name,
- ResultHandler<Schema, P> handler, P p)
+ ResultFuture<Schema> readSchemaForEntry(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException;
@@ -634,9 +577,6 @@
/**
* Searches the Directory Server using the provided search request.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The search request.
* @param resultHandler
@@ -647,8 +587,6 @@
* A search result handler which can be used to
* asynchronously process the search result entries and
* references as they are received, may be {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -658,9 +596,9 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> ResultFuture<Result> search(SearchRequest request,
- ResultHandler<Result, P> resultHandler,
- SearchResultHandler<P> searchResulthandler, P p)
+ ResultFuture<Result> search(SearchRequest request,
+ ResultHandler<Result> resultHandler,
+ SearchResultHandler searchResulthandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
@@ -677,17 +615,12 @@
* then the request will fail with an
* {@link MultipleEntriesFoundException}.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The search request.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -697,9 +630,9 @@
* @throws NullPointerException
* If the {@code request} was {@code null}.
*/
- <P> ResultFuture<SearchResultEntry> searchSingleEntry(
+ ResultFuture<SearchResultEntry> searchSingleEntry(
SearchRequest request,
- ResultHandler<? super SearchResultEntry, P> handler, P p)
+ ResultHandler<? super SearchResultEntry> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException;
}
diff --git a/sdk/src/org/opends/sdk/AuthenticatedConnectionFactory.java b/sdk/src/org/opends/sdk/AuthenticatedConnectionFactory.java
index 953fe56..3dbf42d 100644
--- a/sdk/src/org/opends/sdk/AuthenticatedConnectionFactory.java
+++ b/sdk/src/org/opends/sdk/AuthenticatedConnectionFactory.java
@@ -105,16 +105,15 @@
/**
* {@inheritDoc}
*/
- public <P> ConnectionFuture<AuthenticatedAsynchronousConnection> getAsynchronousConnection(
- ConnectionResultHandler<? super AuthenticatedAsynchronousConnection, P> handler,
- P p)
+ public ConnectionFuture<AuthenticatedAsynchronousConnection> getAsynchronousConnection(
+ ConnectionResultHandler<? super AuthenticatedAsynchronousConnection> handler)
{
// TODO: bug here? if allowRebind= false then bind will never
// happen
- ConnectionFutureImpl<P> future = new ConnectionFutureImpl<P>(
- allowRebinds ? request : null, handler, p);
- future.connectFuture = parentFactory.getAsynchronousConnection(
- future, null);
+ ConnectionFutureImpl future = new ConnectionFutureImpl(
+ allowRebinds ? request : null, handler);
+ future.connectFuture = parentFactory
+ .getAsynchronousConnection(future);
return future;
}
@@ -280,12 +279,12 @@
- public <P> ResultFuture<Result> add(AddRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> add(AddRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.add(request, handler, p);
+ return connection.add(request, handler);
}
@@ -304,8 +303,8 @@
* connections. This method will always throw {@code
* UnsupportedOperationException}.
*/
- public <P> ResultFuture<BindResult> bind(BindRequest request,
- ResultHandler<? super BindResult, P> handler, P p)
+ public ResultFuture<BindResult> bind(BindRequest request,
+ ResultHandler<? super BindResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -329,54 +328,52 @@
- public <P> ResultFuture<CompareResult> compare(
- CompareRequest request,
- ResultHandler<? super CompareResult, P> handler, P p)
+ public ResultFuture<CompareResult> compare(CompareRequest request,
+ ResultHandler<? super CompareResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.compare(request, handler, p);
+ return connection.compare(request, handler);
}
- public <P> ResultFuture<Result> delete(DeleteRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> delete(DeleteRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.delete(request, handler, p);
+ return connection.delete(request, handler);
}
- public <R extends Result, P> ResultFuture<R> extendedRequest(
- ExtendedRequest<R> request,
- ResultHandler<? super R, P> handler, P p)
+ public <R extends Result> ResultFuture<R> extendedRequest(
+ ExtendedRequest<R> request, ResultHandler<? super R> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.extendedRequest(request, handler, p);
+ return connection.extendedRequest(request, handler);
}
- public <P> ResultFuture<Result> modify(ModifyRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modify(ModifyRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.modify(request, handler, p);
+ return connection.modify(request, handler);
}
- public <P> ResultFuture<Result> modifyDN(ModifyDNRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modifyDN(ModifyDNRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.modifyDN(request, handler, p);
+ return connection.modifyDN(request, handler);
}
@@ -386,15 +383,10 @@
* associated with this connection. If re-authentication fails for
* some reason then this connection will be automatically closed.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param handler
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support rebind operations.
@@ -402,8 +394,8 @@
* If this connection has already been closed, i.e. if
* {@code isClosed() == true}.
*/
- public <P> ResultFuture<BindResult> rebind(
- ResultHandler<? super BindResult, P> handler, P p)
+ public ResultFuture<BindResult> rebind(
+ ResultHandler<? super BindResult> handler)
throws UnsupportedOperationException, IllegalStateException
{
if (request == null)
@@ -413,13 +405,12 @@
// Wrap the client handler so that we can update the connection
// state.
- final ResultHandler<? super BindResult, P> clientHandler = handler;
- final P clientParameter = p;
+ final ResultHandler<? super BindResult> clientHandler = handler;
- ResultHandler<BindResult, Void> handlerWrapper = new ResultHandler<BindResult, Void>()
+ ResultHandler<BindResult> handlerWrapper = new ResultHandler<BindResult>()
{
- public void handleErrorResult(Void p, ErrorResultException error)
+ public void handleErrorResult(ErrorResultException error)
{
// This connection is now unauthenticated so prevent
// further use.
@@ -427,26 +418,26 @@
if (clientHandler != null)
{
- clientHandler.handleErrorResult(clientParameter, error);
+ clientHandler.handleErrorResult(error);
}
}
- public void handleResult(Void p, BindResult result)
+ public void handleResult(BindResult result)
{
// Save the result.
AuthenticatedAsynchronousConnection.this.result = result;
if (clientHandler != null)
{
- clientHandler.handleResult(clientParameter, result);
+ clientHandler.handleResult(result);
}
}
};
- return connection.bind(request, handlerWrapper, null);
+ return connection.bind(request, handlerWrapper);
}
@@ -459,14 +450,14 @@
- public <P> ResultFuture<Result> search(SearchRequest request,
- ResultHandler<Result, P> resultHandler,
- SearchResultHandler<P> searchResulthandler, P p)
+ public ResultFuture<Result> search(SearchRequest request,
+ ResultHandler<Result> resultHandler,
+ SearchResultHandler searchResulthandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
return connection.search(request, resultHandler,
- searchResulthandler, p);
+ searchResulthandler);
}
@@ -484,11 +475,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<RootDSE> readRootDSE(
- ResultHandler<RootDSE, P> handler, P p)
+ public ResultFuture<RootDSE> readRootDSE(
+ ResultHandler<RootDSE> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return connection.readRootDSE(handler, p);
+ return connection.readRootDSE(handler);
}
@@ -496,14 +487,14 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> readEntry(DN name,
+ public ResultFuture<SearchResultEntry> readEntry(DN name,
Collection<String> attributeDescriptions,
- ResultHandler<? super SearchResultEntry, P> resultHandler, P p)
+ ResultHandler<? super SearchResultEntry> resultHandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
return connection.readEntry(name, attributeDescriptions,
- resultHandler, p);
+ resultHandler);
}
@@ -511,13 +502,13 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> searchSingleEntry(
+ public ResultFuture<SearchResultEntry> searchSingleEntry(
SearchRequest request,
- ResultHandler<? super SearchResultEntry, P> resultHandler, P p)
+ ResultHandler<? super SearchResultEntry> resultHandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.searchSingleEntry(request, resultHandler, p);
+ return connection.searchSingleEntry(request, resultHandler);
}
@@ -525,11 +516,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchemaForEntry(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchemaForEntry(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return connection.readSchemaForEntry(name, handler, p);
+ return connection.readSchemaForEntry(name, handler);
}
@@ -537,11 +528,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchema(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchema(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return connection.readSchema(name, handler, p);
+ return connection.readSchema(name, handler);
}
}
@@ -569,10 +560,10 @@
- private static final class ConnectionFutureImpl<P> implements
+ private static final class ConnectionFutureImpl implements
ConnectionFuture<AuthenticatedAsynchronousConnection>,
- ConnectionResultHandler<AsynchronousConnection, Void>,
- ResultHandler<BindResult, Void>
+ ConnectionResultHandler<AsynchronousConnection>,
+ ResultHandler<BindResult>
{
private volatile AuthenticatedAsynchronousConnection authenticatedConnection;
@@ -586,9 +577,7 @@
private final CountDownLatch latch = new CountDownLatch(1);
- private final ConnectionResultHandler<? super AuthenticatedAsynchronousConnection, P> handler;
-
- private final P p;
+ private final ConnectionResultHandler<? super AuthenticatedAsynchronousConnection> handler;
private boolean cancelled;
@@ -598,12 +587,10 @@
private ConnectionFutureImpl(
BindRequest request,
- ConnectionResultHandler<? super AuthenticatedAsynchronousConnection, P> handler,
- P p)
+ ConnectionResultHandler<? super AuthenticatedAsynchronousConnection> handler)
{
this.request = request;
this.handler = handler;
- this.p = p;
}
@@ -671,16 +658,15 @@
- public void handleConnection(Void v,
- AsynchronousConnection connection)
+ public void handleConnection(AsynchronousConnection connection)
{
this.connection = connection;
- this.bindFuture = this.connection.bind(request, this, null);
+ this.bindFuture = this.connection.bind(request, this);
}
- public void handleConnectionError(Void v, ErrorResultException error)
+ public void handleConnectionError(ErrorResultException error)
{
exception = error;
latch.countDown();
@@ -688,7 +674,7 @@
- public void handleResult(Void v, BindResult result)
+ public void handleResult(BindResult result)
{
// FIXME: should make the result unmodifiable.
authenticatedConnection = new AuthenticatedAsynchronousConnection(
@@ -696,13 +682,13 @@
latch.countDown();
if (handler != null)
{
- handler.handleConnection(p, authenticatedConnection);
+ handler.handleConnection(authenticatedConnection);
}
}
- public void handleErrorResult(Void v, ErrorResultException error)
+ public void handleErrorResult(ErrorResultException error)
{
// Ensure that the connection is closed.
try
@@ -718,7 +704,7 @@
latch.countDown();
if (handler != null)
{
- handler.handleConnectionError(p, exception);
+ handler.handleConnectionError(exception);
}
}
}
@@ -765,11 +751,10 @@
- public <P> ConnectionFuture<AuthenticatedAsynchronousConnection> getAsynchronousConnection(
- ConnectionResultHandler<? super AuthenticatedAsynchronousConnection, P> handler,
- P p)
+ public ConnectionFuture<AuthenticatedAsynchronousConnection> getAsynchronousConnection(
+ ConnectionResultHandler<? super AuthenticatedAsynchronousConnection> handler)
{
- return impl.getAsynchronousConnection(handler, p);
+ return impl.getAsynchronousConnection(handler);
}
diff --git a/sdk/src/org/opends/sdk/Connection.java b/sdk/src/org/opends/sdk/Connection.java
index cf2cfaf..74ee0fd 100644
--- a/sdk/src/org/opends/sdk/Connection.java
+++ b/sdk/src/org/opends/sdk/Connection.java
@@ -1126,17 +1126,12 @@
* result references will be passed to the provided search result
* handler.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param request
* The search request.
* @param handler
* A search result handler which can be used to process the
* search result entries and references as they are received,
* may be {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return The result of the operation.
* @throws ErrorResultException
* If the result code indicates that the request failed for
@@ -1151,10 +1146,10 @@
* @throws NullPointerException
* If {@code request} was {@code null}.
*/
- <P> Result search(SearchRequest request,
- SearchResultHandler<P> handler, P p) throws ErrorResultException,
- InterruptedException, UnsupportedOperationException,
- IllegalStateException, NullPointerException;
+ Result search(SearchRequest request, SearchResultHandler handler)
+ throws ErrorResultException, InterruptedException,
+ UnsupportedOperationException, IllegalStateException,
+ NullPointerException;
diff --git a/sdk/src/org/opends/sdk/ConnectionFactory.java b/sdk/src/org/opends/sdk/ConnectionFactory.java
index 8d8d998..ed345b9 100644
--- a/sdk/src/org/opends/sdk/ConnectionFactory.java
+++ b/sdk/src/org/opends/sdk/ConnectionFactory.java
@@ -27,8 +27,6 @@
package org.opends.sdk;
-
-
/**
* A connection factory provides an interface for obtaining a connection
* to a Directory Server. Connection factories can be used to wrap other
@@ -79,17 +77,12 @@
* ConnectionResultHandler} is provided, the handler will be notified
* when the connection is available and ready for use.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param handler
* The completion handler, or {@code null} if no handler is
* to be used.
- * @param p
- * Optional additional handler parameter.
* @return A future which can be used to retrieve the asynchronous
* connection.
*/
- <P> ConnectionFuture<? extends C> getAsynchronousConnection(
- ConnectionResultHandler<? super C, P> handler, P p);
+ ConnectionFuture<? extends C> getAsynchronousConnection(
+ ConnectionResultHandler<? super C> handler);
}
diff --git a/sdk/src/org/opends/sdk/ConnectionPool.java b/sdk/src/org/opends/sdk/ConnectionPool.java
index e8c9504..5bf2dff 100644
--- a/sdk/src/org/opends/sdk/ConnectionPool.java
+++ b/sdk/src/org/opends/sdk/ConnectionPool.java
@@ -60,7 +60,7 @@
// FIXME: should use a better collection than this - CLQ?
private final Stack<AsynchronousConnection> pool;
- private final ConcurrentLinkedQueue<PendingConnectionFuture<?>> pendingFutures;
+ private final ConcurrentLinkedQueue<PendingConnectionFuture> pendingFutures;
private final Object lock = new Object();
@@ -94,8 +94,8 @@
- public <P> ResultFuture<Result> add(AddRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> add(AddRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -103,13 +103,13 @@
{
throw new IllegalStateException();
}
- return connection.add(request, handler, p);
+ return connection.add(request, handler);
}
- public <P> ResultFuture<BindResult> bind(BindRequest request,
- ResultHandler<? super BindResult, P> handler, P p)
+ public ResultFuture<BindResult> bind(BindRequest request,
+ ResultHandler<? super BindResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -117,7 +117,7 @@
{
throw new IllegalStateException();
}
- return connection.bind(request, handler, p);
+ return connection.bind(request, handler);
}
@@ -145,7 +145,7 @@
}
// See if there waiters pending
- PendingConnectionFuture<?> future = pendingFutures.poll();
+ PendingConnectionFuture future = pendingFutures.poll();
if (future != null)
{
PooledConnectionWapper pooledConnection = new PooledConnectionWapper(
@@ -195,9 +195,8 @@
- public <P> ResultFuture<CompareResult> compare(
- CompareRequest request,
- ResultHandler<? super CompareResult, P> handler, P p)
+ public ResultFuture<CompareResult> compare(CompareRequest request,
+ ResultHandler<? super CompareResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -205,13 +204,13 @@
{
throw new IllegalStateException();
}
- return connection.compare(request, handler, p);
+ return connection.compare(request, handler);
}
- public <P> ResultFuture<Result> delete(DeleteRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> delete(DeleteRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -219,14 +218,13 @@
{
throw new IllegalStateException();
}
- return connection.delete(request, handler, p);
+ return connection.delete(request, handler);
}
- public <R extends Result, P> ResultFuture<R> extendedRequest(
- ExtendedRequest<R> request,
- ResultHandler<? super R, P> handler, P p)
+ public <R extends Result> ResultFuture<R> extendedRequest(
+ ExtendedRequest<R> request, ResultHandler<? super R> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -234,13 +232,13 @@
{
throw new IllegalStateException();
}
- return connection.extendedRequest(request, handler, p);
+ return connection.extendedRequest(request, handler);
}
- public <P> ResultFuture<Result> modify(ModifyRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modify(ModifyRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -248,13 +246,13 @@
{
throw new IllegalStateException();
}
- return connection.modify(request, handler, p);
+ return connection.modify(request, handler);
}
- public <P> ResultFuture<Result> modifyDN(ModifyDNRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modifyDN(ModifyDNRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -262,14 +260,14 @@
{
throw new IllegalStateException();
}
- return connection.modifyDN(request, handler, p);
+ return connection.modifyDN(request, handler);
}
- public <P> ResultFuture<Result> search(SearchRequest request,
- ResultHandler<Result, P> resultHandler,
- SearchResultHandler<P> searchResulthandler, P p)
+ public ResultFuture<Result> search(SearchRequest request,
+ ResultHandler<Result> resultHandler,
+ SearchResultHandler searchResulthandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -278,7 +276,7 @@
throw new IllegalStateException();
}
return connection.search(request, resultHandler,
- searchResulthandler, p);
+ searchResulthandler);
}
@@ -286,9 +284,9 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> readEntry(DN name,
+ public ResultFuture<SearchResultEntry> readEntry(DN name,
Collection<String> attributeDescriptions,
- ResultHandler<? super SearchResultEntry, P> resultHandler, P p)
+ ResultHandler<? super SearchResultEntry> resultHandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -297,7 +295,7 @@
throw new IllegalStateException();
}
return connection.readEntry(name, attributeDescriptions,
- resultHandler, p);
+ resultHandler);
}
@@ -305,9 +303,9 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> searchSingleEntry(
+ public ResultFuture<SearchResultEntry> searchSingleEntry(
SearchRequest request,
- ResultHandler<? super SearchResultEntry, P> resultHandler, P p)
+ ResultHandler<? super SearchResultEntry> resultHandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
@@ -315,7 +313,7 @@
{
throw new IllegalStateException();
}
- return connection.searchSingleEntry(request, resultHandler, p);
+ return connection.searchSingleEntry(request, resultHandler);
}
@@ -323,15 +321,15 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<RootDSE> readRootDSE(
- ResultHandler<RootDSE, P> handler, P p)
+ public ResultFuture<RootDSE> readRootDSE(
+ ResultHandler<RootDSE> handler)
throws UnsupportedOperationException, IllegalStateException
{
if (connection == null)
{
throw new IllegalStateException();
}
- return connection.readRootDSE(handler, p);
+ return connection.readRootDSE(handler);
}
@@ -339,15 +337,15 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchemaForEntry(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchemaForEntry(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
if (connection == null)
{
throw new IllegalStateException();
}
- return connection.readSchemaForEntry(name, handler, p);
+ return connection.readSchemaForEntry(name, handler);
}
@@ -355,15 +353,15 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchema(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchema(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
if (connection == null)
{
throw new IllegalStateException();
}
- return connection.readSchema(name, handler, p);
+ return connection.readSchema(name, handler);
}
@@ -493,7 +491,7 @@
- private final class PendingConnectionFuture<P> implements
+ private final class PendingConnectionFuture implements
ConnectionFuture<AsynchronousConnection>
{
private volatile boolean isCancelled;
@@ -502,20 +500,16 @@
private volatile ErrorResultException err;
- private final ConnectionResultHandler<? super AsynchronousConnection, P> handler;
-
- private final P p;
+ private final ConnectionResultHandler<? super AsynchronousConnection> handler;
private final CountDownLatch latch = new CountDownLatch(1);
private PendingConnectionFuture(
- P p,
- ConnectionResultHandler<? super AsynchronousConnection, P> handler)
+ ConnectionResultHandler<? super AsynchronousConnection> handler)
{
this.handler = handler;
- this.p = p;
}
@@ -573,7 +567,7 @@
this.connection = connection;
if (handler != null)
{
- handler.handleConnection(p, connection);
+ handler.handleConnection(connection);
}
latch.countDown();
}
@@ -585,7 +579,7 @@
this.err = e;
if (handler != null)
{
- handler.handleConnectionError(p, e);
+ handler.handleConnectionError(e);
}
latch.countDown();
}
@@ -609,28 +603,26 @@
this.connectionFactory = connectionFactory;
this.poolSize = poolSize;
this.pool = new Stack<AsynchronousConnection>();
- this.pendingFutures = new ConcurrentLinkedQueue<PendingConnectionFuture<?>>();
+ this.pendingFutures = new ConcurrentLinkedQueue<PendingConnectionFuture>();
}
private final class WrapConnectionResultHandler implements
- ConnectionResultHandler<AsynchronousConnection, Void>
+ ConnectionResultHandler<AsynchronousConnection>
{
- private final PendingConnectionFuture<?> future;
+ private final PendingConnectionFuture future;
- private WrapConnectionResultHandler(
- PendingConnectionFuture<?> future)
+ private WrapConnectionResultHandler(PendingConnectionFuture future)
{
this.future = future;
}
- public void handleConnection(java.lang.Void p,
- AsynchronousConnection connection)
+ public void handleConnection(AsynchronousConnection connection)
{
PooledConnectionWapper pooledConnection = new PooledConnectionWapper(
connection);
@@ -639,8 +631,7 @@
- public void handleConnectionError(java.lang.Void p,
- ErrorResultException error)
+ public void handleConnectionError(ErrorResultException error)
{
future.error(error);
}
@@ -648,9 +639,8 @@
- public <P> ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
- ConnectionResultHandler<? super AsynchronousConnection, P> handler,
- P p)
+ public ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
+ ConnectionResultHandler<? super AsynchronousConnection> handler)
{
synchronized (lock)
{
@@ -673,13 +663,13 @@
conn);
if (handler != null)
{
- handler.handleConnection(p, pooledConnection);
+ handler.handleConnection(pooledConnection);
}
return new CompletedConnectionFuture(pooledConnection);
}
- PendingConnectionFuture<P> pendingFuture = new PendingConnectionFuture<P>(
- p, handler);
+ PendingConnectionFuture pendingFuture = new PendingConnectionFuture(
+ handler);
// Pool was empty. Maybe a new connection if pool size is not
// reached
if (numConnections < poolSize)
@@ -687,7 +677,7 @@
numConnections++;
WrapConnectionResultHandler wrapHandler = new WrapConnectionResultHandler(
pendingFuture);
- connectionFactory.getAsynchronousConnection(wrapHandler, null);
+ connectionFactory.getAsynchronousConnection(wrapHandler);
if (StaticUtils.DEBUG_LOG.isLoggable(Level.FINE))
{
StaticUtils.DEBUG_LOG
diff --git a/sdk/src/org/opends/sdk/ConnectionResultHandler.java b/sdk/src/org/opends/sdk/ConnectionResultHandler.java
index c4ee3d6..3e9d56e 100644
--- a/sdk/src/org/opends/sdk/ConnectionResultHandler.java
+++ b/sdk/src/org/opends/sdk/ConnectionResultHandler.java
@@ -27,8 +27,6 @@
package org.opends.sdk;
-
-
/**
* A completion handler which is notified when an asynchronous
* connection attempt has completed.
@@ -47,35 +45,27 @@
* @param <C>
* The type of asynchronous connection handled by this
* connection result handler.
- * @param <P>
- * The type of the additional parameter to this handler's
- * methods. Use {@link java.lang.Void} for visitors that do not
- * need an additional parameter.
*/
-public interface ConnectionResultHandler<C extends AsynchronousConnection, P>
+public interface ConnectionResultHandler<C extends AsynchronousConnection>
{
/**
* Invoked when the asynchronous connection has completed
* successfully.
*
- * @param p
- * A handler specified parameter.
* @param connection
* The connection which can be used to interact with the
* Directory Server.
*/
- void handleConnection(P p, C connection);
+ void handleConnection(C connection);
/**
* Invoked when the asynchronous connection attempt has failed.
*
- * @param p
- * A handler specified parameter.
* @param error
* The error result exception indicating why the asynchronous
* connection attempt has failed.
*/
- void handleConnectionError(P p, ErrorResultException error);
+ void handleConnectionError(ErrorResultException error);
}
diff --git a/sdk/src/org/opends/sdk/HeartBeatConnectionFactory.java b/sdk/src/org/opends/sdk/HeartBeatConnectionFactory.java
index 498d486..3fb12f3 100644
--- a/sdk/src/org/opends/sdk/HeartBeatConnectionFactory.java
+++ b/sdk/src/org/opends/sdk/HeartBeatConnectionFactory.java
@@ -136,7 +136,7 @@
*/
private final class AsynchronousConnectionImpl implements
AsynchronousConnection, ConnectionEventListener,
- ResultHandler<Result, Void>
+ ResultHandler<Result>
{
private final AsynchronousConnection connection;
@@ -158,22 +158,22 @@
- public <P> ResultFuture<Result> add(AddRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> add(AddRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.add(request, handler, p);
+ return connection.add(request, handler);
}
- public <P> ResultFuture<BindResult> bind(BindRequest request,
- ResultHandler<? super BindResult, P> handler, P p)
+ public ResultFuture<BindResult> bind(BindRequest request,
+ ResultHandler<? super BindResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.bind(request, handler, p);
+ return connection.bind(request, handler);
}
@@ -203,66 +203,64 @@
- public <P> ResultFuture<CompareResult> compare(
- CompareRequest request,
- ResultHandler<? super CompareResult, P> handler, P p)
+ public ResultFuture<CompareResult> compare(CompareRequest request,
+ ResultHandler<? super CompareResult> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.compare(request, handler, p);
+ return connection.compare(request, handler);
}
- public <P> ResultFuture<Result> delete(DeleteRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> delete(DeleteRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.delete(request, handler, p);
+ return connection.delete(request, handler);
}
- public <R extends Result, P> ResultFuture<R> extendedRequest(
- ExtendedRequest<R> request,
- ResultHandler<? super R, P> handler, P p)
+ public <R extends Result> ResultFuture<R> extendedRequest(
+ ExtendedRequest<R> request, ResultHandler<? super R> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.extendedRequest(request, handler, p);
+ return connection.extendedRequest(request, handler);
}
- public <P> ResultFuture<Result> modify(ModifyRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modify(ModifyRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.modify(request, handler, p);
+ return connection.modify(request, handler);
}
- public <P> ResultFuture<Result> modifyDN(ModifyDNRequest request,
- ResultHandler<Result, P> handler, P p)
+ public ResultFuture<Result> modifyDN(ModifyDNRequest request,
+ ResultHandler<Result> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.modifyDN(request, handler, p);
+ return connection.modifyDN(request, handler);
}
- public <P> ResultFuture<Result> search(SearchRequest request,
- ResultHandler<Result, P> resultHandler,
- SearchResultHandler<P> searchResultHandler, P p)
+ public ResultFuture<Result> search(SearchRequest request,
+ ResultHandler<Result> resultHandler,
+ SearchResultHandler searchResultHandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
return connection.search(request, resultHandler,
- searchResultHandler, p);
+ searchResultHandler);
}
@@ -270,14 +268,14 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> readEntry(DN name,
+ public ResultFuture<SearchResultEntry> readEntry(DN name,
Collection<String> attributeDescriptions,
- ResultHandler<? super SearchResultEntry, P> resultHandler, P p)
+ ResultHandler<? super SearchResultEntry> resultHandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
return connection.readEntry(name, attributeDescriptions,
- resultHandler, p);
+ resultHandler);
}
@@ -285,13 +283,13 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<SearchResultEntry> searchSingleEntry(
+ public ResultFuture<SearchResultEntry> searchSingleEntry(
SearchRequest request,
- ResultHandler<? super SearchResultEntry, P> resultHandler, P p)
+ ResultHandler<? super SearchResultEntry> resultHandler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- return connection.searchSingleEntry(request, resultHandler, p);
+ return connection.searchSingleEntry(request, resultHandler);
}
@@ -299,11 +297,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<RootDSE> readRootDSE(
- ResultHandler<RootDSE, P> handler, P p)
+ public ResultFuture<RootDSE> readRootDSE(
+ ResultHandler<RootDSE> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return connection.readRootDSE(handler, p);
+ return connection.readRootDSE(handler);
}
@@ -311,11 +309,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchemaForEntry(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchemaForEntry(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return connection.readSchemaForEntry(name, handler, p);
+ return connection.readSchemaForEntry(name, handler);
}
@@ -323,11 +321,11 @@
/**
* {@inheritDoc}
*/
- public <P> ResultFuture<Schema> readSchema(DN name,
- ResultHandler<Schema, P> handler, P p)
+ public ResultFuture<Schema> readSchema(DN name,
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException
{
- return connection.readSchema(name, handler, p);
+ return connection.readSchema(name, handler);
}
@@ -379,7 +377,7 @@
- public void handleErrorResult(Void aVoid, ErrorResultException error)
+ public void handleErrorResult(ErrorResultException error)
{
// TODO: I18N
if (error instanceof TimeoutResultException)
@@ -390,7 +388,7 @@
- public void handleResult(Void aVoid, Result result)
+ public void handleResult(Result result)
{
// Do nothing
}
@@ -399,7 +397,7 @@
private void sendHeartBeat()
{
- search(heartBeat, this, null, null);
+ search(heartBeat, this, null);
}
}
@@ -439,9 +437,9 @@
- private final class ConnectionFutureImpl<P> implements
+ private final class ConnectionFutureImpl implements
ConnectionFuture<AsynchronousConnection>,
- ConnectionResultHandler<AsynchronousConnection, Void>
+ ConnectionResultHandler<AsynchronousConnection>
{
private volatile AsynchronousConnectionImpl heartBeatConnection;
@@ -451,20 +449,16 @@
private final CountDownLatch latch = new CountDownLatch(1);
- private final ConnectionResultHandler<? super AsynchronousConnectionImpl, P> handler;
-
- private final P p;
+ private final ConnectionResultHandler<? super AsynchronousConnectionImpl> handler;
private boolean cancelled;
private ConnectionFutureImpl(
- ConnectionResultHandler<? super AsynchronousConnectionImpl, P> handler,
- P p)
+ ConnectionResultHandler<? super AsynchronousConnectionImpl> handler)
{
this.handler = handler;
- this.p = p;
}
@@ -530,8 +524,7 @@
- public void handleConnection(Void v,
- AsynchronousConnection connection)
+ public void handleConnection(AsynchronousConnection connection)
{
heartBeatConnection = new AsynchronousConnectionImpl(connection);
synchronized (activeConnections)
@@ -541,19 +534,19 @@
}
if (handler != null)
{
- handler.handleConnection(p, heartBeatConnection);
+ handler.handleConnection(heartBeatConnection);
}
latch.countDown();
}
- public void handleConnectionError(Void v, ErrorResultException error)
+ public void handleConnectionError(ErrorResultException error)
{
exception = error;
if (handler != null)
{
- handler.handleConnectionError(p, error);
+ handler.handleConnectionError(error);
}
latch.countDown();
}
@@ -561,14 +554,12 @@
- public <P> ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
- ConnectionResultHandler<? super AsynchronousConnection, P> handler,
- P p)
+ public ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
+ ConnectionResultHandler<? super AsynchronousConnection> handler)
{
- ConnectionFutureImpl<P> future = new ConnectionFutureImpl<P>(
- handler, p);
- future.connectFuture = parentFactory.getAsynchronousConnection(
- future, null);
+ ConnectionFutureImpl future = new ConnectionFutureImpl(handler);
+ future.connectFuture = parentFactory
+ .getAsynchronousConnection(future);
return future;
}
}
diff --git a/sdk/src/org/opends/sdk/ResultHandler.java b/sdk/src/org/opends/sdk/ResultHandler.java
index 84d638b..0b885c4 100644
--- a/sdk/src/org/opends/sdk/ResultHandler.java
+++ b/sdk/src/org/opends/sdk/ResultHandler.java
@@ -43,33 +43,25 @@
*
* @param <S>
* The type of result handled by this result handler.
- * @param <P>
- * The type of the additional parameter to this handler's
- * methods. Use {@link java.lang.Void} for visitors that do not
- * need an additional parameter.
*/
-public interface ResultHandler<S, P>
+public interface ResultHandler<S>
{
/**
* Invoked when the asynchronous operation has failed.
*
- * @param p
- * A handler specified parameter.
* @param error
* The error result exception indicating why the asynchronous
* operation has failed.
*/
- void handleErrorResult(P p, ErrorResultException error);
+ void handleErrorResult(ErrorResultException error);
/**
* Invoked when the asynchronous operation has completed successfully.
*
- * @param p
- * A handler specified parameter.
* @param result
* The result of the asynchronous operation.
*/
- void handleResult(P p, S result);
+ void handleResult(S result);
}
diff --git a/sdk/src/org/opends/sdk/RootDSE.java b/sdk/src/org/opends/sdk/RootDSE.java
index d9b579f..1a32f78 100644
--- a/sdk/src/org/opends/sdk/RootDSE.java
+++ b/sdk/src/org/opends/sdk/RootDSE.java
@@ -140,9 +140,6 @@
* request will fail with an {@link EntryNotFoundException}. More
* specifically, the returned future will never return {@code null}.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param connection
* A connection to the Directory Server whose Root DSE is to
* be read.
@@ -150,8 +147,6 @@
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If the connection does not support search operations.
@@ -161,14 +156,14 @@
* @throws NullPointerException
* If the {@code connection} was {@code null}.
*/
- public static <P> ResultFuture<RootDSE> readRootDSE(
+ public static ResultFuture<RootDSE> readRootDSE(
AsynchronousConnection connection,
- ResultHandler<RootDSE, P> handler, P p)
+ ResultHandler<RootDSE> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- final ResultTransformer<SearchResultEntry, RootDSE, P> future =
- new ResultTransformer<SearchResultEntry, RootDSE, P>(handler)
+ final ResultTransformer<SearchResultEntry, RootDSE> future =
+ new ResultTransformer<SearchResultEntry, RootDSE>(handler)
{
protected RootDSE transformResult(SearchResultEntry result)
@@ -180,7 +175,7 @@
};
ResultFuture<SearchResultEntry> innerFuture = connection
- .searchSingleEntry(SEARCH_REQUEST, future, p);
+ .searchSingleEntry(SEARCH_REQUEST, future);
future.setResultFuture(innerFuture);
return future;
}
diff --git a/sdk/src/org/opends/sdk/SearchResultHandler.java b/sdk/src/org/opends/sdk/SearchResultHandler.java
index 653e8c6..74ad84c 100644
--- a/sdk/src/org/opends/sdk/SearchResultHandler.java
+++ b/sdk/src/org/opends/sdk/SearchResultHandler.java
@@ -48,35 +48,26 @@
* Implementations of these methods should complete in a timely manner
* so as to avoid keeping the invoking thread from dispatching to other
* completion handlers.
- *
- * @param <P>
- * The type of the additional parameter to this handler's
- * methods. Use {@link java.lang.Void} for visitors that do not
- * need an additional parameter.
*/
-public interface SearchResultHandler<P>
+public interface SearchResultHandler
{
/**
* Invoked each time a search result entry is returned from an
* asynchronous search operation.
- *
- * @param p
- * A handler specified parameter.
+ *
* @param entry
* The search result entry.
*/
- void handleEntry(P p, SearchResultEntry entry);
+ void handleEntry(SearchResultEntry entry);
/**
* Invoked each time a search result reference is returned from an
* asynchronous search operation.
- *
- * @param p
- * A handler specified parameter.
+ *
* @param reference
* The search result reference.
*/
- void handleReference(P p, SearchResultReference reference);
+ void handleReference(SearchResultReference reference);
}
diff --git a/sdk/src/org/opends/sdk/SynchronousConnection.java b/sdk/src/org/opends/sdk/SynchronousConnection.java
index 3ebef74..87caee7 100644
--- a/sdk/src/org/opends/sdk/SynchronousConnection.java
+++ b/sdk/src/org/opends/sdk/SynchronousConnection.java
@@ -74,7 +74,7 @@
InterruptedException, UnsupportedOperationException,
IllegalStateException, NullPointerException
{
- ResultFuture<Result> future = connection.add(request, null, null);
+ ResultFuture<Result> future = connection.add(request, null);
try
{
return future.get();
@@ -102,8 +102,7 @@
UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- ResultFuture<BindResult> future = connection.bind(request, null,
- null);
+ ResultFuture<BindResult> future = connection.bind(request, null);
try
{
return future.get();
@@ -138,7 +137,7 @@
NullPointerException
{
ResultFuture<CompareResult> future = connection.compare(request,
- null, null);
+ null);
try
{
return future.get();
@@ -157,8 +156,7 @@
UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- ResultFuture<Result> future = connection
- .delete(request, null, null);
+ ResultFuture<Result> future = connection.delete(request, null);
try
{
return future.get();
@@ -177,8 +175,7 @@
UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- ResultFuture<R> future = connection.extendedRequest(request, null,
- null);
+ ResultFuture<R> future = connection.extendedRequest(request, null);
try
{
return future.get();
@@ -197,8 +194,7 @@
UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- ResultFuture<Result> future = connection
- .modify(request, null, null);
+ ResultFuture<Result> future = connection.modify(request, null);
try
{
return future.get();
@@ -217,8 +213,7 @@
UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- ResultFuture<Result> future = connection.modifyDN(request, null,
- null);
+ ResultFuture<Result> future = connection.modifyDN(request, null);
try
{
return future.get();
@@ -243,13 +238,13 @@
/**
* {@inheritDoc}
*/
- public <P> Result search(SearchRequest request,
- SearchResultHandler<P> handler, P p) throws ErrorResultException,
+ public Result search(SearchRequest request,
+ SearchResultHandler handler) throws ErrorResultException,
InterruptedException, UnsupportedOperationException,
IllegalStateException, NullPointerException
{
ResultFuture<Result> future = connection.search(request, null,
- handler, p);
+ handler);
try
{
return future.get();
@@ -281,7 +276,7 @@
UnsupportedOperationException, IllegalStateException
{
ResultFuture<Schema> future = connection.readSchemaForEntry(name,
- null, null);
+ null);
try
{
return future.get();
diff --git a/sdk/src/org/opends/sdk/ldap/LDAPConnectionFactory.java b/sdk/src/org/opends/sdk/ldap/LDAPConnectionFactory.java
index 7056d3f..7af69cb 100644
--- a/sdk/src/org/opends/sdk/ldap/LDAPConnectionFactory.java
+++ b/sdk/src/org/opends/sdk/ldap/LDAPConnectionFactory.java
@@ -33,6 +33,7 @@
import com.sun.opends.sdk.ldap.LDAPConnectionFactoryImpl;
+
/**
* LDAP connection factory implementation.
*/
@@ -113,11 +114,10 @@
- public <P> ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
- ConnectionResultHandler<? super AsynchronousConnection, P> handler,
- P p)
+ public ConnectionFuture<AsynchronousConnection> getAsynchronousConnection(
+ ConnectionResultHandler<? super AsynchronousConnection> handler)
{
- return impl.getAsynchronousConnection(handler, p);
+ return impl.getAsynchronousConnection(handler);
}
diff --git a/sdk/src/org/opends/sdk/schema/Schema.java b/sdk/src/org/opends/sdk/schema/Schema.java
index 1dcc5b7..37b665f 100644
--- a/sdk/src/org/opends/sdk/schema/Schema.java
+++ b/sdk/src/org/opends/sdk/schema/Schema.java
@@ -1640,9 +1640,6 @@
* Implementations may choose to perform optimizations such as
* caching.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param connection
* A connection to the Directory Server whose schema is to be
* read.
@@ -1652,8 +1649,6 @@
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -1664,15 +1659,15 @@
* If the {@code connection} or {@code name} was {@code
* null}.
*/
- public static <P> ResultFuture<Schema> readSchema(
+ public static ResultFuture<Schema> readSchema(
AsynchronousConnection connection, DN name,
- ResultHandler<? super Schema, P> handler, P p)
+ ResultHandler<? super Schema> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
final SearchRequest request = getReadSchemaSearchRequest(name);
- final ResultTransformer<SearchResultEntry, Schema, P> future = new ResultTransformer<SearchResultEntry, Schema, P>(
+ final ResultTransformer<SearchResultEntry, Schema> future = new ResultTransformer<SearchResultEntry, Schema>(
handler)
{
@@ -1685,7 +1680,7 @@
};
ResultFuture<SearchResultEntry> innerFuture = connection
- .searchSingleEntry(request, future, p);
+ .searchSingleEntry(request, future);
future.setResultFuture(innerFuture);
return future;
}
@@ -1706,9 +1701,6 @@
* schema. However, implementations may choose to perform other
* optimizations, such as caching.
*
- * @param <P>
- * The type of the additional parameter to the handler's
- * methods.
* @param connection
* A connection to the Directory Server whose schema is to be
* read.
@@ -1719,8 +1711,6 @@
* A result handler which can be used to asynchronously
* process the operation result when it is received, may be
* {@code null}.
- * @param p
- * Optional additional handler parameter.
* @return A future representing the result of the operation.
* @throws UnsupportedOperationException
* If this connection does not support search operations.
@@ -1731,30 +1721,30 @@
* If the {@code connection} or {@code name} was {@code
* null}.
*/
- public static <P> ResultFuture<Schema> readSchemaForEntry(
+ public static ResultFuture<Schema> readSchemaForEntry(
final AsynchronousConnection connection, final DN name,
- ResultHandler<Schema, P> handler, final P p)
+ ResultHandler<Schema> handler)
throws UnsupportedOperationException, IllegalStateException,
NullPointerException
{
- final ResultChain<SearchResultEntry, Schema, P> future = new ResultChain<SearchResultEntry, Schema, P>(
+ final ResultChain<SearchResultEntry, Schema> future = new ResultChain<SearchResultEntry, Schema>(
handler)
{
protected ResultFuture<Schema> chainResult(
SearchResultEntry innerResult,
- ResultHandler<? super Schema, P> handler)
+ ResultHandler<? super Schema> handler)
throws ErrorResultException
{
final DN subschemaDN = getSubschemaSubentryDN(name, innerResult);
- return readSchema(connection, subschemaDN, handler, p);
+ return readSchema(connection, subschemaDN, handler);
}
};
final SearchRequest request = getReadSchemaForEntrySearchRequest(name);
ResultFuture<SearchResultEntry> innerFuture = connection
- .searchSingleEntry(request, future, p);
+ .searchSingleEntry(request, future);
future.setInnerResultFuture(innerFuture);
return future;
}
--
Gitblit v1.10.0