DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.dcs
Class DcsDataManager

java.lang.Object
  extended by org.dlese.dpc.schemedit.dcs.DcsDataManager

public class DcsDataManager
extends Object

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
DcsDataManager(RepositoryManager rm, MetaDataFramework dcsDataFramework, CollectionRegistry collectionRegistry)
          Create a DcsDataManager.
 
Method Summary
 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
 File getCollectionDir(String collection, String xmlFormat)
          Get the directory in which dcs_data records are stored for the given collection and metadataFormat.
static File getDcsDataDir(RepositoryManager rm)
          Gets the dcsDataDir attribute of the DcsDataManager object
static File getDcsDataDir(String metadataRecordsLocation)
          Gets the dcsDataDir attribute of the DcsDataManager class
 DcsDataRecord getDcsDataRecord(String id, RepositoryManager rm)
          Retrieve the DcsDataRecord correponding to the given record ID
 DcsDataRecord getDcsDataRecord(String collection, String xmlFormat, String fileName)
          Gets a dcsDataRecord without specifying an id.
 DcsDataRecord getDcsDataRecord(String collection, String xmlFormat, String fileName, String id)
          Returns an empty dcsDataRecord corresponding to an indexed source record.
 List getDcsStatusOptions()
          Gets the dcsStatusOptions attribute of the DcsDataManager object
 void normalizeStatuses()
          NOT YET DOCUMENTED
 void normalizeStatuses(String collection)
          NOT YET DOCUMENTED
 boolean removeFromCache(String id)
          NOT YET DOCUMENTED
 void removeListener(WorkFlowServices listener)
          Description of the Method
 boolean revertToSaved(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DcsDataManager

public DcsDataManager(RepositoryManager rm,
                      MetaDataFramework dcsDataFramework,
                      CollectionRegistry collectionRegistry)
Create a DcsDataManager.

Parameters:
rm - Description of the Parameter
dcsDataFramework - MetaDataFramework for the dcs_data format
collectionRegistry - NOT YET DOCUMENTED
Method Detail

getDcsDataDir

public static File getDcsDataDir(RepositoryManager rm)
Gets the dcsDataDir attribute of the DcsDataManager object

Parameters:
rm - Description of the Parameter
Returns:
The dcsDataDir value

getDcsDataDir

public static File getDcsDataDir(String metadataRecordsLocation)
Gets the dcsDataDir attribute of the DcsDataManager class

Parameters:
metadataRecordsLocation - NOT YET DOCUMENTED
Returns:
The dcsDataDir value

getCollectionDir

public File getCollectionDir(String collection,
                             String xmlFormat)
Get the directory in which dcs_data records are stored for the given collection and metadataFormat. Creates necessary directories.

Parameters:
collection - Description of the Parameter
xmlFormat - Description of the Parameter
Returns:
The collectionDir value

getDcsStatusOptions

public List getDcsStatusOptions()
Gets the dcsStatusOptions attribute of the DcsDataManager object

Returns:
The dcsStatusOptions value

normalizeStatuses

public void normalizeStatuses()
NOT YET DOCUMENTED


normalizeStatuses

public void normalizeStatuses(String collection)
NOT YET DOCUMENTED

Parameters:
collection - NOT YET DOCUMENTED

getDcsDataRecord

public DcsDataRecord getDcsDataRecord(String id,
                                      RepositoryManager rm)
Retrieve the DcsDataRecord correponding to the given record ID

Parameters:
id - Description of the Parameter
rm - Description of the Parameter
Returns:
The dcsDataRecord value

getDcsDataRecord

public DcsDataRecord getDcsDataRecord(String collection,
                                      String xmlFormat,
                                      String fileName)
Gets a dcsDataRecord without specifying an id. Necessary to support indexing, DcsDataFileIndexingPlugin where the ID is not known or easily obtainable.

Parameters:
collection - Description of the Parameter
xmlFormat - Description of the Parameter
fileName - 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 record
xmlFormat - Description of the Parameter
fileName - file name of the metadata file
id - Description of the Parameter
Returns:
The dcsDataRecord value

revertToSaved

public boolean revertToSaved(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.

Parameters:
id - Description of the Parameter
Returns:
Description of the Return Value

removeFromCache

public boolean removeFromCache(String id)
NOT YET DOCUMENTED

Parameters:
id - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

cacheRecord

public void cacheRecord(DcsDataRecord dcsDataRecord)
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

public void addListener(WorkFlowServices listener)
Adds a feature to the Listener attribute of the DcsDataRecord object

Parameters:
listener - The feature to be added to the Listener attribute

removeListener

public void removeListener(WorkFlowServices listener)
Description of the Method

Parameters:
listener - Description of the Parameter

DLESE Tools
v1.6.0