public class RepositoryWriter
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
RepositoryWriter(javax.servlet.ServletContext servletContext)
Constructor for the RepositoryWriter object
|
Modifier and Type | Method and Description |
---|---|
void |
addPlugin(RepositoryWriterPlugin plugin)
Register a RepositoryWriterPlugin.
|
protected boolean |
deleteCollection(CollectionConfig config)
Delete a collection from the local repository.
|
protected boolean |
deleteRecord(java.lang.String recId,
DcsDataRecord dcsDataRecord)
Delete a record from the repository.
|
java.util.List |
getPlugins()
Gets the registered RepositoryWriterPlugins
|
protected void |
init()
NOT YET DOCUMENTED
|
void |
removePlugin(RepositoryWriterPlugin plugin)
Unregister a RepositoryWriterPlugin.
|
protected void |
writeRecord(java.lang.String recordXml,
java.lang.String xmlFormat,
java.lang.String collection,
java.lang.String id,
DcsDataRecord dcsDataRecord)
Writes provided metadata to the index and to other registered repositories,
such as the NDR.
|
protected void |
writeRecord(java.lang.String recId,
java.lang.String recordXml,
XMLDocReader docReader,
DcsDataRecord dcsDataRecord)
Convenience method for RepositoryServices calls that have the docReader
handy, calls writeRecord after computing required params.
|
protected RepositoryWriter(javax.servlet.ServletContext servletContext)
servletContext
- NOT YET DOCUMENTEDpublic void addPlugin(RepositoryWriterPlugin plugin)
plugin
- the RepositoryWriterPluginpublic void removePlugin(RepositoryWriterPlugin plugin)
plugin
- the RepositoryWriterPluginpublic java.util.List getPlugins()
protected void writeRecord(java.lang.String recId, java.lang.String recordXml, XMLDocReader docReader, DcsDataRecord dcsDataRecord) throws RecordUpdateException, java.lang.Exception
recId
- metadata record idrecordXml
- metadata record as xml stringdocReader
- docReader for metadatadcsDataRecord
- dcsDataRecord for metadataRecordUpdateException
- if record cannot be written to indexjava.lang.Exception
- NOT YET DOCUMENTEDprotected void writeRecord(java.lang.String recordXml, java.lang.String xmlFormat, java.lang.String collection, java.lang.String id, DcsDataRecord dcsDataRecord) throws RecordUpdateException, java.lang.Exception
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.
recordXml
- metadata record as xml stringxmlFormat
- format of metadatacollection
- collection key of metadata record (e.g.,
"dcc")id
- metadata record iddcsDataRecord
- dcsDataRecord for metadataRecordUpdateException
- if record cannot be written to indexjava.lang.Exception
- NOT YET DOCUMENTEDprotected boolean deleteRecord(java.lang.String recId, DcsDataRecord dcsDataRecord) throws java.lang.Exception
Current plugin exception policy: If there is a pluginError, the record is NOT deleted, but instead it is re-indexed as a sync-error.
recId
- NOT YET DOCUMENTEDdcsDataRecord
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDprotected boolean deleteCollection(CollectionConfig config) throws java.lang.Exception
RepositoryService
config
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDprotected void init() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTED