Package org.opennms.netmgt.flows.elastic
Class SearchQueryProvider
- java.lang.Object
-
- org.opennms.netmgt.flows.elastic.SearchQueryProvider
-
- All Implemented Interfaces:
FilterVisitor<String>
public class SearchQueryProvider extends Object implements FilterVisitor<String>
Here we store the search queries in the class-path in the form of Freemarker templates and use the templating to perform the parameter substitution. This makes it cleaner than storing the search queries as multiline strings in Java code, and is much less verbose than storing these as POJOs.
-
-
Constructor Summary
Constructors Constructor Description SearchQueryProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAllValues(String field, int fieldSize, List<Filter> filters)
String
getApplicationsQuery(String prefix, long limit, List<Filter> filters)
String
getConversationsRegexQuery(String regex, long limit, List<Filter> filters)
String
getFlowCountQuery(List<Filter> filters)
String
getHostnameByConversationQuery(String convoKey, List<Filter> filters)
String
getHostnameByHostQuery(String host, List<Filter> filters)
String
getHostsQuery(String regex, long limit, List<Filter> filters)
String
getSeriesFromMissingQuery(long step, long start, long end, String groupByTerm, String keyForMissingTerm, List<Filter> filters)
String
getSeriesFromOthersQuery(Collection<String> from, long step, long start, long end, String groupByTerm, boolean excludeMissing, List<Filter> filters)
String
getSeriesFromQuery(int size, long step, long start, long end, String groupByTerm, List<Filter> filters)
String
getSeriesFromQuery(Collection<String> from, long step, long start, long end, String groupByTerm, List<Filter> filters)
String
getTopNQuery(int N, String groupByTerm, String keyForMissingTerm, List<Filter> filters)
String
getUniqueNodeExporters(long size, List<Filter> filters)
String
getUniqueSnmpInterfaces(long size, List<Filter> filters)
String
visit(DscpFilter dscpFilter)
String
visit(ExporterNodeFilter exporterNodeFilter)
String
visit(SnmpInterfaceIdFilter snmpInterfaceIdFilter)
String
visit(TimeRangeFilter timeRangeFilter)
-
-
-
Method Detail
-
getTopNQuery
public String getTopNQuery(int N, String groupByTerm, String keyForMissingTerm, List<Filter> filters)
-
getSeriesFromQuery
public String getSeriesFromQuery(Collection<String> from, long step, long start, long end, String groupByTerm, List<Filter> filters)
-
getSeriesFromQuery
public String getSeriesFromQuery(int size, long step, long start, long end, String groupByTerm, List<Filter> filters)
-
getSeriesFromMissingQuery
public String getSeriesFromMissingQuery(long step, long start, long end, String groupByTerm, String keyForMissingTerm, List<Filter> filters)
-
getSeriesFromOthersQuery
public String getSeriesFromOthersQuery(Collection<String> from, long step, long start, long end, String groupByTerm, boolean excludeMissing, List<Filter> filters)
-
getApplicationsQuery
public String getApplicationsQuery(String prefix, long limit, List<Filter> filters)
-
getConversationsRegexQuery
public String getConversationsRegexQuery(String regex, long limit, List<Filter> filters)
-
visit
public String visit(ExporterNodeFilter exporterNodeFilter)
- Specified by:
visit
in interfaceFilterVisitor<String>
-
visit
public String visit(TimeRangeFilter timeRangeFilter)
- Specified by:
visit
in interfaceFilterVisitor<String>
-
visit
public String visit(SnmpInterfaceIdFilter snmpInterfaceIdFilter)
- Specified by:
visit
in interfaceFilterVisitor<String>
-
visit
public String visit(DscpFilter dscpFilter)
- Specified by:
visit
in interfaceFilterVisitor<String>
-
getHostnameByConversationQuery
public String getHostnameByConversationQuery(String convoKey, List<Filter> filters)
-
-