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
9 package org.opendaylight.controller.cluster.sharding;
11 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction;
12 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
13 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
14 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
17 * The context for a single shards modification, keeps a ClientTransaction so it can route requests correctly.
19 public class DistributedShardModificationContext {
21 private ClientTransaction transaction;
22 private DOMDataTreeIdentifier identifier;
23 private DOMDataTreeWriteCursor cursor;
25 public DistributedShardModificationContext(final ClientTransaction transaction,
26 final DOMDataTreeIdentifier identifier) {
27 this.transaction = transaction;
28 this.identifier = identifier;
31 public DOMDataTreeIdentifier getIdentifier() {
35 DOMDataTreeWriteCursor cursor() {
37 cursor = transaction.openCursor();
43 DOMStoreThreePhaseCommitCohort ready() {
49 return transaction.ready();