Class QueryProvider
- java.lang.Object
-
- org.opennms.features.alarms.history.elastic.QueryProvider
-
public class QueryProvider extends Object
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.
-
-
Field Summary
Fields Modifier and Type Field Description static longMAX_BUCKETSMaximum number of buckets that can be processed in one request.static longMAX_STATES_FOR_ALARMMaximum number of states to return when querying the states for a single alarm.
-
Constructor Summary
Constructors Constructor Description QueryProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetActiveAlarmIdsAt(TimeRange timeRange, Integer afterAlarmWithId)StringgetActiveAlarmIdsAtTimeAndExclude(TimeRange timeRange, Set<Integer> alarmIdsToKeep, Integer afterAlarmWithId)StringgetActiveAlarmsAt(TimeRange timeRange, Integer afterAlarmWithId)StringgetAlarmByDbIdAt(long id, TimeRange timeRange)StringgetAlarmByReductionKeyAt(String reductionKey, TimeRange timeRange)StringgetAlarmStatesByDbId(long id)StringgetAlarmStatesByReductionKey(String reductionKey)StringgetAllAlarms(TimeRange timeRange, Integer afterAlarmWithId)
-
-
-
Field Detail
-
MAX_STATES_FOR_ALARM
public static final long MAX_STATES_FOR_ALARM
Maximum number of states to return when querying the states for a single alarm.- See Also:
- Constant Field Values
-
MAX_BUCKETS
public static final long MAX_BUCKETS
Maximum number of buckets that can be processed in one request. Subsequent requests should be made to page through the results- See Also:
- Constant Field Values
-
-
Method Detail
-
getAlarmStatesByDbId
public String getAlarmStatesByDbId(long id)
-
getAlarmByReductionKeyAt
public String getAlarmByReductionKeyAt(String reductionKey, TimeRange timeRange)
-
getActiveAlarmIdsAt
public String getActiveAlarmIdsAt(TimeRange timeRange, Integer afterAlarmWithId)
-
getActiveAlarmIdsAtTimeAndExclude
public String getActiveAlarmIdsAtTimeAndExclude(TimeRange timeRange, Set<Integer> alarmIdsToKeep, Integer afterAlarmWithId)
-
-