Interface QueryLimiter

All Known Implementing Classes:
DefaultQueryLimiter

public interface QueryLimiter
Allows limiting concurrent number of calls to responseSupplier.
  • Method Details

    • getResponseWithLimit

      QueryLimiter.QueryResponse getResponseWithLimit(Supplier<jakarta.ws.rs.core.Response> responseSupplier, jakarta.ws.rs.core.Response quotaExceededResponse)
      Allows limiting concurrent number of queries.
      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

      long getConcurrentSearchNum()
      Returns:
      Number of currently executing searches.
    • getConcurrentSearchLimit

      long getConcurrentSearchLimit()
      Returns:
      Current concurrent search limit.