Package org.alfresco.repo.content
Class AbstractRoutingContentStore
java.lang.Object
org.alfresco.repo.content.AbstractRoutingContentStore
- All Implemented Interfaces:
ContentStore
- Direct Known Subclasses:
AbstractTenantRoutingContentStore
A store providing support for content store implementations that provide
routing of content read and write requests based on context.
- Since:
- 2.1
- Author:
- Derek Hulley
- See Also:
-
Field Summary
Fields inherited from interface org.alfresco.repo.content.ContentStore
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis operation has to be performed on all the stores in order to maintain theContentStore.exists(String)contract.booleanprotected abstract List<ContentStore>longlonggetStorageProperties(String contentUrl) getWriter(ContentContext context) Selects a store for the given context and caches store that was used.getWriter(ContentReader existingContentReader, String newContentUrl) booleanisContentUrlSupported(String contentUrl) booleanbooleanrequestRestoreContentFromArchive(String contentUrl, Map<String, Serializable> restoreParams) booleanrequestSendContentToArchive(String contentUrl, Map<String, Serializable> archiveParams) protected abstract ContentStoreGet a content store based on the context provided.voidsetStoresCache(SimpleCache<Pair<String, String>, ContentStore> storesCache) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.repo.content.ContentStore
isContentDirectUrlEnabled, isContentDirectUrlEnabled, requestContentDirectUrl, requestContentDirectUrl, requestContentDirectUrl, requestContentDirectUrl
-
Constructor Details
-
AbstractRoutingContentStore
protected AbstractRoutingContentStore()
-
-
Method Details
-
setStoresCache
- Parameters:
storesCache- cache of stores used to access URLs
-
getAllStores
- Returns:
- Returns a list of all possible stores available for reading or writing
-
selectWriteStore
Get a content store based on the context provided. The applicability of the context and even the types of context allowed are up to the implementation, but normally there should be a fallback case for when the parameters are not adequate to make a decision.- Parameters:
ctx- the context to use to make the choice- Returns:
- Returns the store most appropriate for the given context and never null
-
isContentUrlSupported
- Specified by:
isContentUrlSupportedin interfaceContentStore- Returns:
- Returns true if the URL is supported by any of the stores.
-
isWriteSupported
public boolean isWriteSupported()- Specified by:
isWriteSupportedin interfaceContentStore- Returns:
- Returns true if write is supported by any of the stores.
-
getRootLocation
- Specified by:
getRootLocationin interfaceContentStore- Returns:
- Returns . always
-
getSpaceFree
public long getSpaceFree()- Specified by:
getSpaceFreein interfaceContentStore- Returns:
- Returns -1 always
-
getSpaceTotal
public long getSpaceTotal()- Specified by:
getSpaceTotalin interfaceContentStore- Returns:
- Returns -1 always
-
exists
- Specified by:
existsin interfaceContentStore- Throws:
ContentIOException- See Also:
-
selectReadStore(String)
-
getReader
- Specified by:
getReaderin interfaceContentStore- Returns:
- Returns a valid reader from one of the stores otherwise
a
EmptyContentReaderis returned. - Throws:
ContentIOException
-
getWriter
Selects a store for the given context and caches store that was used.- Specified by:
getWriterin interfaceContentStore- Throws:
ContentIOException- See Also:
-
getWriter
public ContentWriter getWriter(ContentReader existingContentReader, String newContentUrl) throws ContentIOException - Throws:
ContentIOException
-
delete
This operation has to be performed on all the stores in order to maintain theContentStore.exists(String)contract.- Specified by:
deletein interfaceContentStore- Throws:
ContentIOException
-
getStorageProperties
- Specified by:
getStoragePropertiesin interfaceContentStore
-
requestSendContentToArchive
public boolean requestSendContentToArchive(String contentUrl, Map<String, Serializable> archiveParams) - Specified by:
requestSendContentToArchivein interfaceContentStore
-
requestRestoreContentFromArchive
public boolean requestRestoreContentFromArchive(String contentUrl, Map<String, Serializable> restoreParams) - Specified by:
requestRestoreContentFromArchivein interfaceContentStore
-