Fqn<?> fqn = aChildren.getFqn();
Object value = cache.get(fqn, JBossCacheIndexChangesFilter.LISTWRAPPER);
if (value instanceof ChangesFilterListsWrapper)
{
// get wrapper object
ChangesFilterListsWrapper listsWrapper = (ChangesFilterListsWrapper)value;
if (listsWrapper.withChanges())
{
if (listsWrapper.getChanges() != null)
{
// get search manager lists
addedNodes.addAll(listsWrapper.getChanges().getAddIds());
removedNodes.addAll(listsWrapper.getChanges().getRemove());
}
if (listsWrapper.getParentChanges() != null)
{
// parent search manager lists
parentAddedNodes.addAll(listsWrapper.getParentChanges().getAddIds());
parentRemovedNodes.addAll(listsWrapper.getParentChanges().getRemove());
}
}
else
{
// get search manager lists
addedNodes.addAll(listsWrapper.getAddedNodes());
removedNodes.addAll(listsWrapper.getRemovedNodes());
// parent search manager lists
parentAddedNodes.addAll(listsWrapper.getParentAddedNodes());
parentRemovedNodes.addAll(listsWrapper.getParentAddedNodes());
}
}
}
String id = IdGenerator.generate();
cache.put(Fqn.fromRelativeElements(wsChildren.getFqn(), id), JBossCacheIndexChangesFilter.LISTWRAPPER,
new ChangesFilterListsWrapper(addedNodes, removedNodes, parentAddedNodes, parentRemovedNodes));
// Once we put the merged changes into the cache we can remove other changes from the cache
for (NodeSPI aChildren : children)
{
// Remove the node from the cache and do it asynchronously
cache.getInvocationContext().getOptionOverrides().setForceAsynchronous(true);