es.moki.ratelimitj.inmemory.InMemoryRateLimiterFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ratelimitj-inmemory Show documentation
Show all versions of ratelimitj-inmemory Show documentation
The RateLimitJ project aims to provide a modular rate limiting solution
package es.moki.ratelimitj.inmemory;
import es.moki.ratelimitj.core.limiter.request.AbstractRequestRateLimiterFactory;
import es.moki.ratelimitj.core.limiter.request.AsyncRequestRateLimiter;
import es.moki.ratelimitj.core.limiter.request.ReactiveRequestRateLimiter;
import es.moki.ratelimitj.core.limiter.request.RequestLimitRule;
import es.moki.ratelimitj.core.limiter.request.RequestRateLimiter;
import es.moki.ratelimitj.inmemory.request.InMemorySlidingWindowRequestRateLimiter;
import java.io.IOException;
import java.util.Set;
public class InMemoryRateLimiterFactory extends AbstractRequestRateLimiterFactory {
@Override
public RequestRateLimiter getInstance(Set rules) {
return lookupInstance(rules);
}
@Override
public AsyncRequestRateLimiter getInstanceAsync(Set rules) {
throw new RuntimeException("In memory async not yet implemented");
}
@Override
public ReactiveRequestRateLimiter getInstanceReactive(Set rules) {
throw new RuntimeException("In memory reactive not yet implemented");
}
@Override
protected InMemorySlidingWindowRequestRateLimiter create(Set rules) {
return new InMemorySlidingWindowRequestRateLimiter(rules);
}
@Override
public void close() throws IOException {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy