@Component public class DefaultQueryLimiter extends Object implements QueryLimiter
QueryLimiter.QueryResponse, QueryLimiter.QueryStatistics| Constructor and Description |
|---|
DefaultQueryLimiter(ApplicationProperties applicationProperties) |
| Modifier and Type | Method and Description |
|---|---|
long |
getConcurrentSearchLimit() |
long |
getConcurrentSearchNum() |
QueryLimiter.QueryResponse |
getResponseWithLimit(java.util.function.Supplier<javax.ws.rs.core.Response> responseSupplier,
javax.ws.rs.core.Response quotaExceededResponse)
Allows limiting concurrent number of queries.
|
@Autowired public DefaultQueryLimiter(ApplicationProperties applicationProperties)
public QueryLimiter.QueryResponse getResponseWithLimit(java.util.function.Supplier<javax.ws.rs.core.Response> responseSupplier, javax.ws.rs.core.Response quotaExceededResponse)
QueryLimitergetResponseWithLimit in interface QueryLimiterresponseSupplier - Supplier that will be executed if quota is not exceeded.quotaExceededResponse - If quota is exceeded it will be returned to the caller.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.public long getConcurrentSearchNum()
getConcurrentSearchNum in interface QueryLimiterpublic long getConcurrentSearchLimit()
getConcurrentSearchLimit in interface QueryLimiterCopyright © 2002-2018 Atlassian. All Rights Reserved.