Codota Logo
FirewallConfig.addRolesPeriodicCounter
Code IndexAdd Codota to your IDE (free)

How to use
addRolesPeriodicCounter
method
in
org.restlet.ext.platform.FirewallConfig

Best Java code snippets using org.restlet.ext.platform.FirewallConfig.addRolesPeriodicCounter (Showing top 8 results out of 315)

  • Common ways to obtain FirewallConfig
private void myMethod () {
FirewallConfig f =
  • Codota IconList rules;new FirewallConfig(rules)
  • Smart code suggestions by Codota
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Adds a rule that restricts access according to the {@link Role} of the
 * current authenticated {@link User}. Each role is defined a limit in terms
 * of requests by period of time, in any other case the access is forbidden.
 * 
 * @param period
 *            The period of time.
 * @param periodUnit
 *            Period time unit associated to the rule.
 * @param limitsPerRole
 *            The limit assigned per role's name.
 */
public void addRolesPeriodicCounter(int period, TimeUnit periodUnit,
    Map<String, Integer> limitsPerRole) {
  addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0);
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Adds a rule that restricts access according to the {@link Role} of the
 * current authenticated {@link User}. Each role is defined a limit in terms
 * of requests by period of time, in any other case the access is forbidden.
 * 
 * @param period
 *            The period of time.
 * @param periodUnit
 *            Period time unit associated to the rule.
 * @param limitsPerRole
 *            The limit assigned per role's name.
 */
public void addRolesPeriodicCounter(int period, TimeUnit periodUnit,
    Map<String, Integer> limitsPerRole) {
  addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0);
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Adds a rule that restricts access according to the {@link Role} of the
 * current authenticated {@link User}. Each role is defined a limit in terms
 * of requests by period of time, in any other case the access is forbidden.
 * 
 * @param period
 *            The period of time.
 * @param periodUnit
 *            Period time unit associated to the rule.
 * @param limitsPerRole
 *            The limit assigned per role's name.
 */
public void addRolesPeriodicCounter(int period, TimeUnit periodUnit,
    Map<String, Integer> limitsPerRole) {
  addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0);
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Adds a rule that restricts access according to the {@link Role} of the
 * current authenticated {@link User}. Each role is defined a limit in terms
 * of requests by period of time, in any other case the access is forbidden.
 * 
 * @param period
 *            The period of time.
 * @param periodUnit
 *            Period time unit associated to the rule.
 * @param limitsPerRole
 *            The limit assigned per role's name.
 */
public void addRolesPeriodicCounter(int period, TimeUnit periodUnit,
    Map<String, Integer> limitsPerRole) {
  addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0);
}
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.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);
    }
  }
}
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);
    }
  }
}
org.restlet.ext.platformFirewallConfigaddRolesPeriodicCounter

Javadoc

Adds a rule that restricts access according to the Role of the current authenticated User. Each role is defined a limit in terms of requests by period of time, in any other case the access is forbidden.

Popular methods of FirewallConfig

  • <init>
    Private Constructor.
  • add
    Adds a rule to the firewall.
  • addIpAddressesBlackList
    Adds a rule that forbids access to the given set of IP addresses.
  • addIpAddressesWhiteList
    Adds a rule that restricts access to the given set of IP addresses.
  • addRolesConcurrencyCounter
    Adds a rule that restricts access according to the Role of the current authenticated User. Each role

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now