BUG-5280: emit DestroyLocalHistory and PurgeLocalHistory requests
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / actors / dds / ClientLocalHistory.java
index 26b03e39b092c57d00876b030df15d1aeda015e8..4598d95ebb9f7cc0482ccb75a04b73c053c41e04 100644 (file)
@@ -32,11 +32,7 @@ public final class ClientLocalHistory extends AbstractClientHistory implements A
 
     @Override
     public void close() {
-        final State local = state();
-        if (local != State.CLOSED) {
-            Preconditions.checkState(local == State.IDLE, "Local history %s has an open transaction", this);
-            updateState(local, State.CLOSED);
-        }
+        doClose();
     }
 
     private State ensureIdleState() {
@@ -92,6 +88,6 @@ public final class ClientLocalHistory extends AbstractClientHistory implements A
     @Override
     ProxyHistory createHistoryProxy(final LocalHistoryIdentifier historyId,
             final AbstractClientConnection<ShardBackendInfo> connection) {
-        return ProxyHistory.createClient(connection, historyId);
+        return ProxyHistory.createClient(this, connection, historyId);
     }
 }