Class FSComponentRepositoryHelper<DB extends FSComponentExtRepositoryDB<? extends FSCRDBComponent>>


  • public class FSComponentRepositoryHelper<DB extends FSComponentExtRepositoryDB<? extends FSCRDBComponent>>
    extends java.lang.Object
    General repo implementation helper class. Can be forced to purge repo cache on init by setting the system prop com.zfabrik.cr.purge
    Author:
    hb
    • Constructor Detail

      • FSComponentRepositoryHelper

        public FSComponentRepositoryHelper​(java.lang.Class<DB> clz,
                                           java.io.File root)
        Compatibility constructor with empty check properties.
      • FSComponentRepositoryHelper

        public FSComponentRepositoryHelper​(java.lang.Class<DB> clz,
                                           java.io.File root,
                                           java.util.Properties checkProps)
        Initialize a repo helper with a specific DB class, a local store folder and a set of check props that are to be found again to validate the repository storage. If the latter check fails, local repository content will be evicted.
    • Method Detail

      • setEvictionDelay

        public void setEvictionDelay​(long evictionDelay)
      • lockDB

        public Lock lockDB()
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • lockComponent

        public Lock lockComponent​(java.lang.String component)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getComponentFolder

        public java.io.File getComponentFolder​(FSCRDBComponent c)
      • getComponentRIFolder

        public java.io.File getComponentRIFolder​(java.lang.String name)
      • evictLocalComponent

        public void evictLocalComponent​(java.lang.String name)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readDB

        public DB readDB()
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • saveDB

        public void saveDB​(DB db)
                    throws java.io.IOException
        Throws:
        java.io.IOException