Class JiraRuleInsightStore

java.lang.Object
com.codebarrel.jira.plugin.automation.store.JiraRuleInsightStore
All Implemented Interfaces:
RuleInsightStore

@Component public class JiraRuleInsightStore extends Object implements RuleInsightStore
  • Constructor Details

    • JiraRuleInsightStore

      @Inject public JiraRuleInsightStore(DbConnectionManager dbConnectionManager)
  • Method Details

    • populateInsights

      public void populateInsights(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull Instant startInclusive, @Nonnull Instant endExclusive)
      Description copied from interface: RuleInsightStore
      Populates insights rollup data from the given start instant (inclusive) to the end (exclusive)
      Specified by:
      populateInsights in interface RuleInsightStore
      Parameters:
      environment - Given instant environment
      type - Type of rollup to perform against
      startInclusive - Instant to populate form (inclusive)
      endExclusive - Instant to populate to (exclusive)
    • updateInsight

      public void updateInsight(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull Long insightId, @Nonnull State state, @Nonnull Long auditId)
      Description copied from interface: RuleInsightStore
      Update the state of the given insight by its ID
      Specified by:
      updateInsight in interface RuleInsightStore
      Parameters:
      environment - Given instant environment
      type - Type of rollup to perform against
      insightId - ID of the given insight
      state - A new state to be set for a given insight
      auditId - Audit ID of the given insight
    • getRuleExecutionState

      public Optional<String> getRuleExecutionState(@Nonnull Environment environment, @Nonnull Long ruleId, @Nonnull Instant created, @Nonnull Long auditId)
      Description copied from interface: RuleInsightStore
      Returns the state of the first statistic searched by rule ID and creation time
      Specified by:
      getRuleExecutionState in interface RuleInsightStore
      Parameters:
      environment - Given instant environment
      ruleId - Rule ID of a statistic we are looking for
      created - Creation time of a statistic we are looking for
      auditId - Audit ID of a statistic we are looking for
      Returns:
      Statistic state in string or empty
    • getMostRecentInsightTime

      public Optional<Instant> getMostRecentInsightTime(@Nonnull Environment environment, @Nonnull RollupType type)
      Description copied from interface: RuleInsightStore
      Returns the time instant of the last populated insight
      Specified by:
      getMostRecentInsightTime in interface RuleInsightStore
      Parameters:
      environment - Given instant environment
      type - Type of rollup to perform against
      Returns:
      Instant of the last populate insight or empty
    • getInsightCategoryDetailsEarlierThan

      public org.apache.commons.lang3.tuple.Pair<List<RuleInsightDetails>,Long> getInsightCategoryDetailsEarlierThan(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull State category, @Nonnull Instant earlierThan, @Nonnull Instant startTime)
      Description copied from interface: RuleInsightStore
      Returns the list of insight details for the given category, and earlier than the given time instant
      Specified by:
      getInsightCategoryDetailsEarlierThan in interface RuleInsightStore
      Parameters:
      environment - Given instance environment
      type - Type of rollup to perform against
      category - Category to use
      earlierThan - Instant to include rows earlier than (exclusive)
      startTime - Instant to include rows after than (exclusive)
      Returns:
      Pair of list of RuleInsightDetails objects which are within max duration allowed, it contains insight ID, rule ID, and creation time; and the count of insights that were outside of max time duration allowed
    • removeInsightsOlderThan

      public void removeInsightsOlderThan(@Nonnull Environment environment, @Nonnull RollupType type, @Nonnull Instant olderThan)
      Description copied from interface: RuleInsightStore
      Removes insight rollup data for the given type and instant
      Specified by:
      removeInsightsOlderThan in interface RuleInsightStore
      Parameters:
      environment - Given instance environment
      type - Type of rollup to perform against
      olderThan - Instant to remove rows older than (exclusive)
    • getInsights

      public RuleInsightResult getInsights(@Nonnull TenantContext context, @Nonnull RollupType type, @Nonnull InsightFilter filter, @Nonnull InsightSort sort, int limit)
      Description copied from interface: RuleInsightStore
      Retrieves insight data aggregated by rule
      Specified by:
      getInsights in interface RuleInsightStore
      Parameters:
      context - Given instance environment
      type - Type of rollup to perform against
      filter - Filter query object
      limit - Number of rules results to return
      Returns:
      Rule insight results
    • getTimeSeries

      public TimeSeriesResult getTimeSeries(@Nonnull TenantContext context, @Nonnull RollupType type, @Nonnull InsightFilter filter)
      Description copied from interface: RuleInsightStore
      Retrieves insight data as time series data
      Specified by:
      getTimeSeries in interface RuleInsightStore
      Parameters:
      context - Given instance environment
      type - Type of rollup to perform against
      filter - Filter query object
      Returns:
      Time series result with an entry for each time unit (including empty values)