Package org.dlese.dpc.schemedit.dcs
Class DcsDataManager
java.lang.Object
org.dlese.dpc.schemedit.dcs.DcsDataManager
Provides access to, and caching of
DcsDataRecord
instances that house workflow status associated with each metadata record
managed by the DCS.
Dcs-data is stored on disk as xml files and read into DcsDataRecord
instances which are subsequently accessed via the cache.
DcsDataRecords are removed from cache via the revertToSaved(String)
method, which forces the DcsDataRecord to be read from disk the next time it
is requested.
- Author:
- ostwald $Id: DcsDataManager.java,v 1.4 2004/12/08 17:05:37 ostwald Exp $
-
Constructor Summary
ConstructorsConstructorDescriptionDcsDataManager(RepositoryManager rm, MetaDataFramework dcsDataFramework, CollectionRegistry collectionRegistry) Create a DcsDataManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(WorkFlowServices listener) Adds a feature to the Listener attribute of the DcsDataRecord objectvoidcacheRecord(DcsDataRecord dcsDataRecord) Description of the Methodvoiddestroy()This method is called at the conclusion of processing and may be used for tear-down.voidWrite all cached DcsDataRecords to disk and then clear the cachegetCollectionDir(String collection, String xmlFormat) Get the directory in which dcs_data records are stored for the given collection and metadataFormat.static FilegetDcsDataDir(String metadataRecordsLocation) Gets the dcsDataDir attribute of the DcsDataManager classstatic FileGets the dcsDataDir attribute of the DcsDataManager objectgetDcsDataRecord(String collection, String xmlFormat, String fileName) Gets a dcsDataRecord without specifying an id.getDcsDataRecord(String collection, String xmlFormat, String fileName, String id) Returns an empty dcsDataRecord corresponding to an indexed source record.getDcsDataRecord(String id, RepositoryManager rm) Retrieve the DcsDataRecord correponding to the given record IDGets the dcsStatusOptions attribute of the DcsDataManager objectvoidNOT YET DOCUMENTEDvoidnormalizeStatuses(String collection) NOT YET DOCUMENTEDbooleanNOT YET DOCUMENTEDvoidremoveListener(WorkFlowServices listener) Description of the MethodbooleanrevertToSaved(String id) Remove the cashed DcsDataRecord, in effect reverting to the last saved version of the record, since it will be read from disk next time it is accessed.
-
Constructor Details
-
DcsDataManager
public DcsDataManager(RepositoryManager rm, MetaDataFramework dcsDataFramework, CollectionRegistry collectionRegistry) Create a DcsDataManager.- Parameters:
rm- Description of the ParameterdcsDataFramework- MetaDataFramework for the dcs_data formatcollectionRegistry- NOT YET DOCUMENTED
-
-
Method Details
-
getDcsDataDir
Gets the dcsDataDir attribute of the DcsDataManager object- Parameters:
rm- Description of the Parameter- Returns:
- The dcsDataDir value
-
getDcsDataDir
Gets the dcsDataDir attribute of the DcsDataManager class- Parameters:
metadataRecordsLocation- NOT YET DOCUMENTED- Returns:
- The dcsDataDir value
-
getCollectionDir
Get the directory in which dcs_data records are stored for the given collection and metadataFormat. Creates necessary directories.- Parameters:
collection- Description of the ParameterxmlFormat- Description of the Parameter- Returns:
- The collectionDir value
-
getDcsStatusOptions
Gets the dcsStatusOptions attribute of the DcsDataManager object- Returns:
- The dcsStatusOptions value
-
normalizeStatuses
public void normalizeStatuses()NOT YET DOCUMENTED -
normalizeStatuses
NOT YET DOCUMENTED- Parameters:
collection- NOT YET DOCUMENTED
-
getDcsDataRecord
Retrieve the DcsDataRecord correponding to the given record ID- Parameters:
id- Description of the Parameterrm- Description of the Parameter- Returns:
- The dcsDataRecord value
-
getDcsDataRecord
Gets a dcsDataRecord without specifying an id. Necessary to support indexing,DcsDataFileIndexingPluginwhere the ID is not known or easily obtainable.- Parameters:
collection- Description of the ParameterxmlFormat- Description of the ParameterfileName- Description of the Parameter- Returns:
- The dcsDataRecord value
-
getDcsDataRecord
public DcsDataRecord getDcsDataRecord(String collection, String xmlFormat, String fileName, String id) Returns an empty dcsDataRecord corresponding to an indexed source record. The DcsDataRecord is a place holder for dcs-data, and is asociated with a file that will hold the dcs-data record for the source record.- Parameters:
collection- The collection of the source recordxmlFormat- Description of the ParameterfileName- file name of the metadata fileid- Description of the Parameter- Returns:
- The dcsDataRecord value
-
revertToSaved
Remove the cashed DcsDataRecord, in effect reverting to the last saved version of the record, since it will be read from disk next time it is accessed.- Parameters:
id- Description of the Parameter- Returns:
- Description of the Return Value
-
removeFromCache
NOT YET DOCUMENTED- Parameters:
id- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
cacheRecord
Description of the Method- Parameters:
dcsDataRecord- Description of the Parameter
-
flushCache
public void flushCache()Write all cached DcsDataRecords to disk and then clear the cache -
destroy
public void destroy()This method is called at the conclusion of processing and may be used for tear-down.We don't need to flush on destroy if we are writing dcsDataRecords to disk after each change.
-
addListener
Adds a feature to the Listener attribute of the DcsDataRecord object- Parameters:
listener- The feature to be added to the Listener attribute
-
removeListener
Description of the Method- Parameters:
listener- Description of the Parameter
-