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.FSProvider<T>
-
- All Implemented Interfaces:
CfgEventListener
,EventListener
,javax.inject.Provider<T>
- Direct Known Subclasses:
ClientFSStoreProvider
public abstract class FSProvider<T extends FileStore> extends TypedProvider<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 protected
FSProvider(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 Object
componentFound(CfgEvent configurationEvent)
T
get()
It is up to you to add the appropriate logic to check for the correct store type (e.g.UpkeepConfiguration
getUpkeepConfiguration()
boolean
isRemoveEmptyFiles()
boolean
isRemoveFailedFiles()
protected abstract T
produce(File dataPath, File indexPath, boolean removeEmptyFiles, boolean removeFailedFiles)
Put the actual instantiation of the store here.void
setConfig(org.apache.commons.configuration.tree.ConfigurationNode config)
void
setUpkeepConfiguration(UpkeepConfiguration upkeepConfiguration)
-
Methods inherited from class edu.uiuc.ncsa.security.core.configuration.provider.TypedProvider
checkEvent, getTarget, getType, getTypeAttribute, getTypeAttribute, getTypeBooleanAttribute, getTypeConfig, getTypeIntAttribute, getTypeIntAttribute, setTarget, setType, setTypeConfig, toString
-
Methods inherited from class edu.uiuc.ncsa.security.core.configuration.provider.HierarchicalConfigProvider
addListener, fireComponentFound, getAttribute, getAttribute, getBooleanAttribute, getConfig, getConfigurationAt, getIntAttribute, getIntAttribute, getListeners, hasA, 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)
-
-
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:
-
getUpkeepConfiguration
public UpkeepConfiguration getUpkeepConfiguration()
-
setUpkeepConfiguration
public void setUpkeepConfiguration(UpkeepConfiguration upkeepConfiguration)
-
setConfig
public void setConfig(org.apache.commons.configuration.tree.ConfigurationNode config)
- Overrides:
setConfig
in classHierarchicalConfigProvider<T extends FileStore>
-
-