Class ElasticSearchConnection
- java.lang.Object
-
- org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnection
-
- Direct Known Subclasses:
ElasticSearchAction,ElasticSearchDelete,ElasticSearchIndex
public class ElasticSearchConnection extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classElasticSearchConnection.CallThreadstatic classElasticSearchConnection.Result
-
Field Summary
Fields Modifier and Type Field Description protected ElasticSearchConfigconfigprotected static java.lang.StringjsonException
-
Constructor Summary
Constructors Modifier Constructor Description protectedElasticSearchConnection(ElasticSearchConfig config, org.apache.http.client.HttpClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancall(org.apache.http.client.methods.HttpRequestBase method)Call ElasticSearch.protected java.lang.StringcheckJson(java.lang.String jsonQuery)protected java.lang.StringBuffergetApiUrl(java.lang.String command, boolean checkConnection)java.lang.StringgetCallUrlSnippet()protected java.lang.StringgetResponse()ElasticSearchConnection.ResultgetResult()java.lang.StringgetResultCode()java.lang.StringgetResultDescription()protected voidhandleHttpException(org.apache.http.HttpException e)protected voidhandleIOException(java.io.IOException e)protected booleanhandleResultCode(int code, java.lang.String response)protected voidsetResult(java.lang.String resultCode, ElasticSearchConnection.Result res, java.lang.String desc)voidsetResultCode(java.lang.String resultCode)
-
-
-
Field Detail
-
config
protected final ElasticSearchConfig config
-
jsonException
protected static final java.lang.String jsonException
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ElasticSearchConnection
protected ElasticSearchConnection(ElasticSearchConfig config, org.apache.http.client.HttpClient client)
-
-
Method Detail
-
getApiUrl
protected java.lang.StringBuffer getApiUrl(java.lang.String command, boolean checkConnection) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
call
protected boolean call(org.apache.http.client.methods.HttpRequestBase method) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruptionCall ElasticSearch.- Returns:
- false if there was a "rejection".
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
handleResultCode
protected boolean handleResultCode(int code, java.lang.String response) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruption- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
handleHttpException
protected void handleHttpException(org.apache.http.HttpException e) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruption- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
handleIOException
protected void handleIOException(java.io.IOException e) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruption- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruption
-
checkJson
protected java.lang.String checkJson(java.lang.String jsonQuery) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
-
setResult
protected void setResult(java.lang.String resultCode, ElasticSearchConnection.Result res, java.lang.String desc)
-
getResultDescription
public java.lang.String getResultDescription()
-
getResponse
protected java.lang.String getResponse()
-
getResult
public ElasticSearchConnection.Result getResult()
-
getCallUrlSnippet
public java.lang.String getCallUrlSnippet()
-
getResultCode
public java.lang.String getResultCode()
-
setResultCode
public void setResultCode(java.lang.String resultCode)
-
-