From b50046a1249caf511cfec8d4d35d572ed838f840 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 3 Feb 2014 19:40:03 +0100 Subject: [PATCH] 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 --- .../sal/common/api/data/DataModification.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) 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); /** -- 2.36.6