ResourceChangeListener for page moves: Will the listener receive a pair of events (ADDED and REMOVED) in a single call only when a page has been moved?
Hi,
If a page is moved, then my listener shall react to it. - The listener needs the old and the new path of the moved page in order to move another resource which is located at a different root path in the repository accordingly.
The listener implements the ResourceChangeListener and therefore has the following method:
public void onChange(final List<ResourceChange> changes)
All pages which are observed by the listener are located under "/content/".
According to my analysis, the listener receives the following events when a page is moved:
- several CHANGED events - each CHANGED event in a separate call to the onChange method, i.e. as a single object in the input list,
- afterwards one list (ResourceChangeList) which contains 2 JcrResourceChange events of type ADDED and REMOVED:
[ResourceChange[type=ADDED, path=/content/b/c, external=false], ResourceChange[type=REMOVED, path=/content/a/c, external=false]]
This last pair of events (ADDED and REMOVED) is interesting to me, because it contains the old and new path of the moved page. The old path is located in the event of type REMOVED and the new path in the event of type ADDED.
My question is: Will the listener receive such a pair of events (ADDED and REMOVED) in a single call only when a page has been moved? - This is my assumption, but despite a long search I haven't found any specification of this behavior, therefore I ask you here.
Is it maybe possible that the listener will receive such a pair of events (ADDED and REMOVED) in a single call if two different pages are added and removed exactly at the same time?
I ask, because I need the old and new path of the moved page and want to make sure that such a pair of events will be received by the listener in a single call only in case of a moved page and not in any other case.
Thank you in advance for your help.