congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
FirewallModule.sortRateLimitsByPeriod
Code IndexAdd Tabnine to your IDE (free)

How to use
sortRateLimitsByPeriod
method
in
org.restlet.ext.platform.internal.agent.module.FirewallModule

Best Java code snippets using org.restlet.ext.platform.internal.agent.module.FirewallModule.sortRateLimitsByPeriod (Showing top 4 results out of 315)

origin: org.restlet.jse/org.restlet.ext.platform

private void addRateLimitationRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getRateLimits() != null) {
    List<FirewallRateLimit> rateLimits = firewallSettings
        .getRateLimits();
    Map<Integer, Collection<FirewallRateLimit>> rateLimitsByPeriod = sortRateLimitsByPeriod(rateLimits);
    for (Integer period : rateLimitsByPeriod.keySet()) {
      Map<String, Integer> limitsPerRole = new HashMap<>();
      int defaultRateLimit = Integer.MAX_VALUE;
      for (FirewallRateLimit firewallRateLimit : rateLimitsByPeriod
          .get(period)) {
        if (firewallRateLimit.isDefaultRateLimit()) {
          defaultRateLimit = firewallRateLimit.getRateLimit();
        } else {
          limitsPerRole.put(firewallRateLimit.getGroup(),
              firewallRateLimit.getRateLimit());
        }
      }
      firewallConfig.addRolesPeriodicCounter(period,
          TimeUnit.SECONDS, limitsPerRole, defaultRateLimit);
    }
  }
}
origin: org.restlet.gae/org.restlet.ext.platform

private void addRateLimitationRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getRateLimits() != null) {
    List<FirewallRateLimit> rateLimits = firewallSettings
        .getRateLimits();
    Map<Integer, Collection<FirewallRateLimit>> rateLimitsByPeriod = sortRateLimitsByPeriod(rateLimits);
    for (Integer period : rateLimitsByPeriod.keySet()) {
      Map<String, Integer> limitsPerRole = new HashMap<>();
      int defaultRateLimit = Integer.MAX_VALUE;
      for (FirewallRateLimit firewallRateLimit : rateLimitsByPeriod
          .get(period)) {
        if (firewallRateLimit.isDefaultRateLimit()) {
          defaultRateLimit = firewallRateLimit.getRateLimit();
        } else {
          limitsPerRole.put(firewallRateLimit.getGroup(),
              firewallRateLimit.getRateLimit());
        }
      }
      firewallConfig.addRolesPeriodicCounter(period,
          TimeUnit.SECONDS, limitsPerRole, defaultRateLimit);
    }
  }
}
origin: org.restlet.jee/org.restlet.ext.platform

private void addRateLimitationRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getRateLimits() != null) {
    List<FirewallRateLimit> rateLimits = firewallSettings
        .getRateLimits();
    Map<Integer, Collection<FirewallRateLimit>> rateLimitsByPeriod = sortRateLimitsByPeriod(rateLimits);
    for (Integer period : rateLimitsByPeriod.keySet()) {
      Map<String, Integer> limitsPerRole = new HashMap<>();
      int defaultRateLimit = Integer.MAX_VALUE;
      for (FirewallRateLimit firewallRateLimit : rateLimitsByPeriod
          .get(period)) {
        if (firewallRateLimit.isDefaultRateLimit()) {
          defaultRateLimit = firewallRateLimit.getRateLimit();
        } else {
          limitsPerRole.put(firewallRateLimit.getGroup(),
              firewallRateLimit.getRateLimit());
        }
      }
      firewallConfig.addRolesPeriodicCounter(period,
          TimeUnit.SECONDS, limitsPerRole, defaultRateLimit);
    }
  }
}
origin: org.restlet.osgi/org.restlet.ext.platform

private void addRateLimitationRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getRateLimits() != null) {
    List<FirewallRateLimit> rateLimits = firewallSettings
        .getRateLimits();
    Map<Integer, Collection<FirewallRateLimit>> rateLimitsByPeriod = sortRateLimitsByPeriod(rateLimits);
    for (Integer period : rateLimitsByPeriod.keySet()) {
      Map<String, Integer> limitsPerRole = new HashMap<>();
      int defaultRateLimit = Integer.MAX_VALUE;
      for (FirewallRateLimit firewallRateLimit : rateLimitsByPeriod
          .get(period)) {
        if (firewallRateLimit.isDefaultRateLimit()) {
          defaultRateLimit = firewallRateLimit.getRateLimit();
        } else {
          limitsPerRole.put(firewallRateLimit.getGroup(),
              firewallRateLimit.getRateLimit());
        }
      }
      firewallConfig.addRolesPeriodicCounter(period,
          TimeUnit.SECONDS, limitsPerRole, defaultRateLimit);
    }
  }
}
org.restlet.ext.platform.internal.agent.moduleFirewallModulesortRateLimitsByPeriod

Popular methods of FirewallModule

  • <init>
  • addIpFilterRules
  • addRateLimitationRules
  • updateFirewallConfig

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now