X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fapi%2FWriteOperations.java;h=b054d43f7bd0f14f9e8f19ef2122d9ca4510b4e1;hb=94fb90ab450470ee1b3225d737cd394f034ea932;hp=2bc0be80625a18e8aa1bfe404c89c0e740b31ca6;hpb=a10c289bba4f28edb60fd555ee6d0f69cadd5c5f;p=mdsal.git diff --git a/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/WriteOperations.java b/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/WriteOperations.java index 2bc0be8062..b054d43f7b 100644 --- a/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/WriteOperations.java +++ b/binding/mdsal-binding-api/src/main/java/org/opendaylight/mdsal/binding/api/WriteOperations.java @@ -7,8 +7,10 @@ */ package org.opendaylight.mdsal.binding.api; +import com.google.common.util.concurrent.FluentFuture; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.mdsal.common.api.TransactionDatastoreMismatchException; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -22,83 +24,120 @@ public interface WriteOperations { * whole subtree will be replaced by the specified data. * *
- * This method does not automatically create missing parent nodes. It is equivalent to invoking
- * {@link #put(LogicalDatastoreType, InstanceIdentifier, DataObject, boolean)}
- * with createMissingParents
set to false.
- *
- *
- * If you need to make sure that a parent object exists but you do not want modify
- * its pre-existing state by using put, consider using {@link #merge} instead.
+ * If you need to make sure that a parent object exists but you do not want modify its pre-existing state by using
+ * put, consider using {@link #merge} instead.
*
* @param store the logical data store which should be modified
* @param path the data object path
* @param data the data object to be written to the specified path
* @throws IllegalStateException if the transaction has already been submitted
- * @throws NullPointerException if any of the arguments is null
+ * @throws NullPointerException if any of the arguments is {@code null}
+ * @throws TransactionDatastoreMismatchException if this transaction is already bound to a different data store
*/
* If you need to make sure that a parent object exists but you do not want modify its pre-existing state by using
* put, consider using {@link #merge} instead.
*
*
- * Note: Using
- * This method does not automatically create missing parent nodes. It is equivalent to invoking
- * {@link #merge(LogicalDatastoreType, InstanceIdentifier, DataObject, boolean)}
- * with
* If you require an explicit replace operation, use {@link #put} instead.
+ *
* @param store the logical data store which should be modified
* @param path the data object path
* @param data the data object to be merged to the specified path
* @throws IllegalStateException if the transaction has already been submitted
- * @throws NullPointerException if any of the arguments is null
+ * @throws NullPointerException if any of the arguments is {@code null}
+ * @throws TransactionDatastoreMismatchException if this transaction is already bound to a different data store
*/
* If you require an explicit replace operation, use {@link #put} instead.
*
+ *
+ * WARNING: Using this method may introduce garbage in data store, or recreate nodes, which were deleted by
+ * a previous transaction. It is not necessary in most scenarios and has a significantly higher cost
+ * than {@link #merge(LogicalDatastoreType, InstanceIdentifier, DataObject)}. It should only be used
+ * when absolutely necessary.
+ *
* @param store the logical data store which should be modified
* @param path the data object path
* @param data the data object to be merged to the specified path
- * @param createMissingParents if {@link #CREATE_MISSING_PARENTS}, any missing parent nodes will be automatically
- * created using a merge operation.
* @throws IllegalStateException if the transaction has already been submitted
- * @throws NullPointerException if any of the arguments is null
+ * @throws NullPointerException if any of the arguments is {@code null}
+ * @throws TransactionDatastoreMismatchException if this transaction is already bound to a different data store
+ * @deprecated Use of this method is a manifestation of bad lifecycle management: it attempts to create data tree
+ * parent nodes which may have semantic meaning without assigning responsibility. The datastore handles
+ * all the cases which do not attach semantics, such as {@code container}s without {@code presence},
+ * {@code augmentation} and {@code list} encapsulation.
+ * This method does not work in the general case, where there are:
+ * createMissingParents
with value true, may introduce garbage in data store, or recreate
- * nodes, which were deleted by previous transaction.
+ * WARNING: Using this method may introduce garbage in data store, or recreate nodes, which were deleted by
+ * a previous transaction. It also has a significantly higher cost than
+ * {@link #put(LogicalDatastoreType, InstanceIdentifier, DataObject)} and should only be used when
+ * absolutely necessary.
*
* @param store the logical data store which should be modified
* @param path the data object path
* @param data the data object to be written to the specified path
- * @param createMissingParents if {@link #CREATE_MISSING_PARENTS}, any missing parent nodes will be automatically
- * created using a merge operation.
* @throws IllegalStateException if the transaction has already been submitted
- * @throws NullPointerException if any of the arguments is null
+ * @throws NullPointerException if any of the arguments is {@code null}
+ * @throws TransactionDatastoreMismatchException if this transaction is already bound to a different data store
+ * @deprecated Use of this method is a manifestation of bad lifecycle management: it attempts to create data tree
+ * parent nodes which may have semantic meaning without assigning responsibility. The datastore handles
+ * all the cases which do not attach semantics, such as {@code container}s without {@code presence},
+ * {@code augmentation} and {@code list} encapsulation.
+ * This method does not work in the general case, where there are:
+ *
+ *
+ * Based on this analysis, all users of this method need to be migrated to have a proper lifecycle
+ * relationship with entities responsible for managing such semantic items which are created by this
+ * method.
*/
- createMissingParents
set to false.
- *
- *
+ *
+ * Based on this analysis, all users of this method need to be migrated to have a proper lifecycle
+ * relationship with entities responsible for managing such semantic items which are created by this
+ * method.
*/
-