public final Map<Agent, ReplicationResult> flush(final ResourceResolver resourceResolver,
final ReplicationActionType actionType,
final boolean synchronous,
final AgentFilter agentFilter,
final String... paths) throws ReplicationException {
final ReplicationOptions options = new ReplicationOptions();
final ReplicationResultListener listener = new ReplicationResultListener();
options.setFilter(agentFilter);
options.setSynchronous(synchronous);
options.setSuppressStatusUpdate(true);
options.setSuppressVersions(true);
options.setListener(listener);
for (final String path : paths) {
if (log.isDebugEnabled()) {
log.debug("--------------------------------------------------------------------------------");
log.debug("Issuing Dispatcher Flush (via AEM Replication API) request for: {}", path);
log.debug(" > Synchronous: {}", options.isSynchronous());
log.debug(" > Replication Action Type: {}", actionType.name());
}
replicator.replicate(resourceResolver.adaptTo(Session.class),
actionType, path, options);