Class SolrContentUrlBuilder


  • public class SolrContentUrlBuilder
    extends java.lang.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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.slf4j.Logger logger  
    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
    • 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​(java.lang.String key,
                                         java.lang.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:
        java.lang.IllegalArgumentException - if the key is null
        java.lang.IllegalStateException - if the key has been used already
      • get

        public java.lang.String get()
        Get the final content URL using the supplied metadata.
        Returns:
        the SOLR content URL
        Throws:
        java.lang.IllegalStateException - if no metadata has been added