public abstract class AbstractListeningFlushPolicy extends Object implements FlushPolicy
FlushPolicy
providing functionality for triggering flush operation based on changes in observed workspaces.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractListeningFlushPolicy.CacheCleaner
Event listener triggering the cleanup of the cache.
|
Constructor and Description |
---|
AbstractListeningFlushPolicy(CacheModule cacheModule,
info.magnolia.repository.RepositoryManager repositoryManager) |
Modifier and Type | Method and Description |
---|---|
protected void |
flushByUUID(String uuid,
String repository,
Cache cache)
Flushes all content related to given uuid&repository combination from provided cache.
|
List<String> |
getExcludedWorkspaces()
The workspaces to which the listener is NOT attached.
|
protected Collection<String> |
getPaths(Cache cache,
String workspace) |
List<String> |
getWorkspaces()
The workspaces to which the listener is attached - upon any event on these,
the cache is cleared.
|
protected abstract void |
handleSingleEvent(Cache cache,
String repository,
javax.jcr.observation.Event event)
Implement this method to react on each and every event on a given cache and repository,
even if multiple where buffered.
|
protected abstract void |
postHandleEvents(Cache cache,
String repository)
Implement this method to wrap up flushing process after all single events have been processed.
|
protected abstract boolean |
preHandleEvents(Cache cache,
String repository)
Implement this method to react on buffered events on a given cache and repository.
|
void |
setExcludedWorkspaces(List<String> excludedWorkspaces) |
void |
setWorkspaces(List<String> workspaces) |
void |
start(Cache cache) |
void |
stop(Cache cache) |
@Inject public AbstractListeningFlushPolicy(CacheModule cacheModule, info.magnolia.repository.RepositoryManager repositoryManager)
public void start(Cache cache)
start
in interface FlushPolicy
protected Collection<String> getPaths(Cache cache, String workspace)
public void stop(Cache cache)
stop
in interface FlushPolicy
protected abstract boolean preHandleEvents(Cache cache, String repository)
protected abstract void postHandleEvents(Cache cache, String repository)
preHandleEvents(Cache, String)
returns true;protected abstract void handleSingleEvent(Cache cache, String repository, javax.jcr.observation.Event event)
preHandleEvents(Cache, String)
returns true;protected void flushByUUID(String uuid, String repository, Cache cache)
public List<String> getWorkspaces()
public List<String> getExcludedWorkspaces()
Copyright © 2019 Magnolia International Ltd.. All rights reserved.