- @Override
- protected void handleEditException(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data, final NetconfDocumentedException e, final String editType) {
- LOG.warn("{}: Error {} data to (candidate){}, data: {}, canceling", id, editType, path, data, e);
- cancel();
- throw new RuntimeException(id + ": Error while " + editType + ": (candidate)" + path, e);
- }
-
- @Override
- protected void handleDeleteException(final YangInstanceIdentifier path, final NetconfDocumentedException e) {
- LOG.warn("{}: Error deleting data (candidate){}, canceling", id, path, e);
- cancel();
- throw new RuntimeException(id + ": Error while deleting (candidate)" + path, e);
- }
-
- @Override
- public synchronized CheckedFuture<Void, TransactionCommitFailedException> submit() {
- final ListenableFuture<Void> commitFutureAsVoid = Futures.transform(commit(), new Function<RpcResult<TransactionStatus>, Void>() {
- @Override
- public Void apply(final RpcResult<TransactionStatus> input) {
- Preconditions.checkArgument(input.isSuccessful() && input.getErrors().isEmpty(), "Submit failed with errors: %s", input.getErrors());
- return null;
- }
- });
-
- return Futures.makeChecked(commitFutureAsVoid, new Function<Exception, TransactionCommitFailedException>() {
- @Override
- public TransactionCommitFailedException apply(final Exception input) {
- return new TransactionCommitFailedException("Submit of transaction " + getIdentifier() + " failed", input);
- }
- });
- }
-