Move FIXMEs out to 6.0.0
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / shard / DOMDataTreeShardWriteTransaction.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.dom.spi.shard;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.mdsal.dom.api.DOMDataTreeCursorProvider;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
15 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
16
17 @Beta
18 public interface DOMDataTreeShardWriteTransaction extends DOMDataTreeCursorProvider {
19     /**
20      * Create a new write cursor. Any previous cursors have to be {@link DOMDataTreeWriteCursor#close()}d.
21      *
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.
26      */
27     @Override
28     // FIXME: 6.0.0: reconcile @NonNull vs. super @Nullable
29     @NonNull DOMDataTreeWriteCursor createCursor(@NonNull DOMDataTreeIdentifier prefix);
30
31     /**
32      * Finish this transaction and submit it for processing.
33      *
34      *<p>
35      * FIXME: this method should accept a callback which will report success/failure. Let's not use a CheckedFuture
36      *        due to overhead associated with attaching listeners to them.
37      * @throws IllegalStateException if this transaction has an unclosed cursor.
38      */
39     void ready();
40
41     /**
42      * Close this transaction and all other foreign shard transactions that were opened as a part of this transaction.
43      */
44     void close();
45
46     ListenableFuture<Void> submit();
47
48     ListenableFuture<Boolean> validate();
49
50     ListenableFuture<Void> prepare();
51
52     ListenableFuture<Void> commit();
53
54 }