public class CachingContentStore extends Object implements ContentStore, org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.BeanNameAware
CachingContentStore should only be used to wrap content stores that are significantly slower that FileContentStore - otherwise performance may actually degrade from its use.
It is important that cacheOnInbound is set to true for exceptionally slow backing stores.
This store handles the FileContentStore.SPOOF_PROTOCOL and can be used to wrap stores
that do not handle the protocol out of the box e.g. the S3 connector's store.
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER| Constructor and Description |
|---|
CachingContentStore() |
CachingContentStore(ContentStore backingStore,
ContentCache cache,
boolean cacheOnInbound) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(String contentUrl) |
boolean |
exists(String contentUrl) |
String |
getBackingStoreDescription() |
String |
getBackingStoreType() |
String |
getBeanName() |
ContentCache |
getCache() |
int |
getMaxCacheTries() |
QuotaManagerStrategy |
getQuota() |
ContentReader |
getReader(String contentUrl) |
String |
getRootLocation() |
long |
getSpaceFree() |
long |
getSpaceTotal() |
ContentWriter |
getWriter(ContentContext context) |
void |
init()
Initialisation method, should be called once the CachingContentStore has been constructed.
|
boolean |
isCacheOnInbound() |
boolean |
isContentUrlSupported(String contentUrl) |
boolean |
isWriteSupported() |
ReentrantReadWriteLock |
readWriteLock(String url)
Get a ReentrantReadWriteLock for a given URL.
|
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setBackingStore(ContentStore backingStore) |
void |
setBeanName(String name) |
void |
setCache(ContentCache cache) |
void |
setCacheOnInbound(boolean cacheOnInbound) |
void |
setMaxCacheTries(int maxCacheTries) |
void |
setQuota(QuotaManagerStrategy quota)
Sets the QuotaManagerStrategy that will be used.
|
public CachingContentStore()
public CachingContentStore(ContentStore backingStore, ContentCache cache, boolean cacheOnInbound)
public void init()
public boolean isContentUrlSupported(String contentUrl)
isContentUrlSupported in interface ContentStorepublic boolean isWriteSupported()
isWriteSupported in interface ContentStorepublic long getSpaceFree()
getSpaceFree in interface ContentStorepublic long getSpaceTotal()
getSpaceTotal in interface ContentStorepublic String getRootLocation()
getRootLocation in interface ContentStorepublic boolean exists(String contentUrl)
For spoofed URLs, the URL always exists.
exists in interface ContentStorepublic ContentReader getReader(String contentUrl)
This store handles the FileContentStore.SPOOF_PROTOCOL so that underlying stores do not need
to implement anything related to spoofing.
getReader in interface ContentStorepublic ContentWriter getWriter(ContentContext context)
getWriter in interface ContentStorepublic boolean delete(String contentUrl)
delete in interface ContentStorepublic ReentrantReadWriteLock readWriteLock(String url)
url - Stringpublic void setBackingStore(ContentStore backingStore)
public String getBackingStoreType()
public String getBackingStoreDescription()
public void setCache(ContentCache cache)
public ContentCache getCache()
public void setCacheOnInbound(boolean cacheOnInbound)
public boolean isCacheOnInbound()
public int getMaxCacheTries()
public void setMaxCacheTries(int maxCacheTries)
public void setQuota(QuotaManagerStrategy quota)
quota - QuotaManagerStrategypublic QuotaManagerStrategy getQuota()
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwarepublic void setBeanName(String name)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic String getBeanName()
Copyright © 2005–2021 Alfresco Software. All rights reserved.