Class DefaultQueryLimiter
java.lang.Object
com.atlassian.jira.plugins.quicksearch.impl.DefaultQueryLimiter
- All Implemented Interfaces:
QueryLimiter
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.plugins.quicksearch.api.QueryLimiter
QueryLimiter.QueryResponse, QueryLimiter.QueryStatistics -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglonggetResponseWithLimit(Supplier<jakarta.ws.rs.core.Response> responseSupplier, jakarta.ws.rs.core.Response quotaExceededResponse) Allows limiting concurrent number of queries.
-
Constructor Details
-
DefaultQueryLimiter
-
-
Method Details
-
getResponseWithLimit
public QueryLimiter.QueryResponse getResponseWithLimit(Supplier<jakarta.ws.rs.core.Response> responseSupplier, jakarta.ws.rs.core.Response quotaExceededResponse) Description copied from interface:QueryLimiterAllows limiting concurrent number of queries.- Specified by:
getResponseWithLimitin interfaceQueryLimiter- 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.QueryResponsewithQueryLimiter.QueryStatisticsand response consisting of: if quota is not exceeded then value returned byresponseSupplierwill be used, otherwisequotaExceededResponsewill be used.
-
getConcurrentSearchNum
public long getConcurrentSearchNum()- Specified by:
getConcurrentSearchNumin interfaceQueryLimiter- Returns:
- Number of currently executing searches.
-
getConcurrentSearchLimit
public long getConcurrentSearchLimit()- Specified by:
getConcurrentSearchLimitin interfaceQueryLimiter- Returns:
- Current concurrent search limit.
-