BUG-8402: correctly propagate read-only bit
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / commands / AbstractReadTransactionRequest.java
index c0d47145708c5e540e4e2a4fdff9ddcc4b48ad4c..3fc4821edf99e64eed0feec7b983b1015fc86329 100644 (file)
@@ -10,15 +10,11 @@ package org.opendaylight.controller.cluster.access.commands;
 import akka.actor.ActorRef;
 import com.google.common.annotations.Beta;
 import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
-import javax.annotation.Nonnull;
 import org.opendaylight.controller.cluster.access.ABIVersion;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 /**
- * Abstract base class for {@link TransactionRequest}s accessing data as visible in the isolated context of a particular
- * transaction. The path of the data being accessed is returned via {@link #getPath()}.
+ * Abstract base class for {@link TransactionRequest}s accessing transaction state without modifying it.
  *
  * <p>
  * This class is visible outside of this package for the purpose of allowing common instanceof checks
@@ -32,34 +28,27 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 public abstract class AbstractReadTransactionRequest<T extends AbstractReadTransactionRequest<T>>
         extends TransactionRequest<T> {
     private static final long serialVersionUID = 1L;
-    private final YangInstanceIdentifier path;
+
     private final boolean snapshotOnly;
 
     AbstractReadTransactionRequest(final TransactionIdentifier identifier, final long sequence, final ActorRef replyTo,
-        final YangInstanceIdentifier path, final boolean snapshotOnly) {
+        final boolean snapshotOnly) {
         super(identifier, sequence, replyTo);
-        this.path = Preconditions.checkNotNull(path);
         this.snapshotOnly = snapshotOnly;
     }
 
     AbstractReadTransactionRequest(final T request, final ABIVersion version) {
         super(request, version);
-        this.path = request.getPath();
         this.snapshotOnly = request.isSnapshotOnly();
     }
 
-    @Nonnull
-    public final YangInstanceIdentifier getPath() {
-        return path;
-    }
-
     public final boolean isSnapshotOnly() {
         return snapshotOnly;
     }
 
     @Override
     protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
-        return super.addToStringAttributes(toStringHelper).add("path", path);
+        return super.addToStringAttributes(toStringHelper).add("snapshotOnly", snapshotOnly);
     }
 
     @Override