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 Link icon

    • build Link icon

      @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 Link icon

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

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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