Skip to content

Home

Introduction

Development

IDEs

Services

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

ThrottlingMethods

The ThrottlingMethods class contains one-liners for managing throttling rules. These methods can be used in either Gloop or Groovy.

deleteThrottlingRule

The ThrottlingMethods.deleteThrottlingRule(String) method is used to delete a throttling rule.

Parameters

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

Usage

Sample Gloop service showing how to use the `deleteThrottlingRule` one-liner of `ThrottlingMethods`

saveThrottlingRule

The ThrottlingMethods.saveThrottlingRule(ThrottlingRuleMetadata) method is used to save a throttling rule.

Parameters

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

Usage

Sample Gloop service showing how to use the `saveThrottlingRule` one-liner of `ThrottlingMethods`

disableThrottlingRule

The ThrottlingMethods.disableThrottlingRule(String) method is used to disable a throttling rule.

Parameters

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

Usage

Sample Gloop service showing how to use the `disableThrottlingRule` one-liner of `ThrottlingMethods`

enableThrottlingRule

The ThrottlingMethods.enableThrottlingRule(String) method is used to enable a throttling rule.

Parameters

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

Usage

Sample Gloop service showing how to use the `enableThrottlingRule` one-liner of `ThrottlingMethods`

getThrottlingRules

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

  • MartiniMethods.getThrottlingRules()
  • MartiniMethods.getThrottlingRules(boolean)
  • MartiniMethods.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 Gloop service showing how to use the `getThrottlingRules` one-liner of `ThrottlingMethods`

getThrottlingRules

The ThrottlingMethods.getThrottlingRule(String) method 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 Gloop service showing how to use the `getThrottlingRule(String)` one-liner of `ThrottlingMethods`