public class MultiConnectorHttpPushAPI extends MultiConnectorPushAPI implements IHttpPushAPI
Modifier and Type | Class and Description |
---|---|
static class |
MultiConnectorHttpPushAPI.CheckpointInfoIterable |
static class |
MultiConnectorHttpPushAPI.SyncedEntriesIterable |
DEFAULT_CHECKPOINT_NAME, STREAMING_BLOCK_SIZE
DEFAULT_NDOC_COMPACTION, DEFAULT_URL_PREFIX, HTTP_PAPI_VERSION, HTTPPAPI_VERSION_KEY, PREFIX_PARAMETER
Constructor and Description |
---|
MultiConnectorHttpPushAPI(Protocol protocol,
java.lang.String host,
java.lang.String port,
java.lang.String connectorType,
java.lang.String login,
java.lang.String password) |
MultiConnectorHttpPushAPI(Protocol protocol,
java.lang.String host,
java.lang.String port,
java.lang.String urlPrefix,
java.lang.String connectorType,
java.lang.String login,
java.lang.String password) |
MultiConnectorHttpPushAPI(Protocol protocol,
java.lang.String host,
java.lang.String port,
java.lang.String urlPrefix,
java.lang.String connectorType,
java.lang.String login,
java.lang.String password,
boolean ndocCompaction) |
MultiConnectorHttpPushAPI(java.lang.String host,
java.lang.String port,
java.lang.String connectorType,
java.lang.String login,
java.lang.String password)
Deprecated.
|
MultiConnectorHttpPushAPI(java.lang.String host,
java.lang.String port,
java.lang.String urlPrefix,
java.lang.String connectorType,
java.lang.String login,
java.lang.String password)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptAllCertificate() |
void |
addDocument(java.lang.String connectorName,
Document document)
Adds a document.
|
void |
addDocumentList(java.lang.String connectorName,
Document[] documents)
Adds a set of documents.
|
boolean |
areDocumentsSearchable(java.lang.String connectorName,
java.math.BigInteger serial)
Checks whether documents sent prior a given setCheckpoint operation
are searchable.
|
void |
clearAllCheckpoints(java.lang.String connectorName)
Resets all the checkpoints values.
|
void |
clearCheckpoints(java.lang.String connectorName,
java.lang.String checkpointNamePrefix)
Resets all the checkpoints values whose name starts with a specific prefix
|
protected static void |
closeStreams(ContentInputStream[] streams)
Close all extracted streams ; does not throw IOException
|
long |
countSyncedEntries(java.lang.String connectorName,
java.lang.String rootPath,
EnumerationMode mode)
Counts the number of synchronized entries.
|
void |
deleteDocument(java.lang.String connectorName,
java.lang.String uri)
Deletes a document specified by its URI.
|
void |
deleteDocumentList(java.lang.String connectorName,
int[] dids,
int[] slices)
Deletes a list of documents specified by their dids and slices.
|
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,
boolean recursive,
boolean clearCache)
Deletes a set of documents corresponding to a URI prefix.
|
java.lang.Iterable<CheckpointInfo> |
enumerateCheckpointInfo(java.lang.String connectorName)
Enumerates all the checkpoints known by the system (synchronized).
|
java.lang.Iterable<CheckpointInfo> |
enumerateCheckpointInfo(java.lang.String connectorName,
boolean showSynchronizedOnly)
Enumerates all the checkpoints.
|
java.lang.Iterable<SyncedEntry> |
enumerateSyncedEntries(java.lang.String connectorName,
java.lang.String rootPath,
EnumerationMode mode)
Enumerates synchronized entries.
|
protected static java.lang.String |
escape(java.lang.String source) |
protected static java.util.Vector<Part> |
extractParts(Document doc)
Extract parts from Document
|
protected static ContentInputStream[] |
extractStreams(java.util.Vector<Part> parts)
Extract streams from Part list
|
java.lang.String |
getCheckpoint(java.lang.String connectorName,
java.lang.String name)
Gets the value of a named checkpoint in the indexing process.
|
CheckpointInfo |
getCheckpoint(java.lang.String connectorName,
java.lang.String name,
boolean showSynchronizedOnly)
Gets the checkpoint detailed information.
|
java.lang.String |
getConnectorType() |
Document.DidAndSlice[] |
getDocumentDidsAndSlices(java.lang.String connectorName,
java.lang.String[] uris)
Get the CloudView internal identifiers of a set of documents.
|
DocumentStatus |
getDocumentStatus(java.lang.String connectorName,
java.lang.String uri)
Gets document status.
|
DocumentStatus[] |
getDocumentStatusList(java.lang.String connectorName,
java.lang.String[] uris)
Gets the status of a given list of documents in the push server.
|
java.lang.String |
getLogin() |
java.lang.String |
getPassword() |
long |
getSessionId() |
java.lang.String |
getUrl() |
boolean |
hasSession() |
void |
ping(java.lang.String connectorName)
Tests the connection with the server.
|
protected static void |
rethrowDocumentsPushAPIException(java.lang.String title,
HttpSender.BodyPartPushAPIException e,
Document[] documents) |
void |
setAcceptAllCertificate()
If using an https connection, accept autosigned and invalid SSL certificates.
|
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.
|
void |
startPushSession(java.lang.String connectorName)
Starts a new session on the push server.
|
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.
|
void |
sync(java.lang.String connectorName)
Forces the synchronization of all pending operations before returning.
|
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.
|
void |
updateDocument(java.lang.String connectorName,
Document doc,
java.lang.String[] fields)
Partially updates a document.
|
void |
updateDocumentList(java.lang.String connectorName,
Document[] documents,
java.lang.String[][] fieldsList)
Updates a set of documents.
|
void |
updateDocumentMetas(java.lang.String connectorName,
java.lang.String uri,
java.lang.String stamp,
MetaContainer metaContainer)
Updates the stamp and the meta data of a document, using a strict meta to field
mapping.
|
void |
updateDocumentMetasList(java.lang.String connectorName,
java.lang.String[] uriList,
java.lang.String[] stampList,
MetaContainer[] metaContainerList)
Updates a set of the stamp and meta data for given documents.
|
countSyncedEntries, deleteDocumentRootPath, deleteDocumentRootPath, enumerateSyncedEntries, getCheckpoint, setCheckpoint, setCheckpoint, setCheckpoint
public MultiConnectorHttpPushAPI(Protocol protocol, java.lang.String host, java.lang.String port, java.lang.String urlPrefix, java.lang.String connectorType, java.lang.String login, java.lang.String password, boolean ndocCompaction)
public MultiConnectorHttpPushAPI(Protocol protocol, java.lang.String host, java.lang.String port, java.lang.String urlPrefix, java.lang.String connectorType, java.lang.String login, java.lang.String password)
public MultiConnectorHttpPushAPI(Protocol protocol, java.lang.String host, java.lang.String port, java.lang.String connectorType, java.lang.String login, java.lang.String password)
@Deprecated public MultiConnectorHttpPushAPI(java.lang.String host, java.lang.String port, java.lang.String urlPrefix, java.lang.String connectorType, java.lang.String login, java.lang.String password)
@Deprecated public MultiConnectorHttpPushAPI(java.lang.String host, java.lang.String port, java.lang.String connectorType, java.lang.String login, java.lang.String password)
public boolean hasSession()
hasSession
in interface IHttpPushAPI
public long getSessionId()
getSessionId
in interface IHttpPushAPI
public boolean acceptAllCertificate()
acceptAllCertificate
in interface IHttpPushAPI
public void setAcceptAllCertificate()
public java.lang.String getConnectorType()
getConnectorType
in interface IHttpPushAPI
public java.lang.String getLogin()
getLogin
in interface IHttpPushAPI
public java.lang.String getPassword()
getPassword
in interface IHttpPushAPI
public java.lang.String getUrl()
getUrl
in interface IHttpPushAPI
public void addDocument(java.lang.String connectorName, Document document) throws PushAPIException
MultiConnectorPushAPI
addDocument
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commanddocument
- Document to be added.PushAPIException
- upon errorprotected static java.util.Vector<Part> extractParts(Document doc)
protected static ContentInputStream[] extractStreams(java.util.Vector<Part> parts) throws java.io.IOException
java.io.IOException
protected static void closeStreams(ContentInputStream[] streams)
protected static void rethrowDocumentsPushAPIException(java.lang.String title, HttpSender.BodyPartPushAPIException e, Document[] documents) throws DocumentsPushAPIException
DocumentsPushAPIException
public void addDocumentList(java.lang.String connectorName, Document[] documents) throws PushAPIException
MultiConnectorPushAPI
addDocumentList
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commanddocuments
- Documents to be added.PushAPIException
- upon error.public void clearAllCheckpoints(java.lang.String connectorName) throws PushAPIException
MultiConnectorPushAPI
clearAllCheckpoints
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon errorpublic void clearCheckpoints(java.lang.String connectorName, java.lang.String checkpointNamePrefix) throws PushAPIException
MultiConnectorPushAPI
clearCheckpoints
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commandcheckpointNamePrefix
- Prefix of the checkpoint name to removePushAPIException
- upon errorpublic long countSyncedEntries(java.lang.String connectorName, java.lang.String rootPath, EnumerationMode mode) throws PushAPIException
MultiConnectorPushAPI
countSyncedEntries
in class MultiConnectorPushAPI
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 void deleteDocument(java.lang.String connectorName, java.lang.String uri) throws PushAPIException
MultiConnectorPushAPI
deleteDocument
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commanduri
- the URI of the document to deletePushAPIException
- upon errorpublic void deleteDocumentList(java.lang.String connectorName, java.lang.String[] uris) throws PushAPIException
MultiConnectorPushAPI
deleteDocumentList
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commanduris
- the list of URIs of the documents to deletePushAPIException
- upon errorpublic void deleteDocumentList(java.lang.String connectorName, int[] dids, int[] slices) throws PushAPIException
MultiConnectorPushAPI
deleteDocumentList
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commandslices
- the list of slices to delete.PushAPIException
public void deleteDocumentRootPath(java.lang.String connectorName, java.lang.String rootPath, boolean recursive, boolean clearCache) throws PushAPIException
MultiConnectorPushAPI
rootPath
prefix will be deleted.deleteDocumentRootPath
in class MultiConnectorPushAPI
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 Document.DidAndSlice[] getDocumentDidsAndSlices(java.lang.String connectorName, java.lang.String[] uris) throws PushAPIException
MultiConnectorPushAPI
getDocumentDidsAndSlices
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commanduris
- URIs of the document to identifyPushAPIException
public java.lang.Iterable<CheckpointInfo> enumerateCheckpointInfo(java.lang.String connectorName) throws PushAPIException
MultiConnectorPushAPI
enumerateCheckpointInfo
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon errorMultiConnectorPushAPI.setCheckpoint(String, String, boolean)
,
#sync()
public java.lang.Iterable<CheckpointInfo> enumerateCheckpointInfo(java.lang.String connectorName, boolean showSynchronizedOnly) throws PushAPIException
MultiConnectorPushAPI
enumerateCheckpointInfo
in class MultiConnectorPushAPI
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 errorMultiConnectorPushAPI.setCheckpoint(String, String, boolean)
,
#synchronize()
public java.lang.Iterable<SyncedEntry> enumerateSyncedEntries(java.lang.String connectorName, java.lang.String rootPath, EnumerationMode mode) throws PushAPIException
MultiConnectorPushAPI
enumerateSyncedEntries
in class MultiConnectorPushAPI
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.String getCheckpoint(java.lang.String connectorName, java.lang.String name) throws PushAPIException
MultiConnectorPushAPI
getCheckpoint
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commandname
- the name of the checkpointPushAPIException
- upon errorMultiConnectorPushAPI.setCheckpoint(String, String, boolean)
public CheckpointInfo getCheckpoint(java.lang.String connectorName, java.lang.String name, boolean showSynchronizedOnly) throws PushAPIException
MultiConnectorPushAPI
getCheckpoint
in class MultiConnectorPushAPI
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
MultiConnectorPushAPI.setCheckpoint(String, String, boolean)
public DocumentStatus getDocumentStatus(java.lang.String connectorName, java.lang.String uri) throws PushAPIException
MultiConnectorPushAPI
areDocumentsSearchable
method.getDocumentStatus
in class MultiConnectorPushAPI
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 DocumentStatus[] getDocumentStatusList(java.lang.String connectorName, java.lang.String[] uris) throws PushAPIException
MultiConnectorPushAPI
getDocumentStatusList
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commanduris
- the URIs of the documents for which the status should be retrieved.PushAPIException
- upon errorpublic void ping(java.lang.String connectorName) throws PushAPIException
MultiConnectorPushAPI
ping
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commandPushAPIException
- upon error (invalid connector name or IO error)public java.math.BigInteger setCheckpoint(java.lang.String connectorName, java.lang.String value, java.lang.String name, boolean sync) throws PushAPIException
MultiConnectorPushAPI
#areDocumentsSearchable(BigInteger)
for more information.setCheckpoint
in class MultiConnectorPushAPI
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.lang.String[] suggestSyncedEntries(java.lang.String connectorName, java.lang.String rootPath, int limit) throws PushAPIException
MultiConnectorPushAPI
suggestSyncedEntries
in class MultiConnectorPushAPI
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 void updateDocument(java.lang.String connectorName, Document doc, java.lang.String[] fields) throws PushAPIException
MultiConnectorPushAPI
updateDocument
in class MultiConnectorPushAPI
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
public void updateDocumentList(java.lang.String connectorName, Document[] documents, java.lang.String[][] fieldsList) throws PushAPIException
MultiConnectorPushAPI
updateDocumentList
in class MultiConnectorPushAPI
connectorName
- the connector name, as known as the original source of the commanddocuments
- the list of documents to updatefieldsList
- for each document, the fields to be updatedPushAPIException
- upon error#updateDocument(Document, String[])
public void updateDocumentMetas(java.lang.String connectorName, java.lang.String uri, java.lang.String stamp, MetaContainer metaContainer) throws PushAPIException
MultiConnectorPushAPI
#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.updateDocumentMetas
in class MultiConnectorPushAPI
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 void updateDocumentMetasList(java.lang.String connectorName, java.lang.String[] uriList, java.lang.String[] stampList, MetaContainer[] metaContainerList) throws PushAPIException
MultiConnectorPushAPI
#updateDocument(Document, String[])
which
automatically creates the list of index fields from the meta names found in
the meta data container.updateDocumentMetasList
in class MultiConnectorPushAPI
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 errorMultiConnectorPushAPI.updateDocumentMetas(java.lang.String, java.lang.String, java.lang.String, com.exalead.papi.helper.MetaContainer)
public boolean areDocumentsSearchable(java.lang.String connectorName, java.math.BigInteger serial) throws PushAPIException
MultiConnectorPushAPI
areDocumentsSearchable
in class MultiConnectorPushAPI
serial
- the serial returned by a setChecpoint operationPushAPIException
- upon errorpublic void triggerIndexingJob(java.lang.String connectorName) throws PushAPIException
MultiConnectorPushAPI
triggerIndexingJob
in class MultiConnectorPushAPI
PushAPIException
- upon errorpublic void triggerIndexingJobWhenIdle(java.lang.String connectorName) throws PushAPIException
MultiConnectorPushAPI
triggerIndexingJobWhenIdle
in class MultiConnectorPushAPI
PushAPIException
- upon errorpublic void sync(java.lang.String connectorName) throws PushAPIException
MultiConnectorPushAPI
sync
in class MultiConnectorPushAPI
PushAPIException
- upon errorpublic void startPushSession(java.lang.String connectorName) throws PushAPIException
MultiConnectorPushAPI
stopPushSession
),
if the push server restarts for any reason, an exception will be thrown.
The connector should then engage a recovery procedure.startPushSession
in class MultiConnectorPushAPI
PushAPISessionExistsException
- if the session is already started.PushAPIException
- if any another error occurred.public void stopPushSession(java.lang.String connectorName, boolean releaseConnections) throws PushAPIException
MultiConnectorPushAPI
stopPushSession
in class MultiConnectorPushAPI
PushAPISessionNotFoundException
- if session is not started.PushAPIException
- if another error occurred.startPushSession}
protected static java.lang.String escape(java.lang.String source)
Copyright © 2021 Dassault Systèmes, All Rights Reserved.