From: Robert Varga Date: Mon, 3 Feb 2014 18:40:03 +0000 (+0100) Subject: Clarify the semantics of put{Configuration,Operational}Data() X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~535^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=b50046a1249caf511cfec8d4d35d572ed838f840 Clarify the semantics of put{Configuration,Operational}Data() This just adds documentation to how the put operations interact with pre-existing data. Change-Id: I01979df6a22f1a6d16c04c2cb0b97d7472d62040 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModification.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModification.java index d74b26dae2..29ba192ba8 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModification.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModification.java @@ -37,8 +37,46 @@ public interface DataModification

*/, D> extends DataChange< @Deprecated void putRuntimeData(P path, D data); + /** + * Store a piece of data at specified path. This acts as a merge operation, + * which is to say that any pre-existing data which is not explicitly + * overwritten will be preserved. This means that if you store a container, + * its child lists will be merged. Performing the following put operations: + * + * 1) container { list [ a ] } + * 2) container { list [ b ] } + * + * will result in the following data being present: + * + * container { list [ a, b ] } + * + * This also means that storing the container will preserve any augmentations + * which have been attached to it. + * + * If you require an explicit replace operation, perform + * {@link removeOperationalData} first. + */ void putOperationalData(P path, D data); + /** + * Store a piece of data at specified path. This acts as a merge operation, + * which is to say that any pre-existing data which is not explicitly + * overwritten will be preserved. This means that if you store a container, + * its child lists will be merged. Performing the following put operations: + * + * 1) container { list [ a ] } + * 2) container { list [ b ] } + * + * will result in the following data being present: + * + * container { list [ a, b ] } + * + * This also means that storing the container will preserve any augmentations + * which have been attached to it. + * + * If you require an explicit replace operation, perform + * {@link removeConfigurationData} first. + */ void putConfigurationData(P path, D data); /**