AbstractMappedCommitter
@Deprecated 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.
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
.
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
.
FileSystemQueueCommitter.QueuedAddedDocument, FileSystemQueueCommitter.QueuedDeletedDocument
DEFAULT_QUEUE_DIR
DEFAULT_BATCH_SIZE
DEFAULT_DOCUMENT_REFERENCE
Constructor and Description |
---|
BaseCommitter()
Deprecated.
Constructor.
|
BaseCommitter(int batchSize)
Deprecated.
Creates a new instance with the given batch size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Deprecated.
|
String |
getContentSourceField()
Deprecated.
Gets the source field name holding the document content.
|
String |
getContentTargetField()
Deprecated.
Gets the target field where to store the document content.
|
String |
getIdSourceField()
Deprecated.
Gets the source field name holding the unique identifier.
|
String |
getIdTargetField()
Deprecated.
Gets the target field name to store the unique identifier.
|
int |
hashCode()
Deprecated.
|
boolean |
isKeepContentSourceField()
Deprecated.
Whether to keep the content source field or not, once mapped.
|
boolean |
isKeepIdSourceField()
Deprecated.
Whether to keep the ID source field or not, once mapped.
|
void |
loadFromXML(Reader in)
Deprecated.
|
protected abstract void |
loadFromXml(org.apache.commons.configuration.XMLConfiguration xml)
Deprecated.
Allows subclasses to load their config from xml
|
protected void |
preCommitAddedDocument(FileSystemQueueCommitter.QueuedAddedDocument document)
Deprecated.
Optionally performs operations on a document to be added before
actually committing it.
|
void |
saveToXML(Writer out)
Deprecated.
|
protected abstract void |
saveToXML(XMLStreamWriter writer)
Deprecated.
Allows subclasses to write their configuration to XML.
|
void |
setContentSourceField(String contentSourceField)
Deprecated.
Sets the source field name holding the document content.
|
void |
setContentTargetField(String contentTargetField)
Deprecated.
Sets the target field where to store the document content.
|
void |
setIdSourceField(String idSourceField)
Deprecated.
sets the source field name holding the unique identifier.
|
void |
setIdTargetField(String idTargetField)
Deprecated.
Sets the target field name to store the unique identifier.
|
void |
setKeepContentSourceField(boolean keepContentSourceField)
Deprecated.
Sets whether to keep the content source field or not, once mapped.
|
void |
setKeepIdSourceField(boolean keepIdSourceField)
Deprecated.
Sets whether to keep the ID source field or not, once mapped.
|
String |
toString()
Deprecated.
|
commit, commitAddedDocument, commitComplete, commitDeletedDocument, getQueueDir, preCommitDeletedDocument, queueBatchableAdd, queueBatchableRemove, setQueueDir
getBatchSize, queueAdd, queueRemove, setBatchSize
public BaseCommitter()
public BaseCommitter(int batchSize)
batchSize
- batch sizepublic String getIdSourceField()
public void setIdSourceField(String idSourceField)
idSourceField
- source field namepublic String getIdTargetField()
public void setIdTargetField(String idTargetField)
idTargetField
- target field namepublic String getContentTargetField()
public void setContentTargetField(String contentTargetField)
contentTargetField
- target field namepublic String getContentSourceField()
public void setContentSourceField(String contentSourceField)
contentSourceField
- source field namepublic boolean isKeepIdSourceField()
true
when keeping ID source fieldpublic void setKeepIdSourceField(boolean keepIdSourceField)
keepIdSourceField
- true
when keeping ID source fieldpublic boolean isKeepContentSourceField()
true
when keeping content source fieldpublic void setKeepContentSourceField(boolean keepContentSourceField)
keepContentSourceField
- true
when keeping content
source fieldprotected void preCommitAddedDocument(FileSystemQueueCommitter.QueuedAddedDocument document) throws IOException
FileSystemQueueCommitter
preCommitAddedDocument
in class FileSystemQueueCommitter
document
- document to be addedIOException
public void saveToXML(Writer out) throws IOException
saveToXML
in interface IXMLConfigurable
IOException
protected abstract void saveToXML(XMLStreamWriter writer) throws XMLStreamException
writer
- the xml being writtenXMLStreamException
public void loadFromXML(Reader in)
loadFromXML
in interface IXMLConfigurable
protected abstract void loadFromXml(org.apache.commons.configuration.XMLConfiguration xml)
xml
- public int hashCode()
hashCode
in class FileSystemQueueCommitter
public boolean equals(Object obj)
equals
in class FileSystemQueueCommitter
public String toString()
toString
in class FileSystemQueueCommitter
Copyright © 2009-2014 Norconex Inc.. All Rights Reserved.