| | |
| | | |
| | | |
| | | |
| | | public ResultFuture<Result> add(AddRequest request, |
| | | public FutureResult<Result> add(AddRequest request, |
| | | ResultHandler<Result> handler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | | NullPointerException |
| | |
| | | |
| | | |
| | | |
| | | public ResultFuture<BindResult> bind(BindRequest request, |
| | | public FutureResult<BindResult> bind(BindRequest request, |
| | | ResultHandler<? super BindResult> handler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | | NullPointerException |
| | |
| | | |
| | | |
| | | |
| | | public ResultFuture<CompareResult> compare(CompareRequest request, |
| | | public FutureResult<CompareResult> compare(CompareRequest request, |
| | | ResultHandler<? super CompareResult> handler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | | NullPointerException |
| | |
| | | |
| | | |
| | | |
| | | public ResultFuture<Result> delete(DeleteRequest request, |
| | | public FutureResult<Result> delete(DeleteRequest request, |
| | | ResultHandler<Result> handler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | | NullPointerException |
| | |
| | | |
| | | |
| | | |
| | | public <R extends Result> ResultFuture<R> extendedRequest( |
| | | public <R extends Result> FutureResult<R> extendedRequest( |
| | | ExtendedRequest<R> request, ResultHandler<? super R> handler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | | NullPointerException |
| | |
| | | |
| | | |
| | | |
| | | public ResultFuture<Result> modify(ModifyRequest request, |
| | | public FutureResult<Result> modify(ModifyRequest request, |
| | | ResultHandler<Result> handler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | | NullPointerException |
| | |
| | | |
| | | |
| | | |
| | | public ResultFuture<Result> modifyDN(ModifyDNRequest request, |
| | | public FutureResult<Result> modifyDN(ModifyDNRequest request, |
| | | ResultHandler<Result> handler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | | NullPointerException |
| | |
| | | |
| | | |
| | | |
| | | public ResultFuture<Result> search(SearchRequest request, |
| | | public FutureResult<Result> search(SearchRequest request, |
| | | ResultHandler<Result> resultHandler, |
| | | SearchResultHandler searchResultHandler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ResultFuture<SearchResultEntry> readEntry(DN name, |
| | | public FutureResult<SearchResultEntry> readEntry(DN name, |
| | | Collection<String> attributeDescriptions, |
| | | ResultHandler<? super SearchResultEntry> resultHandler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ResultFuture<SearchResultEntry> searchSingleEntry( |
| | | public FutureResult<SearchResultEntry> searchSingleEntry( |
| | | SearchRequest request, |
| | | ResultHandler<? super SearchResultEntry> resultHandler) |
| | | throws UnsupportedOperationException, IllegalStateException, |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ResultFuture<RootDSE> readRootDSE( |
| | | public FutureResult<RootDSE> readRootDSE( |
| | | ResultHandler<RootDSE> handler) |
| | | throws UnsupportedOperationException, IllegalStateException |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ResultFuture<Schema> readSchemaForEntry(DN name, |
| | | public FutureResult<Schema> readSchemaForEntry(DN name, |
| | | ResultHandler<Schema> handler) |
| | | throws UnsupportedOperationException, IllegalStateException |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ResultFuture<Schema> readSchema(DN name, |
| | | public FutureResult<Schema> readSchema(DN name, |
| | | ResultHandler<Schema> handler) |
| | | throws UnsupportedOperationException, IllegalStateException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | private final class ConnectionFutureImpl implements |
| | | ConnectionFuture<AsynchronousConnection>, |
| | | ConnectionResultHandler<AsynchronousConnection> |
| | | private final class ResultFutureImpl implements |
| | | FutureResult<AsynchronousConnection>, |
| | | ResultHandler<AsynchronousConnection> |
| | | { |
| | | private volatile AsynchronousConnectionImpl heartBeatConnection; |
| | | |
| | | private volatile ErrorResultException exception; |
| | | |
| | | private volatile ConnectionFuture<?> connectFuture; |
| | | private volatile FutureResult<?> connectFuture; |
| | | |
| | | private final CountDownLatch latch = new CountDownLatch(1); |
| | | |
| | | private final ConnectionResultHandler<? super AsynchronousConnectionImpl> handler; |
| | | private final ResultHandler<? super AsynchronousConnectionImpl> handler; |
| | | |
| | | private boolean cancelled; |
| | | |
| | | |
| | | |
| | | private ConnectionFutureImpl( |
| | | ConnectionResultHandler<? super AsynchronousConnectionImpl> handler) |
| | | private ResultFutureImpl( |
| | | ResultHandler<? super AsynchronousConnectionImpl> handler) |
| | | { |
| | | this.handler = handler; |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | public void handleConnection(AsynchronousConnection connection) |
| | | public int getRequestID() |
| | | { |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | |
| | | public void handleResult(AsynchronousConnection connection) |
| | | { |
| | | heartBeatConnection = new AsynchronousConnectionImpl(connection); |
| | | synchronized (activeConnections) |
| | |
| | | } |
| | | if (handler != null) |
| | | { |
| | | handler.handleConnection(heartBeatConnection); |
| | | handler.handleResult(heartBeatConnection); |
| | | } |
| | | latch.countDown(); |
| | | } |
| | | |
| | | |
| | | |
| | | public void handleConnectionError(ErrorResultException error) |
| | | public void handleErrorResult(ErrorResultException error) |
| | | { |
| | | exception = error; |
| | | if (handler != null) |
| | | { |
| | | handler.handleConnectionError(error); |
| | | handler.handleErrorResult(error); |
| | | } |
| | | latch.countDown(); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | public ConnectionFuture<AsynchronousConnection> getAsynchronousConnection( |
| | | ConnectionResultHandler<? super AsynchronousConnection> handler) |
| | | public FutureResult<AsynchronousConnection> getAsynchronousConnection( |
| | | ResultHandler<? super AsynchronousConnection> handler) |
| | | { |
| | | ConnectionFutureImpl future = new ConnectionFutureImpl(handler); |
| | | ResultFutureImpl future = new ResultFutureImpl(handler); |
| | | future.connectFuture = parentFactory |
| | | .getAsynchronousConnection(future); |
| | | return future; |