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 class
ElasticSearchConnection.CallThread
static class
ElasticSearchConnection.Result
-
Field Summary
Fields Modifier and Type Field Description protected ElasticSearchConfig
config
protected static java.lang.String
jsonException
-
Constructor Summary
Constructors Modifier Constructor Description protected
ElasticSearchConnection(ElasticSearchConfig config, org.apache.http.client.HttpClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
call(org.apache.http.client.methods.HttpRequestBase method)
Call ElasticSearch.protected java.lang.String
checkJson(java.lang.String jsonQuery)
protected java.lang.StringBuffer
getApiUrl(java.lang.String command, boolean checkConnection)
java.lang.String
getCallUrlSnippet()
protected java.lang.String
getResponse()
ElasticSearchConnection.Result
getResult()
java.lang.String
getResultCode()
java.lang.String
getResultDescription()
protected void
handleHttpException(org.apache.http.HttpException e)
protected void
handleIOException(java.io.IOException e)
protected boolean
handleResultCode(int code, java.lang.String response)
protected void
setResult(java.lang.String resultCode, ElasticSearchConnection.Result res, java.lang.String desc)
void
setResultCode(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.ServiceInterruption
Call ElasticSearch.- Returns:
- false if there was a "rejection".
- Throws:
org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.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.ManifoldCFException
org.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.ManifoldCFException
org.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.ManifoldCFException
org.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)
-
-