Class FutureRpcResults.FutureRpcResultBuilder<I,O>

java.lang.Object
org.opendaylight.serviceutils.tools.rpc.FutureRpcResults.FutureRpcResultBuilder<I,O>
Enclosing class:
FutureRpcResults

public static final class FutureRpcResults.FutureRpcResultBuilder<I,O> extends Object
  • Method Details

    • build

      @CheckReturnValue public com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<O>> build()
      Builds the Future RpcResult.
      Returns:
      Future RpcResult. Note that this will NEVER be a failed Future; any errors are reported as !RpcResult.isSuccessful(), with details in RpcResult.getErrors(), and not the Future itself.
    • onFailure

      public FutureRpcResults.FutureRpcResultBuilder<I,O> onFailure(Consumer<Throwable> newOnFailureConsumer)
      Sets a custom on-failure action, for a given exception.
    • onFailureLogLevel

      Sets a custom on-failure SLF4J logging level, in case of an exception. The log message mentions the RPC method name, the provided input, the exception and its stack trace (depending on logger settings). By default, it is LOG.error. Setting NONE will disable this logging.
    • onSuccessLogLevel

      Sets a custom on-success SLF4J logging level. The log message mentions the RPC method name, the provided input, and the resulting output. By default, it is LOG.debug. Setting NONE will disable this logging.
    • onEnterLogLevel

      Sets a custom on-enter SLF4J logging level. The log message mentions the RPC method name and the provided input. By default, it is LOG.trace. Setting NONE will disable this logging.
    • withRpcErrorMessage

      public FutureRpcResults.FutureRpcResultBuilder<I,O> withRpcErrorMessage(Function<Throwable,String> newRpcErrorMessageFunction)
      Set a custom RpcError message function, for a given exception. By default, the message is just Throwable.getMessage().
    • onSuccess

      public FutureRpcResults.FutureRpcResultBuilder<I,O> onSuccess(Consumer<O> newOnSuccessFunction)
      Sets a custom on-success action, for a given output.