public class CommitRateLimiter extends Object implements CommitHook
CommitHook
can be used to block or delay commits for any length of time.
As long as commits are blocked this hook throws a CommitFailedException
.Constructor and Description |
---|
CommitRateLimiter() |
Modifier and Type | Method and Description |
---|---|
void |
blockCommits()
Block any further commits until
unblockCommits() is called. |
NodeState |
processCommit(NodeState before,
NodeState after,
CommitInfo info)
Validates and/or modifies the given content change before it gets
persisted.
|
void |
setDelay(long delay)
Number of milli seconds to delay commits going through this hook.
|
void |
unblockCommits()
Unblock blocked commits.
|
public void blockCommits()
unblockCommits()
is called.public void unblockCommits()
public void setDelay(long delay)
0
, any currently blocked commit will be unblocked.delay
- milli secondspublic NodeState processCommit(NodeState before, NodeState after, CommitInfo info) throws CommitFailedException
CommitHook
processCommit
in interface CommitHook
before
- content tree before the commitafter
- content tree prepared for the commitinfo
- metadata associated with this commitCommitFailedException
- if the commit should be rejected"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"