Class ElasticSearchConnector
- java.lang.Object
-
- org.apache.manifoldcf.core.connector.BaseConnector
-
- org.apache.manifoldcf.agents.output.BaseOutputConnector
-
- org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnector
-
- All Implemented Interfaces:
org.apache.manifoldcf.agents.interfaces.IOutputConnector,org.apache.manifoldcf.agents.interfaces.IPipelineConnector,org.apache.manifoldcf.core.interfaces.IConnector
public class ElasticSearchConnector extends org.apache.manifoldcf.agents.output.BaseOutputConnectorThis is the "output connector" for elasticsearch.- Author:
- Luca Stancapiano
-
-
Constructor Summary
Constructors Constructor Description ElasticSearchConnector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddOrReplaceDocumentWithException(java.lang.String documentURI, org.apache.manifoldcf.core.interfaces.VersionContext pipelineDescription, org.apache.manifoldcf.agents.interfaces.RepositoryDocument document, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)Add (or replace) a document in the output data store using the connector.java.lang.Stringcheck()protected voidcloseSession()protected static java.lang.StringcompressDocumentURI(java.lang.String documentURI)Create a hashed URI string for ID according to ElasticSearch parameters.voidconnect(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)protected static java.lang.String[]convertACL(java.lang.String[] acl, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities)Convert an unqualified ACL to qualified form.voiddisconnect()java.lang.String[]getActivitiesList()org.apache.manifoldcf.core.interfaces.VersionContextgetPipelineDescription(org.apache.manifoldcf.core.interfaces.Specification os)protected org.apache.http.client.HttpClientgetSession()booleanisConnected()This method is called to assess whether to count this connector instance should actually be counted as being connected.voidoutputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.lang.String tabName)voidoutputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.util.List<java.lang.String> tabsArray)voidpoll()java.lang.StringprocessConfigurationPost(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IPostParameters variableContext, org.apache.manifoldcf.core.interfaces.ConfigParams parameters)voidremoveDocument(java.lang.String documentURI, java.lang.String outputDescription, org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity activities)voidviewConfiguration(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters)-
Methods inherited from class org.apache.manifoldcf.agents.output.BaseOutputConnector
checkDateIndexable, checkDocumentIndexable, checkLengthIndexable, checkMimeTypeIndexable, checkURLIndexable, getFormCheckJavascriptMethodName, getFormPresaveCheckJavascriptMethodName, noteAllRecordsRemoved, noteJobComplete, outputSpecificationBody, outputSpecificationHeader, processSpecificationPost, requestInfo, viewSpecification
-
Methods inherited from class org.apache.manifoldcf.core.connector.BaseConnector
clearThreadContext, deinstall, getConfiguration, install, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, unpack, unpackFixedList, unpackList, viewConfiguration
-
-
-
-
Method Detail
-
connect
public void connect(org.apache.manifoldcf.core.interfaces.ConfigParams configParams)
- Specified by:
connectin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
connectin classorg.apache.manifoldcf.core.connector.BaseConnector
-
getSession
protected org.apache.http.client.HttpClient getSession() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
closeSession
protected void closeSession()
-
compressDocumentURI
protected static java.lang.String compressDocumentURI(java.lang.String documentURI) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionCreate a hashed URI string for ID according to ElasticSearch parameters.- Parameters:
documentURI- is the URI of the document.- Returns:
- hashed URI.
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
isConnected
public boolean isConnected()
This method is called to assess whether to count this connector instance should actually be counted as being connected.- Specified by:
isConnectedin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
isConnectedin classorg.apache.manifoldcf.core.connector.BaseConnector- Returns:
- true if the connector instance is actually connected.
-
disconnect
public void disconnect() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Specified by:
disconnectin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
disconnectin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
poll
public void poll() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Specified by:
pollin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
pollin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
getActivitiesList
public java.lang.String[] getActivitiesList()
- Specified by:
getActivitiesListin interfaceorg.apache.manifoldcf.agents.interfaces.IOutputConnector- Overrides:
getActivitiesListin classorg.apache.manifoldcf.agents.output.BaseOutputConnector
-
outputConfigurationHeader
public void outputConfigurationHeader(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.util.List<java.lang.String> tabsArray) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, java.io.IOException- Specified by:
outputConfigurationHeaderin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
outputConfigurationHeaderin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOException
-
outputConfigurationBody
public void outputConfigurationBody(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters, java.lang.String tabName) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, java.io.IOException- Specified by:
outputConfigurationBodyin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
outputConfigurationBodyin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOException
-
getPipelineDescription
public org.apache.manifoldcf.core.interfaces.VersionContext getPipelineDescription(org.apache.manifoldcf.core.interfaces.Specification os) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Specified by:
getPipelineDescriptionin interfaceorg.apache.manifoldcf.agents.interfaces.IPipelineConnector- Overrides:
getPipelineDescriptionin classorg.apache.manifoldcf.agents.output.BaseOutputConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
viewConfiguration
public void viewConfiguration(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IHTTPOutput out, java.util.Locale locale, org.apache.manifoldcf.core.interfaces.ConfigParams parameters) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, java.io.IOException- Specified by:
viewConfigurationin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
viewConfigurationin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionjava.io.IOException
-
processConfigurationPost
public java.lang.String processConfigurationPost(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, org.apache.manifoldcf.core.interfaces.IPostParameters variableContext, org.apache.manifoldcf.core.interfaces.ConfigParams parameters) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Overrides:
processConfigurationPostin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
convertACL
protected static java.lang.String[] convertACL(java.lang.String[] acl, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities) throws org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionConvert an unqualified ACL to qualified form.- Parameters:
acl- is the initial, unqualified ACL.authorityNameString- is the name of the governing authority for this document's acls, or null if none.activities- is the activities object, so we can report what's happening.- Returns:
- the modified ACL.
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
addOrReplaceDocumentWithException
public int addOrReplaceDocumentWithException(java.lang.String documentURI, org.apache.manifoldcf.core.interfaces.VersionContext pipelineDescription, org.apache.manifoldcf.agents.interfaces.RepositoryDocument document, java.lang.String authorityNameString, org.apache.manifoldcf.agents.interfaces.IOutputAddActivity activities) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruption, java.io.IOExceptionAdd (or replace) a document in the output data store using the connector. This method presumes that the connector object has been configured, and it is thus able to communicate with the output data store should that be necessary.- Specified by:
addOrReplaceDocumentWithExceptionin interfaceorg.apache.manifoldcf.agents.interfaces.IPipelineConnector- Overrides:
addOrReplaceDocumentWithExceptionin classorg.apache.manifoldcf.agents.output.BaseOutputConnector- Parameters:
documentURI- is the URI of the document. The URI is presumed to be the unique identifier which the output data store will use to process and serve the document. This URI is constructed by the repository connector which fetches the document, and is thus universal across all output connectors.pipelineDescription- includes the description string that was constructed for this document by the getOutputDescription() method.document- is the document data to be processed (handed to the output data store).authorityNameString- is the name of the authority responsible for authorizing any access tokens passed in with the repository document. May be null.activities- is the handle to an object that the implementer of a pipeline connector may use to perform operations, such as logging processing activity, or sending a modified document to the next stage in the pipeline.- Returns:
- the document status (accepted or permanently rejected).
- Throws:
java.io.IOException- only if there's a stream error reading the document data.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
removeDocument
public void removeDocument(java.lang.String documentURI, java.lang.String outputDescription, org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity activities) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruption- Specified by:
removeDocumentin interfaceorg.apache.manifoldcf.agents.interfaces.IOutputConnector- Overrides:
removeDocumentin classorg.apache.manifoldcf.agents.output.BaseOutputConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
check
public java.lang.String check() throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Specified by:
checkin interfaceorg.apache.manifoldcf.core.interfaces.IConnector- Overrides:
checkin classorg.apache.manifoldcf.core.connector.BaseConnector- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
-