|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.content.AbstractRoutingContentStore
public abstract class AbstractRoutingContentStore
A store providing support for content store implementations that provide routing of content read and write requests based on context.
ContentContext
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.alfresco.repo.content.ContentStore |
---|
ContentStore.ContentUrlHandler |
Field Summary |
---|
Fields inherited from interface org.alfresco.repo.content.ContentStore |
---|
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER |
Constructor Summary | |
---|---|
protected |
AbstractRoutingContentStore()
|
Method Summary | |
---|---|
boolean |
delete(java.lang.String contentUrl)
This operation has to be performed on all the stores in order to maintain the ContentStore.exists(String) contract. |
boolean |
exists(java.lang.String contentUrl)
Check for the existence of content in the store. |
protected abstract java.util.List |
getAllStores()
|
ContentReader |
getReader(java.lang.String contentUrl)
Get the accessor with which to read from the content at the given URL. |
java.lang.String |
getRootLocation()
Get the location where the store is rooted. |
long |
getTotalSize()
Calculates the total size of content stored. |
void |
getUrls(ContentStore.ContentUrlHandler handler)
Get all URLs for the store, regardless of creation time. |
void |
getUrls(java.util.Date createdAfter,
java.util.Date createdBefore,
ContentStore.ContentUrlHandler handler)
Passes the call to each of the stores wrapped by this store |
ContentWriter |
getWriter(ContentContext context)
Selects a store for the given context and caches store that was used. |
ContentWriter |
getWriter(ContentReader existingContentReader,
java.lang.String newContentUrl)
Shortcut method to ContentStore.getWriter(ContentContext) . |
boolean |
isContentUrlSupported(java.lang.String contentUrl)
Check if the content URL format is supported by the store. |
boolean |
isWriteSupported()
Check if the store supports write requests. |
protected abstract ContentStore |
selectWriteStore(ContentContext ctx)
Get a content store based on the context provided. |
void |
setStoresCache(SimpleCache storesCache)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractRoutingContentStore()
Method Detail |
---|
public void setStoresCache(SimpleCache storesCache)
storesCache
- cache of stores used to access URLsprotected abstract java.util.List getAllStores()
protected abstract ContentStore selectWriteStore(ContentContext ctx)
ctx
- the context to use to make the choice
public boolean isContentUrlSupported(java.lang.String contentUrl)
ContentStore
isContentUrlSupported
in interface ContentStore
contentUrl
- the content URL to check
public boolean isWriteSupported()
ContentStore
isWriteSupported
in interface ContentStore
public java.lang.String getRootLocation()
ContentStore
getRootLocation
in interface ContentStore
public long getTotalSize()
ContentStore
NOTE: For efficiency, some implementations may provide a guess. If not, this call could take a long time.
Implementations should focus on calculating a size value quickly, rather than accurately.
getTotalSize
in interface ContentStore
public boolean exists(java.lang.String contentUrl) throws ContentIOException
ContentStore
The implementation of this may be more efficient than first getting a
reader to check for existence
, although
that check should also be performed.
exists
in interface ContentStore
contentUrl
- the path to the content
ContentIOException
- if an IO error occursAbstractRoutingContentStore.selectReadStore(String)
public ContentReader getReader(java.lang.String contentUrl) throws ContentIOException
ContentStore
getReader
in interface ContentStore
contentUrl
- the path to where the content is located
EmptyContentReader
is returned.
ContentIOException
- if an IO error occursContentStore.exists(String)
,
ContentReader.exists()
,
EmptyContentReader
public ContentWriter getWriter(ContentContext context) throws ContentIOException
getWriter
in interface ContentStore
context
- the context of content.
ContentIOException
- if an IO error occursAbstractRoutingContentStore.selectWriteStore(ContentContext)
public ContentWriter getWriter(ContentReader existingContentReader, java.lang.String newContentUrl) throws ContentIOException
ContentStore
ContentStore.getWriter(ContentContext)
.
getWriter
in interface ContentStore
ContentIOException
ContentStore.getWriter(ContentContext)
public void getUrls(ContentStore.ContentUrlHandler handler) throws ContentIOException
ContentStore
getUrls
in interface ContentStore
ContentIOException
- if an IO error occursContentStore.getUrls(Date, Date, ContentUrlHandler)
public void getUrls(java.util.Date createdAfter, java.util.Date createdBefore, ContentStore.ContentUrlHandler handler) throws ContentIOException
getUrls
in interface ContentStore
createdAfter
- all URLs returned must have been created after this date. May be null.createdBefore
- all URLs returned must have been created before this date. May be null.handler
- the callback that will passed each URL
ContentIOException
- if an error occursContentStore.getUrls(Date, Date, ContentUrlHandler)
public boolean delete(java.lang.String contentUrl) throws ContentIOException
ContentStore.exists(String)
contract.
delete
in interface ContentStore
contentUrl
- the URL of the content to delete
ContentIOException
- if an error occurs
if an IO error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |