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()
Deprecated.
since 5.4. Use
AbstractListeningFlushPolicy(CacheModule, RepositoryManager) instead. |
AbstractListeningFlushPolicy(CacheModule cacheModule,
info.magnolia.repository.RepositoryManager repositoryManager) |
Modifier and Type | Method and Description |
---|---|
void |
addRepository(String repository)
Deprecated.
since 5.4. Use
setWorkspaces(List) instead. |
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 String |
getPath(Cache cache)
Deprecated.
since 5.4.4. Use
getPaths(Cache, String) instead. |
protected Collection<String> |
getPaths(Cache cache,
String workspace) |
List<String> |
getRepositories()
Deprecated.
since 5.4. Use
getWorkspaces() instead. |
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 |
setRepositories(List<String> repositories)
Deprecated.
since 5.4. Use
setWorkspaces(List) instead. |
void |
setWorkspaces(List<String> workspaces) |
void |
start(Cache cache) |
void |
stop(Cache cache) |
public AbstractListeningFlushPolicy()
AbstractListeningFlushPolicy(CacheModule, RepositoryManager)
instead.@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)
@Deprecated protected String getPath(Cache cache)
getPaths(Cache, String)
instead.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()
public List<String> getRepositories()
getWorkspaces()
instead.public void setRepositories(List<String> repositories)
setWorkspaces(List)
instead.public void addRepository(String repository)
setWorkspaces(List)
instead.Copyright © 2019 Magnolia International Ltd.. All rights reserved.