Class QueryProvider
- java.lang.Object
-
- org.opennms.features.alarms.history.elastic.QueryProvider
-
public class QueryProvider extends java.lang.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 java.lang.String
getActiveAlarmIdsAt(TimeRange timeRange, java.lang.Integer afterAlarmWithId)
java.lang.String
getActiveAlarmIdsAtTimeAndExclude(TimeRange timeRange, java.util.Set<java.lang.Integer> alarmIdsToKeep, java.lang.Integer afterAlarmWithId)
java.lang.String
getActiveAlarmsAt(TimeRange timeRange, java.lang.Integer afterAlarmWithId)
java.lang.String
getAlarmByDbIdAt(long id, TimeRange timeRange)
java.lang.String
getAlarmByReductionKeyAt(java.lang.String reductionKey, TimeRange timeRange)
java.lang.String
getAlarmStatesByDbId(long id)
java.lang.String
getAlarmStatesByReductionKey(java.lang.String reductionKey)
java.lang.String
getAllAlarms(TimeRange timeRange, java.lang.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 java.lang.String getAlarmStatesByDbId(long id)
-
getAlarmStatesByReductionKey
public java.lang.String getAlarmStatesByReductionKey(java.lang.String reductionKey)
-
getAlarmByDbIdAt
public java.lang.String getAlarmByDbIdAt(long id, TimeRange timeRange)
-
getAlarmByReductionKeyAt
public java.lang.String getAlarmByReductionKeyAt(java.lang.String reductionKey, TimeRange timeRange)
-
getActiveAlarmsAt
public java.lang.String getActiveAlarmsAt(TimeRange timeRange, java.lang.Integer afterAlarmWithId)
-
getActiveAlarmIdsAt
public java.lang.String getActiveAlarmIdsAt(TimeRange timeRange, java.lang.Integer afterAlarmWithId)
-
getActiveAlarmIdsAtTimeAndExclude
public java.lang.String getActiveAlarmIdsAtTimeAndExclude(TimeRange timeRange, java.util.Set<java.lang.Integer> alarmIdsToKeep, java.lang.Integer afterAlarmWithId)
-
getAllAlarms
public java.lang.String getAllAlarms(TimeRange timeRange, java.lang.Integer afterAlarmWithId)
-
-