public class CachingContentStore extends Object implements org.alfresco.repo.content.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.
Constructor and Description |
---|
CachingContentStore() |
CachingContentStore(org.alfresco.repo.content.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() |
org.alfresco.service.cmr.repository.ContentReader |
getReader(String contentUrl) |
String |
getRootLocation() |
long |
getSpaceFree() |
long |
getSpaceTotal() |
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(org.alfresco.repo.content.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(org.alfresco.repo.content.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(org.alfresco.repo.content.ContentStore backingStore, ContentCache cache, boolean cacheOnInbound)
public void init()
public boolean isContentUrlSupported(String contentUrl)
isContentUrlSupported
in interface org.alfresco.repo.content.ContentStore
public boolean isWriteSupported()
isWriteSupported
in interface org.alfresco.repo.content.ContentStore
public long getSpaceFree()
getSpaceFree
in interface org.alfresco.repo.content.ContentStore
public long getSpaceTotal()
getSpaceTotal
in interface org.alfresco.repo.content.ContentStore
public String getRootLocation()
getRootLocation
in interface org.alfresco.repo.content.ContentStore
public boolean exists(String contentUrl)
For spoofed
URLs, the URL always exists.
exists
in interface org.alfresco.repo.content.ContentStore
public org.alfresco.service.cmr.repository.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 org.alfresco.repo.content.ContentStore
public org.alfresco.service.cmr.repository.ContentWriter getWriter(org.alfresco.repo.content.ContentContext context)
getWriter
in interface org.alfresco.repo.content.ContentStore
public boolean delete(String contentUrl)
delete
in interface org.alfresco.repo.content.ContentStore
public ReentrantReadWriteLock readWriteLock(String url)
url
- Stringpublic void setBackingStore(org.alfresco.repo.content.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.ApplicationEventPublisherAware
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public String getBeanName()
Copyright © 2005–2017 Alfresco Software. All rights reserved.