BUG-2967: Expose before-state from DataObjectModification 00/18000/1
authorRobert Varga <rovarga@cisco.com>
Thu, 9 Apr 2015 09:32:48 +0000 (11:32 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 9 Apr 2015 10:11:32 +0000 (12:11 +0200)
commit0992b3023da383702cf44ab3e5a95272365169a4
treea1edb61b22a62e2cdcfd09e75cfc1b5a0401cef2
parent6a7e0492ef541f8aae9a6159862358443ed43f8e
BUG-2967: Expose before-state from DataObjectModification

Not exposing the before-state requires users to track this state
themselves. The problem is most visible in the delete case, if
the user needs some attributes to reconstruct keys to other structures
in order to perform cleanup -- they would effectively have to retain
a InstanceIdentifier->data map to efficiently perform deletes.

Rather than forcing everyone to duplicate data, expose the before-state,
as best available. Note that applications still need to deal with the
fact that the before-state in delete can be null -- at least by issuing
a warning to the operator.

Change-Id: I72c886f384254a6808159eaee612b07083073492
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/md/sal/binding/api/DataObjectModification.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDataObjectModification.java