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.mdsal.dom.store.inmemory;
11 import com.google.common.annotations.Beta;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
16 // FIXME: this should be moved to a separate package
18 public interface DOMDataTreeShardWriteTransaction {
20 * Create a new write cursor. Any previous cursors have to be {@link DOMDataTreeWriteCursor#close()}d.
22 * @param prefix Tree identifier of the apex at which the cursor is rooted.
23 * @return A new cursor rooted at specified prefx.
24 * @throws IllegalStateException if a previous cursor has not been closed.
25 * @throws NullPointerException if prefix is null.
27 @Nonnull DOMDataTreeWriteCursor createCursor(@Nonnull DOMDataTreeIdentifier prefix);
30 * Finish this transaction and submit it for processing.
32 * FIXME: this method should accept a callback which will report success/failure. Let's not use a CheckedFuture
33 * due to overhead associated with attaching listeners to them.
34 * @throws IllegalStateException if this transaction has an unclosed cursor.