Ejemplo n.º 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;
   }
 }
Ejemplo n.º 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();
   }
 }