public class DcsDataManager
extends java.lang.Object
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.
Constructor and Description |
---|
DcsDataManager(RepositoryManager rm,
MetaDataFramework dcsDataFramework,
CollectionRegistry collectionRegistry)
Create a DcsDataManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(WorkFlowServices listener)
Adds a feature to the Listener attribute of the DcsDataRecord object
|
void |
cacheRecord(DcsDataRecord dcsDataRecord)
Description of the Method
|
void |
destroy()
This method is called at the conclusion of processing and may be used for
tear-down.
|
void |
flushCache()
Write all cached DcsDataRecords to disk and then clear the cache
|
java.io.File |
getCollectionDir(java.lang.String collection,
java.lang.String xmlFormat)
Get the directory in which dcs_data records are stored for the given
collection and metadataFormat.
|
static java.io.File |
getDcsDataDir(RepositoryManager rm)
Gets the dcsDataDir attribute of the DcsDataManager object
|
static java.io.File |
getDcsDataDir(java.lang.String metadataRecordsLocation)
Gets the dcsDataDir attribute of the DcsDataManager class
|
DcsDataRecord |
getDcsDataRecord(java.lang.String id,
RepositoryManager rm)
Retrieve the DcsDataRecord correponding to the given record ID
|
DcsDataRecord |
getDcsDataRecord(java.lang.String collection,
java.lang.String xmlFormat,
java.lang.String fileName)
Gets a dcsDataRecord without specifying an id.
|
DcsDataRecord |
getDcsDataRecord(java.lang.String collection,
java.lang.String xmlFormat,
java.lang.String fileName,
java.lang.String id)
Returns an empty dcsDataRecord corresponding to an indexed source record.
|
java.util.List |
getDcsStatusOptions()
Gets the dcsStatusOptions attribute of the DcsDataManager object
|
void |
normalizeStatuses()
NOT YET DOCUMENTED
|
void |
normalizeStatuses(java.lang.String collection)
NOT YET DOCUMENTED
|
boolean |
removeFromCache(java.lang.String id)
NOT YET DOCUMENTED
|
void |
removeListener(WorkFlowServices listener)
Description of the Method
|
boolean |
revertToSaved(java.lang.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.
|
public DcsDataManager(RepositoryManager rm, MetaDataFramework dcsDataFramework, CollectionRegistry collectionRegistry)
rm
- Description of the ParameterdcsDataFramework
- MetaDataFramework for the dcs_data formatcollectionRegistry
- NOT YET DOCUMENTEDpublic static java.io.File getDcsDataDir(RepositoryManager rm)
rm
- Description of the Parameterpublic static java.io.File getDcsDataDir(java.lang.String metadataRecordsLocation)
metadataRecordsLocation
- NOT YET DOCUMENTEDpublic java.io.File getCollectionDir(java.lang.String collection, java.lang.String xmlFormat)
collection
- Description of the ParameterxmlFormat
- Description of the Parameterpublic java.util.List getDcsStatusOptions()
public void normalizeStatuses()
public void normalizeStatuses(java.lang.String collection)
collection
- NOT YET DOCUMENTEDpublic DcsDataRecord getDcsDataRecord(java.lang.String id, RepositoryManager rm)
id
- Description of the Parameterrm
- Description of the Parameterpublic DcsDataRecord getDcsDataRecord(java.lang.String collection, java.lang.String xmlFormat, java.lang.String fileName)
DcsDataFileIndexingPlugin
where the ID is not known or easily obtainable.collection
- Description of the ParameterxmlFormat
- Description of the ParameterfileName
- Description of the Parameterpublic DcsDataRecord getDcsDataRecord(java.lang.String collection, java.lang.String xmlFormat, java.lang.String fileName, java.lang.String id)
collection
- The collection of the source recordxmlFormat
- Description of the ParameterfileName
- file name of the metadata fileid
- Description of the Parameterpublic boolean revertToSaved(java.lang.String id)
id
- Description of the Parameterpublic boolean removeFromCache(java.lang.String id)
id
- NOT YET DOCUMENTEDpublic void cacheRecord(DcsDataRecord dcsDataRecord)
dcsDataRecord
- Description of the Parameterpublic void flushCache()
public void destroy()
We don't need to flush on destroy if we are writing dcsDataRecords to disk after each change.
public void addListener(WorkFlowServices listener)
listener
- The feature to be added to the Listener attributepublic void removeListener(WorkFlowServices listener)
listener
- Description of the Parameter