public class Throttling extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIME_PERIOD
Default time period is one second.
|
static String |
MAX_REQUESTS
Message header used to specify the max requests used by the throttler in a given
time period.
|
Constructor and Description |
---|
Throttling() |
Modifier and Type | Method and Description |
---|---|
int |
getMaxRequests()
Returns the maximum number of requests allowed in a given time period.
|
long |
getTimePeriod()
Returns the time period in milliseconds used to calculate the max request window.
|
Throttling |
setMaxRequests(int max)
Specifies the maximum number of requests allowed in a given time period.
|
Throttling |
setTimePeriod(long timeMS)
Specifies the time period in milliseconds used to calculate the max request window.
|
public static final String MAX_REQUESTS
public static final long DEFAULT_TIME_PERIOD
public int getMaxRequests()
public long getTimePeriod()
public Throttling setMaxRequests(int max)
max
- maximum number of requestspublic Throttling setTimePeriod(long timeMS)
timeMS
- time period in millisecondsCopyright © 2013–2017 JBoss by Red Hat. All rights reserved.