Package org.alfresco.repo.content
Class AbstractRoutingContentStore
- java.lang.Object
-
- org.alfresco.repo.content.AbstractRoutingContentStore
-
- All Implemented Interfaces:
ContentStore
- Direct Known Subclasses:
AbstractTenantRoutingContentStore
public abstract class AbstractRoutingContentStore extends Object implements ContentStore
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:
ContentContext
-
-
Field Summary
-
Fields inherited from interface org.alfresco.repo.content.ContentStore
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER, SCS_ARCHIVE, SCS_DEFAULT, SCS_WORM, STORAGE_CLASS_ARCHIVE, STORAGE_CLASS_DEFAULT, STORAGE_CLASS_WORM
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRoutingContentStore()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.content.ContentStore
getDirectAccessUrl, isDirectAccessSupported
-
-
-
-
Method Detail
-
setStoresCache
public void setStoresCache(SimpleCache<Pair<String,String>,ContentStore> storesCache)
- Parameters:
storesCache- cache of stores used to access URLs
-
getAllStores
protected abstract List<ContentStore> getAllStores()
- Returns:
- Returns a list of all possible stores available for reading or writing
-
selectWriteStore
protected abstract ContentStore selectWriteStore(ContentContext ctx)
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
public boolean isContentUrlSupported(String contentUrl)
- 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
public String 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
public boolean exists(String contentUrl) throws ContentIOException
- Specified by:
existsin interfaceContentStore- Throws:
ContentIOException- See Also:
selectReadStore(String)
-
getReader
public ContentReader getReader(String contentUrl) throws ContentIOException
- Specified by:
getReaderin interfaceContentStore- Returns:
- Returns a valid reader from one of the stores otherwise
a
EmptyContentReaderis returned. - Throws:
ContentIOException
-
getWriter
public ContentWriter getWriter(ContentContext context) throws ContentIOException
Selects a store for the given context and caches store that was used.- Specified by:
getWriterin interfaceContentStore- Throws:
ContentIOException- See Also:
selectWriteStore(ContentContext)
-
getWriter
public ContentWriter getWriter(ContentReader existingContentReader, String newContentUrl) throws ContentIOException
- Throws:
ContentIOException
-
delete
public boolean delete(String contentUrl) throws ContentIOException
This operation has to be performed on all the stores in order to maintain theContentStore.exists(String)contract.- Specified by:
deletein interfaceContentStore- Throws:
ContentIOException
-
isStorageClassesSupported
public boolean isStorageClassesSupported(StorageClassSet storageClassSet)
- Specified by:
isStorageClassesSupportedin interfaceContentStore
-
getSupportedStorageClasses
public Set<String> getSupportedStorageClasses()
- Specified by:
getSupportedStorageClassesin interfaceContentStore
-
updateStorageClasses
public void updateStorageClasses(String contentUrl, StorageClassSet storageClassSet, Map<String,Object> parameters)
- Specified by:
updateStorageClassesin interfaceContentStore
-
findStorageClasses
public StorageClassSet findStorageClasses(String contentUrl)
- Specified by:
findStorageClassesin interfaceContentStore
-
getStorageClassesTransitions
public Map<StorageClassSet,Set<StorageClassSet>> getStorageClassesTransitions()
- Specified by:
getStorageClassesTransitionsin interfaceContentStore
-
findStorageClassesTransitions
public Map<StorageClassSet,Set<StorageClassSet>> findStorageClassesTransitions(String contentUrl)
- Specified by:
findStorageClassesTransitionsin interfaceContentStore
-
-