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 long
MAX_BUCKETS
Maximum number of buckets that can be processed in one request.static long
MAX_STATES_FOR_ALARM
Maximum 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 String
getActiveAlarmIdsAt(TimeRange timeRange, Integer afterAlarmWithId)
String
getActiveAlarmIdsAtTimeAndExclude(TimeRange timeRange, Set<Integer> alarmIdsToKeep, Integer afterAlarmWithId)
String
getActiveAlarmsAt(TimeRange timeRange, Integer afterAlarmWithId)
String
getAlarmByDbIdAt(long id, TimeRange timeRange)
String
getAlarmByReductionKeyAt(String reductionKey, TimeRange timeRange)
String
getAlarmStatesByDbId(long id)
String
getAlarmStatesByReductionKey(String reductionKey)
String
getAllAlarms(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)
-
-