Do not leak DataTree from backend actor
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / LocalPrimaryShardFound.java
index 76d404bc9c41b9e7fe1585007e4923aede93bb87..e4b9174f1eb9354cd6f39c61a3eec697b8b82dfe 100644 (file)
@@ -11,7 +11,7 @@ import static java.util.Objects.requireNonNull;
 
 import org.apache.commons.lang3.ObjectUtils;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.ReadOnlyDataTree;
 
 /**
  * Local message sent in reply to FindPrimaryShard to indicate the primary shard is local to the caller.
@@ -21,9 +21,9 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
 public class LocalPrimaryShardFound {
 
     private final String primaryPath;
-    private final DataTree localShardDataTree;
+    private final ReadOnlyDataTree localShardDataTree;
 
-    public LocalPrimaryShardFound(@NonNull  String primaryPath, @NonNull  DataTree localShardDataTree) {
+    public LocalPrimaryShardFound(@NonNull  String primaryPath, @NonNull ReadOnlyDataTree localShardDataTree) {
         this.primaryPath = requireNonNull(primaryPath);
         this.localShardDataTree = requireNonNull(localShardDataTree);
     }
@@ -32,7 +32,7 @@ public class LocalPrimaryShardFound {
         return primaryPath;
     }
 
-    public @NonNull DataTree getLocalShardDataTree() {
+    public @NonNull ReadOnlyDataTree getLocalShardDataTree() {
         return localShardDataTree;
     }