Class RepositoryWriter
java.lang.Object
org.dlese.dpc.schemedit.repository.RepositoryWriter
The class includes methods to create, copy, and put Records to the main Repository, and
RepositoryWriterPlugins if so configured.
- Author:
- ostwald
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRepositoryWriter(ServletContext servletContext) Constructor for the RepositoryWriter object -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlugin(RepositoryWriterPlugin plugin) Register a RepositoryWriterPlugin.protected booleandeleteCollection(CollectionConfig config) Delete a collection from the local repository.protected booleandeleteRecord(String recId, DcsDataRecord dcsDataRecord) Delete a record from the repository.Gets the registered RepositoryWriterPluginsprotected voidinit()NOT YET DOCUMENTEDvoidremovePlugin(RepositoryWriterPlugin plugin) Unregister a RepositoryWriterPlugin.protected voidwriteRecord(String recordXml, String xmlFormat, String collection, String id, DcsDataRecord dcsDataRecord) Writes provided metadata to the index and to other registered repositories, such as the NDR.protected voidwriteRecord(String recId, String recordXml, XMLDocReader docReader, DcsDataRecord dcsDataRecord) Convenience method for RepositoryServices calls that have the docReader handy, calls writeRecord after computing required params.
-
Constructor Details
-
RepositoryWriter
Constructor for the RepositoryWriter object- Parameters:
servletContext- NOT YET DOCUMENTED
-
-
Method Details
-
addPlugin
Register a RepositoryWriterPlugin.- Parameters:
plugin- the RepositoryWriterPlugin
-
removePlugin
Unregister a RepositoryWriterPlugin.- Parameters:
plugin- the RepositoryWriterPlugin
-
getPlugins
Gets the registered RepositoryWriterPlugins- Returns:
- The plugins value
-
writeRecord
protected void writeRecord(String recId, String recordXml, XMLDocReader docReader, DcsDataRecord dcsDataRecord) throws RecordUpdateException, Exception Convenience method for RepositoryServices calls that have the docReader handy, calls writeRecord after computing required params.- Parameters:
recId- metadata record idrecordXml- metadata record as xml stringdocReader- docReader for metadatadcsDataRecord- dcsDataRecord for metadata- Throws:
RecordUpdateException- if record cannot be written to indexException- NOT YET DOCUMENTED
-
writeRecord
protected void writeRecord(String recordXml, String xmlFormat, String collection, String id, DcsDataRecord dcsDataRecord) throws RecordUpdateException, Exception Writes provided metadata to the index and to other registered repositories, such as the NDR.First try to write to the external repository. This attempt may fail before the record has been indexed the first time, if a RepositoryWriterPlugin required the index (as the NDR plugin does). In this case, a syncError is registered in the index.
- Parameters:
recordXml- metadata record as xml stringxmlFormat- format of metadatacollection- collection key of metadata record (e.g., "dcc")id- metadata record iddcsDataRecord- dcsDataRecord for metadata- Throws:
RecordUpdateException- if record cannot be written to indexException- NOT YET DOCUMENTED
-
deleteRecord
Delete a record from the repository.Current plugin exception policy: If there is a pluginError, the record is NOT deleted, but instead it is re-indexed as a sync-error.
- Parameters:
recId- NOT YET DOCUMENTEDdcsDataRecord- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
deleteCollection
Delete a collection from the local repository. Called byRepositoryService- Parameters:
config- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
init
NOT YET DOCUMENTED- Throws:
Exception- NOT YET DOCUMENTED
-