Skip to content

Home

Development

IDEs

JAR services

API Explorer

ThrottlingFunctions

The Throttling class contains functions for managing throttling rules. These functions can be used in either Gloop or Groovy.

deleteThrottlingRule

The ThrottlingFunctions.deleteThrottlingRule(String) function is used to delete a throttling rule.

Parameters

Property Type Description
name java.lang.String Name of the rule to delete

Usage

Sample service showing how to use the `deleteThrottlingRule` function of `ThrottlingFunctions`

saveThrottlingRule

The ThrottlingFunctions.saveThrottlingRule(ThrottlingRuleMetadata) function is used to save a throttling rule.

Parameters

Property Type Description
rule io.toro.martini.throttling.ThrottlingRuleMetadata Throttling rule to save

Usage

Sample service showing how to use the `saveThrottlingRule` function of `ThrottlingFunctions`

disableThrottlingRule

The ThrottlingFunctions.disableThrottlingRule(String) function is used to disable a throttling rule.

Parameters

Property Type Description
name java.lang.String Name of the rule to disable

Usage

Sample service showing how to use the `disableThrottlingRule` function of `ThrottlingFunctions`

enableThrottlingRule

The ThrottlingFunctions.enableThrottlingRule(String) function is used to enable a throttling rule.

Parameters

Property Type Description
name java.lang.String Name of the rule to enable

Usage

Sample service showing how to use the `enableThrottlingRule` function of `ThrottlingFunctions`

getThrottlingRules

The ThrottlingFunctions.getThrottlingRules(...) function is used to get a list of all existing throttling rules. There are several versions of this function that you can use:

  • MartiniFunctions.getThrottlingRules()
  • MartiniFunctions.getThrottlingRules(boolean)
  • MartiniFunctions.getThrottlingRules(int, int, boolean)

Parameters

Property Type Description
page java.lang.Integer Page number in pagination
size java.lang.Integer The maximum number of throttling rules to return
enabled java.lang.Boolean If true, it will get only throttling rules that are enabled

Return value

Property Type Description
throttlingRulesMetadata io.toro.martini.throttling.ThrottlingRuleMetadata[] Collection of throttling rule metadata

Usage

Sample service showing how to use the `getThrottlingRules` function of `ThrottlingFunctions`

getThrottlingRules

The ThrottlingFunctions.getThrottlingRule(String) function is used to get a throttling rule by name.

Parameters

Property Type Description
String java.lang.String The name of the throttling rule to get

Return value

Property Type Description
throttlingRuleMetadata io.toro.martini.throttling.ThrottlingRuleMetadata The throttling rule metadata

Usage

Sample service showing how to use the `getThrottlingRule(String)` function of `ThrottlingFunctions`