示例#1
0
 private void checkReadSuccess(final DOMRpcResult result, final YangInstanceIdentifier path) {
   try {
     Preconditions.checkArgument(
         AbstractWriteTx.isSuccess(result),
         "%s: Unable to read data: %s, errors: %s",
         id,
         path,
         result.getErrors());
   } catch (final IllegalArgumentException e) {
     LOG.warn("{}: Unable to read data: {}, errors: {}", id, path, result.getErrors());
     throw e;
   }
 }
示例#2
0
 @Override
 public RpcResult<TransactionStatus> apply(final DOMRpcResult input) {
   if (isSuccess(input)) {
     return RpcResultBuilder.success(TransactionStatus.COMMITED).build();
   } else {
     final RpcResultBuilder<TransactionStatus> failed = RpcResultBuilder.failed();
     for (final RpcError rpcError : input.getErrors()) {
       failed.withError(
           rpcError.getErrorType(),
           rpcError.getTag(),
           rpcError.getMessage(),
           rpcError.getApplicationTag(),
           rpcError.getInfo(),
           rpcError.getCause());
     }
     return failed.build();
   }
 }
示例#3
0
 private DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?> findDataNode(
     final DOMRpcResult result) {
   return ((ContainerNode) result.getResult())
       .getChild(NetconfMessageTransformUtil.toId(NetconfMessageTransformUtil.NETCONF_DATA_QNAME))
       .get();
 }