X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FAsyncDataBroker.java;h=dff2f8ba2fa7abfafc0d37fdfb93694bd737296c;hb=99f994b3e45963f6ef46bc2b71ab4dd8eea8b9ac;hp=528324151710fdf8abd1c670c05f3de38744a04d;hpb=441af0d780a045ae6172c0872704e8f0e47fb09d;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 5283241517..dff2f8ba2f 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 @@ -11,7 +11,6 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.concepts.Path; /** - * * Base interface that provides access to a conceptual data tree store and also provides the ability to * subscribe for changes to data under a given branch of the tree. * @@ -32,7 +31,7 @@ import org.opendaylight.yangtools.concepts.Path; * For a detailed explanation of how transaction are isolated and how transaction-local * changes are committed to global data tree, see * {@link AsyncReadTransaction}, {@link AsyncWriteTransaction}, - * {@link AsyncReadWriteTransaction} and {@link AsyncWriteTransaction#commit()}. + * {@link AsyncReadWriteTransaction} and {@link AsyncWriteTransaction#submit()}. * * *

@@ -57,16 +56,15 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange AsyncDataTransactionFactory { /** - * * Scope of Data Change * *

* Represents scope of data change (addition, replacement, deletion). - * * The terminology for scope types is reused from LDAP. * *

Examples

* + *

* Following is an example model with comments describing what notifications * you would receive based on the scope you specify, when you are * registering for changes on container a. @@ -83,6 +81,7 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange * id "b" // scope SUBTREE * * + *

* Following is an example model with comments describing what notifications * you would receive based on the scope you specify, when you are * registering for changes on list list (without specifying concrete item in @@ -112,12 +111,14 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange /** * 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, @@ -140,6 +141,7 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange * } * * + *

* This scope is superset of {@link #BASE}. * */ @@ -148,27 +150,19 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange * Represents a change of the node or any of or any of its child nodes, * direct and nested. * + *

* This scope is superset of {@link #ONE} and {@link #BASE}. * */ SUBTREE } - /** - * {@inheritDoc} - */ @Override AsyncReadOnlyTransaction newReadOnlyTransaction(); - /** - * {@inheritDoc} - */ @Override AsyncReadWriteTransaction newReadWriteTransaction(); - /** - * {@inheritDoc} - */ @Override AsyncWriteTransaction newWriteOnlyTransaction(); @@ -176,16 +170,19 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange * Registers a {@link AsyncDataChangeListener} to receive * notifications when data changes under a given path in the conceptual data * tree. + * *

* You are able to register for notifications for any node or subtree * which can be reached via the supplied path. + * *

* If path type P allows it, you may specify paths up to the leaf nodes * then it is possible to listen on leaf nodes. + * *

* You are able to register for data change notifications for a subtree even - * if it does not exist. You will receive notification once that node is - * created. + * if it does not exist. You will receive notification once that node is created. + * *

* If there is any preexisting data in data tree on path for which you are * registering, you will receive initial data change event, which will @@ -194,6 +191,7 @@ public interface AsyncDataBroker

, D, L extends AsyncDataChange *

* You are also able to specify the scope of the changes you want to be * notified. + * *

* Supported scopes are: *

* See {@link DataChangeScope} for examples. + * *

* This method returns a {@link ListenerRegistration} object. To * "unregister" your listener for changes call the "close" method on this * returned object. + * *

* You MUST call close when you no longer need to receive notifications * (such as during shutdown or for example if your bundle is shutting down).