Class AbstractSearchInput
- java.lang.Object
-
- com.floragunn.signals.watch.common.WatchElement
-
- com.floragunn.signals.watch.checks.Check
-
- com.floragunn.signals.watch.checks.AbstractInput
-
- com.floragunn.signals.watch.checks.AbstractSearchInput
-
- All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentObject
- Direct Known Subclasses:
SearchInput,SearchTemplateInput
public abstract class AbstractSearchInput extends AbstractInput
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>indicesprotected org.elasticsearch.action.support.IndicesOptionsindicesOptionsprotected org.elasticsearch.action.search.SearchTypesearchTypeprotected org.elasticsearch.script.TemplateScript.FactorytemplateScriptFactoryprotected org.elasticsearch.common.unit.TimeValuetimeout-
Fields inherited from class com.floragunn.signals.watch.checks.AbstractInput
target
-
-
Constructor Summary
Constructors Constructor Description AbstractSearchInput(String name, String target, List<String> indices)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcompileScripts(WatchInitializationService watchInitService)protected org.elasticsearch.action.search.SearchRequestcreateSearchRequest(org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry, String searchBody)protected abstract org.elasticsearch.script.ScriptcreateTemplateScript()booleanexecute(WatchExecutionContext ctx)protected booleanexecuteSearchRequest(WatchExecutionContext ctx, String searchBody)protected StringexecuteTemplateScript(WatchExecutionContext ctx)List<String>getIndices()protected String[]getIndicesAsArray()org.elasticsearch.common.unit.TimeValuegetTimeout()static org.elasticsearch.action.support.IndicesOptionsparseIndicesOptions(com.fasterxml.jackson.databind.JsonNode jsonNode)voidsetTimeout(org.elasticsearch.common.unit.TimeValue timeout)-
Methods inherited from class com.floragunn.signals.watch.checks.AbstractInput
setResult
-
Methods inherited from class com.floragunn.signals.watch.checks.Check
create, getIndexMapping, getName, getTemplateScriptParamsAsMap, toString
-
Methods inherited from class com.floragunn.signals.watch.common.WatchElement
getChildByNameAndType, getChildByNameAndType, getChildren, render, render
-
-
-
-
Field Detail
-
timeout
protected org.elasticsearch.common.unit.TimeValue timeout
-
templateScriptFactory
protected org.elasticsearch.script.TemplateScript.Factory templateScriptFactory
-
searchType
protected org.elasticsearch.action.search.SearchType searchType
-
indicesOptions
protected org.elasticsearch.action.support.IndicesOptions indicesOptions
-
-
Method Detail
-
getIndicesAsArray
protected String[] getIndicesAsArray()
-
createTemplateScript
protected abstract org.elasticsearch.script.Script createTemplateScript()
-
executeTemplateScript
protected String executeTemplateScript(WatchExecutionContext ctx)
-
compileScripts
public void compileScripts(WatchInitializationService watchInitService) throws com.floragunn.searchsupport.jobs.config.validation.ConfigValidationException
- Throws:
com.floragunn.searchsupport.jobs.config.validation.ConfigValidationException
-
execute
public boolean execute(WatchExecutionContext ctx) throws CheckExecutionException
- Specified by:
executein classCheck- Throws:
CheckExecutionException
-
executeSearchRequest
protected boolean executeSearchRequest(WatchExecutionContext ctx, String searchBody)
-
createSearchRequest
protected org.elasticsearch.action.search.SearchRequest createSearchRequest(org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry, String searchBody)
-
parseIndicesOptions
public static org.elasticsearch.action.support.IndicesOptions parseIndicesOptions(com.fasterxml.jackson.databind.JsonNode jsonNode) throws com.floragunn.searchsupport.jobs.config.validation.ConfigValidationException- Throws:
com.floragunn.searchsupport.jobs.config.validation.ConfigValidationException
-
getTimeout
public org.elasticsearch.common.unit.TimeValue getTimeout()
-
setTimeout
public void setTimeout(org.elasticsearch.common.unit.TimeValue timeout)
-
-