X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2Factors%2Fdds%2FAbstractClientHistory.java;h=542cc2dbafb48d9e8db27fe632618af54209644e;hb=127042ea7e148d9dc0282acc3780b4754ca69e12;hp=00f7572f986562c2c3d88d8c8743c6266c34157f;hpb=5ab22a0bea0492dd8f1541b2f0cde4ea7618a786;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java index 00f7572f98..542cc2dbaf 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java @@ -9,6 +9,7 @@ package org.opendaylight.controller.cluster.databroker.actors.dds; import com.google.common.base.Preconditions; import com.google.common.base.Verify; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -24,7 +25,7 @@ import org.opendaylight.controller.cluster.access.commands.CreateLocalHistoryReq import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier; import org.opendaylight.controller.cluster.access.concepts.Response; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; -import org.opendaylight.mdsal.common.api.TransactionChainClosedException; +import org.opendaylight.mdsal.dom.api.DOMTransactionChainClosedException; import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.slf4j.Logger; @@ -36,7 +37,7 @@ import org.slf4j.LoggerFactory; * * @author Robert Varga */ -abstract class AbstractClientHistory extends LocalAbortable implements Identifiable { +public abstract class AbstractClientHistory extends LocalAbortable implements Identifiable { enum State { IDLE, TX_OPEN, @@ -88,6 +89,7 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia if (local != State.CLOSED) { Preconditions.checkState(local == State.IDLE, "Local history %s has an open transaction", this); histories.values().forEach(ProxyHistory::close); + updateState(local, State.CLOSED); } } @@ -97,7 +99,7 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia } @Override - public final LocalHistoryIdentifier getIdentifier() { + public LocalHistoryIdentifier getIdentifier() { return identifier; } @@ -183,7 +185,7 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia private void checkNotClosed() { if (state == State.CLOSED) { - throw new TransactionChainClosedException(String.format("Local history %s is closed", identifier)); + throw new DOMTransactionChainClosedException(String.format("Local history %s is closed", identifier)); } } @@ -191,10 +193,10 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia * Allocate a new {@link ClientTransaction}. * * @return A new {@link ClientTransaction} - * @throws TransactionChainClosedException if this history is closed + * @throws DOMTransactionChainClosedException if this history is closed * @throws IllegalStateException if a previous dependent transaction has not been closed */ - public final ClientTransaction createTransaction() { + public ClientTransaction createTransaction() { checkNotClosed(); synchronized (this) { @@ -208,10 +210,10 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia * Create a new {@link ClientSnapshot}. * * @return A new {@link ClientSnapshot} - * @throws TransactionChainClosedException if this history is closed + * @throws DOMTransactionChainClosedException if this history is closed * @throws IllegalStateException if a previous dependent transaction has not been closed */ - public final ClientSnapshot takeSnapshot() { + public ClientSnapshot takeSnapshot() { checkNotClosed(); synchronized (this) { @@ -305,8 +307,8 @@ abstract class AbstractClientHistory extends LocalAbortable implements Identifia } @Override - void replaySuccessfulRequests(final Iterable previousEntries) { - proxy.replaySuccessfulRequests(previousEntries); + void replayRequests(final Collection previousEntries) { + proxy.replayRequests(previousEntries); } @Override