2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.replicate.netty;
10 import static java.util.Objects.requireNonNull;
12 import io.netty.channel.Channel;
13 import org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction;
14 import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
15 import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 final class SinkTransactionChainListener implements DOMTransactionChainListener {
20 private static final Logger LOG = LoggerFactory.getLogger(SinkTransactionChainListener.class);
22 private final Channel channel;
24 SinkTransactionChainListener(final Channel channel) {
25 this.channel = requireNonNull(channel);
29 public void onTransactionChainFailed(final DOMTransactionChain chain, final DOMDataTreeTransaction transaction,
30 final Throwable cause) {
31 LOG.error("Transaction chain for channel {} failed", channel, cause);
36 public void onTransactionChainSuccessful(final DOMTransactionChain chain) {
37 LOG.info("Transaction chain for channel {} completed", channel);