public class CollectionRegistry
extends java.lang.Object
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.$Id: CollectionRegistry.java,v 1.31 2010/07/14 00:18:49 jweather Exp $
Constructor and Description |
---|
CollectionRegistry()
no-argument Constructor for the CollectionRegistry object
|
CollectionRegistry(java.io.File configDir,
java.lang.String idFilesPath,
java.lang.String defaultCollConfigPath)
Register collections from configuration directory
|
Modifier and Type | Method and Description |
---|---|
void |
deleteCollection(CollectionConfig config)
Unregister a collection and delete it's configuration file.
|
void |
deleteCollection(java.lang.String collection)
Unregister a collection and deletes it's configuration file.
|
void |
destroy()
Description of the Method
|
CollectionConfig |
findCollectionByHandle(java.lang.String handle)
find collectionConfig having provided handle as its MetadataProviderHandle.
|
CollectionConfig |
getCollectionConfig(java.lang.String collection)
Gets the collectionConfig attribute of the CollectionRegistry object
|
CollectionConfig |
getCollectionConfig(java.lang.String collection,
boolean createIfNotFound)
Gets a
CollectionConfig instance
corresponding to the provided collection. |
long |
getCollectionConfigMod()
Gets the collectionConfigMod attribute of the CollectionRegistry object
|
java.util.List |
getFinalStatusFlags()
Gets a list of the finalStatusFlags defined by each collection.
|
java.lang.String |
getFinalStatusLabel(java.lang.String collection)
Gets the finalStatusLabel attribute of the CollectionRegistry object
|
java.lang.String |
getIdFilesPath() |
IDGenerator |
getIDGenerator(java.lang.String collectionKey)
Obtain IDGenerator instance for specified collection (which must be registered).
|
java.lang.String |
getIdPrefix(java.lang.String collectionKey) |
java.util.Set |
getIds()
Returns the keys for the registered collections.
|
CollectionConfig |
getMasterCollectionConfig() |
java.util.Map |
getMasterStatusLabelMap()
Gets the masterStatusLabelMap attribute of the CollectionRegistry object
|
java.util.List |
getMasterStatusList()
Returns a list of all status flags defined by all registered collections.
|
java.lang.String |
getNextID(java.lang.String collectionKey)
Convenience method to obtain a new record ID from specified collection (which must exist)
|
void |
initializeIDGenerator(CollectionConfig collectionConfig,
SimpleLuceneIndex index) |
void |
initializeIDGenerators(SimpleLuceneIndex index)
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.
|
boolean |
isDuplicateIdPrefix(java.lang.String idPrefix) |
boolean |
isDuplicateIdPrefix(java.lang.String collectionKey,
java.lang.String idPrefix) |
boolean |
isNDRCollection(java.lang.String collection) |
boolean |
isRegistered(java.lang.String collectionKey) |
void |
register(CollectionConfig config)
Register a collection by placing it's CollectionConfig instance in the map.
|
void |
setCollectionConfigMod()
Sets the collectionConfigMod attribute of the CollectionRegistry object
|
int |
size()
The number of registered collections
|
java.lang.String |
toString()
Print the items of the mdvMap for debugging purposes.
|
void |
unregister(CollectionConfig config)
Remove the CollectionConfig from the registry.
|
void |
unregister(java.lang.String id)
NOT YET DOCUMENTED
|
void |
updateMasterStatusList()
NOT YET DOCUMENTED
|
public CollectionRegistry()
public CollectionRegistry(java.io.File configDir, java.lang.String idFilesPath, java.lang.String defaultCollConfigPath)
configDir
- NOT YET DOCUMENTEDpublic boolean isNDRCollection(java.lang.String collection)
public boolean isRegistered(java.lang.String collectionKey)
public CollectionConfig getMasterCollectionConfig()
public java.lang.String getIdFilesPath()
public CollectionConfig findCollectionByHandle(java.lang.String handle)
handle
- NOT YET DOCUMENTEDpublic CollectionConfig getCollectionConfig(java.lang.String collection)
collection
- collectionKey (e.g., "dcc")public CollectionConfig getCollectionConfig(java.lang.String collection, boolean createIfNotFound)
CollectionConfig
instance
corresponding to the provided collection.collection
- Description of the ParametercreateIfNotFound
- NOT YET DOCUMENTEDpublic boolean isDuplicateIdPrefix(java.lang.String idPrefix)
public boolean isDuplicateIdPrefix(java.lang.String collectionKey, java.lang.String idPrefix)
public java.lang.String getNextID(java.lang.String collectionKey)
public java.lang.String getIdPrefix(java.lang.String collectionKey)
public IDGenerator getIDGenerator(java.lang.String collectionKey)
public void initializeIDGenerators(SimpleLuceneIndex index)
public void initializeIDGenerator(CollectionConfig collectionConfig, SimpleLuceneIndex index) throws java.lang.Exception
java.lang.Exception
public long getCollectionConfigMod()
public void setCollectionConfigMod()
public java.lang.String getFinalStatusLabel(java.lang.String collection)
collection
- NOT YET DOCUMENTEDpublic java.util.List getFinalStatusFlags()
public java.util.List getMasterStatusList()
public void updateMasterStatusList()
public java.util.Map getMasterStatusLabelMap()
public void register(CollectionConfig config) throws java.lang.Exception
config
- Description of the Parameterjava.lang.Exception
public void unregister(java.lang.String id)
id
- NOT YET DOCUMENTEDpublic void unregister(CollectionConfig config)
config
- Description of the Parameterpublic void deleteCollection(java.lang.String collection)
collection
- Description of the Parameterpublic void deleteCollection(CollectionConfig config)
config
- Description of the Parameterpublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Set getIds()
public int size()
public void destroy()