Package edu.uiuc.ncsa.security.storage
Class FSProvider<T extends FileStore>
- java.lang.Object
-
- edu.uiuc.ncsa.security.core.configuration.provider.HierarchicalConfigProvider<T>
-
- edu.uiuc.ncsa.security.core.configuration.provider.TypedProvider<T>
-
- edu.uiuc.ncsa.security.storage.AbstractUpkeepStoreProvider<T>
-
- edu.uiuc.ncsa.security.storage.FSProvider<T>
-
- All Implemented Interfaces:
CfgEventListener,EventListener,javax.inject.Provider<T>
- Direct Known Subclasses:
ClientFSStoreProvider
public abstract class FSProvider<T extends FileStore> extends AbstractUpkeepStoreProvider<T>
Creates Filestores. This centralizes all the general checking to create these. Specific providers are needed for specific store types. NOTE If the configuration only supplies a single path, then this will create the storage and index path automatically and will add the component of theTypedProvider.getTarget()(e.g. "clientApprovals") to the path).Created by Jeff Gaynor
on 1/10/12 at 2:11 PM
-
-
Constructor Summary
Constructors Modifier Constructor Description FSProvider(CFNode config, String type, String target, MapConverter converter)protectedFSProvider(String type, String target, MapConverter converter)FSProvider(org.apache.commons.configuration.tree.ConfigurationNode config, String type, String target, MapConverter converter)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ObjectcomponentFound(CfgEvent configurationEvent)Tget()It is up to you to add the appropriate logic to check for the correct store type (e.g.booleanisRemoveEmptyFiles()booleanisRemoveFailedFiles()protected abstract Tproduce(File dataPath, File indexPath, boolean removeEmptyFiles, boolean removeFailedFiles)Put the actual instantiation of the store here.-
Methods inherited from class edu.uiuc.ncsa.security.storage.AbstractUpkeepStoreProvider
getUpkeepConfiguration, setCFNode, setConfig, setUpkeepConfiguration
-
Methods inherited from class edu.uiuc.ncsa.security.core.configuration.provider.TypedProvider
checkEvent, getParentCFNode, getTarget, getType, getTypeAttribute, getTypeAttribute, getTypeBooleanAttribute, getTypeConfig, getTypeIntAttribute, getTypeIntAttribute, hasParentCFNode, setParentCFNode, setTarget, setType, setTypeConfig, toString
-
Methods inherited from class edu.uiuc.ncsa.security.core.configuration.provider.HierarchicalConfigProvider
addListener, fireComponentFound, getAttribute, getAttribute, getBooleanAttribute, getCFNode, getConfig, getConfigurationAt, getIntAttribute, getIntAttribute, getListeners, hasA, hasCFNode, isA, removeListener
-
-
-
-
Field Detail
-
PATH_KEY
protected static final String PATH_KEY
- See Also:
- Constant Field Values
-
INDEX_KEY
protected static final String INDEX_KEY
- See Also:
- Constant Field Values
-
DATA_KEY
protected static final String DATA_KEY
- See Also:
- Constant Field Values
-
converter
protected MapConverter converter
-
-
Constructor Detail
-
FSProvider
public FSProvider(org.apache.commons.configuration.tree.ConfigurationNode config, String type, String target, MapConverter converter)
-
FSProvider
protected FSProvider(String type, String target, MapConverter converter)
-
FSProvider
public FSProvider(CFNode config, String type, String target, MapConverter converter)
-
-
Method Detail
-
isRemoveEmptyFiles
public boolean isRemoveEmptyFiles()
-
isRemoveFailedFiles
public boolean isRemoveFailedFiles()
-
get
public T get()
It is up to you to add the appropriate logic to check for the correct store type (e.g. transaction store) and instantiate it in theproduce(File, File, boolean, boolean)method. This method simply invokes theproduce(java.io.File, java.io.File, boolean, boolean)method and returns that result.- Returns:
-
produce
protected abstract T produce(File dataPath, File indexPath, boolean removeEmptyFiles, boolean removeFailedFiles)
Put the actual instantiation of the store here.get()does the grunt work of getting everything out of the configuration for you and checking that it all works as planned.- Parameters:
dataPath-indexPath-- Returns:
-
-