public final class RpcUtils extends Object
RpcUtils class is a collection of utility class methods for
RPC implementation.| Modifier and Type | Method and Description |
|---|---|
static <T> T |
checkResult(RpcRequest rpc,
org.opendaylight.yangtools.yang.common.RpcResult<T> result,
org.slf4j.Logger logger)
Check the given RPC result.
|
static <T> org.opendaylight.yangtools.yang.common.RpcResultBuilder<T> |
getErrorBuilder(Class<T> type,
Exception e)
Construct a new RPC error builder from the given
Exception. |
static <T> org.opendaylight.yangtools.yang.common.RpcResultBuilder<T> |
getErrorBuilder(Class<T> type,
RpcErrorTag tag,
String msg,
VtnErrorTag vtnTag,
String info)
Construct a new RPC error builder.
|
static RpcException |
getInvalidOperationException(VtnUpdateOperationType op)
Return a new
RpcException that indicates the RPC request has
failed due to invalid VtnUpdateOperationType value. |
static RpcException |
getNullInputException()
Return a new
RpcException that indicates the RPC request has
failed due to null RPC input. |
public static RpcException getNullInputException()
RpcException that indicates the RPC request has
failed due to null RPC input.RpcException instance.public static RpcException getInvalidOperationException(VtnUpdateOperationType op)
RpcException that indicates the RPC request has
failed due to invalid VtnUpdateOperationType value.op - A VtnUpdateOperationType value.RpcException instance.public static <T> org.opendaylight.yangtools.yang.common.RpcResultBuilder<T> getErrorBuilder(Class<T> type, RpcErrorTag tag, String msg, VtnErrorTag vtnTag, String info)
T - The type of RPC output.type - A Class that indicates the type of RPC output.tag - An RpcErrorTag instance that indicates an error
tag.msg - An error message.vtnTag - A VtnErrorTag instance to be set as
application-specific tag.info - An additional debugging information.RpcResultBuilder instance.public static <T> org.opendaylight.yangtools.yang.common.RpcResultBuilder<T> getErrorBuilder(Class<T> type, Exception e)
Exception.public static <T> T checkResult(RpcRequest rpc, org.opendaylight.yangtools.yang.common.RpcResult<T> result, org.slf4j.Logger logger) throws VTNException
T - The type of the value returned by the RPC.rpc - An RpcRequest instance.result - An RpcResult instance.logger - A Logger instance.VTNException - The RPC call was failed.Copyright © 2018 OpenDaylight. All rights reserved.