Package org.opennms.netmgt.flows.elastic
Class SearchQueryProvider
- java.lang.Object
-
- org.opennms.netmgt.flows.elastic.SearchQueryProvider
-
- All Implemented Interfaces:
FilterVisitor<java.lang.String>
public class SearchQueryProvider extends java.lang.Object implements FilterVisitor<java.lang.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 java.lang.String
getAllValues(java.lang.String field, int fieldSize, java.util.List<Filter> filters)
java.lang.String
getApplicationsQuery(java.lang.String prefix, long limit, java.util.List<Filter> filters)
java.lang.String
getConversationsRegexQuery(java.lang.String regex, long limit, java.util.List<Filter> filters)
java.lang.String
getFlowCountQuery(java.util.List<Filter> filters)
java.lang.String
getHostnameByConversationQuery(java.lang.String convoKey, java.util.List<Filter> filters)
java.lang.String
getHostnameByHostQuery(java.lang.String host, java.util.List<Filter> filters)
java.lang.String
getHostsQuery(java.lang.String regex, long limit, java.util.List<Filter> filters)
java.lang.String
getSeriesFromMissingQuery(long step, long start, long end, java.lang.String groupByTerm, java.lang.String keyForMissingTerm, java.util.List<Filter> filters)
java.lang.String
getSeriesFromOthersQuery(java.util.Collection<java.lang.String> from, long step, long start, long end, java.lang.String groupByTerm, boolean excludeMissing, java.util.List<Filter> filters)
java.lang.String
getSeriesFromQuery(int size, long step, long start, long end, java.lang.String groupByTerm, java.util.List<Filter> filters)
java.lang.String
getSeriesFromQuery(java.util.Collection<java.lang.String> from, long step, long start, long end, java.lang.String groupByTerm, java.util.List<Filter> filters)
java.lang.String
getTopNQuery(int N, java.lang.String groupByTerm, java.lang.String keyForMissingTerm, java.util.List<Filter> filters)
java.lang.String
getUniqueNodeExporters(long size, java.util.List<Filter> filters)
java.lang.String
getUniqueSnmpInterfaces(long size, java.util.List<Filter> filters)
java.lang.String
visit(DscpFilter dscpFilter)
java.lang.String
visit(ExporterNodeFilter exporterNodeFilter)
java.lang.String
visit(SnmpInterfaceIdFilter snmpInterfaceIdFilter)
java.lang.String
visit(TimeRangeFilter timeRangeFilter)
-
-
-
Method Detail
-
getFlowCountQuery
public java.lang.String getFlowCountQuery(java.util.List<Filter> filters)
-
getUniqueNodeExporters
public java.lang.String getUniqueNodeExporters(long size, java.util.List<Filter> filters)
-
getUniqueSnmpInterfaces
public java.lang.String getUniqueSnmpInterfaces(long size, java.util.List<Filter> filters)
-
getTopNQuery
public java.lang.String getTopNQuery(int N, java.lang.String groupByTerm, java.lang.String keyForMissingTerm, java.util.List<Filter> filters)
-
getSeriesFromQuery
public java.lang.String getSeriesFromQuery(java.util.Collection<java.lang.String> from, long step, long start, long end, java.lang.String groupByTerm, java.util.List<Filter> filters)
-
getSeriesFromQuery
public java.lang.String getSeriesFromQuery(int size, long step, long start, long end, java.lang.String groupByTerm, java.util.List<Filter> filters)
-
getSeriesFromMissingQuery
public java.lang.String getSeriesFromMissingQuery(long step, long start, long end, java.lang.String groupByTerm, java.lang.String keyForMissingTerm, java.util.List<Filter> filters)
-
getSeriesFromOthersQuery
public java.lang.String getSeriesFromOthersQuery(java.util.Collection<java.lang.String> from, long step, long start, long end, java.lang.String groupByTerm, boolean excludeMissing, java.util.List<Filter> filters)
-
getApplicationsQuery
public java.lang.String getApplicationsQuery(java.lang.String prefix, long limit, java.util.List<Filter> filters)
-
getHostsQuery
public java.lang.String getHostsQuery(java.lang.String regex, long limit, java.util.List<Filter> filters)
-
getConversationsRegexQuery
public java.lang.String getConversationsRegexQuery(java.lang.String regex, long limit, java.util.List<Filter> filters)
-
visit
public java.lang.String visit(ExporterNodeFilter exporterNodeFilter)
- Specified by:
visit
in interfaceFilterVisitor<java.lang.String>
-
visit
public java.lang.String visit(TimeRangeFilter timeRangeFilter)
- Specified by:
visit
in interfaceFilterVisitor<java.lang.String>
-
visit
public java.lang.String visit(SnmpInterfaceIdFilter snmpInterfaceIdFilter)
- Specified by:
visit
in interfaceFilterVisitor<java.lang.String>
-
visit
public java.lang.String visit(DscpFilter dscpFilter)
- Specified by:
visit
in interfaceFilterVisitor<java.lang.String>
-
getHostnameByConversationQuery
public java.lang.String getHostnameByConversationQuery(java.lang.String convoKey, java.util.List<Filter> filters)
-
getHostnameByHostQuery
public java.lang.String getHostnameByHostQuery(java.lang.String host, java.util.List<Filter> filters)
-
getAllValues
public java.lang.String getAllValues(java.lang.String field, int fieldSize, java.util.List<Filter> filters)
-
-