public abstract class AbstractRoutingContentStore extends java.lang.Object implements ContentStore
ContentContextContentStore.ContentUrlHandlerNEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRoutingContentStore() |
| Modifier and Type | Method and Description |
|---|---|
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() |
org.alfresco.service.cmr.repository.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 |
getSpaceFree()
Calcualates the remaing free space in the underlying store.
|
long |
getSpaceTotal()
Calculates the total storage space of the underlying store.
|
long |
getSpaceUsed()
Calculates the total size of stored content, excluding any other data in the underlying
storage.
|
long |
getTotalSize()
Uses
AbstractRoutingContentStore.getSpaceUsed(), which is the equivalent method. |
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
|
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(ContentContext context)
Selects a store for the given context and caches store that was used.
|
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(org.alfresco.service.cmr.repository.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(org.alfresco.repo.cache.SimpleCache storesCache) |
public void setStoresCache(org.alfresco.repo.cache.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 choicepublic boolean isContentUrlSupported(java.lang.String contentUrl)
ContentStoreisContentUrlSupported in interface ContentStorecontentUrl - the content URL to checkpublic boolean isWriteSupported()
ContentStoreisWriteSupported in interface ContentStorepublic java.lang.String getRootLocation()
ContentStoregetRootLocation in interface ContentStorepublic final long getTotalSize()
AbstractRoutingContentStore.getSpaceUsed(), which is the equivalent method. This method is now
final in order to catch any implementations that should switch over to AbstractRoutingContentStore.getSpaceUsed().getTotalSize in interface ContentStoreContentStore.getSpaceFree(),
ContentStore.getSpaceTotal()public long getSpaceUsed()
ContentStoregetSpaceUsed in interface ContentStorepublic long getSpaceFree()
ContentStoreNOTE: For efficiency, some implementations may provide a guess.
Implementations should focus on calculating a size value quickly, rather than accurately.
getSpaceFree in interface ContentStorepublic long getSpaceTotal()
ContentStoreNOTE: For efficiency, some implementations may provide a guess.
Implementations should focus on calculating a size value quickly, rather than accurately.
getSpaceTotal in interface ContentStorepublic boolean exists(java.lang.String contentUrl)
throws org.alfresco.service.cmr.repository.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 ContentStorecontentUrl - the path to the contentorg.alfresco.service.cmr.repository.ContentIOException - if an IO error occursAbstractRoutingContentStore.selectReadStore(String)public org.alfresco.service.cmr.repository.ContentReader getReader(java.lang.String contentUrl)
throws org.alfresco.service.cmr.repository.ContentIOException
ContentStoregetReader in interface ContentStorecontentUrl - the path to where the content is locatedEmptyContentReader is returned.org.alfresco.service.cmr.repository.ContentIOException - if an IO error occursContentStore.exists(String),
ContentReader.exists(),
EmptyContentReaderpublic org.alfresco.service.cmr.repository.ContentWriter getWriter(ContentContext context) throws org.alfresco.service.cmr.repository.ContentIOException
getWriter in interface ContentStorecontext - the context of content.org.alfresco.service.cmr.repository.ContentIOException - if an IO error occursAbstractRoutingContentStore.selectWriteStore(ContentContext)public org.alfresco.service.cmr.repository.ContentWriter getWriter(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
java.lang.String newContentUrl)
throws org.alfresco.service.cmr.repository.ContentIOException
ContentStoreContentStore.getWriter(ContentContext).getWriter in interface ContentStoreorg.alfresco.service.cmr.repository.ContentIOExceptionContentStore.getWriter(ContentContext)public void getUrls(ContentStore.ContentUrlHandler handler) throws org.alfresco.service.cmr.repository.ContentIOException
ContentStoregetUrls in interface ContentStoreorg.alfresco.service.cmr.repository.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 org.alfresco.service.cmr.repository.ContentIOException
getUrls in interface ContentStorecreatedAfter - 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 URLorg.alfresco.service.cmr.repository.ContentIOException - if an error occursContentStore.getUrls(Date, Date, ContentUrlHandler)public boolean delete(java.lang.String contentUrl)
throws org.alfresco.service.cmr.repository.ContentIOException
ContentStore.exists(String) contract.delete in interface ContentStorecontentUrl - the URL of the content to deleteorg.alfresco.service.cmr.repository.ContentIOException - if an error occurs
if an IO error occursCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.