DataTreeCandidateTip should be recursive 11/31911/3
authorRobert Varga <robert.varga@pantheon.sk>
Mon, 28 Dec 2015 15:14:06 +0000 (16:14 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 4 Jan 2016 08:47:05 +0000 (08:47 +0000)
DataTreeCandidateTip#prepare() should return a DataTreeCandidateTip, not
just a DataTreeCandidate. This makes the operations equal to
TipProducingDataTree.

Change-Id: Ie49e6cd5c432c35067fa14ea76746f834a60d22e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidateTip.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/TipProducingDataTree.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/TipProducingDataTreeTip.java [new file with mode: 0644]

index 7045a9edc9dc3ddf1cd64b248d908956b561e725..ed082df336af868a2633d0f28143145fcffa427b 100644 (file)
@@ -17,6 +17,6 @@ import com.google.common.annotations.Beta;
  * a candidate commit needs to be coordinated across distributed parties.
  */
 @Beta
-public interface DataTreeCandidateTip extends DataTreeCandidate, DataTreeTip {
+public interface DataTreeCandidateTip extends DataTreeCandidate, TipProducingDataTreeTip {
 
 }
index 547d60640776b79b31863afeb564f8b40e1b53d4..7baa814935540cea92b95014c9067f2a325ccf89 100644 (file)
@@ -12,7 +12,6 @@ package org.opendaylight.yangtools.yang.data.api.schema.tree;
  * thus allowing existence of multiple candidates, which can be {@link #commit(DataTreeCandidate)}ed
  * in sequence.
  */
-public interface TipProducingDataTree extends DataTree {
-    @Override
-    DataTreeCandidateTip prepare(DataTreeModification modification);
+public interface TipProducingDataTree extends DataTree, TipProducingDataTreeTip {
+
 }
diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/TipProducingDataTreeTip.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/TipProducingDataTreeTip.java
new file mode 100644 (file)
index 0000000..6121d7f
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015 Pantheon Technologies, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.data.api.schema.tree;
+
+/**
+ * A {@link DataTreeCandidateTip} which produces {@link DataTreeCandidateTip}s from its
+ * {@link #prepare(DataTreeModification)} method.
+ */
+public interface TipProducingDataTreeTip extends DataTreeTip {
+    @Override
+    DataTreeCandidateTip prepare(DataTreeModification modification);
+}