[
https://issues.apache.org/jira/browse/OAK-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Dürig reassigned OAK-1438:
----------------------------------
Assignee: Michael Dürig
> Generalise Root.commit(String) to Root.commit(Map)
> --------------------------------------------------
>
> Key: OAK-1438
> URL: https://issues.apache.org/jira/browse/OAK-1438
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Michael Dürig
> Assignee: Michael Dürig
>
> Currently {{Root.commit}} takes a message argument of type string. This is
> used in a single place for looping through the user data for observation,
> which stretches the initial intention. OTOH we might need a way to convey
> additional information from {{Root.commit}} to the commit validators (e.g.
> for OAK-1424). I therefore suggest to replace the message parameter with a
> info parameter of type Map<String, Object>:
> {code}
> /**
> * Atomically persists all changes made to the tree attached to this root.
> * <p>
> * If {@code info} contains a mapping for {@link #COMMIT_PATH} and the
> * associated value is a string, implementations may throw a
> * {@code CommitFailedException} if there are changes outside of the
> subtree
> * designated by that path and the implementation does not support
> * such partial commits. However all implementation must handler the
> * case where a {@code path} designates a subtree that contains all
> * unpersisted changes.
> * <p>
> * The {@code info} map is passed to the underlying storage
> * as a part of the internal commit information attached to this commit.
> * The commit information will be made available to local observers but
> * will not be visible to observers on other cluster nodes.
> * <p>
> * After a successful operation the root is automatically
> * {@link #refresh() refreshed}, such that trees previously obtained
> * through {@link #getTree(String)} may become non existing.
> */
> void commit(Map<String, Object> info) throws CommitFailedException;
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)