Class AggregatingContentStore
- java.lang.Object
-
- org.alfresco.repo.content.AbstractContentStore
-
- org.alfresco.repo.content.replication.AggregatingContentStore
-
- All Implemented Interfaces:
ContentStore
public class AggregatingContentStore extends AbstractContentStore
Aggregating Content Store
A content store implementation that aggregates a set of stores. Content is not persisted by this store, but rather it relies on any number of child
storesto provide access to content readers and writers.The order in which the stores appear in the list of stores participating is important. The first store in the list is known as the primary store.
Content is written to the primary store only. The other stores are only used to retrieve content and the primary store is not updated with the content.
- Author:
- Derek Hulley, Mark Rogers
- See Also:
CachingContentStore
-
-
Field Summary
Fields Modifier and Type Field Description static StringREPLICATING_CONTENT_STORE_NOT_INITIALISED-
Fields inherited from class org.alfresco.repo.content.AbstractContentStore
contentLimitProvider
-
Fields inherited from interface org.alfresco.repo.content.ContentStore
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER
-
-
Constructor Summary
Constructors Constructor Description AggregatingContentStore()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(String contentUrl)Performs a delete on the local store and if outbound replication is on, propogates the delete to the other stores too.booleanexists(String contentUrl)Simple implementation that uses thereader's existsmethod as its implementation.ContentReadergetReader(String contentUrl)Forwards the call directly to the first store in the list of stores.StringgetRootLocation()Map<String,String>getStorageProperties(String contentUrl)ContentWritergetWriter(ContentContext ctx)An implementation that does some sanity checking before requesting a writer from the store.booleanisContentDirectUrlEnabled()booleanisContentDirectUrlEnabled(String contentUrl)booleanisContentUrlSupported(String contentUrl)Override this method to supply a efficient and direct check of the URL supplied.booleanisWriteSupported()DirectAccessUrlrequestContentDirectUrl(String contentUrl, boolean attachment, String fileName, String mimetype, Long validFor)voidsetPrimaryStore(ContentStore primaryStore)Set the primary store that content will be replicated to or fromvoidsetSecondaryStores(List<ContentStore> secondaryStores)Set the secondary stores that this component will replicate to or from-
Methods inherited from class org.alfresco.repo.content.AbstractContentStore
getContentUrlParts, getSpaceFree, getSpaceTotal, getWriterInternal, isValidContentUrl, setContentLimitProvider
-
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
requestContentDirectUrl, requestContentDirectUrl, requestContentDirectUrl
-
-
-
-
Field Detail
-
REPLICATING_CONTENT_STORE_NOT_INITIALISED
public static final String REPLICATING_CONTENT_STORE_NOT_INITIALISED
- See Also:
- Constant Field Values
-
-
Method Detail
-
setPrimaryStore
public void setPrimaryStore(ContentStore primaryStore)
Set the primary store that content will be replicated to or from- Parameters:
primaryStore- the primary content store
-
setSecondaryStores
public void setSecondaryStores(List<ContentStore> secondaryStores)
Set the secondary stores that this component will replicate to or from- Parameters:
secondaryStores- a list of stores to replicate to or from
-
isWriteSupported
public boolean isWriteSupported()
- Returns:
- Returns true if the primary store supports writing
-
isContentUrlSupported
public boolean isContentUrlSupported(String contentUrl)
Description copied from class:AbstractContentStoreOverride this method to supply a efficient and direct check of the URL supplied. The default implementation checks whetherContentStore.getReader(String)throws theUnsupportedContentUrlExceptionexception.- Specified by:
isContentUrlSupportedin interfaceContentStore- Overrides:
isContentUrlSupportedin classAbstractContentStore- Returns:
- Returns true if the primary store supports the URL
-
getRootLocation
public String getRootLocation()
- Specified by:
getRootLocationin interfaceContentStore- Overrides:
getRootLocationin classAbstractContentStore- Returns:
- Return the primary store root location
-
getReader
public ContentReader getReader(String contentUrl) throws ContentIOException
Forwards the call directly to the first store in the list of stores.- Throws:
ContentIOException
-
exists
public boolean exists(String contentUrl)
Description copied from class:AbstractContentStoreSimple implementation that uses thereader's existsmethod as its implementation. Override this method if a more efficient implementation is possible.- Specified by:
existsin interfaceContentStore- Overrides:
existsin classAbstractContentStore
-
getWriter
public ContentWriter getWriter(ContentContext ctx)
Description copied from class:AbstractContentStoreAn implementation that does some sanity checking before requesting a writer from the store. If this method is not overridden, then an implementation ofAbstractContentStore.getWriterInternal(ContentReader, String)must be supplied.- Specified by:
getWriterin interfaceContentStore- Overrides:
getWriterin classAbstractContentStore- See Also:
AbstractContentStore.getWriterInternal(ContentReader, String)
-
delete
public boolean delete(String contentUrl) throws ContentIOException
Performs a delete on the local store and if outbound replication is on, propogates the delete to the other stores too.- Specified by:
deletein interfaceContentStore- Overrides:
deletein classAbstractContentStore- Returns:
- Returns the value returned by the delete on the primary store.
- Throws:
ContentIOException
-
isContentDirectUrlEnabled
public boolean isContentDirectUrlEnabled()
- Returns:
- Returns
trueif at least one store supports direct access URLs
-
isContentDirectUrlEnabled
public boolean isContentDirectUrlEnabled(String contentUrl)
- Returns:
- Returns
trueif at least one store supports direct access URL for node
-
requestContentDirectUrl
public DirectAccessUrl requestContentDirectUrl(String contentUrl, boolean attachment, String fileName, String mimetype, Long validFor)
-
getStorageProperties
@Experimental public Map<String,String> getStorageProperties(String contentUrl)
-
-