public interface RestPluginThrottling
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCounterKey(WebClient client,
RestDefinition restDefinition)
get the key of the throttling counter, the key has to be shorter than 255 characters
|
int |
getPeriod(WebClient client,
RestDefinition rd)
get the throttling period in seconds
|
int |
getRequestLimit(WebClient client,
RestDefinition rd)
-1 is no limit
0 is always reject
n is allow n requests in each throttling period
|
@CheckReturnValue @Nullable java.lang.String getCounterKey(@Nonnull WebClient client, @Nonnull RestDefinition restDefinition) throws java.lang.UnsupportedOperationException, java.lang.Exception, java.lang.IllegalArgumentException
client
- the client. Null means check only of opsrestDefinition
- the definitionjava.lang.UnsupportedOperationException
- if this method is NOT supported.java.lang.Exception
- an error has occurred.java.lang.IllegalArgumentException
int getRequestLimit(@Nonnull WebClient client, @Nonnull RestDefinition rd) throws java.lang.UnsupportedOperationException, java.lang.Exception
client
- the client. Null means check only of opsrd
- the definitionjava.lang.UnsupportedOperationException
- use default throttling settings configured in RestDefinition recordjava.lang.Exception
int getPeriod(@Nonnull WebClient client, @Nonnull RestDefinition rd) throws java.lang.UnsupportedOperationException, java.lang.Exception
client
- the client. Null means check only of opsrd
- the definitionjava.lang.UnsupportedOperationException
- use default throttling settings configured in RestDefinition recordjava.lang.Exception
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.