Interface QueryLimiter
- All Known Implementing Classes:
DefaultQueryLimiter
public interface QueryLimiter
Allows limiting concurrent number of calls to
responseSupplier.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionlonglonggetResponseWithLimit(Supplier<jakarta.ws.rs.core.Response> responseSupplier, jakarta.ws.rs.core.Response quotaExceededResponse) Allows limiting concurrent number of queries.
-
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.QueryResponsewithQueryLimiter.QueryStatisticsand response consisting of: if quota is not exceeded then value returned byresponseSupplierwill be used, otherwisequotaExceededResponsewill be used.
-
getConcurrentSearchNum
long getConcurrentSearchNum()- Returns:
- Number of currently executing searches.
-
getConcurrentSearchLimit
long getConcurrentSearchLimit()- Returns:
- Current concurrent search limit.
-