Class RawMetadataCache

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.regex.Pattern MATCH_ALL_PATTERN
      A regular expression object that matches everything.
    • Constructor Summary

      Constructors 
      Constructor Description
      RawMetadataCache​(java.lang.String prefix, java.util.regex.Pattern urlMatcher, java.util.regex.Pattern mimeMatcher)
      Create a new RawMetadataCache.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Long cacheData​(java.lang.Long id)
      Actually cache data for the given ID.
      java.io.File getCacheFile​(java.lang.Long id)
      Get the file potentially containing (cached) data for a single job.
      • Methods inherited from class java.lang.Object

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

      • MATCH_ALL_PATTERN

        public static final java.util.regex.Pattern MATCH_ALL_PATTERN
        A regular expression object that matches everything.
    • Constructor Detail

      • RawMetadataCache

        public RawMetadataCache​(java.lang.String prefix,
                                java.util.regex.Pattern urlMatcher,
                                java.util.regex.Pattern mimeMatcher)
        Create a new RawMetadataCache. For a given job ID, this will fetch and cache selected content from metadata files (<ID>-metadata-[0-9]+.arc). Any entry in a metadata file that matches both patterns will be returned. The returned data does not directly indicate which file they were from, though parts intrinsic to the particular format might.
        Parameters:
        prefix - A prefix that will be used to distinguish this cache's files from other caches'. It will be used for creating a directory, so it must not contain characters not legal in directory names.
        urlMatcher - A pattern for matching URLs of the desired entries. If null, a .* pattern will be used.
        mimeMatcher - A pattern for matching mime-types of the desired entries. If null, a .* pattern will be used.
    • Method Detail

      • cacheData

        protected java.lang.Long cacheData​(java.lang.Long id)
        Actually cache data for the given ID.
        Specified by:
        cacheData in class FileBasedCache<java.lang.Long>
        Parameters:
        id - A job ID to cache data for.
        Returns:
        A File containing the data. This file will be the same as getCacheFile(ID);
        See Also:
        FileBasedCache.cacheData(Object)