Class AggregatingContentStore
java.lang.Object
org.alfresco.repo.content.AbstractContentStore
org.alfresco.repo.content.replication.AggregatingContentStore
- All Implemented Interfaces:
ContentStore
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 stores to 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:
-
Field Summary
FieldsFields inherited from class org.alfresco.repo.content.AbstractContentStore
contentLimitProviderFields inherited from interface org.alfresco.repo.content.ContentStore
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanPerforms a delete on the local store and if outbound replication is on, propogates the delete to the other stores too.booleanSimple implementation that uses thereader's existsmethod as its implementation.Forwards the call directly to the first store in the list of stores.getStorageProperties(String contentUrl) getWriter(ContentContext ctx) An implementation that does some sanity checking before requesting a writer from the store.booleanbooleanisContentDirectUrlEnabled(String contentUrl) booleanisContentUrlSupported(String contentUrl) Override this method to supply a efficient and direct check of the URL supplied.booleanrequestContentDirectUrl(String contentUrl, boolean attachment, String fileName, String mimetype, Long validFor) booleanrequestRestoreContentFromArchive(String contentUrl, Map<String, Serializable> restoreParams) booleanrequestSendContentToArchive(String contentUrl, Map<String, Serializable> archiveParams) 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 fromMethods inherited from class org.alfresco.repo.content.AbstractContentStore
getContentUrlParts, getSpaceFree, getSpaceTotal, getWriterInternal, isValidContentUrl, setContentLimitProviderMethods 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
requestContentDirectUrl, requestContentDirectUrl, requestContentDirectUrl
-
Field Details
-
REPLICATING_CONTENT_STORE_NOT_INITIALISED
- See Also:
-
SECONDARY_STORE_COULD_NOT_HANDLE_CONTENT_URL
- See Also:
-
PRIMARY_STORE_COULD_NOT_HANDLE_CONTENT_URL
- See Also:
-
-
Constructor Details
-
AggregatingContentStore
public AggregatingContentStore()Default constructor
-
-
Method Details
-
setPrimaryStore
Set the primary store that content will be replicated to or from- Parameters:
primaryStore- the primary content store
-
setSecondaryStores
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
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
- Specified by:
getRootLocationin interfaceContentStore- Overrides:
getRootLocationin classAbstractContentStore- Returns:
- Return the primary store root location
-
getReader
Forwards the call directly to the first store in the list of stores.- Throws:
ContentIOException
-
exists
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
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:
-
delete
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
- 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
-
requestSendContentToArchive
public boolean requestSendContentToArchive(String contentUrl, Map<String, Serializable> archiveParams) -
requestRestoreContentFromArchive
public boolean requestRestoreContentFromArchive(String contentUrl, Map<String, Serializable> restoreParams)
-