[
https://issues.apache.org/jira/browse/JCR-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750636#action_12750636
]
Jukka Zitting commented on JCR-1865:
------------------------------------
> Could you provide code examples, and all interfaces required for your
> solution?
Here's a quick example of how this could work:
ManagedRepository mr = new
ManagedRepositoryImpl(RepositoryConfig.create(...));
// Accessing the repository through normal JCR API
Repository repository = mr.getRepository();
...;
// Getting an administrative session (see the similar Sling API)
Session admin = mr.loginAdministrative();
...;
// Collecting garbage
GarbageCollector collector = mr.getGarbageCollector();
try {
collector.mark();
collector.sweep();
} finally {
collector.close();
}
// Closing the repository
mr.shutdown();
The advantage of this approach over adding things to JackrabbitSession is that
access control to such admin features becomes a deployment issue, not an
authorization issue. We won't need to extend the JCR access control mechanism
with custom privileges like "garbage collection" or "repository shutdown".
> No, because the user may not want to call sweep()
Good point.
> Add the Data Store to the Jackrabbit API
> ----------------------------------------
>
> Key: JCR-1865
> URL: https://issues.apache.org/jira/browse/JCR-1865
> Project: Jackrabbit Content Repository
> Issue Type: Improvement
> Components: jackrabbit-core
> Reporter: Thomas Mueller
> Assignee: Thomas Mueller
> Priority: Minor
> Attachments: api.patch, api_2.patch, core.patch, core_2.patch
>
>
> Currently, the garbage collection is not part of the Jackrabbit API. However,
> the data store garbage collection must be used once in a while if the data
> store is enabled. I propose to add the required interfaces to the Jackrabbit
> API. This will also allow to call garbage collection using RMI.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.