2 * Copyright (c) 2016 Cisco Systems, Inc. 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.controller.cluster.databroker.actors.dds;
10 import org.opendaylight.controller.cluster.access.client.AbstractClientConnection;
11 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
12 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
17 * An {@link AbstractClientHistory} which handles free-standing transactions.
19 * @author Robert Varga
21 final class SingleClientHistory extends AbstractClientHistory {
22 private static final Logger LOG = LoggerFactory.getLogger(AbstractClientHistory.class);
24 SingleClientHistory(final AbstractDataStoreClientBehavior client, final LocalHistoryIdentifier identifier) {
25 super(client, identifier);
29 ClientSnapshot doCreateSnapshot() {
30 final TransactionIdentifier txId = new TransactionIdentifier(getIdentifier(), nextTx());
31 LOG.debug("{}: creating a new snapshot {}", this, txId);
33 return new ClientSnapshot(this, txId);
37 ClientTransaction doCreateTransaction() {
38 final TransactionIdentifier txId = new TransactionIdentifier(getIdentifier(), nextTx());
39 LOG.debug("{}: creating a new transaction {}", this, txId);
41 return new ClientTransaction(this, txId);
45 ProxyHistory createHistoryProxy(final LocalHistoryIdentifier historyId,
46 final AbstractClientConnection<ShardBackendInfo> connection) {
47 return ProxyHistory.createSingle(connection, historyId);