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

matthew_swift
01.04.2010 6439bba5cc09d6febc59bdc9e0d9bc25f1f1eb18
sdk/src/org/opends/sdk/HeartBeatConnectionFactory.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 */
package org.opends.sdk;
@@ -53,7 +53,7 @@
   * operations.
   */
  private final class AsynchronousConnectionImpl implements
      AsynchronousConnection, ConnectionEventListener, ResultHandler<Result>
      AsynchronousConnection, ConnectionEventListener, SearchResultHandler
  {
    private final AsynchronousConnection connection;
@@ -80,7 +80,7 @@
    public FutureResult<Result> add(final AddRequest request,
        final ResultHandler<Result> handler)
        final ResultHandler<? super Result> handler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
    {
@@ -90,7 +90,7 @@
    public FutureResult<Result> add(final AddRequest request,
        final ResultHandler<Result> resultHandler,
        final ResultHandler<? super Result> resultHandler,
        final IntermediateResponseHandler intermediateResponseHandler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
@@ -179,14 +179,14 @@
    public void connectionClosed()
    public void handleConnectionClosed()
    {
      // Ignore - we intercept close through the close method.
    }
    public void connectionErrorOccurred(final boolean isDisconnectNotification,
    public void handleConnectionError(final boolean isDisconnectNotification,
        final ErrorResultException error)
    {
      synchronized (activeConnections)
@@ -198,7 +198,7 @@
    public void connectionReceivedUnsolicitedNotification(
    public void handleUnsolicitedNotification(
        final ExtendedResult notification)
    {
      // Do nothing
@@ -207,7 +207,7 @@
    public FutureResult<Result> delete(final DeleteRequest request,
        final ResultHandler<Result> handler)
        final ResultHandler<? super Result> handler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
    {
@@ -217,7 +217,7 @@
    public FutureResult<Result> delete(final DeleteRequest request,
        final ResultHandler<Result> resultHandler,
        final ResultHandler<? super Result> resultHandler,
        final IntermediateResponseHandler intermediateResponseHandler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
@@ -261,6 +261,17 @@
    /**
     * {@inheritDoc}
     */
    public boolean handleEntry(SearchResultEntry entry)
    {
      // Ignore.
      return true;
    }
    public void handleErrorResult(final ErrorResultException error)
    {
      connection.close(Requests.newUnbindRequest(), "Heartbeat retured error: "
@@ -269,6 +280,17 @@
    /**
     * {@inheritDoc}
     */
    public boolean handleReference(SearchResultReference reference)
    {
      // Ignore.
      return true;
    }
    public void handleResult(final Result result)
    {
      lastSuccessfulPing = System.currentTimeMillis();
@@ -299,7 +321,7 @@
    public FutureResult<Result> modify(final ModifyRequest request,
        final ResultHandler<Result> handler)
        final ResultHandler<? super Result> handler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
    {
@@ -309,7 +331,7 @@
    public FutureResult<Result> modify(final ModifyRequest request,
        final ResultHandler<Result> resultHandler,
        final ResultHandler<? super Result> resultHandler,
        final IntermediateResponseHandler intermediateResponseHandler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
@@ -321,7 +343,7 @@
    public FutureResult<Result> modifyDN(final ModifyDNRequest request,
        final ResultHandler<Result> handler)
        final ResultHandler<? super Result> handler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
    {
@@ -331,7 +353,7 @@
    public FutureResult<Result> modifyDN(final ModifyDNRequest request,
        final ResultHandler<Result> resultHandler,
        final ResultHandler<? super Result> resultHandler,
        final IntermediateResponseHandler intermediateResponseHandler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
@@ -360,7 +382,7 @@
     * {@inheritDoc}
     */
    public FutureResult<RootDSE> readRootDSE(
        final ResultHandler<RootDSE> handler)
        final ResultHandler<? super RootDSE> handler)
        throws UnsupportedOperationException, IllegalStateException
    {
      return connection.readRootDSE(handler);
@@ -372,7 +394,7 @@
     * {@inheritDoc}
     */
    public FutureResult<Schema> readSchema(final DN name,
        final ResultHandler<Schema> handler)
        final ResultHandler<? super Schema> handler)
        throws UnsupportedOperationException, IllegalStateException
    {
      return connection.readSchema(name, handler);
@@ -384,7 +406,7 @@
     * {@inheritDoc}
     */
    public FutureResult<Schema> readSchemaForEntry(final DN name,
        final ResultHandler<Schema> handler)
        final ResultHandler<? super Schema> handler)
        throws UnsupportedOperationException, IllegalStateException
    {
      return connection.readSchemaForEntry(name, handler);
@@ -401,24 +423,22 @@
    public FutureResult<Result> search(final SearchRequest request,
        final ResultHandler<Result> resultHandler,
        final SearchResultHandler searchResultHandler)
        final SearchResultHandler handler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
    {
      return connection.search(request, resultHandler, searchResultHandler);
      return connection.search(request, handler);
    }
    public FutureResult<Result> search(final SearchRequest request,
        final ResultHandler<Result> resultHandler,
        final SearchResultHandler searchResulthandler,
        final SearchResultHandler resultHandler,
        final IntermediateResponseHandler intermediateResponseHandler)
        throws UnsupportedOperationException, IllegalStateException,
        NullPointerException
    {
      return connection.search(request, resultHandler, searchResulthandler,
      return connection.search(request, resultHandler,
          intermediateResponseHandler);
    }
@@ -590,7 +610,7 @@
  @Override
  public FutureResult<AsynchronousConnection> getAsynchronousConnection(
      final ResultHandler<AsynchronousConnection> handler)
      final ResultHandler<? super AsynchronousConnection> handler)
  {
    final FutureResultImpl future = new FutureResultImpl(handler);
    future.setFutureResult(parentFactory.getAsynchronousConnection(future));