@Deprecated
public interface LocalDocumentStore
Document metadata is automatically persisted (or deleted) for documents by the Connector Manager:
DocumentList
objects returned by the connector
in response to TraversalManager.startTraversal()
or
TraversalManager.resumeTraversal(String)
callsSpiConstants.PROPNAME_MANAGER_SHOULD_PERSIST
property to true
SpiConstants.PROPNAME_ACTION
property is not set
to SpiConstants.ActionType.DELETE
(if it is, then the document is
removed from the local store)SpiConstants.PERSISTABLE_ATTRIBUTES
map are persistedstoreDocument(Document)
method to programmatically store a document
in the local store without sending it through the traversal manager.
The connector may explicitly request stored information to be returned
through the findDocument(String)
, getDocumentIterator()
and
getDocumentIterator(String)
calls. These calls return
Document
objects; again, only those keys in the
SpiConstants.PERSISTABLE_ATTRIBUTES
map will be populated.
If necessary, the connector developer can also get access to the underlying document table in the database implementation of this store by:
getDocTableName()
callDataSource
object by calling
LocalDatabase.getDataSource()
ConnectorPersistentStore
Modifier and Type | Method and Description |
---|---|
Document |
findDocument(java.lang.String docid)
Deprecated.
Finds a
Document in the Connector Manager's per-document store by
docid. |
void |
flush()
Deprecated.
Flushes all changes pending in the table.
|
java.lang.String |
getDocTableName()
Deprecated.
Returns the table name of the underlying implementation table.
|
java.util.Iterator<Document> |
getDocumentIterator()
Deprecated.
Returns an iterator of all documents in the store created by this
connector instance, in sorted order by docid.
|
java.util.Iterator<Document> |
getDocumentIterator(java.lang.String docid)
Deprecated.
Returns an iterator of all documents in the store created by this
connector instance whose docids are
> the specified docid,
in sorted order by docid. |
void |
storeDocument(Document document)
Deprecated.
Persists information about a document.
|
Document findDocument(java.lang.String docid)
Document
in the Connector Manager's per-document store by
docid. If not found, null is returned. If found, the Document
returned contains only the persisted attributes. See
SpiConstants.PERSISTABLE_ATTRIBUTES
.docid
- the docid to search forDocument
or null
, if this document is not found.java.util.Iterator<Document> getDocumentIterator()
Iterator.remove()
.
The documents returned will be non-null and will contain only the
persisted attributes. See SpiConstants.PERSISTABLE_ATTRIBUTES
.
Note: The LocalDocumentStore
implementation
buffers information stored via storeDocument(Document)
, then
writes records out in batches. Consequently unflushed documents will
not yet be available for retrieval. Consider calling flush()
before getting an Iterator. Similarly, the document Iterator
implementation fetches documents in batches, so the Iterator may
return documents that were committed to the document store after the
Iterator
was created.
Iterator
of all documents created by this connector
instance, in order by docidjava.util.Iterator<Document> getDocumentIterator(java.lang.String docid)
>
the specified docid,
in sorted order by docid.
The result iterator is read-only. It will not support
Iterator.remove()
.
The documents returned will be non-null and will contain only the
persisted attributes. See SpiConstants.PERSISTABLE_ATTRIBUTES
.
Note: The LocalDocumentStore
implementation
buffers information stored via storeDocument(Document)
, then
writes records out in batches. Consequently unflushed documents will
not yet be available for retrieval. Consider calling flush()
before getting an Iterator. Similarly, the document Iterator
implementation fetches documents in batches, so the Iterator may
return documents that were committed to the document store after the
Iterator
was created.
docid
- the docid after which to start the iteration, if null
or empty, all documents created by this connector are returnedIterator
of all documents created by this connector
instance whose docid exceeds the supplied docid, in order by docidvoid storeDocument(Document document)
SpiConstants.PERSISTABLE_ATTRIBUTES
table will be ignored.
Note: The LocalDocumentStore
implementation
buffers information stored via storeDocument(Document)
, then
writes records out in batches for improved document store performance.
The buffered records are flushed to the document store periodically
and at the end of processing a traversal batch. See flush()
.
document
- a Document
void flush()
OutputStream.flush()
: it is an indication that, if any
documents previously added or deleted have not yet been committed to the
store, such records should immediately be committed.java.lang.String getDocTableName()
LocalDocumentStore
object. We expect
this to be used to do queries with non-updatable cursors, involving joins
between this table and other tables independently managed by the connector.