|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.content.caching.ContentCacheImpl
public class ContentCacheImpl
The one and only implementation of the ContentCache class. Binary content data itself
is stored on disk in the location specified by cacheRoot
.
The in-memory lookup table is provided by Ehcache.
Constructor Summary | |
---|---|
ContentCacheImpl()
|
Method Summary | |
---|---|
protected java.lang.String |
cacheFileLocation(java.lang.String url)
|
boolean |
contains(Key key)
Allows caller to perform lookup using a Key . |
boolean |
contains(java.lang.String contentUrl)
Check to see if the content - specified by URL - exists in the cache. |
static java.lang.String |
createNewCacheFilePath()
Creates a relative path for a new cache file. |
java.lang.String |
getCacheFilePath(java.lang.String contentUrl)
Get the path of a cache file for the given content URL - will return null if there is no entry in the cache for the specified URL. |
java.io.File |
getCacheRoot()
Returns the directory where cache files will be written (cacheRoot). |
java.lang.String |
getContentUrl(java.io.File file)
Get a content URL from the cache - keyed by File. |
org.alfresco.service.cmr.repository.ContentReader |
getReader(java.lang.String contentUrl)
Retrieve a ContentReader for the cached content specified by URL. |
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(java.lang.String url)
Retrieve a ContentWriter to write content to a cache file. |
void |
processFiles(FileHandler handler)
|
boolean |
put(java.lang.String contentUrl,
org.alfresco.service.cmr.repository.ContentReader source)
Put an item into cache - this will populate both a disk file (with content) and the in-memory lookup table (with the URL and cache file location). |
void |
putIntoLookup(Key key,
java.lang.String value)
Put an item in the lookup table. |
void |
remove(java.lang.String contentUrl)
Remove a cached item from the in-memory lookup table. |
void |
setCacheRoot(java.io.File cacheRoot)
Specify the directory where cache files will be written. |
void |
setMemoryStore(org.alfresco.repo.cache.SimpleCache memoryStore)
Configure ContentCache with a memory store - an EhCacheAdapter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentCacheImpl()
Method Detail |
---|
public boolean contains(java.lang.String contentUrl)
ContentCache
Note that just because the in-memory cache has a record of the content item having been placed into the cache, it does not mean that the disk item is guaranteed to be there. The temp file clean-up process, for example, may have removed it.
contains
in interface ContentCache
public boolean contains(Key key)
Key
.
key
-
public void putIntoLookup(Key key, java.lang.String value)
key
- value
- public java.lang.String getCacheFilePath(java.lang.String contentUrl)
contentUrl
-
public java.lang.String getContentUrl(java.io.File file)
file
-
public org.alfresco.service.cmr.repository.ContentReader getReader(java.lang.String contentUrl)
ContentCache
getReader
in interface ContentCache
public boolean put(java.lang.String contentUrl, org.alfresco.service.cmr.repository.ContentReader source)
ContentCache
put
in interface ContentCache
public void remove(java.lang.String contentUrl)
ContentCache
remove
in interface ContentCache
public org.alfresco.service.cmr.repository.ContentWriter getWriter(java.lang.String url)
ContentCache
getWriter
in interface ContentCache
public static java.lang.String createNewCacheFilePath()
e.g. 2011/12/3/13/55/27d56416-bf9f-4d89-8f9e-e0a52de0a59e.bin
public void setMemoryStore(org.alfresco.repo.cache.SimpleCache memoryStore)
memoryStore
- the memoryStore to setpublic void setCacheRoot(java.io.File cacheRoot)
cacheRoot
- public java.io.File getCacheRoot()
protected java.lang.String cacheFileLocation(java.lang.String url)
public void processFiles(FileHandler handler)
cachedContentCleaner
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |