public final class ThrottlingMethods extends Object
Constructor and Description |
---|
ThrottlingMethods(io.toro.martini.rengine.RuleService<io.toro.martini.throttling.ThrottlingRuleMetadata> throttlingRuleService) |
Modifier and Type | Method and Description |
---|---|
static void |
deleteThrottlingRule(String name)
Delete a throttling rule by name.
|
static void |
disableThrottlingRule(String name)
Disable a throttling rule by name.
|
static void |
enableThrottlingRule(String name)
Enable a throttling rule by name.
|
static GloopModel |
getThrottlingRule(String name)
Get a throttling rule by name.
|
static GloopModel |
getThrottlingRules()
Get a list of all saved throttling rules.
|
static GloopModel |
getThrottlingRules(boolean enabled)
Get a list of saved throttling rules.
|
static GloopModel |
getThrottlingRules(int page,
int size,
Boolean enabled)
Get a filtered list of saved throttling rules.
|
static void |
saveThrottlingRule(GloopModel rule)
Save a throttling rule.
|
@Autowired ThrottlingMethods(io.toro.martini.rengine.RuleService<io.toro.martini.throttling.ThrottlingRuleMetadata> throttlingRuleService)
@GloopObjectParameter(value="throttlingRuleMetadata{\nthrottlingRuleMetadata#io.toro.martini.throttling.ThrottlingRuleMetadata{\n}\n}") public static GloopModel getThrottlingRule(@GloopParameter(allowNull=false) String name)
name
- the rule's name@GloopObjectParameter(value="throttlingRulesMetadata{\n throttlingRulesMetadata#io.toro.martini.throttling.ThrottlingRuleMetadata[]{\n }\n}") public static GloopModel getThrottlingRules()
@GloopObjectParameter(value="throttlingRulesMetadata{\n throttlingRulesMetadata#io.toro.martini.throttling.ThrottlingRuleMetadata[]{\n }\n}") public static GloopModel getThrottlingRules(boolean enabled)
enabled
- if true, returns only enabled throttling rules;
if false, returns only disabled throttling rules@GloopObjectParameter(value="throttlingRulesMetadata{\n throttlingRulesMetadata#io.toro.martini.throttling.ThrottlingRuleMetadata[]{\n }\n}") public static GloopModel getThrottlingRules(@GloopParameter(defaultValue="1") int page, @GloopParameter(defaultValue="25") int size, Boolean enabled)
page
- the starting pagesize
- the maximum number of throttling rules per pageenabled
- if true, returns only enabled throttling rules;
if false, returns only disabled throttling rules;
if null, returns all throttling rules regardless if enabled or disabledpublic static void enableThrottlingRule(@GloopParameter(allowNull=false) String name)
name
- name of the throttling rule to enablepublic static void disableThrottlingRule(@GloopParameter(allowNull=false) String name)
name
- name of the throttling rule to disablepublic static void saveThrottlingRule(@GloopObjectParameter(value="throttlingRuleMetadata#io.toro.martini.throttling.ThrottlingRuleMetadata{\n}") @GloopParameter(allowNull=false) GloopModel rule)
rule
- the throttling rule to savepublic static void deleteThrottlingRule(@GloopParameter(allowNull=false) String name)
name
- name of the throttling rule to deleteCopyright © 2023. All rights reserved.