X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FAsyncDataBroker.java;h=2af9f055f93566dd1e7d347d53435ac9ff1111f2;hb=690b4c7632f05f7f1ba23e45ce2d00a2e82d22c1;hp=3a68092f07e27f0ffe56dc090c01a0e04b37d3fd;hpb=e1cc353b5513cd68da9793361c2af6057c4ef312;p=controller.git diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncDataBroker.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncDataBroker.java index 3a68092f07..2af9f055f9 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncDataBroker.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncDataBroker.java @@ -97,20 +97,48 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange * * * - * @see http://www.idevelopment.info/data/LDAP/LDAP_Resources/ - * SEARCH_Setting_the_SCOPE_Parameter.shtml + * @see LDAP */ - public enum DataChangeScope { + enum DataChangeScope { /** - * Represents only a direct change of the node, such as replacement of a - * node, addition or deletion. + * Represents only a direct change of the node, such as replacement of a node, addition or + * deletion. Note that, as described in {@link #ONE}, this may have counterintuitive + * interactions when viewed from a binding aware application, in particular when it + * pertains to lists. * */ BASE, /** - * Represent a change (addition,replacement,deletion) of the node or one - * of its direct children. + * Represent a change (addition,replacement,deletion) of the node or one of its direct + * children. + *

+ * Note that this is done in the binding independent data tree and so the behavior + * might be counterintuitive when used with binding aware interfaces particularly + * when it comes to lists. The list itself is a node in the binding independent tree, + * which means that if you want to listen on new elements you must listen on the list itself + * with the scope of {@link #ONE}. + *

+ * As an example, in the below YANG snippet, listening on node with scope + * {@link #ONE} would tell you if the node-connector list was created or deleted, + * but not when elements were added or removed from the list assuming the list itself + * already existed. + * + *

+         * container nodes {
+         *   list node {
+         *     key "id";
+         *     leaf id {
+         *       type string;
+         *     }
+         *     list node-connector {
+         *       leaf id {
+         *         type string;
+         *       }
+         *     }
+         *   }
+         * }
+         * 
* * This scope is superset of {@link #BASE}. * @@ -130,19 +158,19 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange * {@inheritDoc} */ @Override - public AsyncReadOnlyTransaction newReadOnlyTransaction(); + AsyncReadOnlyTransaction newReadOnlyTransaction(); /** * {@inheritDoc} */ @Override - public AsyncReadWriteTransaction newReadWriteTransaction(); + AsyncReadWriteTransaction newReadWriteTransaction(); /** * {@inheritDoc} */ @Override - public AsyncWriteTransaction newWriteOnlyTransaction(); + AsyncWriteTransaction newWriteOnlyTransaction(); /** * Registers a {@link AsyncDataChangeListener} to receive