com.norconex.committer
Class BaseCommitter
java.lang.Object
com.norconex.committer.BatchableCommitter
com.norconex.committer.FileSystemQueueCommitter
com.norconex.committer.BaseCommitter
- All Implemented Interfaces:
- ICommitter, IXMLConfigurable, Serializable
public abstract class BaseCommitter
- extends FileSystemQueueCommitter
- implements IXMLConfigurable
A base class batching documents and offering mappings of source id and
content fields to target id and content fields.
Batched documents are queued on the file system.
ID Mapping:
Both the idSourceField
and idTargetField
must
be set for ID mapping to take place. The default source id field is
the metadata normally set by the Norconex Importer module called
document.reference
. The default (or constant) target id
field is for subclasses to define. When an ID mapping is defined, the
source id field will be deleted unless the keepIdSourceField
attribute is set to true
.
Content Mapping:
Only the contentTargetField
needs to be set for content
mapping to take place. The default source content is
the actual document content. Defining a contentSourceField
will use the matching metadata property instead.
The default (or constant) target content field is for subclasses
to define. When a content mapping is defined, the
content id field will be deleted (if provided) unless the
keepContentSourceField
attribute is set to
true
.
- Author:
- Pascal Essiembre, Pascal Dimassimo
- See Also:
- Serialized Form
idTargetField
protected String idTargetField
idSourceField
protected String idSourceField
keepIdSourceField
protected boolean keepIdSourceField
contentTargetField
protected String contentTargetField
contentSourceField
protected String contentSourceField
keepContentSourceField
protected boolean keepContentSourceField
BaseCommitter
public BaseCommitter()
BaseCommitter
public BaseCommitter(int batchSize)
getIdSourceField
public String getIdSourceField()
setIdSourceField
public void setIdSourceField(String idSourceField)
getIdTargetField
public String getIdTargetField()
setIdTargetField
public void setIdTargetField(String idTargetField)
getContentTargetField
public String getContentTargetField()
setContentTargetField
public void setContentTargetField(String contentTargetField)
getContentSourceField
public String getContentSourceField()
setContentSourceField
public void setContentSourceField(String contentSourceField)
isKeepIdSourceField
public boolean isKeepIdSourceField()
setKeepIdSourceField
public void setKeepIdSourceField(boolean keepIdSourceField)
isKeepContentSourceField
public boolean isKeepContentSourceField()
setKeepContentSourceField
public void setKeepContentSourceField(boolean keepContentSourceField)
preCommitAddedDocument
protected void preCommitAddedDocument(FileSystemQueueCommitter.QueuedAddedDocument document)
throws IOException
- Description copied from class:
FileSystemQueueCommitter
- Optionally performs operations on a document to be added before
actually committing it. Default implementation does nothing.
- Overrides:
preCommitAddedDocument
in class FileSystemQueueCommitter
- Parameters:
document
- document to be added
- Throws:
IOException
saveToXML
public void saveToXML(Writer out)
throws IOException
- Specified by:
saveToXML
in interface IXMLConfigurable
- Throws:
IOException
saveToXML
protected abstract void saveToXML(XMLStreamWriter writer)
throws XMLStreamException
- Allows subclasses to write their config to xml
- Parameters:
writer
-
- Throws:
XMLStreamException
loadFromXML
public void loadFromXML(Reader in)
- Specified by:
loadFromXML
in interface IXMLConfigurable
loadFromXml
protected abstract void loadFromXml(XMLConfiguration xml)
- Allows subclasses to load their config from xml
- Parameters:
xml
-
hashCode
public int hashCode()
- Overrides:
hashCode
in class FileSystemQueueCommitter
equals
public boolean equals(Object obj)
- Overrides:
equals
in class FileSystemQueueCommitter
toString
public String toString()
- Overrides:
toString
in class FileSystemQueueCommitter
Copyright © 2009-2013 Norconex Inc.. All Rights Reserved.