Class 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 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:
    CachingContentStore
    • Field Summary

      • Fields inherited from interface org.alfresco.repo.content.ContentStore

        NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean delete​(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.ContentReader getReader​(java.lang.String contentUrl)
      Forwards the call directly to the first store in the list of stores.
      java.lang.String getRootLocation()  
      org.alfresco.service.cmr.repository.ContentWriter getWriter​(org.alfresco.repo.content.ContentContext ctx)
      An implementation that does some sanity checking before requesting a writer from the store.
      boolean isContentUrlSupported​(java.lang.String contentUrl)
      Override this method to supply a efficient and direct check of the URL supplied.
      boolean isWriteSupported()  
      void setPrimaryStore​(org.alfresco.repo.content.ContentStore primaryStore)
      Set the primary store that content will be replicated to or from
      void setSecondaryStores​(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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AggregatingContentStore

        public AggregatingContentStore()
        Default constructor
    • 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: AbstractContentStore
        Override this method to supply a efficient and direct check of the URL supplied. The default implementation checks whether ContentStore.getReader(String) throws the UnsupportedContentUrlException exception.
        Specified by:
        isContentUrlSupported in interface org.alfresco.repo.content.ContentStore
        Overrides:
        isContentUrlSupported in class AbstractContentStore
        Returns:
        Returns true if the primary store supports the URL
      • getRootLocation

        public java.lang.String getRootLocation()
        Specified by:
        getRootLocation in interface org.alfresco.repo.content.ContentStore
        Overrides:
        getRootLocation in class AbstractContentStore
        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.ContentIOException
        Forwards the call directly to the first store in the list of stores.
        Throws:
        org.alfresco.service.cmr.repository.ContentIOException
      • delete

        public boolean delete​(java.lang.String contentUrl)
                       throws org.alfresco.service.cmr.repository.ContentIOException
        Performs a delete on the local store and if outbound replication is on, propogates the delete to the other stores too.
        Specified by:
        delete in interface org.alfresco.repo.content.ContentStore
        Overrides:
        delete in class AbstractContentStore
        Returns:
        Returns the value returned by the delete on the primary store.
        Throws:
        org.alfresco.service.cmr.repository.ContentIOException