public abstract class MultiConnectorPushAPI
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CHECKPOINT_NAME
Name of the default checkpoint, used when setting a checkpoint with no name
(#setCheckpoint(String, String) or {@link #setCheckpoint(String, String, boolean)}.
|
static int |
STREAMING_BLOCK_SIZE |
Constructor and Description |
---|
MultiConnectorPushAPI() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addDocument(java.lang.String connectorName,
Document document)
Adds a document.
|
abstract void |
addDocumentList(java.lang.String connectorName,
Document[] documents)
Adds a set of documents.
|
abstract boolean |
areDocumentsSearchable(java.lang.String connectorName,
java.math.BigInteger serial)
Checks whether documents sent prior a given setCheckpoint operation
are searchable.
|
abstract void |
clearAllCheckpoints(java.lang.String connectorName)
Resets all the checkpoints values.
|
abstract void |
clearCheckpoints(java.lang.String connectorName,
java.lang.String checkpointNamePrefix)
Resets all the checkpoints values whose name starts with a specific prefix
|
long |
countSyncedEntries(java.lang.String connectorName)
Counts the number of synchronized entries recursively from root.
|
abstract long |
countSyncedEntries(java.lang.String connectorName,
java.lang.String rootPath,
EnumerationMode mode)
Counts the number of synchronized entries.
|
abstract void |
deleteDocument(java.lang.String connectorName,
java.lang.String uri)
Deletes a document specified by its URI.
|
abstract void |
deleteDocumentList(java.lang.String connectorName,
int[] did,
int[] slices)
Deletes a list of documents specified by their dids and slices.
|
abstract void |
deleteDocumentList(java.lang.String connectorName,
java.lang.String[] uris)
Deletes a list of documents specified by their URIs.
|
void |
deleteDocumentRootPath(java.lang.String connectorName,
java.lang.String rootPath)
Deletes a set of document corresponding to a URI prefix.
|
void |
deleteDocumentRootPath(java.lang.String connectorName,
java.lang.String rootPath,
boolean recursive)
Deletes a set of documents corresponding to a URI prefix.
|
abstract void |
deleteDocumentRootPath(java.lang.String connectorName,
java.lang.String rootPath,
boolean recursive,
boolean clearCache)
Deletes a set of documents corresponding to a URI prefix.
|
abstract java.lang.Iterable<CheckpointInfo> |
enumerateCheckpointInfo(java.lang.String connectorName)
Enumerates all the checkpoints known by the system (synchronized).
|
abstract java.lang.Iterable<CheckpointInfo> |
enumerateCheckpointInfo(java.lang.String connectorName,
boolean showSynchronizedOnly)
Enumerates all the checkpoints.
|
java.lang.Iterable<SyncedEntry> |
enumerateSyncedEntries(java.lang.String connectorName)
Enumerates synchronized entries recursively from root.
|
abstract java.lang.Iterable<SyncedEntry> |
enumerateSyncedEntries(java.lang.String connectorName,
java.lang.String rootPath,
EnumerationMode mode)
Enumerates synchronized entries.
|
java.lang.String |
getCheckpoint(java.lang.String connectorName)
Gets the value of the default checkpoint in the indexing process.
|
abstract java.lang.String |
getCheckpoint(java.lang.String connectorName,
java.lang.String name)
Gets the value of a named checkpoint in the indexing process.
|
abstract CheckpointInfo |
getCheckpoint(java.lang.String connectorName,
java.lang.String name,
boolean showSynchronizedOnly)
Gets the checkpoint detailed information.
|
Document.DidAndSlice[] |
getDocumentDidsAndSlices(java.lang.String connectorName,
java.lang.String[] uris)
Get the CloudView internal identifiers of a set of documents.
|
abstract DocumentStatus |
getDocumentStatus(java.lang.String connectorName,
java.lang.String uri)
Gets document status.
|
abstract DocumentStatus[] |
getDocumentStatusList(java.lang.String connectorName,
java.lang.String[] uri)
Gets the status of a given list of documents in the push server.
|
abstract void |
ping(java.lang.String connectorName)
Tests the connection with the server.
|
java.math.BigInteger |
setCheckpoint(java.lang.String connectorName,
java.lang.String value)
Sets the value for the default checkpoint in the push server but do not
automatically synchronize the task log.
|
java.math.BigInteger |
setCheckpoint(java.lang.String connectorName,
java.lang.String value,
boolean sync)
Sets the value for the default checkpoint in the push server.
|
java.math.BigInteger |
setCheckpoint(java.lang.String connectorName,
java.lang.String value,
java.lang.String name)
Sets a checkpoint in the push server but do not automatically synchronize
the tasks log.
|
abstract java.math.BigInteger |
setCheckpoint(java.lang.String connectorName,
java.lang.String value,
java.lang.String name,
boolean sync)
Sets a checkpoint in the push server.
|
abstract void |
startPushSession(java.lang.String connectorName)
Starts a new session on the push server.
|
abstract void |
stopPushSession(java.lang.String connectorName,
boolean releaseConnections)
Stops the current session on the push server.
|
java.lang.String[] |
suggestSyncedEntries(java.lang.String connectorName,
java.lang.String rootPath,
int limit)
Suggest synchronized entries.
|
abstract void |
sync(java.lang.String connectorName)
Forces the synchronization of all pending operations before returning.
|
abstract void |
triggerIndexingJob(java.lang.String connectorName)
Forces the processing of all pending operations synchronized to disk.
|
void |
triggerIndexingJobWhenIdle(java.lang.String connectorName)
Wait for indexing to be idle, and forces the processing of all pending
operations synchronized to disk.
|
abstract void |
updateDocument(java.lang.String connectorName,
Document doc,
java.lang.String[] fields)
Partially updates a document.
|
abstract void |
updateDocumentList(java.lang.String connectorName,
Document[] docList,
java.lang.String[][] fieldsList)
Updates a set of documents.
|
abstract void |
updateDocumentMetas(java.lang.String connectorName,
java.lang.String uri,
java.lang.String stamp,
MetaContainer metaContainer)
Deprecated.
|
abstract void |
updateDocumentMetasList(java.lang.String connectorName,
java.lang.String[] uriList,
java.lang.String[] stampList,
MetaContainer[] metaContainerList)
Deprecated.
|
public static final int STREAMING_BLOCK_SIZE
public static final java.lang.String DEFAULT_CHECKPOINT_NAME
public abstract void ping(java.lang.String connectorName) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon error (invalid connector name or IO error)public abstract void addDocument(java.lang.String connectorName, Document document) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanddocument
- Document to be added.PushAPIException
- upon errorpublic abstract void addDocumentList(java.lang.String connectorName, Document[] documents) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanddocuments
- Documents to be added.PushAPIException
- upon error.public abstract void updateDocument(java.lang.String connectorName, Document doc, java.lang.String[] fields) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanddoc
- 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.fields
- Not used for the moment.PushAPIException
@Deprecated public abstract void updateDocumentMetas(java.lang.String connectorName, java.lang.String uri, java.lang.String stamp, MetaContainer metaContainer) throws PushAPIException
#updateDocument(Document, String[])
which
automatically creates the list of index fields from the meta names found in
the meta data container.#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.connectorName
- the connector name, as known as the original source of the commanduri
- the URI of the document to updatestamp
- the new document stampmetaContainer
- the container of meta to be updatedPushAPIException
- upon errorpublic abstract void updateDocumentList(java.lang.String connectorName, Document[] docList, java.lang.String[][] fieldsList) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanddocList
- the list of documents to updatefieldsList
- for each document, the fields to be updatedPushAPIException
- upon error#updateDocument(Document, String[])
@Deprecated public abstract void updateDocumentMetasList(java.lang.String connectorName, java.lang.String[] uriList, java.lang.String[] stampList, MetaContainer[] metaContainerList) throws PushAPIException
#updateDocument(Document, String[])
which
automatically creates the list of index fields from the meta names found in
the meta data container.connectorName
- the connector name, as known as the original source of the commanduriList
- the URIs of the documents to updatestampList
- the list of new stampsmetaContainerList
- the list of meta data containersPushAPIException
- upon errorupdateDocumentMetas(java.lang.String, java.lang.String, java.lang.String, com.exalead.papi.helper.MetaContainer)
public abstract void deleteDocument(java.lang.String connectorName, java.lang.String uri) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanduri
- the URI of the document to deletePushAPIException
- upon errorpublic abstract void deleteDocumentList(java.lang.String connectorName, java.lang.String[] uris) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanduris
- the list of URIs of the documents to deletePushAPIException
- upon errorpublic abstract void deleteDocumentList(java.lang.String connectorName, int[] did, int[] slices) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanddids
- the list of dids to delete.slices
- the list of slices to delete.PushAPIException
public void deleteDocumentRootPath(java.lang.String connectorName, java.lang.String rootPath) throws PushAPIException
deleteDocumentRootPath(connectorName, rootPath, true)
.connectorName
- the connector name, as known as the original source of the commandPushAPIException
public void deleteDocumentRootPath(java.lang.String connectorName, java.lang.String rootPath, boolean recursive) throws PushAPIException
rootPath
prefix will be deleted.connectorName
- the connector name, as known as the original source of the commandrootPath
- 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.PushAPIException
public abstract void deleteDocumentRootPath(java.lang.String connectorName, java.lang.String rootPath, boolean recursive, boolean clearCache) throws PushAPIException
rootPath
prefix will be deleted.connectorName
- the connector name, as known as the original source of the commandrootPath
- 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
- This boolean flag indicates if we want to delete documents
from the document cache when they are deleted from the index.PushAPIException
public abstract DocumentStatus getDocumentStatus(java.lang.String connectorName, java.lang.String uri) throws PushAPIException
areDocumentsSearchable
method.connectorName
- the connector name, as known as the original source of the commanduri
- the URI to be looked up.getDocumentStatus
method always returns a non-null DocumentStatus
object. To check if
the document actually exists in the index, please use the DocumentStatus.isExist()
method.PushAPIException
DocumentStatus
public abstract DocumentStatus[] getDocumentStatusList(java.lang.String connectorName, java.lang.String[] uri) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanduri
- the URIs of the documents for which the status should be retrieved.PushAPIException
- upon errorpublic Document.DidAndSlice[] getDocumentDidsAndSlices(java.lang.String connectorName, java.lang.String[] uris) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commanduris
- URIs of the document to identifyPushAPIException
public abstract java.math.BigInteger setCheckpoint(java.lang.String connectorName, java.lang.String value, java.lang.String name, boolean sync) throws PushAPIException
#areDocumentsSearchable(BigInteger)
for more information.connectorName
- the connector name, as known as the original source of the commandvalue
- the value of the checkpoint.name
- the name of the checkpoint.sync
- if all the pending operations in the task log should be
synchronized to disk before returning.PushAPIException
- upon error#sync()
,
#areDocumentsSearchable(BigInteger)
public java.math.BigInteger setCheckpoint(java.lang.String connectorName, java.lang.String value, java.lang.String name) throws PushAPIException
setCheckpoint(connectorName, value, name, false)
.connectorName
- the connector name, as known as the original source of the commandvalue
- the value of the checkpointname
- the name of the checkpointPushAPIException
- upon errorsetCheckpoint(String, String, boolean)
public java.math.BigInteger setCheckpoint(java.lang.String connectorName, java.lang.String value, boolean sync) throws PushAPIException
setCheckpoint(connectorName, value, "", sync)
.connectorName
- the connector name, as known as the original source of the commandvalue
- the value of the default checkpoint.sync
- if all the pending operations should be synchronized to disk
before returning.PushAPIException
- upon errorsetCheckpoint(String, String, boolean)
public java.math.BigInteger setCheckpoint(java.lang.String connectorName, java.lang.String value) throws PushAPIException
setCheckpoint(connectorName, value, "", false)
.connectorName
- the connector name, as known as the original source of the commandvalue
- the value of the default checkpointPushAPIException
- upon errorsetCheckpoint(String, String, boolean)
public abstract java.lang.String getCheckpoint(java.lang.String connectorName, java.lang.String name) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandname
- the name of the checkpointPushAPIException
- upon errorsetCheckpoint(String, String, boolean)
public abstract CheckpointInfo getCheckpoint(java.lang.String connectorName, java.lang.String name, boolean showSynchronizedOnly) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandname
- the name of the checkpoint to retrieve.showSynchronizedOnly
- if true, then returns the last synchronized (i.e safe) checkpoint,
otherwise returns the unsynchronized checkpoint (in memory only)
when more recent than the last synchronized one.PushAPIException
setCheckpoint(String, String, boolean)
public java.lang.String getCheckpoint(java.lang.String connectorName) throws PushAPIException
getCheckpoint("")
.connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon errorpublic abstract void clearAllCheckpoints(java.lang.String connectorName) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon errorpublic abstract void clearCheckpoints(java.lang.String connectorName, java.lang.String checkpointNamePrefix) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandcheckpointNamePrefix
- Prefix of the checkpoint name to removePushAPIException
- upon errorpublic abstract java.lang.Iterable<CheckpointInfo> enumerateCheckpointInfo(java.lang.String connectorName) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon errorsetCheckpoint(String, String, boolean)
,
#sync()
public abstract java.lang.Iterable<CheckpointInfo> enumerateCheckpointInfo(java.lang.String connectorName, boolean showSynchronizedOnly) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandshowSynchronizedOnly
- if true, then returns synchronized (i.e safe) checkpoints,
otherwise returns the unsynchronized checkpoints (in memory only)
when more recent than the synchronized ones.PushAPIException
- upon errorsetCheckpoint(String, String, boolean)
,
#synchronize()
public abstract void sync(java.lang.String connectorName) throws PushAPIException
PushAPIException
- upon errorpublic abstract void triggerIndexingJob(java.lang.String connectorName) throws PushAPIException
PushAPIException
- upon errorpublic void triggerIndexingJobWhenIdle(java.lang.String connectorName) throws PushAPIException
PushAPIException
- upon errorpublic abstract boolean areDocumentsSearchable(java.lang.String connectorName, java.math.BigInteger serial) throws PushAPIException
serial
- the serial returned by a setChecpoint operationPushAPIException
- upon errorpublic abstract java.lang.Iterable<SyncedEntry> enumerateSyncedEntries(java.lang.String connectorName, java.lang.String rootPath, EnumerationMode mode) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandrootPath
- URI prefix used to select a subset of the corpus. Empty string can
be used to enumerate the whole collection. The character '/' is used
to build a hierarchical view of your corpus.mode
- the enumeration mode.PushAPIException
- upon error#sync()}
public java.lang.Iterable<SyncedEntry> enumerateSyncedEntries(java.lang.String connectorName) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon error#sync()}
public abstract long countSyncedEntries(java.lang.String connectorName, java.lang.String rootPath, EnumerationMode mode) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandrootPath
- 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.mode
- the enumeration mode.PushAPIException
- upon error.public long countSyncedEntries(java.lang.String connectorName) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon error.public java.lang.String[] suggestSyncedEntries(java.lang.String connectorName, java.lang.String rootPath, int limit) throws PushAPIException
connectorName
- the connector name, as known as the original source of the commandrootPath
- URI prefix used to select a subset of the corpus. Empty string can
be used to enumerate the whole collection. The character '/' is used
to build a hierarchical view of your corpus.limit
- maximum number of suggestions.PushAPIException
- upon error#sync()}
public abstract void startPushSession(java.lang.String connectorName) throws PushAPIException
stopPushSession
),
if the push server restarts for any reason, an exception will be thrown.
The connector should then engage a recovery procedure.PushAPISessionExistsException
- if the session is already started.PushAPIException
- if any another error occurred.public abstract void stopPushSession(java.lang.String connectorName, boolean releaseConnections) throws PushAPIException
releaseConnection
- Try to release persistent connections to save resources.PushAPISessionNotFoundException
- if session is not started.PushAPIException
- if another error occurred.startPushSession}
Copyright © 2021 Dassault Systèmes, All Rights Reserved.