Class DefaultQueryLimiter

java.lang.Object
com.atlassian.jira.plugins.quicksearch.impl.DefaultQueryLimiter
All Implemented Interfaces:
QueryLimiter

@Component public class DefaultQueryLimiter extends Object implements QueryLimiter
  • Constructor Details

    • DefaultQueryLimiter

      @Autowired public DefaultQueryLimiter(ApplicationProperties applicationProperties)
  • Method Details

    • getResponseWithLimit

      public QueryLimiter.QueryResponse getResponseWithLimit(Supplier<jakarta.ws.rs.core.Response> responseSupplier, jakarta.ws.rs.core.Response quotaExceededResponse)
      Description copied from interface: QueryLimiter
      Allows limiting concurrent number of queries.
      Specified by:
      getResponseWithLimit in interface QueryLimiter
      Parameters:
      responseSupplier - Supplier that will be executed if quota is not exceeded.
      quotaExceededResponse - If quota is exceeded it will be returned to the caller.
      Returns:
      QueryLimiter.QueryResponse with QueryLimiter.QueryStatistics and response consisting of: if quota is not exceeded then value returned by responseSupplier will be used, otherwise quotaExceededResponse will be used.
    • getConcurrentSearchNum

      public long getConcurrentSearchNum()
      Specified by:
      getConcurrentSearchNum in interface QueryLimiter
      Returns:
      Number of currently executing searches.
    • getConcurrentSearchLimit

      public long getConcurrentSearchLimit()
      Specified by:
      getConcurrentSearchLimit in interface QueryLimiter
      Returns:
      Current concurrent search limit.