Class SolrContentUrlBuilder


  • public class SolrContentUrlBuilder
    extends Object
    Utility class that wraps up the creation of SOLR content URLs given arbitrary, string-based metadata.

    The URL is constructed from a 19 digit number (zero-padded long), which is built from the ACL ID, the DB ID or a CRC32 of the provided metadata, and a numerical version starting with "000".
    For example, the DB ID "4775808" will generate "someprefix:///db/4775/808.gz"
    The

    Since:
    5.0
    Author:
    Derek Hulley
    • Constructor Detail

      • SolrContentUrlBuilder

        protected SolrContentUrlBuilder()
        Protected constructor used by start()
    • Method Detail

      • start

        public static SolrContentUrlBuilder start()
        Factory method to start building the SOLR content URL.
        Returns:
        an instance of the builder
      • add

        public SolrContentUrlBuilder add​(String key,
                                         String value)
        Add some metadata to the URL generator. The order in which metadata is added is irrelevant.

        Note that there are specific keys that are commonly used and, if provided, may not be null or empty.

        Parameters:
        key - an arbitrary metadata key (never null>
        value - some metadata value (null is supported)
        Returns:
        this builder for more building
        Throws:
        IllegalArgumentException - if the key is null
        IllegalStateException - if the key has been used already
      • getContentContext

        public org.alfresco.repo.content.ContentContext getContentContext()
        Helper method to retrieve a ContentContext constructed using the final get() url.