public class ElasticSearchConnector extends BaseOutputConnector
_rcsid
currentContext, params
DOCUMENTSTATUS_ACCEPTED, DOCUMENTSTATUS_REJECTED
Constructor and Description |
---|
ElasticSearchConnector() |
Modifier and Type | Method and Description |
---|---|
int |
addOrReplaceDocumentWithException(String documentURI,
VersionContext pipelineDescription,
RepositoryDocument document,
String authorityNameString,
IOutputAddActivity activities)
Add (or replace) a document in the output data store using the connector.
|
String |
check() |
boolean |
checkLengthIndexable(VersionContext outputDescription,
long length,
IOutputCheckActivity activities) |
boolean |
checkMimeTypeIndexable(VersionContext outputDescription,
String mimeType,
IOutputCheckActivity activities) |
boolean |
checkURLIndexable(VersionContext outputDescription,
String url,
IOutputCheckActivity activities)
Pre-determine whether a document's URL is indexable by this connector.
|
protected void |
closeSession() |
void |
connect(ConfigParams configParams) |
protected static String[] |
convertACL(String[] acl,
String authorityNameString,
IOutputAddActivity activities)
Convert an unqualified ACL to qualified form.
|
void |
disconnect() |
String[] |
getActivitiesList() |
String |
getFormCheckJavascriptMethodName(int connectionSequenceNumber)
Obtain the name of the form check javascript method to call.
|
String |
getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
Obtain the name of the form presave check javascript method to call.
|
VersionContext |
getPipelineDescription(Specification os) |
protected org.apache.http.client.HttpClient |
getSession() |
boolean |
isConnected()
This method is called to assess whether to count this connector instance should
actually be counted as being connected.
|
void |
noteJobComplete(IOutputNotifyActivity activities) |
void |
outputConfigurationBody(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
String tabName) |
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
List<String> tabsArray) |
void |
outputSpecificationBody(IHTTPOutput out,
Locale locale,
Specification os,
int connectionSequenceNumber,
int actualSequenceNumber,
String tabName)
Output the specification body section.
|
void |
outputSpecificationHeader(IHTTPOutput out,
Locale locale,
Specification os,
int connectionSequenceNumber,
List<String> tabsArray)
Output the specification header section.
|
void |
poll() |
String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
ConfigParams parameters) |
String |
processSpecificationPost(IPostParameters variableContext,
Locale locale,
Specification os,
int connectionSequenceNumber)
Process a specification post.
|
void |
removeDocument(String documentURI,
String outputDescription,
IOutputRemoveActivity activities) |
void |
viewConfiguration(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters) |
void |
viewSpecification(IHTTPOutput out,
Locale locale,
Specification os,
int connectionSequenceNumber)
View specification.
|
addOrReplaceDocument, checkDateIndexable, checkDocumentIndexable, checkDocumentIndexable, checkDocumentIndexable, checkLengthIndexable, checkMimeTypeIndexable, checkMimeTypeIndexable, checkURLIndexable, getOutputDescription, noteAllRecordsRemoved, outputSpecificationBody, outputSpecificationBody, outputSpecificationHeader, outputSpecificationHeader, outputSpecificationHeader, processSpecificationPost, processSpecificationPost, requestInfo, viewSpecification, viewSpecification
clearThreadContext, deinstall, getConfiguration, install, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, unpack, unpackFixedList, unpackList, viewConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearThreadContext, deinstall, getConfiguration, install, processConfigurationPost, setThreadContext
public void connect(ConfigParams configParams)
connect
in interface IConnector
connect
in class BaseConnector
protected org.apache.http.client.HttpClient getSession() throws ManifoldCFException
ManifoldCFException
protected void closeSession()
public boolean isConnected()
isConnected
in interface IConnector
isConnected
in class BaseConnector
public void disconnect() throws ManifoldCFException
disconnect
in interface IConnector
disconnect
in class BaseConnector
ManifoldCFException
public void poll() throws ManifoldCFException
poll
in interface IConnector
poll
in class BaseConnector
ManifoldCFException
public String[] getActivitiesList()
getActivitiesList
in interface IOutputConnector
getActivitiesList
in class BaseOutputConnector
public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray) throws ManifoldCFException, IOException
outputConfigurationHeader
in interface IConnector
outputConfigurationHeader
in class BaseConnector
ManifoldCFException
IOException
public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName) throws ManifoldCFException, IOException
outputConfigurationBody
in interface IConnector
outputConfigurationBody
in class BaseConnector
ManifoldCFException
IOException
public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
getFormCheckJavascriptMethodName
in interface IPipelineConnector
getFormCheckJavascriptMethodName
in class BaseOutputConnector
connectionSequenceNumber
- is the unique number of this connection within the job.public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
getFormPresaveCheckJavascriptMethodName
in interface IPipelineConnector
getFormPresaveCheckJavascriptMethodName
in class BaseOutputConnector
connectionSequenceNumber
- is the unique number of this connection within the job.public void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification os, int connectionSequenceNumber, List<String> tabsArray) throws ManifoldCFException, IOException
outputSpecificationHeader
in interface IPipelineConnector
outputSpecificationHeader
in class BaseOutputConnector
out
- is the output to which any HTML should be sent.locale
- is the preferred local of the output.os
- is the current pipeline specification for this connection.connectionSequenceNumber
- is the unique number of this connection within the job.tabsArray
- is an array of tab names. Add to this array any tab names that are specific to the connector.ManifoldCFException
IOException
public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification os, int connectionSequenceNumber, int actualSequenceNumber, String tabName) throws ManifoldCFException, IOException
outputSpecificationBody
in interface IPipelineConnector
outputSpecificationBody
in class BaseOutputConnector
out
- is the output to which any HTML should be sent.locale
- is the preferred local of the output.os
- is the current pipeline specification for this job.connectionSequenceNumber
- is the unique number of this connection within the job.actualSequenceNumber
- is the connection within the job that has currently been selected.tabName
- is the current tab name.ManifoldCFException
IOException
public String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification os, int connectionSequenceNumber) throws ManifoldCFException
processSpecificationPost
in interface IPipelineConnector
processSpecificationPost
in class BaseOutputConnector
variableContext
- contains the post data, including binary file-upload information.locale
- is the preferred local of the output.os
- is the current pipeline specification for this job.connectionSequenceNumber
- is the unique number of this connection within the job.ManifoldCFException
public void viewSpecification(IHTTPOutput out, Locale locale, Specification os, int connectionSequenceNumber) throws ManifoldCFException, IOException
viewSpecification
in interface IPipelineConnector
viewSpecification
in class BaseOutputConnector
out
- is the output to which any HTML should be sent.locale
- is the preferred local of the output.connectionSequenceNumber
- is the unique number of this connection within the job.os
- is the current pipeline specification for this job.ManifoldCFException
IOException
public VersionContext getPipelineDescription(Specification os) throws ManifoldCFException
getPipelineDescription
in interface IPipelineConnector
getPipelineDescription
in class BaseOutputConnector
ManifoldCFException
public boolean checkLengthIndexable(VersionContext outputDescription, long length, IOutputCheckActivity activities) throws ManifoldCFException, ServiceInterruption
checkLengthIndexable
in interface IPipelineConnector
checkLengthIndexable
in class BaseOutputConnector
ManifoldCFException
ServiceInterruption
public boolean checkURLIndexable(VersionContext outputDescription, String url, IOutputCheckActivity activities) throws ManifoldCFException, ServiceInterruption
checkURLIndexable
in interface IPipelineConnector
checkURLIndexable
in class BaseOutputConnector
outputDescription
- is the document's output version.url
- is the URL of the document.ManifoldCFException
ServiceInterruption
public boolean checkMimeTypeIndexable(VersionContext outputDescription, String mimeType, IOutputCheckActivity activities) throws ManifoldCFException, ServiceInterruption
checkMimeTypeIndexable
in interface IPipelineConnector
checkMimeTypeIndexable
in class BaseOutputConnector
ManifoldCFException
ServiceInterruption
public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException
viewConfiguration
in interface IConnector
viewConfiguration
in class BaseConnector
ManifoldCFException
IOException
public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters) throws ManifoldCFException
processConfigurationPost
in class BaseConnector
ManifoldCFException
protected static String[] convertACL(String[] acl, String authorityNameString, IOutputAddActivity activities) throws ManifoldCFException
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.ManifoldCFException
public int addOrReplaceDocumentWithException(String documentURI, VersionContext pipelineDescription, RepositoryDocument document, String authorityNameString, IOutputAddActivity activities) throws ManifoldCFException, ServiceInterruption, IOException
addOrReplaceDocumentWithException
in interface IPipelineConnector
addOrReplaceDocumentWithException
in class BaseOutputConnector
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.IOException
- only if there's a stream error reading the document data.ManifoldCFException
ServiceInterruption
public void removeDocument(String documentURI, String outputDescription, IOutputRemoveActivity activities) throws ManifoldCFException, ServiceInterruption
removeDocument
in interface IOutputConnector
removeDocument
in class BaseOutputConnector
ManifoldCFException
ServiceInterruption
public String check() throws ManifoldCFException
check
in interface IConnector
check
in class BaseConnector
ManifoldCFException
public void noteJobComplete(IOutputNotifyActivity activities) throws ManifoldCFException, ServiceInterruption
noteJobComplete
in interface IOutputConnector
noteJobComplete
in class BaseOutputConnector
ManifoldCFException
ServiceInterruption