Class AggregatingContentStore
- java.lang.Object
-
- org.alfresco.repo.content.AbstractContentStore
-
- org.alfresco.repo.content.replication.AggregatingContentStore
-
- All Implemented Interfaces:
org.alfresco.repo.content.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 inherited from class org.alfresco.repo.content.AbstractContentStore
contentLimitProvider
-
-
Constructor Summary
Constructors Constructor Description AggregatingContentStore()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(java.lang.String contentUrl)Performs a delete on the local store and if outbound replication is on, propogates the delete to the other stores too.org.alfresco.service.cmr.repository.ContentReadergetReader(java.lang.String contentUrl)Forwards the call directly to the first store in the list of stores.java.lang.StringgetRootLocation()org.alfresco.service.cmr.repository.ContentWritergetWriter(org.alfresco.repo.content.ContentContext ctx)An implementation that does some sanity checking before requesting a writer from the store.booleanisContentUrlSupported(java.lang.String contentUrl)Override this method to supply a efficient and direct check of the URL supplied.booleanisWriteSupported()voidsetPrimaryStore(org.alfresco.repo.content.ContentStore primaryStore)Set the primary store that content will be replicated to or fromvoidsetSecondaryStores(java.util.List<org.alfresco.repo.content.ContentStore> secondaryStores)Set the secondary stores that this component will replicate to or from-
Methods inherited from class org.alfresco.repo.content.AbstractContentStore
exists, getContentUrlParts, getSpaceFree, getSpaceTotal, getWriterInternal, isValidContentUrl, setContentLimitProvider
-
-
-
-
Method Detail
-
setPrimaryStore
public void setPrimaryStore(org.alfresco.repo.content.ContentStore primaryStore)
Set the primary store that content will be replicated to or from- Parameters:
primaryStore- the primary content store
-
setSecondaryStores
public void setSecondaryStores(java.util.List<org.alfresco.repo.content.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(java.lang.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 interfaceorg.alfresco.repo.content.ContentStore- Overrides:
isContentUrlSupportedin classAbstractContentStore- Returns:
- Returns true if the primary store supports the URL
-
getRootLocation
public java.lang.String getRootLocation()
- Specified by:
getRootLocationin interfaceorg.alfresco.repo.content.ContentStore- Overrides:
getRootLocationin classAbstractContentStore- Returns:
- Return the primary store root location
-
getReader
public org.alfresco.service.cmr.repository.ContentReader getReader(java.lang.String contentUrl) throws org.alfresco.service.cmr.repository.ContentIOExceptionForwards the call directly to the first store in the list of stores.- Throws:
org.alfresco.service.cmr.repository.ContentIOException
-
getWriter
public org.alfresco.service.cmr.repository.ContentWriter getWriter(org.alfresco.repo.content.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 interfaceorg.alfresco.repo.content.ContentStore- Overrides:
getWriterin classAbstractContentStore- See Also:
AbstractContentStore.getWriterInternal(ContentReader, String)
-
delete
public boolean delete(java.lang.String contentUrl) throws org.alfresco.service.cmr.repository.ContentIOExceptionPerforms a delete on the local store and if outbound replication is on, propogates the delete to the other stores too.- Specified by:
deletein interfaceorg.alfresco.repo.content.ContentStore- Overrides:
deletein classAbstractContentStore- Returns:
- Returns the value returned by the delete on the primary store.
- Throws:
org.alfresco.service.cmr.repository.ContentIOException
-
-