com.norconex.committer
Class BatchableCommitter

java.lang.Object
  extended by com.norconex.committer.BatchableCommitter
All Implemented Interfaces:
ICommitter, Serializable
Direct Known Subclasses:
FileSystemQueueCommitter

public abstract class BatchableCommitter
extends Object
implements ICommitter

Base implementation offering to batch the committing of documents (additions and deletions alike).

Author:
Pascal Essiembre
See Also:
Serialized Form

Field Summary
static int DEFAULT_BATCH_SIZE
           
 
Fields inherited from interface com.norconex.committer.ICommitter
DEFAULT_DOCUMENT_REFERENCE
 
Constructor Summary
BatchableCommitter()
           
BatchableCommitter(int batchSize)
           
 
Method Summary
 boolean equals(Object obj)
           
 int getBatchSize()
           
 int hashCode()
           
 void queueAdd(String reference, File document, Properties metadata)
          Queues a new or modified document.
protected abstract  void queueBatchableAdd(String reference, File document, Properties metadata)
          Queues a document to be added.
protected abstract  void queueBatchableRemove(String ref, File document, Properties metadata)
          Queues a document to be deleted.
 void queueRemove(String ref, File document, Properties metadata)
          Queues a document for removal.
 void setBatchSize(int batchSize)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.norconex.committer.ICommitter
commit
 

Field Detail

DEFAULT_BATCH_SIZE

public static final int DEFAULT_BATCH_SIZE
See Also:
Constant Field Values
Constructor Detail

BatchableCommitter

public BatchableCommitter()

BatchableCommitter

public BatchableCommitter(int batchSize)
Method Detail

getBatchSize

public int getBatchSize()

setBatchSize

public void setBatchSize(int batchSize)

queueAdd

public final void queueAdd(String reference,
                           File document,
                           Properties metadata)
Description copied from interface: ICommitter
Queues a new or modified document. These queued documents should be sent to their target destination when commit is called.

Specified by:
queueAdd in interface ICommitter
Parameters:
reference - document reference (e.g. URL)
document - text document
metadata - document metadata

queueBatchableAdd

protected abstract void queueBatchableAdd(String reference,
                                          File document,
                                          Properties metadata)
Queues a document to be added.

Parameters:
reference - document reference
document - document file
metadata - document metadata

queueRemove

public final void queueRemove(String ref,
                              File document,
                              Properties metadata)
Description copied from interface: ICommitter
Queues a document for removal. These queued documents should be sent to their target destination for deletion when commit is called.

Specified by:
queueRemove in interface ICommitter
Parameters:
ref - document reference (e.g. URL)
document - text document
metadata - document metadata

queueBatchableRemove

protected abstract void queueBatchableRemove(String ref,
                                             File document,
                                             Properties metadata)
Queues a document to be deleted.

Parameters:
reference - document reference
document - document file
metadata - document metadata

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2013 Norconex Inc.. All Rights Reserved.