BUG-509: add some documentation 44/7344/2
authorRobert Varga <rovarga@cisco.com>
Thu, 22 May 2014 05:38:07 +0000 (07:38 +0200)
committerRobert Varga <rovarga@cisco.com>
Fri, 23 May 2014 09:59:38 +0000 (11:59 +0200)
Documents AlwaysFailOperation and DataNodeContainerModificationStrategy

Change-Id: Ibb67dc5f4a829547538ba02c3eac4f995a6fe6ef
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/AlwaysFailOperation.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/DataNodeContainerModificationStrategy.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/NodeModification.java

index 4e3aa49..5934fd6 100644 (file)
@@ -6,8 +6,13 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
 import com.google.common.base.Optional;
 import com.google.common.primitives.UnsignedLong;
 
+/**
+ * An implementation of apply operation which fails to do anything,
+ * consistently. An instance of this class is used by the data tree
+ * if it does not have a SchemaContext attached and hence cannot
+ * perform anything meaningful.
+ */
 final class AlwaysFailOperation implements ModificationApplyOperation {
-
     @Override
     public Optional<StoreMetadataNode> apply(final NodeModification modification,
             final Optional<StoreMetadataNode> storeMeta, final UnsignedLong subtreeVersion) {
@@ -25,7 +30,7 @@ final class AlwaysFailOperation implements ModificationApplyOperation {
     }
 
     @Override
-    public void verifyStructure(final NodeModification modification) throws IllegalArgumentException {
+    public void verifyStructure(final NodeModification modification) {
         throw new IllegalStateException("Schema Context is not available.");
     }
 }
\ No newline at end of file
index aea070c..dc89148 100644 (file)
@@ -39,6 +39,12 @@ import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
 
+/**
+ * Base strategy for applying changes to a ContainerNode, irrespective of its
+ * actual type.
+ *
+ * @param <T> Type of the container node
+ */
 abstract class DataNodeContainerModificationStrategy<T extends DataNodeContainer> extends NormalizedNodeContainerModificationStrategy {
 
     private final T schema;
index f2720b5..fccc1ed 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.controller.md.sal.dom.store.impl.tree.data;
 
-import static com.google.common.base.Preconditions.checkState;
-
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -21,6 +19,7 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
 
 /**
@@ -187,7 +186,7 @@ final class NodeModification implements StoreTreeNode<NodeModification>, Identif
 
     @GuardedBy("this")
     private void checkSealed() {
-        checkState(!sealed, "Node Modification is sealed. No further changes allowed.");
+        Preconditions.checkState(!sealed, "Node Modification is sealed. No further changes allowed.");
     }
 
     public synchronized void seal() {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.