summaryrefslogtreecommitdiffstats
path: root/infra/data-api/src
diff options
context:
space:
mode:
Diffstat (limited to 'infra/data-api/src')
-rw-r--r--infra/data-api/src/main/java/io/fd/honeycomb/data/DataModification.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/infra/data-api/src/main/java/io/fd/honeycomb/data/DataModification.java b/infra/data-api/src/main/java/io/fd/honeycomb/data/DataModification.java
index 6e903a4e2..22fba0f53 100644
--- a/infra/data-api/src/main/java/io/fd/honeycomb/data/DataModification.java
+++ b/infra/data-api/src/main/java/io/fd/honeycomb/data/DataModification.java
@@ -26,7 +26,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailed
* Modification of a {@link ModifiableDataManager}.
*/
@Beta
-public interface DataModification extends ReadableDataManager {
+public interface DataModification extends ReadableDataManager, AutoCloseable {
/**
* Delete the node at specified path.
@@ -67,4 +67,12 @@ public interface DataModification extends ReadableDataManager {
* @throws DataValidationFailedException if modification data is not valid
*/
void validate() throws DataValidationFailedException;
+
+ /**
+ * Perform cleanup if necessary.
+ */
+ @Override
+ default void close() {
+ // by default, no cleanup is required
+ }
}