Class ExtendedResultLdapPromiseImpl<S extends ExtendedResult>

Type Parameters:
S - The type of result returned by this promise.
All Implemented Interfaces:
Future<S>, IntermediateResponseHandler, LdapPromise<S>, LdapResultHandler<S>, org.forgerock.util.promise.ExceptionHandler<LdapException>, org.forgerock.util.promise.Promise<S,LdapException>, org.forgerock.util.promise.ResultHandler<S>

Extended result promise implementation.
  • Method Details

    • decodeResult

      public S decodeResult(ExtendedResult result, DecodeOptions options) throws DecodeException
      Decode an extended result.
      Parameters:
      result - Extended result to decode.
      options - Decoding options.
      Returns:
      The decoded extended result.
      Throws:
      DecodeException - If a problem occurs during decoding.
    • isBindOrStartTLS

      public boolean isBindOrStartTLS()
      Description copied from class: ResultLdapPromiseImpl
      Returns true if this promise represents the result of a bind or StartTLS request. The default implementation is to return false.
      Overrides:
      isBindOrStartTLS in class ResultLdapPromiseImpl<ExtendedRequest<S extends ExtendedResult>,S extends ExtendedResult>
      Returns:
      true if this promise represents the result of a bind or StartTLS request.
    • getRequestID

      public int getRequestID()
      Description copied from interface: LdapPromise
      Returns the request ID of the request if appropriate.
      Specified by:
      getRequestID in interface LdapPromise<R>
      Returns:
      The request ID, or -1 if there is no request ID.
    • cancel

      public boolean cancel(boolean mayInterruptIfRunning)
      Specified by:
      cancel in interface Future<R>
      Specified by:
      cancel in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • get

      Specified by:
      get in interface Future<R>
      Specified by:
      get in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
      Throws:
      ExecutionException
      InterruptedException
    • get

      public S get(long timeout, TimeUnit unit) throws ExecutionException, TimeoutException, InterruptedException
      Specified by:
      get in interface Future<R>
      Specified by:
      get in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
      Throws:
      ExecutionException
      TimeoutException
      InterruptedException
    • getOrThrow

      public S getOrThrow() throws InterruptedException, LdapException
      Specified by:
      getOrThrow in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
      Throws:
      InterruptedException
      LdapException
    • getOrThrow

      public S getOrThrow(long timeout, TimeUnit unit) throws InterruptedException, LdapException, TimeoutException
      Specified by:
      getOrThrow in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
      Throws:
      InterruptedException
      LdapException
      TimeoutException
    • getOrThrowUninterruptibly

      public S getOrThrowUninterruptibly() throws LdapException
      Specified by:
      getOrThrowUninterruptibly in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
      Throws:
      LdapException
    • getOrThrowUninterruptibly

      public S getOrThrowUninterruptibly(long timeout, TimeUnit unit) throws LdapException, TimeoutException
      Specified by:
      getOrThrowUninterruptibly in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
      Throws:
      LdapException
      TimeoutException
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Future<R>
      Specified by:
      isCancelled in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface Future<R>
      Specified by:
      isDone in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenOnException

      public LdapPromise<S> thenOnException(org.forgerock.util.promise.ExceptionHandler<? super LdapException> onException)
      Specified by:
      thenOnException in interface LdapPromise<R>
      Specified by:
      thenOnException in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenOnRuntimeException

      public LdapPromise<S> thenOnRuntimeException(org.forgerock.util.promise.RuntimeExceptionHandler onRuntimeException)
      Specified by:
      thenOnRuntimeException in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenOnResult

      public LdapPromise<S> thenOnResult(org.forgerock.util.promise.ResultHandler<? super S> onResult)
      Specified by:
      thenOnResult in interface LdapPromise<R>
      Specified by:
      thenOnResult in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenOnResultOrException

      public LdapPromise<S> thenOnResultOrException(Runnable onResultOrException)
      Specified by:
      thenOnResultOrException in interface LdapPromise<R>
      Specified by:
      thenOnResultOrException in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • then

      public <VOUT> LdapPromise<VOUT> then(org.forgerock.util.Function<? super S,VOUT,LdapException> onResult)
      Specified by:
      then in interface LdapPromise<R>
      Specified by:
      then in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • then

      public <VOUT, EOUT extends Exception> org.forgerock.util.promise.Promise<VOUT,EOUT> then(org.forgerock.util.Function<? super S,VOUT,EOUT> onResult, org.forgerock.util.Function<? super LdapException,VOUT,EOUT> onException)
      Specified by:
      then in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • then

      public <VOUT, EOUT extends Exception> org.forgerock.util.promise.Promise<VOUT,EOUT> then(org.forgerock.util.Function<? super S,VOUT,EOUT> onResult, org.forgerock.util.Function<? super LdapException,VOUT,EOUT> onException, org.forgerock.util.Function<? super RuntimeException,VOUT,EOUT> onRuntimeException)
      Specified by:
      then in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenOnResultOrException

      public LdapPromise<S> thenOnResultOrException(org.forgerock.util.promise.ResultHandler<? super S> onResult, org.forgerock.util.promise.ExceptionHandler<? super LdapException> onException)
      Specified by:
      thenOnResultOrException in interface LdapPromise<R>
      Specified by:
      thenOnResultOrException in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenAlways

      public LdapPromise<S> thenAlways(Runnable onResultOrException)
      Specified by:
      thenAlways in interface LdapPromise<R>
      Specified by:
      thenAlways in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenAsync

      public <VOUT> LdapPromise<VOUT> thenAsync(org.forgerock.util.AsyncFunction<? super S,VOUT,LdapException> onResult)
      Specified by:
      thenAsync in interface LdapPromise<R>
      Specified by:
      thenAsync in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenAsync

      public <VOUT, EOUT extends Exception> org.forgerock.util.promise.Promise<VOUT,EOUT> thenAsync(org.forgerock.util.AsyncFunction<? super S,VOUT,EOUT> onResult, org.forgerock.util.AsyncFunction<? super LdapException,VOUT,EOUT> onException)
      Specified by:
      thenAsync in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenAsync

      public <VOUT, EOUT extends Exception> org.forgerock.util.promise.Promise<VOUT,EOUT> thenAsync(org.forgerock.util.AsyncFunction<? super S,VOUT,EOUT> onResult, org.forgerock.util.AsyncFunction<? super LdapException,VOUT,EOUT> onException, org.forgerock.util.AsyncFunction<? super RuntimeException,VOUT,EOUT> onRuntimeException)
      Specified by:
      thenAsync in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenCatch

      public <EOUT extends Exception> org.forgerock.util.promise.Promise<S,EOUT> thenCatch(org.forgerock.util.Function<? super LdapException,S,EOUT> onException)
      Specified by:
      thenCatch in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenCatchRuntimeException

      public org.forgerock.util.promise.Promise<S,LdapException> thenCatchRuntimeException(org.forgerock.util.Function<? super RuntimeException,S,LdapException> onRuntimeException)
      Specified by:
      thenCatchRuntimeException in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenCatchRuntimeExceptionAsync

      public org.forgerock.util.promise.Promise<S,LdapException> thenCatchRuntimeExceptionAsync(org.forgerock.util.AsyncFunction<? super RuntimeException,S,LdapException> onRuntimeException)
      Specified by:
      thenCatchRuntimeExceptionAsync in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenFinally

      public LdapPromise<S> thenFinally(Runnable onResultOrException)
      Specified by:
      thenFinally in interface LdapPromise<R>
      Specified by:
      thenFinally in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • thenCatchAsync

      public <EOUT extends Exception> org.forgerock.util.promise.Promise<S,EOUT> thenCatchAsync(org.forgerock.util.AsyncFunction<? super LdapException,S,EOUT> onException)
      Specified by:
      thenCatchAsync in interface org.forgerock.util.promise.Promise<R,P extends org.forgerock.util.promise.Promise<R,LdapException>>
    • getWrappedPromise

      public org.forgerock.util.promise.PromiseImpl<S,LdapException> getWrappedPromise()