@Beta public final class FutureRpcResults extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FutureRpcResults.FutureRpcResultBuilder<I,O> |
static class |
FutureRpcResults.LogLevel |
| Modifier and Type | Method and Description |
|---|---|
static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> |
fromBuilder(org.slf4j.Logger logger,
I input,
Callable<org.opendaylight.yangtools.concepts.Builder<O>> builder) |
static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> |
fromBuilder(org.slf4j.Logger logger,
String rpcMethodName,
I input,
Callable<org.opendaylight.yangtools.concepts.Builder<O>> builder) |
static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> |
fromListenableFuture(org.slf4j.Logger logger,
I input,
Callable<com.google.common.util.concurrent.ListenableFuture<O>> callable)
Create a Builder for a ListenableFuture to Future<RpcResult<O>> transformer.
|
static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> |
fromListenableFuture(org.slf4j.Logger logger,
String rpcMethodName,
I input,
Callable<com.google.common.util.concurrent.ListenableFuture<O>> callable)
Create a Builder for a ListenableFuture to Future<RpcResult<O>> transformer.
|
@CheckReturnValue public static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> fromListenableFuture(org.slf4j.Logger logger, @Nullable I input, Callable<com.google.common.util.concurrent.ListenableFuture<O>> callable)
The RPC's method name is automatically obtained using StackTraces. This has some cost, which in
the overall scheme of a typical RPC is typically negligible, but on a highly optimized fast path could
theoretically be an issue; if you see this method as a hot spot in a profiler, then (only) use the
alternative signature where you manually pass the String rpcMethodName.
logger - the slf4j Logger of the callerinput - the RPC input DataObject of the caller (may be null)callable - the Callable (typically lambda) creating a ListenableFuture. Note that the
functional interface Callable's call() method declares throws Exception, so your lambda
does not have to do any exception handling (specifically it does NOT have to catch and
wrap any exception into a failed Future); this utility does that for you.@CheckReturnValue public static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> fromListenableFuture(org.slf4j.Logger logger, String rpcMethodName, @Nullable I input, Callable<com.google.common.util.concurrent.ListenableFuture<O>> callable)
logger - the slf4j Logger of the callerrpcMethodName - Java method name (without "()") of the RPC operation, used for logginginput - the RPC input DataObject of the caller (may be null)callable - the Callable (typically lambda) creating a ListenableFuture. Note that the
functional interface Callable's call() method declares throws Exception, so your lambda
does not have to do any exception handling (specifically it does NOT have to catch and
wrap any exception into a failed Future); this utility does that for you.@CheckReturnValue public static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> fromBuilder(org.slf4j.Logger logger, String rpcMethodName, @Nullable I input, Callable<org.opendaylight.yangtools.concepts.Builder<O>> builder)
@CheckReturnValue public static <I,O> FutureRpcResults.FutureRpcResultBuilder<I,O> fromBuilder(org.slf4j.Logger logger, @Nullable I input, Callable<org.opendaylight.yangtools.concepts.Builder<O>> builder)
Copyright © 2019 OpenDaylight. All rights reserved.