public class CountingPushAPI extends PipedPushAPI
Modifier and Type | Field and Description |
---|---|
protected PushAPI |
source |
protected ConnectorState |
state |
defaultLogger, isBestEffortOnStopSession, jlogger, logger, parent
DEFAULT_CHECKPOINT_NAME, STREAMING_BLOCK_SIZE
Constructor and Description |
---|
CountingPushAPI(PushAPI source,
ConnectorState state) |
Modifier and Type | Method and Description |
---|---|
void |
addDocument(Document document)
Adds a document.
|
void |
addDocumentList(Document[] documentList)
Adds a set of documents.
|
boolean |
areDocumentsSearchable(java.math.BigInteger arg0)
Checks whether documents sent prior a given setCheckpoint operation
are searchable.
|
void |
clearAllCheckpoints()
Resets all the checkpoints values.
|
void |
clearCheckpoints(java.lang.String namePrefix)
Resets all the checkpoints whose name starts with the specified prefix.
|
protected static <T> int |
countNonNull(T[] list) |
long |
countSyncedEntries(java.lang.String arg0,
EnumerationMode arg1)
Counts the number of synchronized entries.
|
void |
deleteDocument(java.lang.String arg0)
Deletes a document specified by its URI.
|
void |
deleteDocumentList(int[] did,
int[] slices)
Deletes a list of documents specified by their dids and slices.
|
void |
deleteDocumentList(java.lang.String[] uriList)
Deletes a list of documents specified by their URIs.
|
void |
deleteDocumentRootPath(java.lang.String rootPath,
boolean recursive,
boolean clearCache)
Deletes a set of documents corresponding to a URI prefix.
|
void |
deleteDocumentsWithPrefix(java.lang.String prefix,
boolean clearCache)
Deletes a set of documents corresponding to a URI prefix.
|
void |
updateDocument(Document arg0,
java.lang.String[] arg1)
Partially updates a document.
|
void |
updateDocumentList(Document[] arg0,
java.lang.String[][] arg1)
Updates a set of documents.
|
void |
updateDocumentMetas(java.lang.String arg0,
java.lang.String arg1,
MetaContainer arg2)
Updates the stamp and the meta data of a document, using a strict meta to field
mapping.
|
void |
updateDocumentMetasList(java.lang.String[] arg0,
java.lang.String[] arg1,
MetaContainer[] arg2)
Updates a set of the stamp and meta data for given documents.
|
areDocumentsSearchable, debug, enumerateCheckpointInfo, enumerateCheckpointInfo, enumerateSyncedEntries, error, getBestEffortOnStopSession, getCheckpoint, getCheckpoint, getConnectorName, getDocumentStatus, getDocumentStatusList, getLogger, getParent, info, isTraceEnabled, log, ping, setBestEffortOnStopSession, setCheckpoint, setLogger, startPushSession, stopPushSession, suggestSyncedEntries, sync, synchronize, trace, triggerIndexingJob, triggerIndexingJobWhenIdle, warning
countSyncedEntries, deleteDocumentRootPath, deleteDocumentRootPath, deleteDocumentsWithPrefix, enumerateSyncedEntries, getCheckpoint, getDocumentDidsAndSlices, setCheckpoint, setCheckpoint, setCheckpoint
protected final PushAPI source
protected final ConnectorState state
public CountingPushAPI(PushAPI source, ConnectorState state)
protected static final <T> int countNonNull(T[] list)
list
- A list of objectspublic void addDocument(Document document) throws PushAPIException
PushAPI
addDocument
in class PipedPushAPI
document
- Document to be added.PushAPIException
- upon errorpublic void addDocumentList(Document[] documentList) throws PushAPIException
PushAPI
addDocumentList
in class PipedPushAPI
documentList
- Documents to be added.PushAPIException
- upon error.public void updateDocument(Document arg0, java.lang.String[] arg1) throws PushAPIException
PushAPI
updateDocument
in class PipedPushAPI
arg0
- a Document object specifying the URI of the document to be
updated. Parts and metas that are not updated with the document
are fetched from the document cache, so the document cache
*must* be enabled, and only documents added after the document cache
has been enabled can be updated. Old values of multivalued metas will be dropped,
if you want to update a multivalued meta you have to put new values and
also the old values you want to keep in the document.arg1
- Not used for the moment.PushAPIException
public void updateDocumentList(Document[] arg0, java.lang.String[][] arg1) throws PushAPIException
PushAPI
updateDocumentList
in class PipedPushAPI
arg0
- the list of documents to updatearg1
- for each document, the fields to be updatedPushAPIException
- upon errorPushAPI.updateDocument(Document, String[])
public void updateDocumentMetas(java.lang.String arg0, java.lang.String arg1, MetaContainer arg2) throws PushAPIException
PushAPI
PushAPI.updateDocument(Document, String[])
which
automatically creates the list of index fields from the meta names found in
the meta data container.PushAPI.updateDocument(Document, String[])
, this gives:
MetaContainer cont = new MetaContainer();
cont.addMeta("organization", "myneworg");
papi.updateDocument("mydocument", null, cont);
If the document does not exist yet, an error is returned by the push
server.updateDocumentMetas
in class PipedPushAPI
arg0
- the URI of the document to updatearg1
- the new document stamparg2
- the container of meta to be updatedPushAPIException
- upon errorpublic void updateDocumentMetasList(java.lang.String[] arg0, java.lang.String[] arg1, MetaContainer[] arg2) throws PushAPIException
PushAPI
PushAPI.updateDocument(Document, String[])
which
automatically creates the list of index fields from the meta names found in
the meta data container.updateDocumentMetasList
in class PipedPushAPI
arg0
- the URIs of the documents to updatearg1
- the list of new stampsarg2
- the list of meta data containersPushAPIException
- upon errorPushAPI.updateDocumentMetas(java.lang.String, java.lang.String, com.exalead.papi.helper.MetaContainer)
public boolean areDocumentsSearchable(java.math.BigInteger arg0) throws PushAPIException
PushAPI
areDocumentsSearchable
in class PipedPushAPI
arg0
- the serial returned by a setCheckpoint operationPushAPIException
- upon errorpublic void clearAllCheckpoints() throws PushAPIException
PushAPI
clearAllCheckpoints
in class PipedPushAPI
PushAPIException
- upon errorpublic void clearCheckpoints(java.lang.String namePrefix) throws PushAPIException
PushAPI
clearCheckpoints
in class PipedPushAPI
namePrefix
- Checkpoint name prefixPushAPIException
- upon errorpublic long countSyncedEntries(java.lang.String arg0, EnumerationMode arg1) throws PushAPIException
PushAPI
countSyncedEntries
in class PipedPushAPI
arg0
- URI prefix used to select a subset of the corpus. Empty string can
be used to delete the whole collection. The character '/' is used
to build a hierarchical view of your corpus.arg1
- the enumeration mode.PushAPIException
- upon error.public void deleteDocument(java.lang.String arg0) throws PushAPIException
PushAPI
deleteDocument
in class PipedPushAPI
arg0
- the URI of the document to deletePushAPIException
- upon errorpublic void deleteDocumentList(java.lang.String[] uriList) throws PushAPIException
PushAPI
deleteDocumentList
in class PipedPushAPI
uriList
- the list of URIs of the documents to deletePushAPIException
- upon errorpublic void deleteDocumentList(int[] did, int[] slices) throws PushAPIException
PushAPI
deleteDocumentList
in class PipedPushAPI
slices
- the list of slices to delete.PushAPIException
public void deleteDocumentRootPath(java.lang.String rootPath, boolean recursive, boolean clearCache) throws PushAPIException
PushAPI
rootPath
prefix will be deleted.deleteDocumentRootPath
in class PipedPushAPI
rootPath
- a URI prefix used to select the documents to be deleted."A"
would select all URIs in the form
"A/xyz"
"A/B"
would select all URIs in the form
"A/B/xyz"
recursive
- The recursive flag indicates if the URI pattern specified in
rootPath should match multiple depth levels in the URI tree. For
example the rootPath "A/B"
will always match "A/B/C"
, but will match "A/B/C/D"
only if recursive
is true
. In CloudView 5.1 recursive is always
true.clearCache
- The clearCache flag indicates if we want to delete documents
from the document cache when they are deleted from the index.PushAPIException
public void deleteDocumentsWithPrefix(java.lang.String prefix, boolean clearCache) throws PushAPIException
PushAPI
prefix
will be deleted.deleteDocumentsWithPrefix
in class PipedPushAPI
prefix
- a URI prefix used to select the documents to be deleted.clearCache
- The clearCache flag indicates if we want to delete documents
from the document cache when they are deleted from the index.PushAPIException
Copyright © 2021 Dassault Systèmes, All Rights Reserved.