Package org.dlese.dpc.schemedit.config
Class CollectionRegistry
java.lang.Object
org.dlese.dpc.schemedit.config.CollectionRegistry
Holds
CollectionConfig instances in a
map structure, keyed by collection id (e.g., "dcc"); The registry is
initialized during system startup by reading from a configDir where the
collection config files are located.- Version:
- $Id: CollectionRegistry.java,v 1.31 2010/07/14 00:18:49 jweather Exp $
- Author:
- ostwald
$Id: CollectionRegistry.java,v 1.31 2010/07/14 00:18:49 jweather Exp $
-
Constructor Summary
ConstructorsConstructorDescriptionno-argument Constructor for the CollectionRegistry objectCollectionRegistry(File configDir, String idFilesPath, String defaultCollConfigPath) Register collections from configuration directory -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCollection(String collection) Unregister a collection and deletes it's configuration file.voiddeleteCollection(CollectionConfig config) Unregister a collection and delete it's configuration file.voiddestroy()Description of the MethodfindCollectionByHandle(String handle) find collectionConfig having provided handle as its MetadataProviderHandle.getCollectionConfig(String collection) Gets the collectionConfig attribute of the CollectionRegistry objectgetCollectionConfig(String collection, boolean createIfNotFound) Gets aCollectionConfiginstance corresponding to the provided collection.longGets the collectionConfigMod attribute of the CollectionRegistry objectGets a list of the finalStatusFlags defined by each collection.getFinalStatusLabel(String collection) Gets the finalStatusLabel attribute of the CollectionRegistry objectgetIDGenerator(String collectionKey) Obtain IDGenerator instance for specified collection (which must be registered).getIdPrefix(String collectionKey) getIds()Returns the keys for the registered collections.Gets the masterStatusLabelMap attribute of the CollectionRegistry objectReturns a list of all status flags defined by all registered collections.Convenience method to obtain a new record ID from specified collection (which must exist)voidinitializeIDGenerator(CollectionConfig collectionConfig, SimpleLuceneIndex index) voidInitialize the IDGenerator for each collection in the index so that the next ID to be assigned will increment the last assigned ID for that collection.booleanisDuplicateIdPrefix(String idPrefix) booleanisDuplicateIdPrefix(String collectionKey, String idPrefix) booleanisNDRCollection(String collection) booleanisRegistered(String collectionKey) voidregister(CollectionConfig config) Register a collection by placing it's CollectionConfig instance in the map.voidSets the collectionConfigMod attribute of the CollectionRegistry objectintsize()The number of registered collectionstoString()Print the items of the mdvMap for debugging purposes.voidunregister(String id) NOT YET DOCUMENTEDvoidunregister(CollectionConfig config) Remove the CollectionConfig from the registry.voidNOT YET DOCUMENTED
-
Constructor Details
-
CollectionRegistry
public CollectionRegistry()no-argument Constructor for the CollectionRegistry object -
CollectionRegistry
Register collections from configuration directory- Parameters:
configDir- NOT YET DOCUMENTED
-
-
Method Details
-
isNDRCollection
-
isRegistered
-
getMasterCollectionConfig
-
getIdFilesPath
-
findCollectionByHandle
find collectionConfig having provided handle as its MetadataProviderHandle.- Parameters:
handle- NOT YET DOCUMENTED- Returns:
- null if provided handle is empty or if matching config not found.
-
getCollectionConfig
Gets the collectionConfig attribute of the CollectionRegistry object- Parameters:
collection- collectionKey (e.g., "dcc")- Returns:
- The collectionConfig value
-
getCollectionConfig
Gets aCollectionConfiginstance corresponding to the provided collection.- Parameters:
collection- Description of the ParametercreateIfNotFound- NOT YET DOCUMENTED- Returns:
- The collectionConfig value
-
isDuplicateIdPrefix
-
isDuplicateIdPrefix
-
getNextID
Convenience method to obtain a new record ID from specified collection (which must exist) -
getIdPrefix
-
getIDGenerator
Obtain IDGenerator instance for specified collection (which must be registered). -
initializeIDGenerators
Initialize the IDGenerator for each collection in the index so that the next ID to be assigned will increment the last assigned ID for that collection. -
initializeIDGenerator
public void initializeIDGenerator(CollectionConfig collectionConfig, SimpleLuceneIndex index) throws Exception - Throws:
Exception
-
getCollectionConfigMod
public long getCollectionConfigMod()Gets the collectionConfigMod attribute of the CollectionRegistry object- Returns:
- The collectionConfigMod value
-
setCollectionConfigMod
public void setCollectionConfigMod()Sets the collectionConfigMod attribute of the CollectionRegistry object -
getFinalStatusLabel
Gets the finalStatusLabel attribute of the CollectionRegistry object- Parameters:
collection- NOT YET DOCUMENTED- Returns:
- The finalStatusLabel value
-
getFinalStatusFlags
Gets a list of the finalStatusFlags defined by each collection.- Returns:
- The finalStatusFlags value
-
getMasterStatusList
Returns a list of all status flags defined by all registered collections.- Returns:
- The masterStatusList value
-
updateMasterStatusList
public void updateMasterStatusList()NOT YET DOCUMENTED -
getMasterStatusLabelMap
Gets the masterStatusLabelMap attribute of the CollectionRegistry object- Returns:
- The masterStatusLabelMap value
-
register
Register a collection by placing it's CollectionConfig instance in the map.- Parameters:
config- Description of the Parameter- Throws:
Exception
-
unregister
NOT YET DOCUMENTED- Parameters:
id- NOT YET DOCUMENTED
-
unregister
Remove the CollectionConfig from the registry.- Parameters:
config- Description of the Parameter
-
deleteCollection
Unregister a collection and deletes it's configuration file.- Parameters:
collection- Description of the Parameter
-
deleteCollection
Unregister a collection and delete it's configuration file.- Parameters:
config- Description of the Parameter
-
toString
Print the items of the mdvMap for debugging purposes. -
getIds
Returns the keys for the registered collections.- Returns:
- The ids value
-
size
public int size()The number of registered collections- Returns:
- NOT YET DOCUMENTED
-
destroy
public void destroy()Description of the Method
-