I - The type of the RPC input.O - The type of the RPC output.public abstract class RpcInvocation<I,O> extends Object implements RpcRequest
RpcInvocation keeps a pair of RPC input and future associated with
the RPC execution.| Constructor and Description |
|---|
RpcInvocation(I in,
Future<org.opendaylight.yangtools.yang.common.RpcResult<O>> f)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Future<org.opendaylight.yangtools.yang.common.RpcResult<O>> |
getFuture()
Return the future associated with the RPC execution.
|
I |
getInput()
Return the RPC input.
|
Object |
getInputForLog()
Return an object that indicates an RPC input.
|
O |
getResult(long timeout,
TimeUnit unit,
org.slf4j.Logger logger)
Wait for the RPC execution to complete, and return the result.
|
boolean |
needErrorLog(Collection<org.opendaylight.yangtools.yang.common.RpcError> errors)
Determine whether the RPC failure should be logged or not.
|
boolean |
needErrorLog(Throwable cause)
Determine whether the RPC failure should be logged or not.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamepublic final I getInput()
public final Future<org.opendaylight.yangtools.yang.common.RpcResult<O>> getFuture()
public O getResult(long timeout, TimeUnit unit, org.slf4j.Logger logger) throws VTNException
timeout - The maximum time to wait.unit - The time unit of the timeout argument.logger - A Logger instance.VTNException - An error occurred.public boolean needErrorLog(@Nonnull Throwable cause)
cause - An throwable thrown by the RPC implementation.true if the RPC failure should be logged.
false otherwise.public Object getInputForLog()
Returned object is embedded into a log message.
getInputForLog in interface RpcRequestpublic boolean needErrorLog(@Nonnull Collection<org.opendaylight.yangtools.yang.common.RpcError> errors)
needErrorLog in interface RpcRequesterrors - A collection of RPC errors returned by the RPC
implementation.true if the RPC failure should be logged.
false otherwise.Copyright © 2018 OpenDaylight. All rights reserved.