Class FSComponentRepositoryHelper<DB extends FSComponentExtRepositoryDB<? extends FSCRDBComponent>>
- java.lang.Object
-
- com.zfabrik.components.provider.util.FSComponentRepositoryHelper<DB>
-
public class FSComponentRepositoryHelper<DB extends FSComponentExtRepositoryDB<? extends FSCRDBComponent>> extends java.lang.ObjectGeneral repo implementation helper class. Can be forced to purge repo cache on init by setting the system propcom.zfabrik.cr.purge- Author:
- hb
-
-
Field Summary
Fields Modifier and Type Field Description static longDEF_EVICTION_DELAY
-
Constructor Summary
Constructors Constructor Description FSComponentRepositoryHelper(java.lang.Class<DB> clz, java.io.File root)Compatibility constructor with empty check properties.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevictLocalComponent(java.lang.String name)java.io.FilegetComponentFolder(FSCRDBComponent c)java.io.FilegetComponentRIFolder(java.lang.String name)LocklockComponent(java.lang.String component)LocklockDB()DBreadDB()voidsaveDB(DB db)voidsetEvictionDelay(long evictionDelay)
-
-
-
Field Detail
-
DEF_EVICTION_DELAY
public static final long DEF_EVICTION_DELAY
- See Also:
- Constant Field Values
-
-
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
-
-